Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add TLS integration to the NMS #467

Merged
merged 4 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions tests/integration/nms_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def create_subscriber(self, imsi: str) -> None:
imsi (str): Subscriber's IMSI
"""
SUBSCRIBER_CONFIG["UeId"] = imsi
url = f"http://{self.nms_ip}:5000/api/subscriber/imsi-{imsi}"
response = requests.post(url=url, data=json.dumps(SUBSCRIBER_CONFIG))
url = f"https://{self.nms_ip}:5000/api/subscriber/imsi-{imsi}"
response = requests.post(url=url, data=json.dumps(SUBSCRIBER_CONFIG), verify=False)
response.raise_for_status()
logger.info(f"Created subscriber with IMSI {imsi}.")

Expand All @@ -75,13 +75,13 @@ def create_device_group(self, device_group_name: str, imsis: list) -> None:
imsis (list): List of IMSIs to be included in the device group
"""
DEVICE_GROUP_CONFIG["imsis"] = imsis
url = f"http://{self.nms_ip}:5000/config/v1/device-group/{device_group_name}"
response = requests.post(url, json=DEVICE_GROUP_CONFIG)
url = f"https://{self.nms_ip}:5000/config/v1/device-group/{device_group_name}"
response = requests.post(url, json=DEVICE_GROUP_CONFIG, verify=False)
response.raise_for_status()
now = time.time()
timeout = 5
while time.time() - now <= timeout:
if requests.get(url).json():
if requests.get(url, verify=False).json():
logger.info(f"Created device group {device_group_name}.")
return
else:
Expand All @@ -96,13 +96,13 @@ def create_network_slice(self, network_slice_name: str, device_groups: list) ->
device_groups (list): List of device groups to be included in the network slice
"""
NETWORK_SLICE_CONFIG["site-device-group"] = device_groups
url = f"http://{self.nms_ip}:5000/config/v1/network-slice/{network_slice_name}"
response = requests.post(url, json=NETWORK_SLICE_CONFIG)
url = f"https://{self.nms_ip}:5000/config/v1/network-slice/{network_slice_name}"
response = requests.post(url, json=NETWORK_SLICE_CONFIG, verify=False)
response.raise_for_status()
now = time.time()
timeout = 5
while time.time() - now <= timeout:
if requests.get(url).json():
if requests.get(url, verify=False).json():
logger.info(f"Created network slice {network_slice_name}.")
return
else:
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ async def test_given_external_hostname_configured_for_traefik_when_calling_sdcor
self, configure_traefik_external_hostname
):
nms_url = self._get_nms_url()
network_configuration_resp = requests.get(f"{nms_url}/network-configuration")
network_configuration_resp = requests.get(f"{nms_url}/network-configuration", verify=False)
network_configuration_resp.raise_for_status()
subscribers_resp = requests.get(f"{nms_url}/subscribers")
subscribers_resp = requests.get(f"{nms_url}/subscribers", verify=False)
subscribers_resp.raise_for_status()

@pytest.mark.abort_on_fail
Expand Down