Skip to content

Commit 25b360f

Browse files
fix integration test
1 parent 067e2a4 commit 25b360f

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

test/integration/smoke/test_network.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -470,10 +470,8 @@ def test_01_port_fwd_on_src_nat(self):
470470
except Exception as e:
471471
self.fail("NAT Rule Deletion Failed: %s" % e)
472472

473-
# NAT rule listing should fail as the nat rule does not exist
474-
with self.assertRaises(Exception):
475-
list_nat_rules(self.apiclient,
476-
id=nat_rule.id)
473+
nat_rules_after_deletion = list_nat_rules(self.apiclient, id=nat_rule.id)
474+
self.assertEqual(nat_rules_after_deletion, None, "Check that the port forwarding rule has been deleted.")
477475

478476
# Check if the Public SSH port is inaccessible
479477
with self.assertRaises(Exception):
@@ -585,13 +583,8 @@ def test_02_port_fwd_on_non_src_nat(self):
585583

586584
nat_rule.delete(self.apiclient)
587585

588-
try:
589-
list_nat_rule_response = list_nat_rules(
590-
self.apiclient,
591-
id=nat_rule.id
592-
)
593-
except CloudstackAPIException:
594-
logger.debug("Nat Rule is deleted")
586+
nat_rules_after_deletion = list_nat_rules(self.apiclient, id=nat_rule.id)
587+
self.assertEqual(nat_rules_after_deletion, None, "Check that the port forwarding rule has been deleted.")
595588

596589
# Check if the Public SSH port is inaccessible
597590
with self.assertRaises(Exception):

0 commit comments

Comments
 (0)