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-24] VNF with two VDUs belonging to an Openstack server group
18 Library OperatingSystem
23 Resource ../lib/vnfd_lib.resource
24 Resource ../lib/nsd_lib.resource
25 Resource ../lib/ns_lib.resource
26 Resource ../lib/vnf_lib.resource
27 Resource ../lib/openstack_lib.resource
29 Test Tags basic_24 cluster_main daily regression
31 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
35 # NS and VNF descriptor package folder and ids
36 ${VNFD_PKG} affinity_basic_vnf
37 ${VNFD_NAME} affinity_basic-vnf
38 ${NSD_PKG} affinity_basic_ns
39 ${NSD_NAME} affinity_basic-ns
41 # NS instance name and configuration
43 ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
45 # SSH keys and username to be used
46 ${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub
47 ${PRIVATEKEY} %{HOME}/.ssh/id_rsa
52 ${VNF_MEMBER_INDEX} affinity-basic-1
53 ${SUCCESS_RETURN_CODE} 0
58 [Documentation] Upload VNF package for the testsuite.
59 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
62 [Documentation] Upload NS package for the testsuite.
63 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
65 Network Service Instance Test
66 [Documentation] Instantiate NS for the testsuite.
67 ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY}
68 Set Suite Variable ${NS_ID} ${id}
70 Check Vnf Affinity Groups
71 [Documentation] Check that all VDUs of the VNF belong to the expected affinity group.
72 Variable Should Exist ${NS_ID} msg=NS is not available
73 ${vnf_id}= Get Vnf Id ${NS_ID} ${VNF_MEMBER_INDEX}
74 @{vdur_id_list}= Get VDU List From VNF ${vnf_id}
75 FOR ${vdur_id} IN @{vdur_id_list}
76 ${server_group_name}= Get VDU Affinity Group Name ${NS_NAME} ${vnf_id} ${vdur_id}
77 ${vm_vim_id}= Get VDU VIM Id ${vnf_id} ${vdur_id}
78 Check VM In Server Group ${vm_vim_id} ${server_group_name}
81 Delete NS Instance Test
82 [Documentation] Delete NS instance.
86 Delete NS Descriptor Test
87 [Documentation] Delete NS package from OSM.
89 Delete NSD ${NSD_NAME}
91 Delete VNF Descriptor Test
92 [Documentation] Delete VNF package from OSM.
94 Delete VNFD ${VNFD_NAME}
99 [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
100 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
101 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
102 Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}