5import isystem.connect
as ic
8def test_findExistingInstance():
9 print(
"Finding existing instance by ID...")
10 cfg = ic.CConnectionConfig()
11 cfg.instanceId(
"findExistingInstanceExample")
12 cfg.start_if_required()
13 connMgr = ic.ConnectionMgr()
16 cfg2 = ic.CConnectionConfig()
18 cfg2.instanceId(
"findExistingInstanceExample")
19 connMgr.disconnect_keep()
21 port = cfg2.getTCPPort()
23 print(f
"Instance found, port: {port}")
25 print(f
"Instance with ID 'findExistingInstanceExample' not found")
30 connMgr.disconnect_close(
False)
33if __name__ ==
"__main__":
34 test_findExistingInstance()