[Fullstack] use common assert for ncat connection

For some stable branches, the fullstack test_securitygroup
may stuck and stop at ``self.assertTrue(netcat.test_connectivity())``.
So change to use common assert_connection and assert_no_connection
which have exception try-catch and retry.

Change-Id: I085b0892ac51639f6df502ffc280666255ab2718
(cherry picked from commit b040e6139e)
This commit is contained in:
LIU Yulong 2022-12-27 19:19:45 +08:00 committed by yatin
parent 44ffbc97b7
commit 90cd055fe1
1 changed files with 6 additions and 8 deletions

View File

@ -251,17 +251,15 @@ class TestSecurityGroupsSameNetwork(BaseSecurityGroupsSameNetworkTest):
vms[4].block_until_boot()
netcat = net_helpers.NetcatTester(vms[4].namespace,
vms[0].namespace, vms[0].ip, 3355,
self.assert_connection(
vms[4].namespace, vms[0].namespace, vms[0].ip, 3355,
net_helpers.NetcatTester.TCP)
self.addCleanup(netcat.stop_processes)
self.assertTrue(netcat.test_connectivity())
self.client.delete_security_group_rule(rule2['id'])
common_utils.wait_until_true(lambda: netcat.test_no_connectivity(),
sleep=8)
netcat.stop_processes()
self.assert_no_connection(
vms[4].namespace, vms[0].namespace, vms[0].ip, 3355,
net_helpers.NetcatTester.TCP)
# 8. check if multiple overlapping remote rules work
self.safe_client.create_security_group_rule(