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