2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
16 Documentation [BASIC-08] Disable port security at network level.
18 Library OperatingSystem
22 Resource ../lib/vim_lib.resource
23 Resource ../lib/vnfd_lib.resource
24 Resource ../lib/nsd_lib.resource
25 Resource ../lib/ns_lib.resource
26 Resource ../lib/prometheus_lib.resource
28 Variables ../resources/basic_08-disable_port_security_network_level_data.py
30 Test Tags basic_08 cluster_main daily regression
32 Suite Setup Run Keyword And Ignore Error Suite Preparation
33 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
37 # NS and VNF descriptor package folder and ids
38 ${VNFD_PKG} hackfest_multivdu_vnf
39 ${VNFD_NAME} hackfest_multivdu-vnf
40 ${NSD_PKG} hackfest_multivdu_ns
41 ${NSD_NAME} hackfest_multivdu-ns
43 # NS instance name and configuration
44 ${NS_NAME} basic_08_disable_port_security_network_level_test
45 ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
47 # SSH keys and username to be used
48 ${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub
51 ${PORT_DISABLED_MSG} port_security_enabled: false
55 Create VIM With Port Security Disabled
56 [Documentation] Register an Opentack VIM with port security disabled, so that all ports created from OSM have port security disabled
58 ${created_vim_account_id}= Create VIM Target ${VIM_NAME} ${VIM_USER} ${VIM_PASSWORD} ${VIM_AUTH_URL} ${VIM_TENANT} ${VIM_ACCOUNT_TYPE} config=${VIM_CONFIG}
59 Log ${created_vim_account_id}
60 Check For VIM Target Status ${VIM_NAME} ${PROMETHEUS_HOST} ${PROMETHEUS_PORT} ${PROMETHEUS_USER} ${PROMETHEUS_PASSWORD}
63 [Documentation] Upload VNF package for the testsuite.
64 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
67 [Documentation] Upload NS package for the testsuite.
68 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
70 Instantiate Network Service
71 [Documentation] Instantiate NS for the testsuite.
72 ${id}= Create Network Service ${NSD_NAME} ${VIM_NAME} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY}
73 Set Suite Variable ${NS_ID} ${id}
75 Check Port Security Is Disabled
76 [Documentation] Check that there are ports/interfaces in the VDU of the VNF of the NS whose port security was disabled.
77 ${rc} ${disabled_ports}= Run And Return RC And Output osm ns-show ${NS_NAME} --literal | grep -c '${PORT_DISABLED_MSG}'
78 Log ${rc},${disabled_ports}
79 IF ${disabled_ports} <= 0 Fail msg=Found '${disabled_ports}' matches for '${PORT_DISABLED_MSG}'
82 [Documentation] Delete NS instance.
87 [Documentation] Delete NS package from OSM.
89 Delete NSD ${NSD_NAME}
92 [Documentation] Delete VNF package from OSM.
94 Delete VNFD ${VNFD_NAME}
97 [Documentation] Delete VIM from OSM.
99 Delete VIM Target ${VIM_NAME}
104 [Documentation] Test Suite Preparation: Setting Prometheus Testsuite Variables
105 Set Testsuite Prometheus Variables
108 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
109 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
110 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
111 Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}
112 Run Keyword If Any Tests Failed Delete VIM Target ${VIM_NAME}