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_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
38 ${PORT_DISABLED_MSG} port_security_enabled: false
42 Create VIM With Port Security Disabled
43 [Documentation] Register an Opentack VIM with port security disabled, so that all ports created from OSM have port security disabled
45 ${created_vim_account_id}= Create VIM Target ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} config=${vim_config}
46 Log ${created_vim_account_id}
47 Check For VIM Target Status ${VIM_NAME} ${PROMETHEUS_HOST} ${PROMETHEUS_PORT} ${PROMETHEUS_USER} ${PROMETHEUS_PASSWORD}
50 [Documentation] Upload VNF package for the testsuite.
51 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
54 [Documentation] Upload NS package for the testsuite.
55 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
57 Instantiate Network Service
58 [Documentation] Instantiate NS for the testsuite.
59 ${id}= Create Network Service ${NSD_NAME} ${VIM_NAME} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY}
60 Set Suite Variable ${NS_ID} ${id}
62 Check Port Security Is Disabled
63 [Documentation] Check that there are ports/interfaces in the VDU of the VNF of the NS whose port security was disabled.
64 ${rc} ${disabled_ports}= Run And Return RC And Output osm ns-show ${NS_NAME} --literal | grep -c '${PORT_DISABLED_MSG}'
65 Log ${rc},${disabled_ports}
66 IF ${disabled_ports} <= 0 Fail msg=Found '${disabled_ports}' matches for '${PORT_DISABLED_MSG}'
69 [Documentation] Delete NS instance.
74 [Documentation] Delete NS package from OSM.
76 Delete NSD ${NSD_NAME}
79 [Documentation] Delete VNF package from OSM.
81 Delete VNFD ${VNFD_NAME}
84 [Documentation] Delete VIM from OSM.
86 Delete VIM Target ${VIM_NAME}
91 [Documentation] Test Suite Preparation: Setting Prometheus Testsuite Variables
92 Set Testsuite Prometheus Variables
95 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
96 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
97 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
98 Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}
99 Run Keyword If Any Tests Failed Delete VIM Target ${VIM_NAME}