diff --git a/test/integration/test_ssl_certificate_api_v1.py b/test/integration/test_ssl_certificate_api_v1.py index 338204d..c7ea04f 100644 --- a/test/integration/test_ssl_certificate_api_v1.py +++ b/test/integration/test_ssl_certificate_api_v1.py @@ -75,7 +75,7 @@ def test_1_certificate_actions(self): resp = self.ssl.order_certificate( x_correlation_id="1234", type="dedicated", hosts=[self.url]) assert resp is not None - assert resp.status_code == 200 + assert resp.status_code == 200 or resp.status_code == 201 cert_id = resp.get_result().get("result")["id"] # delete certificate diff --git a/test/integration/test_zone_firewall_access_rules_v1.py b/test/integration/test_zone_firewall_access_rules_v1.py index facc77e..9492e25 100644 --- a/test/integration/test_zone_firewall_access_rules_v1.py +++ b/test/integration/test_zone_firewall_access_rules_v1.py @@ -34,11 +34,26 @@ def setUp(self): crn=self.crn, zone_identifier=self.zone_id, service_name="cis_services") self.rule.set_service_url(self.endpoint) + # list all rules and delete the same for clean up + self._clean_zone_firewall_rules() + def tearDown(self): """ tear down """ # Delete the resources + self._clean_zone_firewall_rules() print("Clean up complete") + def _clean_zone_firewall_rules(self): + resp = self.rule.list_all_zone_access_rules() + assert resp is not None + assert resp.status_code == 200 + for result in resp.get_result().get("result"): + rule_id = result['id'] + resp = self.rule.delete_zone_access_rule( + accessrule_identifier=rule_id) + assert resp is not None + assert resp.status_code == 200 + def test_1_zone_firewall_rule_mode_action(self): i = 0 modes = {