Skip to content

Commit

Permalink
fix: Fix for ssl_certificate and zone_firewall_acess_rules integratio…
Browse files Browse the repository at this point in the history
…n tests
  • Loading branch information
Dwitikrushna Dash authored and Dwitikrushna Dash committed May 4, 2021
1 parent e82ec1d commit a4e77b5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/integration/test_ssl_certificate_api_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions test/integration/test_zone_firewall_access_rules_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit a4e77b5

Please sign in to comment.