Revert "Revert "Create basic_cnf test leveraging onapsdk""
[testsuite/pythonsdk-tests.git] / src / onaptests / configuration / ubuntu16_nomulticloud_settings.py
1 import os
2 import openstack
3 import sys
4 from yaml import load
5
6 import onaptests.utils.exceptions as onap_test_exceptions
7 from .settings import * # pylint: disable=W0614
8
9 """ Specific ubuntu16 without multicloud."""
10
11 # pylint: disable=bad-whitespace
12 # The ONAP part
13 SERVICE_DETAILS="Onboarding, distribution and instanitation of an Ubuntu VM using à la carte"
14 SERVICE_COMPONENTS="SDC, DMAAP, AAI, SO, SDNC"
15
16 USE_MULTICLOUD = False
17 # Set ONLY_INSTANTIATE to true to run an instantiation without repeating
18 # onboarding and related AAI configuration (Cloud config)
19 ONLY_INSTANTIATE= False
20
21 # if a yaml file is define, retrieve info from this yaml files
22 # if not declare the parameters in the settings
23 SERVICE_YAML_TEMPLATE = (sys.path[-1] + "/onaptests/templates/vnf-services/" +
24                          "ubuntu16test-service.yaml")
25
26 try:
27     # Try to retrieve the SERVICE NAME from the yaml file
28     with open(SERVICE_YAML_TEMPLATE, "r") as yaml_template:
29         yaml_config_file = load(yaml_template)
30         SERVICE_NAME = next(iter(yaml_config_file.keys()))
31 except (FileNotFoundError, ValueError):
32     raise onap_test_exceptions.TestConfigurationException
33
34 CLEANUP_FLAG = True
35 CLEANUP_ACTIVITY_TIMER = 10  # nb of seconds before cleanup in case cleanup option is set
36 VENDOR_NAME = "basicvm_vendor"
37
38 VF_NAME = "basicvm_ubuntu_vf"
39 VSP_NAME = "basicvm_ubuntu_vsp"
40
41 CLOUD_REGION_CLOUD_OWNER = "basicvm-cloud-owner"
42 CLOUD_REGION_TYPE = "openstack"
43 CLOUD_REGION_VERSION = "openstack"
44 CLOUD_OWNER_DEFINED_TYPE = "N/A"
45
46 AVAILABILITY_ZONE_NAME = "basicvm-availability-zone"
47 AVAILABILITY_ZONE_TYPE = "nova"
48 COMPLEX_PHYSICAL_LOCATION_ID = "lannion"
49 COMPLEX_DATA_CENTER_CODE = "1234-5"
50
51 GLOBAL_CUSTOMER_ID = "basicvm-customer"
52
53 OWNING_ENTITY = "basicvm-oe"
54 PROJECT = "basicvm-project"
55 LINE_OF_BUSINESS = "basicvm-lob"
56 PLATFORM = "basicvm-platform"
57
58 SERVICE_INSTANCE_NAME = "basicvm_ubuntu16_service_instance"
59
60 # The cloud Part
61 # Assuming a cloud.yaml is available, use the openstack client
62 # to retrieve cloud info and avoid data duplication
63 TEST_CLOUD = os.getenv('OS_TEST_CLOUD')
64 TEST_CLOUD = os.getenv('OS_TEST_CLOUD')
65 cloud = openstack.connect(cloud=TEST_CLOUD)
66 VIM_USERNAME = cloud.config.auth.get('username','Fill me')
67 VIM_PASSWORD = cloud.config.auth.get('password','Fill me')
68 VIM_SERVICE_URL = cloud.config.auth.get('auth_url','Fill me')
69 TENANT_ID = cloud.config.auth.get('project_id','Fill me')
70 TENANT_NAME = cloud.config.auth.get('project_name','Fill me')
71 CLOUD_REGION_ID = cloud.config.auth.get('region_name','RegionOne')
72 CLOUD_DOMAIN = cloud.config.auth.get('project_domain_name','Default')