Feature 11001: Robot framework linting for E2E tests
[osm/tests.git] / robot-systest / resources / basic_08-disable_port_security_network_level_data.py
1 # Licensed under the Apache License, Version 2.0 (the "License");
2 # you may not use this file except in compliance with the License.
3 # You may obtain a copy of the License at
4 #
5 # http://www.apache.org/licenses/LICENSE-2.0
6 #
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS,
9 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 # See the License for the specific language governing permissions and
11 # limitations under the License.
12
13 import os
14 import yaml
15 from get_clouds_yaml_info import get_values_from_cloud, get_vim_values
16
17
18 # Variables to be used by the testsuite
19 VIM_ACCOUNT_TYPE = "openstack"
20 VIM_NAME = "basic_08_vim_test"
21 VIM_USER = ""
22 VIM_PASSWORD = ""
23 VIM_AUTH_URL = ""
24 VIM_TENANT = ""
25 VIM_CONFIG = ""
26
27 # Get credentials from Openstack clouds file
28 cloud, os_cloud = get_values_from_cloud()
29 (
30 VIM_USER,
31 VIM_PASSWORD,
32 VIM_AUTH_URL,
33 VIM_TENANT,
34 vim_user_domain_name,
35 vim_project_domain_name,
36 vim_insecure,
37 ) = get_vim_values(cloud, os_cloud)
38
39 # Extra VIM config
40 vim_config_dict = {}
41 vim_config_dict["vim_network_name"] = os.environ.get("VIM_MGMT_NET")
42 if vim_project_domain_name:
43 vim_config_dict["project_domain_name"] = vim_project_domain_name
44 if vim_user_domain_name:
45 vim_config_dict["user_domain_name"] = vim_user_domain_name
46 if vim_insecure:
47 vim_config_dict["insecure"] = True
48 vim_config_dict["disable_network_port_security"] = True
49 vim_config_dict["management_network_name"] = os.environ.get("VIM_MGMT_NET")
50 VIM_CONFIG = "'{}'".format(
51 yaml.safe_dump(vim_config_dict, default_flow_style=True, width=10000).rstrip("\r\n")
52 )