def test_0098_teardown(self): firewall_obj = FirewallRule(TestFirewallRules._org_client, TestFirewallRules._name, TestFirewallRules._rule_id) firewall_obj.delete() # Verify firewall_rules_resource = \ TestFirewallRules._gateway_obj.get_firewall_rules() # Verify matchFound = False for firewallRule in firewall_rules_resource.firewallRules.firewallRule: if firewallRule['id'] == TestFirewallRules._rule_id: matchFound = True break self.assertFalse(matchFound)
def test_0091_update_firewall_rule_sequence(self): TestFirewallRules._gateway_obj.add_firewall_rule( TestFirewallRules._firewall_rule_name2) firewall_rules_resource = \ TestFirewallRules._gateway_obj.get_firewall_rules() rule_id = None for firewallRule in firewall_rules_resource.firewallRules.firewallRule: if firewallRule['name'] == TestFirewallRules._firewall_rule_name2: rule_id = firewallRule.id break firewall_obj = FirewallRule(TestFirewallRules._org_client, TestFirewallRules._name, rule_id) new_index = 1 firewall_obj.update_firewall_rule_sequence(new_index) sequence_no_after = 0 firewall_rules_resource = \ TestFirewallRules._gateway_obj.get_firewall_rules() for firewallRule in firewall_rules_resource.firewallRules.firewallRule: if firewallRule['name'] == TestFirewallRules._firewall_rule_name2: break sequence_no_after += 1 self.assertEqual(sequence_no_after, new_index) firewall_obj.delete()