Skip to content

Commit a4e77b5

Browse files
Dwitikrushna DashDwitikrushna Dash
Dwitikrushna Dash
authored and
Dwitikrushna Dash
committed
fix: Fix for ssl_certificate and zone_firewall_acess_rules integration tests
1 parent e82ec1d commit a4e77b5

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

test/integration/test_ssl_certificate_api_v1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def test_1_certificate_actions(self):
7575
resp = self.ssl.order_certificate(
7676
x_correlation_id="1234", type="dedicated", hosts=[self.url])
7777
assert resp is not None
78-
assert resp.status_code == 200
78+
assert resp.status_code == 200 or resp.status_code == 201
7979
cert_id = resp.get_result().get("result")["id"]
8080

8181
# delete certificate

test/integration/test_zone_firewall_access_rules_v1.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,26 @@ def setUp(self):
3434
crn=self.crn, zone_identifier=self.zone_id, service_name="cis_services")
3535
self.rule.set_service_url(self.endpoint)
3636

37+
# list all rules and delete the same for clean up
38+
self._clean_zone_firewall_rules()
39+
3740
def tearDown(self):
3841
""" tear down """
3942
# Delete the resources
43+
self._clean_zone_firewall_rules()
4044
print("Clean up complete")
4145

46+
def _clean_zone_firewall_rules(self):
47+
resp = self.rule.list_all_zone_access_rules()
48+
assert resp is not None
49+
assert resp.status_code == 200
50+
for result in resp.get_result().get("result"):
51+
rule_id = result['id']
52+
resp = self.rule.delete_zone_access_rule(
53+
accessrule_identifier=rule_id)
54+
assert resp is not None
55+
assert resp.status_code == 200
56+
4257
def test_1_zone_firewall_rule_mode_action(self):
4358
i = 0
4459
modes = {

0 commit comments

Comments
 (0)