diff options
author | Lukasz Rajewski <lukasz.rajewski@t-mobile.pl> | 2024-01-28 19:45:44 +0100 |
---|---|---|
committer | Lukasz Rajewski <lukasz.rajewski@t-mobile.pl> | 2024-01-29 22:24:42 +0100 |
commit | a7edeebc90bdd335361a7b36f5f5d12a14375554 (patch) | |
tree | 0e48ee456ef26471271c5412f3205aafcda41857 /src/onaptests/configuration | |
parent | 2479155376b6142e97163a7903632015fed50815 (diff) |
Enhanced validation of configuration of all tests
Issue-ID: TEST-402
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@t-mobile.pl>
Change-Id: I2e4ef6365b44c33f4c0b3e72886a83f92c63e2f3
Diffstat (limited to 'src/onaptests/configuration')
18 files changed, 108 insertions, 107 deletions
diff --git a/src/onaptests/configuration/basic_clamp_settings.py b/src/onaptests/configuration/basic_clamp_settings.py index ac99278..7563fb6 100644 --- a/src/onaptests/configuration/basic_clamp_settings.py +++ b/src/onaptests/configuration/basic_clamp_settings.py @@ -3,15 +3,13 @@ from onaptests.utils.resources import get_resource_location from .settings import * # noqa -""" Specific Basic clamp settings.""" + CLEANUP_FLAG = False CLAMP_DISTRIBUTION_TIMER = 10 -# pylint: disable=bad-whitespace # The ONAP part SERVICE_DETAILS = ("Onboarding, enriching a model with TCA." + "Design a loop with Clamp and deploy it in Policy and DCAE") -SERVICE_COMPONENTS = "SDC, CLAMP, POLICY, DCAE, DMAAP" VENDOR_NAME = "basiclamp_vendor" @@ -44,7 +42,7 @@ CONFIGURATION_PATH = get_resource_location("configuration/") try: # Try to retrieve the SERVICE NAME from the yaml file - with open(SERVICE_YAML_TEMPLATE, "r") as yaml_template: + with open(SERVICE_YAML_TEMPLATE, "r", encoding="utf-8") as yaml_template: yaml_config_file = load(yaml_template, SafeLoader) SERVICE_NAME = next(iter(yaml_config_file.keys())) VF_NAME = SERVICE_NAME diff --git a/src/onaptests/configuration/basic_cnf_macro_settings.py b/src/onaptests/configuration/basic_cnf_macro_settings.py index 56bbd81..60682ca 100644 --- a/src/onaptests/configuration/basic_cnf_macro_settings.py +++ b/src/onaptests/configuration/basic_cnf_macro_settings.py @@ -7,10 +7,10 @@ from onaptests.utils.resources import get_resource_location import onaptests.utils.exceptions as onap_test_exceptions from .settings import * # noqa -""" Specific basic_cnf_macro with multicloud-k8s and yaml config scenario.""" + +# Specific basic_cnf_macro with multicloud-k8s and yaml config scenario. SERVICE_DETAILS = ("Onboarding, distribution and instantiation of a Apache CNF " + "using macro and native CNF path: cnf-adapter + K8sPlugin") -SERVICE_COMPONENTS = "SDC, DMAAP, AAI, SO, SDNC, CDS, Multicloud K8S" CLEANUP_FLAG = True @@ -68,11 +68,11 @@ SERVICE_YAML_TEMPLATE = Path(get_resource_location( try: # Try to retrieve the SERVICE NAME from the yaml file - with open(SERVICE_YAML_TEMPLATE, "r") as yaml_template: + with open(SERVICE_YAML_TEMPLATE, "r", encoding="utf-8") as yaml_template: yaml_config_file = load(yaml_template, SafeLoader) SERVICE_NAME = next(iter(yaml_config_file.keys())) -except (FileNotFoundError, ValueError): - raise onap_test_exceptions.TestConfigurationException +except (FileNotFoundError, ValueError) as exc: + raise onap_test_exceptions.TestConfigurationException from exc SERVICE_INSTANCE_NAME = f"basic_cnf_macro_{str(uuid4())}" diff --git a/src/onaptests/configuration/basic_cnf_yaml_settings.py b/src/onaptests/configuration/basic_cnf_yaml_settings.py index 4eb380c..34a1d4d 100644 --- a/src/onaptests/configuration/basic_cnf_yaml_settings.py +++ b/src/onaptests/configuration/basic_cnf_yaml_settings.py @@ -4,10 +4,10 @@ from onaptests.utils.resources import get_resource_location import onaptests.utils.exceptions as onap_test_exceptions from .settings import * # noqa -""" Specific basic_cnf with multicloud-k8s and yaml config scenario.""" + +# Specific basic_cnf with multicloud-k8s and yaml config scenario. SERVICE_DETAILS = ("Onboarding, distribution and instantiation of a CNF" + "using à la carte and Multicloud K8S module") -SERVICE_COMPONENTS = "SDC, DMAAP, AAI, SO, SDNC, Multicloud K8S" # This scenario uses multicloud-k8s and not multicloud # (no registration requested) USE_MULTICLOUD = False @@ -21,11 +21,11 @@ SERVICE_YAML_TEMPLATE = get_resource_location("templates/vnf-services/basic_cnf- try: # Try to retrieve the SERVICE NAME from the yaml file - with open(SERVICE_YAML_TEMPLATE, "r") as yaml_template: + with open(SERVICE_YAML_TEMPLATE, "r", encoding="utf-8") as yaml_template: yaml_config_file = load(yaml_template, SafeLoader) SERVICE_NAME = next(iter(yaml_config_file.keys())) -except (FileNotFoundError, ValueError): - raise onap_test_exceptions.TestConfigurationException +except (FileNotFoundError, ValueError) as exc: + raise onap_test_exceptions.TestConfigurationException from exc CLEANUP_FLAG = True # nb of seconds before cleanup in case cleanup option is set diff --git a/src/onaptests/configuration/basic_cps_settings.py b/src/onaptests/configuration/basic_cps_settings.py index 690499f..cbf9d4c 100644 --- a/src/onaptests/configuration/basic_cps_settings.py +++ b/src/onaptests/configuration/basic_cps_settings.py @@ -1,10 +1,10 @@ -from .settings import * # noqa - import json from pathlib import Path from onaptests.utils.resources import get_resource_location +from .settings import * # noqa + CLEANUP_FLAG = True ANCHOR_DATA = json.dumps( @@ -63,7 +63,7 @@ SCHEMA_SET_NAME = "basic-cps-test-schema-set" SCHEMA_SET_FILE = Path(get_resource_location("templates/artifacts/cps/bookstore.yang")) SERVICE_NAME = "Basic CPS test" -SERVICE_COMPONENTS = "CPS" +SERVICE_DETAILS = "Validation of the most important CPS REST API requests" QUERY_1 = "/bookstore/categories[@code='1']/books" QUERY_2 = "//categories[@code='1']/books[@price=5 and @title='Dune']" QUERY_3 = "//bookstore" @@ -73,4 +73,4 @@ DB_PRIMARY_HOST = "cps-core-pg-primary" DB_PORT = 5432 DB_LOGIN = "login" DB_PASSWORD = "password" -CHECK_POSTGRESQL = False
\ No newline at end of file +CHECK_POSTGRESQL = False diff --git a/src/onaptests/configuration/basic_network_nomulticloud_settings.py b/src/onaptests/configuration/basic_network_nomulticloud_settings.py index ed2cf41..7cecb51 100644 --- a/src/onaptests/configuration/basic_network_nomulticloud_settings.py +++ b/src/onaptests/configuration/basic_network_nomulticloud_settings.py @@ -3,14 +3,12 @@ import openstack from yaml import load, SafeLoader from onaptests.utils.resources import get_resource_location import onaptests.utils.exceptions as onap_test_exceptions +from .settings import IF_VALIDATION from .settings import * # noqa -""" Specific Basic Network without multicloud.""" -# pylint: disable=bad-whitespace # The ONAP part SERVICE_DETAILS = "Onboarding, distribution and instantiation of Basic Network using à la carte" -SERVICE_COMPONENTS = "SDC, DMAAP, AAI, SO, SDNC" USE_MULTICLOUD = False # Set ONLY_INSTANTIATE to true to run an instantiation without repeating # onboarding and related AAI configuration (Cloud config) @@ -22,11 +20,11 @@ SERVICE_YAML_TEMPLATE = get_resource_location("templates/vnf-services/basic_netw try: # Try to retrieve the SERVICE NAME from the yaml file - with open(SERVICE_YAML_TEMPLATE, "r") as yaml_template: + with open(SERVICE_YAML_TEMPLATE, "r", encoding="utf-8") as yaml_template: yaml_config_file = load(yaml_template, SafeLoader) SERVICE_NAME = next(iter(yaml_config_file.keys())) -except (FileNotFoundError, ValueError): - raise onap_test_exceptions.TestConfigurationException +except (FileNotFoundError, ValueError) as exc: + raise onap_test_exceptions.TestConfigurationException from exc CLEANUP_FLAG = True CLEANUP_ACTIVITY_TIMER = 10 # nb of seconds before cleanup in case cleanup option is set @@ -54,15 +52,15 @@ SERVICE_INSTANCE_NAME = "basicnw_service_instance" # The cloud Part # Assuming a cloud.yaml is available, use the openstack client # to retrieve cloud info and avoid data duplication -TEST_CLOUD = os.getenv('OS_TEST_CLOUD') -TEST_CLOUD = os.getenv('OS_TEST_CLOUD') -cloud = openstack.connect(cloud=TEST_CLOUD) -VIM_USERNAME = cloud.config.auth.get('username', 'Fill me') -VIM_PASSWORD = cloud.config.auth.get('password', 'Fill me') -VIM_SERVICE_URL = cloud.config.auth.get('auth_url', 'Fill me') -TENANT_ID = cloud.config.auth.get('project_id', 'Fill me') -TENANT_NAME = cloud.config.auth.get('project_name', 'Fill me') -CLOUD_REGION_ID = cloud.config.auth.get('region_name', 'RegionOne') -CLOUD_DOMAIN = cloud.config.auth.get('project_domain_name', 'Default') +if not IF_VALIDATION: + TEST_CLOUD = os.getenv('OS_TEST_CLOUD') + cloud = openstack.connect(cloud=TEST_CLOUD) + VIM_USERNAME = cloud.config.auth.get('username', 'Fill me') + VIM_PASSWORD = cloud.config.auth.get('password', 'Fill me') + VIM_SERVICE_URL = cloud.config.auth.get('auth_url', 'Fill me') + TENANT_ID = cloud.config.auth.get('project_id', 'Fill me') + TENANT_NAME = cloud.config.auth.get('project_name', 'Fill me') + CLOUD_REGION_ID = cloud.config.auth.get('region_name', 'RegionOne') + CLOUD_DOMAIN = cloud.config.auth.get('project_domain_name', 'Default') MODEL_YAML_TEMPLATE = None diff --git a/src/onaptests/configuration/basic_onboard_settings.py b/src/onaptests/configuration/basic_onboard_settings.py index c4a1a85..e757035 100644 --- a/src/onaptests/configuration/basic_onboard_settings.py +++ b/src/onaptests/configuration/basic_onboard_settings.py @@ -8,8 +8,6 @@ import onaptests.utils.exceptions as onap_test_exceptions from onaptests.utils.resources import get_resource_location from .settings import * # noqa -""" Creation of service to onboard""" - # We need to create a service file with a random service name, # to be sure that we force onboarding @@ -30,16 +28,12 @@ def generate_service_config_yaml_file(): rendered_template = template.render(service_name=service_name) - with open(SERVICE_YAML_TEMPLATE, 'w+') as file_to_write: + with open(SERVICE_YAML_TEMPLATE, 'w+', encoding="utf-8") as file_to_write: file_to_write.write(rendered_template) -"""Basic onboard service to only onboard a service in SDC""" - -# pylint: disable=bad-whitespace # The ONAP part -SERVICE_DETAILS = "Onboarding of an Ubuntu VM" -SERVICE_COMPONENTS = "SDC" +SERVICE_DETAILS = "Basic onboard service to only onboard a service in SDC" # USE_MULTICLOUD = False # Set ONLY_INSTANTIATE to true to run an instantiation without repeating @@ -54,11 +48,11 @@ generate_service_config_yaml_file() try: # Try to retrieve the SERVICE NAME from the yaml file - with open(SERVICE_YAML_TEMPLATE, "r") as yaml_template: + with open(SERVICE_YAML_TEMPLATE, "r", encoding="utf-8") as yaml_template: yaml_config_file = load(yaml_template, SafeLoader) SERVICE_NAME = next(iter(yaml_config_file.keys())) -except (FileNotFoundError, ValueError): - raise onap_test_exceptions.TestConfigurationException +except (FileNotFoundError, ValueError) as exc: + raise onap_test_exceptions.TestConfigurationException from exc # CLEANUP_FLAG = True # CLEANUP_ACTIVITY_TIMER = 10 # nb of seconds before cleanup in case cleanup option is set diff --git a/src/onaptests/configuration/basic_sdnc_settings.py b/src/onaptests/configuration/basic_sdnc_settings.py index d364616..8fedf32 100644 --- a/src/onaptests/configuration/basic_sdnc_settings.py +++ b/src/onaptests/configuration/basic_sdnc_settings.py @@ -4,7 +4,7 @@ CLEANUP_FLAG = True SERVICE_NAME = "Basic SDNC test" -SERVICE_COMPONENTS = "SDNC" +SERVICE_DETAILS = "Test basic functionality of SDNC controller" SERVICE_ID = "pythonsdk-tests-service-01" diff --git a/src/onaptests/configuration/basic_vm_macro_settings.py b/src/onaptests/configuration/basic_vm_macro_settings.py index 1aeea26..ce1a607 100644 --- a/src/onaptests/configuration/basic_vm_macro_settings.py +++ b/src/onaptests/configuration/basic_vm_macro_settings.py @@ -1,13 +1,17 @@ import os -import openstack from pathlib import Path from uuid import uuid4 -from yaml import load, SafeLoader + +import openstack +from yaml import SafeLoader, load import onaptests.utils.exceptions as onap_test_exceptions from onaptests.utils.resources import get_resource_location + from .settings import * # noqa +from .settings import IF_VALIDATION +SERVICE_DETAILS = "Onboarding, distribution and instanitation of an Ubuntu VM using macro" CLEANUP_FLAG = True @@ -32,15 +36,16 @@ COMPLEX_DATA_CENTER_CODE = "1234-5" GLOBAL_CUSTOMER_ID = "basicvm-customer" -TEST_CLOUD = os.getenv('OS_TEST_CLOUD') -cloud = openstack.connect(cloud=TEST_CLOUD) -VIM_USERNAME = cloud.config.auth.get('username', 'Fill me') -VIM_PASSWORD = cloud.config.auth.get('password', 'Fill me') -VIM_SERVICE_URL = cloud.config.auth.get('auth_url', 'Fill me') -TENANT_ID = cloud.config.auth.get('project_id', 'Fill me') -TENANT_NAME = cloud.config.auth.get('project_name', 'Fill me') -CLOUD_REGION_ID = cloud.config.auth.get('region_name', 'RegionOne') -CLOUD_DOMAIN = cloud.config.auth.get('project_domain_name', 'Default') +if not IF_VALIDATION: + TEST_CLOUD = os.getenv('OS_TEST_CLOUD') + cloud = openstack.connect(cloud=TEST_CLOUD) + VIM_USERNAME = cloud.config.auth.get('username', 'Fill me') + VIM_PASSWORD = cloud.config.auth.get('password', 'Fill me') + VIM_SERVICE_URL = cloud.config.auth.get('auth_url', 'Fill me') + TENANT_ID = cloud.config.auth.get('project_id', 'Fill me') + TENANT_NAME = cloud.config.auth.get('project_name', 'Fill me') + CLOUD_REGION_ID = cloud.config.auth.get('region_name', 'RegionOne') + CLOUD_DOMAIN = cloud.config.auth.get('project_domain_name', 'Default') OWNING_ENTITY = "basicvm-oe" PROJECT = "basicvm-project" @@ -52,11 +57,11 @@ SERVICE_YAML_TEMPLATE = Path(get_resource_location( try: # Try to retrieve the SERVICE NAME from the yaml file - with open(SERVICE_YAML_TEMPLATE, "r") as yaml_template: + with open(SERVICE_YAML_TEMPLATE, "r", encoding="utf-8") as yaml_template: yaml_config_file = load(yaml_template, SafeLoader) SERVICE_NAME = next(iter(yaml_config_file.keys())) -except (FileNotFoundError, ValueError): - raise onap_test_exceptions.TestConfigurationException +except (FileNotFoundError, ValueError) as exc: + raise onap_test_exceptions.TestConfigurationException from exc SERVICE_INSTANCE_NAME = f"basic_macro_{str(uuid4())}" diff --git a/src/onaptests/configuration/basic_vm_macro_stability_settings.py b/src/onaptests/configuration/basic_vm_macro_stability_settings.py index c128ae4..58e4395 100644 --- a/src/onaptests/configuration/basic_vm_macro_stability_settings.py +++ b/src/onaptests/configuration/basic_vm_macro_stability_settings.py @@ -1,9 +1,8 @@ -from .basic_vm_macro_settings import * # noqa - from pathlib import Path from onaptests.utils.resources import get_resource_location +from .basic_vm_macro_settings import * # noqa SERVICE_YAML_TEMPLATE = Path(get_resource_location( "templates/vnf-services/basic_vm_macro_stability-service.yaml")) diff --git a/src/onaptests/configuration/basic_vm_multicloud_yaml_settings.py b/src/onaptests/configuration/basic_vm_multicloud_yaml_settings.py index 838a5ec..1cb1aec 100644 --- a/src/onaptests/configuration/basic_vm_multicloud_yaml_settings.py +++ b/src/onaptests/configuration/basic_vm_multicloud_yaml_settings.py @@ -1,10 +1,10 @@ from onaptests.utils.resources import get_resource_location from .settings import * # noqa -""" Specific Basic VM with multicloud and yaml config scenario.""" + +# Specific Basic VM with multicloud and yaml config scenario. SERVICE_DETAILS = ("Onboarding, distribution and instantiation of a VM" + "using à la carte and Multicloud module") -SERVICE_COMPONENTS = "SDC, DMAAP, AAI, SO, SDNC, Multicloud" USE_MULTICLOUD = True # Set ONLY_INSTANTIATE to true to run an instantiation without repeating diff --git a/src/onaptests/configuration/basic_vm_settings.py b/src/onaptests/configuration/basic_vm_settings.py index 8066625..f26bbd8 100644 --- a/src/onaptests/configuration/basic_vm_settings.py +++ b/src/onaptests/configuration/basic_vm_settings.py @@ -3,14 +3,12 @@ import openstack from yaml import load, SafeLoader from onaptests.utils.resources import get_resource_location import onaptests.utils.exceptions as onap_test_exceptions +from .settings import IF_VALIDATION from .settings import * # noqa -""" Specific basic_vm without multicloud.""" -# pylint: disable=bad-whitespace # The ONAP part SERVICE_DETAILS = "Onboarding, distribution and instanitation of an Ubuntu VM using à la carte" -SERVICE_COMPONENTS = "SDC, DMAAP, AAI, SO, SDNC" USE_MULTICLOUD = False # Set ONLY_INSTANTIATE to true to run an instantiation without repeating @@ -23,11 +21,11 @@ SERVICE_YAML_TEMPLATE = get_resource_location("templates/vnf-services/basic_vm-s try: # Try to retrieve the SERVICE NAME from the yaml file - with open(SERVICE_YAML_TEMPLATE, "r") as yaml_template: + with open(SERVICE_YAML_TEMPLATE, "r", encoding="utf-8") as yaml_template: yaml_config_file = load(yaml_template, SafeLoader) SERVICE_NAME = next(iter(yaml_config_file.keys())) -except (FileNotFoundError, ValueError): - raise onap_test_exceptions.TestConfigurationException +except (FileNotFoundError, ValueError) as exc: + raise onap_test_exceptions.TestConfigurationException from exc CLEANUP_FLAG = True CLEANUP_ACTIVITY_TIMER = 10 # nb of seconds before cleanup in case cleanup option is set @@ -58,15 +56,15 @@ SERVICE_INSTANCE_NAME = "basic_vm_service_instance" # The cloud Part # Assuming a cloud.yaml is available, use the openstack client # to retrieve cloud info and avoid data duplication -TEST_CLOUD = os.getenv('OS_TEST_CLOUD') -TEST_CLOUD = os.getenv('OS_TEST_CLOUD') -cloud = openstack.connect(cloud=TEST_CLOUD) -VIM_USERNAME = cloud.config.auth.get('username', 'Fill me') -VIM_PASSWORD = cloud.config.auth.get('password', 'Fill me') -VIM_SERVICE_URL = cloud.config.auth.get('auth_url', 'Fill me') -TENANT_ID = cloud.config.auth.get('project_id', 'Fill me') -TENANT_NAME = cloud.config.auth.get('project_name', 'Fill me') -CLOUD_REGION_ID = cloud.config.auth.get('region_name', 'RegionOne') -CLOUD_DOMAIN = cloud.config.auth.get('project_domain_name', 'Default') +if not IF_VALIDATION: + TEST_CLOUD = os.getenv('OS_TEST_CLOUD') + cloud = openstack.connect(cloud=TEST_CLOUD) + VIM_USERNAME = cloud.config.auth.get('username', 'Fill me') + VIM_PASSWORD = cloud.config.auth.get('password', 'Fill me') + VIM_SERVICE_URL = cloud.config.auth.get('auth_url', 'Fill me') + TENANT_ID = cloud.config.auth.get('project_id', 'Fill me') + TENANT_NAME = cloud.config.auth.get('project_name', 'Fill me') + CLOUD_REGION_ID = cloud.config.auth.get('region_name', 'RegionOne') + CLOUD_DOMAIN = cloud.config.auth.get('project_domain_name', 'Default') MODEL_YAML_TEMPLATE = None diff --git a/src/onaptests/configuration/cba_enrichment_settings.py b/src/onaptests/configuration/cba_enrichment_settings.py index 847e15e..534ebbe 100644 --- a/src/onaptests/configuration/cba_enrichment_settings.py +++ b/src/onaptests/configuration/cba_enrichment_settings.py @@ -5,6 +5,8 @@ from .settings import * # noqa SERVICE_NAME = "CDS blueprint enrichment" +SERVICE_DETAILS = "Tests CDS blueprint enrichment and its upload to blueprint processor" + CLEANUP_FLAG = True CDS_DD_FILE = Path(get_resource_location("templates/artifacts/dd.json")) diff --git a/src/onaptests/configuration/cds_resource_resolution_settings.py b/src/onaptests/configuration/cds_resource_resolution_settings.py index 0ab6ebc..f7573a6 100644 --- a/src/onaptests/configuration/cds_resource_resolution_settings.py +++ b/src/onaptests/configuration/cds_resource_resolution_settings.py @@ -6,6 +6,7 @@ from .settings import * # noqa CLEANUP_FLAG = True SERVICE_NAME = "CDS resource resolution" +SERVICE_DETAILS = "Tests execution or resource resolution in CDS" CLOUD_REGION_CLOUD_OWNER = "basicnf-owner" # must not contain _ CLOUD_REGION_ID = "k8sregion-cds" CLOUD_REGION_TYPE = "k8s" @@ -82,4 +83,3 @@ CDS_WORKFLOW_EXPECTED_OUTPUT = { } } } -CDS_NODE_PORT = 30449 diff --git a/src/onaptests/configuration/clearwater_ims_nomulticloud_settings.py b/src/onaptests/configuration/clearwater_ims_nomulticloud_settings.py index 0965e9d..07c966c 100644 --- a/src/onaptests/configuration/clearwater_ims_nomulticloud_settings.py +++ b/src/onaptests/configuration/clearwater_ims_nomulticloud_settings.py @@ -2,11 +2,11 @@ import os import openstack from yaml import load, SafeLoader from onaptests.utils.resources import get_resource_location +from .settings import IF_VALIDATION from .settings import * # noqa -""" Specific clearwater IMS without multicloud.""" -# pylint: disable=bad-whitespace +SERVICE_DETAILS = "Onboarding, distribution and instantiation of a Clearwater IMS" # The ONAP part USE_MULTICLOUD = False # Set ONLY_INSTANTIATE to true to run an instantiation without repeating @@ -24,7 +24,7 @@ SERVICE_YAML_TEMPLATE = get_resource_location("templates/vnf-services/clearwater try: # Try to retrieve the SERVICE NAME from the yaml file - with open(SERVICE_YAML_TEMPLATE, "r") as yaml_template: + with open(SERVICE_YAML_TEMPLATE, "r", encoding="utf-8") as yaml_template: yaml_config_file = load(yaml_template, SafeLoader) SERVICE_NAME = next(iter(yaml_config_file.keys())) except ValueError: @@ -51,14 +51,15 @@ SERVICE_INSTANCE_NAME = "clearwater-ims_service_instance" # The cloud Part # Assuming a cloud.yaml is available, use the openstack client # to retrieve cloud info and avoid data duplication -TEST_CLOUD = os.getenv('OS_TEST_CLOUD') -cloud = openstack.connect(cloud=TEST_CLOUD) -VIM_USERNAME = cloud.config.auth.get('username', 'Fill me') -VIM_PASSWORD = cloud.config.auth.get('password', 'Fill me') -VIM_SERVICE_URL = cloud.config.auth.get('auth_url', 'Fill me') -TENANT_ID = cloud.config.auth.get('project_id', 'Fill me') -TENANT_NAME = cloud.config.auth.get('project_name', 'Fill me') -CLOUD_REGION_ID = cloud.config.get('region_name', 'RegionOne') -CLOUD_DOMAIN = cloud.config.auth.get('project_domain_name', 'Default') +if not IF_VALIDATION: + TEST_CLOUD = os.getenv('OS_TEST_CLOUD') + cloud = openstack.connect(cloud=TEST_CLOUD) + VIM_USERNAME = cloud.config.auth.get('username', 'Fill me') + VIM_PASSWORD = cloud.config.auth.get('password', 'Fill me') + VIM_SERVICE_URL = cloud.config.auth.get('auth_url', 'Fill me') + TENANT_ID = cloud.config.auth.get('project_id', 'Fill me') + TENANT_NAME = cloud.config.auth.get('project_name', 'Fill me') + CLOUD_REGION_ID = cloud.config.get('region_name', 'RegionOne') + CLOUD_DOMAIN = cloud.config.auth.get('project_domain_name', 'Default') MODEL_YAML_TEMPLATE = None diff --git a/src/onaptests/configuration/multi_vnf_ubuntu_settings.py b/src/onaptests/configuration/multi_vnf_ubuntu_settings.py index 1b9d4a2..a23d72e 100644 --- a/src/onaptests/configuration/multi_vnf_ubuntu_settings.py +++ b/src/onaptests/configuration/multi_vnf_ubuntu_settings.py @@ -4,16 +4,19 @@ from pathlib import Path import openstack from jinja2 import Environment, PackageLoader from onaptests.utils.resources import get_resource_location +from .settings import IF_VALIDATION from .settings import * # noqa + VNF_FILENAME_PREFIX = "multi-vnf-ubuntu" SERVICE_NAME = f"multivnfubuntu{str(uuid.uuid4().hex)[:6]}" +SERVICE_DETAILS = "Onboarding, distribution and instanitation of an Mutli VM service using macro" # We need to create a service file with a random service name, # to be sure that we force onboarding def generate_service_config_yaml_file(filename): - """ generate the service file with a random service name + """generate the service file with a random service name from a jinja template""" env = Environment( @@ -25,7 +28,7 @@ def generate_service_config_yaml_file(filename): file_name = get_resource_location(f"templates/vnf-services/{filename}.yaml") - with open(file_name, 'w+') as file_to_write: + with open(file_name, 'w+', encoding="utf-8") as file_to_write: file_to_write.write(rendered_template) @@ -50,15 +53,16 @@ COMPLEX_DATA_CENTER_CODE = "nlt" GLOBAL_CUSTOMER_ID = "ubuntu-customer" -TEST_CLOUD = os.getenv('OS_TEST_CLOUD') # Get values from clouds.yaml -cloud = openstack.connect(cloud=TEST_CLOUD) -VIM_USERNAME = cloud.config.auth.get('username', 'nso') -VIM_PASSWORD = cloud.config.auth.get('password', 'Password123') -VIM_SERVICE_URL = cloud.config.auth.get('auth_url', 'https://10.195.194.215:5000') -TENANT_ID = cloud.config.auth.get('project_id', 'e2710e84063b421fab08189818761d55') -TENANT_NAME = cloud.config.auth.get('project_name', 'nso') -CLOUD_REGION_ID = cloud.config.auth.get('region_name', 'nso215') -CLOUD_DOMAIN = cloud.config.auth.get('project_domain_name', 'Default') +if not IF_VALIDATION: + TEST_CLOUD = os.getenv('OS_TEST_CLOUD') # Get values from clouds.yaml + cloud = openstack.connect(cloud=TEST_CLOUD) + VIM_USERNAME = cloud.config.auth.get('username', 'nso') + VIM_PASSWORD = cloud.config.auth.get('password', 'Password123') + VIM_SERVICE_URL = cloud.config.auth.get('auth_url', 'https://10.195.194.215:5000') + TENANT_ID = cloud.config.auth.get('project_id', 'e2710e84063b421fab08189818761d55') + TENANT_NAME = cloud.config.auth.get('project_name', 'nso') + CLOUD_REGION_ID = cloud.config.auth.get('region_name', 'nso215') + CLOUD_DOMAIN = cloud.config.auth.get('project_domain_name', 'Default') OWNING_ENTITY = "seb" PROJECT = "Project-UbuntuDemo" diff --git a/src/onaptests/configuration/pnf_macro_settings.py b/src/onaptests/configuration/pnf_macro_settings.py index d332763..53d22e7 100644 --- a/src/onaptests/configuration/pnf_macro_settings.py +++ b/src/onaptests/configuration/pnf_macro_settings.py @@ -10,6 +10,7 @@ USE_MULTICLOUD = False VENDOR_NAME = "pnf_macro_vendor" SERVICE_NAME = "test_pnf_macro" +SERVICE_DETAILS = "Onboarding, distribution and registration of PNF using macro" SERVICE_INSTANCE_NAME = "TestPNFMacroInstantiation" SERVICE_YAML_TEMPLATE = Path(get_resource_location("templates/vnf-services/pnf-service.yaml")) diff --git a/src/onaptests/configuration/settings.py b/src/onaptests/configuration/settings.py index e43a15e..399f3f7 100644 --- a/src/onaptests/configuration/settings.py +++ b/src/onaptests/configuration/settings.py @@ -1,4 +1,4 @@ -"""Specific settings module.""" # pylint: disable=bad-whitespace +"""Specific settings module.""" ###################### # # @@ -56,5 +56,7 @@ ORCHESTRATION_REQUEST_TIMEOUT = 60.0 * 15 # 15 minutes in seconds SERVICE_DISTRIBUTION_NUMBER_OF_TRIES = 30 SERVICE_DISTRIBUTION_SLEEP_TIME = 60 EXPOSE_SERVICES_NODE_PORTS = True +CDS_NODE_PORT = 30449 IN_CLUSTER = False VES_BASIC_AUTH = {'username': 'sample1', 'password': 'sample1'} +IF_VALIDATION = False diff --git a/src/onaptests/configuration/status_settings.py b/src/onaptests/configuration/status_settings.py index 7bcb6d0..13fb8cd 100644 --- a/src/onaptests/configuration/status_settings.py +++ b/src/onaptests/configuration/status_settings.py @@ -1,9 +1,8 @@ from .settings import * # noqa -""" Specific Status Check """ + SERVICE_NAME = "Status Check" SERVICE_DETAILS = "Checks status of all k8s resources in the selected namespace" -SERVICE_COMPONENTS = "ALL" STATUS_RESULTS_DIRECTORY = "/tmp" STORE_ARTIFACTS = True CHECK_POD_VERSIONS = True |