97d3112876983410172c6a59fd2c720d6d81ae44
[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 from pathlib import Path
15 import yaml
16 from .get_clouds_yaml_info import get_values_from_cloud, get_vim_values
17
18
19 # Variables to be used by the testsuite
20 vim_account_type = "openstack"
21 vim_name = "basic_08_vim_test"
22 vim_user = ""
23 vim_password = ""
24 vim_auth_url = ""
25 vim_tenant = ""
26 vim_config = ""
27
28 # Get credentials from Openstack clouds file
29 cloud, os_cloud = get_values_from_cloud()
30 (
31 vim_user,
32 vim_password,
33 vim_auth_url,
34 vim_tenant,
35 vim_user_domain_name,
36 vim_project_domain_name,
37 vim_insecure,
38 ) = get_vim_values(cloud, os_cloud)
39
40 # Extra VIM config
41 vim_config_dict = {}
42 vim_config_dict["vim_network_name"] = os.environ.get("VIM_MGMT_NET")
43 if vim_project_domain_name:
44 vim_config_dict["project_domain_name"] = vim_project_domain_name
45 if vim_user_domain_name:
46 vim_config_dict["user_domain_name"] = vim_user_domain_name
47 if vim_insecure:
48 vim_config_dict["insecure"] = True
49 vim_config_dict["disable_network_port_security"] = True
50 vim_config_dict["management_network_name"] = os.environ.get("VIM_MGMT_NET")
51 vim_config = "'{}'".format(
52 yaml.safe_dump(vim_config_dict, default_flow_style=True, width=10000).rstrip("\r\n")
53 )
54
55 # Get ${HOME} from local machine
56 home = str(Path.home())
57 # NS and VNF descriptor package folder
58 vnfd_pkg = "hackfest_multivdu_vnf"
59 nsd_pkg = "hackfest_multivdu_ns"
60 # NS and VNF descriptor id
61 vnfd_name = "hackfest_multivdu-vnf"
62 nsd_name = "hackfest_multivdu-ns"
63 # NS instance name
64 ns_name = "basic_08_disable_port_security_network_level_test"
65 # SSH keys to be used
66 publickey = home + "/.ssh/id_rsa.pub"
67 privatekey = home + "/.ssh/id_rsa"