Skip to content

Commit 9e9f9a3

Browse files
committed
Add HTTPS and AUTH support to ControllerTest
1 parent 245e3c6 commit 9e9f9a3

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

nmostesting/ControllerTest.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,21 @@ class ControllerTest(GenericTest):
7676
"""
7777
Testing initial set up of new test suite for controller testing
7878
"""
79-
def __init__(self, apis, registries, node, dns_server, disable_auto=True, **kwargs):
79+
def __init__(self, apis, registries, node, dns_server, auths, disable_auto=True, **kwargs):
8080
# Remove the spec_path as there are no corresponding GitHub repos for Controller Tests
8181
apis[CONTROLLER_TEST_API_KEY].pop("spec_path", None)
8282
if CONFIG.ENABLE_HTTPS:
8383
# Comms with Testing Facade are http only
84-
apis[CONTROLLER_TEST_API_KEY]["base_url"] \
85-
= apis[CONTROLLER_TEST_API_KEY]["base_url"].replace("https", "http")
86-
apis[CONTROLLER_TEST_API_KEY]["url"] = apis[CONTROLLER_TEST_API_KEY]["url"].replace("https", "http")
87-
GenericTest.__init__(self, apis, disable_auto=disable_auto)
84+
if apis[CONTROLLER_TEST_API_KEY]["base_url"] is not None:
85+
apis[CONTROLLER_TEST_API_KEY]["base_url"] \
86+
= apis[CONTROLLER_TEST_API_KEY]["base_url"].replace("https", "http")
87+
if apis[CONTROLLER_TEST_API_KEY]["url"] is not None:
88+
apis[CONTROLLER_TEST_API_KEY]["url"] \
89+
= apis[CONTROLLER_TEST_API_KEY]["url"].replace("https", "http")
90+
GenericTest.__init__(self, apis, auths=auths, disable_auto=disable_auto)
8891
self.authorization = False
92+
if CONFIG.ENABLE_AUTH:
93+
self.authorization = True
8994
self.primary_registry = registries[1]
9095
self.node = node
9196
self.dns_server = dns_server

0 commit comments

Comments
 (0)