X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=robot-systest%2Fresources%2Fepa_03-crud_operations_on_sdnc_data.py;h=3267dd241773c593facd3f98602e8816f6152d6a;hb=063677c719bd33d8674903ed5b7f11e7368da23a;hp=9a2b201ec6bcf89d45ebfad3e8da0d575ef56386;hpb=a5704d6a060b5329e10488a351c50495be69d680;p=osm%2Ftests.git diff --git a/robot-systest/resources/epa_03-crud_operations_on_sdnc_data.py b/robot-systest/resources/epa_03-crud_operations_on_sdnc_data.py index 9a2b201..3267dd2 100644 --- a/robot-systest/resources/epa_03-crud_operations_on_sdnc_data.py +++ b/robot-systest/resources/epa_03-crud_operations_on_sdnc_data.py @@ -12,37 +12,32 @@ import os from pathlib import Path + import yaml from common_helpers import get_prometheus_info # Prometheus host and port -(prometheus_host, prometheus_port) = get_prometheus_info() +( + prometheus_host, + prometheus_port, + prometheus_user, + prometheus_password, +) = get_prometheus_info() + -# VIM Configuration -sdnc_type = "onos" -sdnc_name = "epa_03_crud_operations_on_sdnc_test" -# Get credentials from ONOS SDNCs file -os_sdnc = os.environ.get("OS_SDNC") -sdncs_file_paths = ["./sdncs.yaml", str(Path.home()) + "/.config/onos/sdncs.yaml"] -for path in sdncs_file_paths: - sdncs_file_path = Path(path) - if sdncs_file_path.exists(): - break -if not sdncs_file_path.exists(): - raise Exception("ONOS sdncs file not found") -with sdncs_file_path.open() as sdncs_file: - sdncs = yaml.safe_load(sdncs_file) - if not os_sdnc in sdncs["sdncs"]: - raise Exception("SDN controller '" + os_sdnc + "' not found") - sdnc = sdncs["sdncs"][os_sdnc] - if not "username" in sdnc["auth"]: - raise Exception("Username not found in SDN controller '" + os_sdnc + "'") - sdnc_user = sdnc["auth"]["username"] - if not "password" in sdnc["auth"]: - raise Exception("Password not found in SDN controller '" + os_sdnc + "'") - sdnc_password = sdnc["auth"]["password"] - if not "url" in sdnc["auth"]: - raise Exception("URL not found in SDN controller '" + os_sdnc + "'") - sdnc_url = sdnc["auth"]["url"] +# SDNC Configuration +sdnc_name = "epa_03" +sdnc_user = os.environ.get("SDNC_USER") +if not sdnc_user: + raise Exception("'SDNC_USER' environment variable not found") +sdnc_password = os.environ.get("SDNC_PASSWORD") +if not sdnc_password: + raise Exception("'SDNC_PASSWORD' environment variable not found") +sdnc_url = os.environ.get("SDNC_URL") +if not sdnc_url: + raise Exception("'SDNC_URL' environment variable not found") +sdnc_type = os.environ.get("SDNC_TYPE") +if not sdnc_type: + raise Exception("'SDNC_TYPE' environment variable not found")