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 [EPA-02] Support for additional EPA capabilities.
18 Library OperatingSystem
23 Resource ../lib/vnfd_lib.resource
24 Resource ../lib/vnf_lib.resource
25 Resource ../lib/nsd_lib.resource
26 Resource ../lib/ns_lib.resource
27 Resource ../lib/openstack_lib.resource
29 Test Tags epa_02 cluster_epa daily regression
31 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
35 # NS and VNF descriptor package folder and ids
36 ${VNFD_PKG} epa_quota_vnf
37 ${VNFD_NAME} epa_quota-vnf
38 ${NSD_PKG} epa_quota_ns
39 ${NSD_NAME} epa_quota-ns
41 # NS instance name and configuration
42 ${NS_NAME} epa_02-epa_quota_test
43 ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
45 # SSH public keys file
46 ${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub
49 ${VNF_SERVER_ID} ${EMPTY}
50 ${FLAVOR_PROPERTIES} ${EMPTY}
51 ${SUCCESS_RETURN_CODE} 0
56 [Documentation] Upload VNF package for the testsuite.
57 Remove Environment Variable OVERRIDES
58 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
61 [Documentation] Upload NS package for the testsuite.
62 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
64 Instantiate Network Service
65 [Documentation] Instantiate the NS for the testsuite.
66 ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY}
67 Set Suite Variable ${NS_ID} ${id}
70 [Documentation] Get the id of the VM at the VIM and store in VNF_SERVER_ID suite variable to be used later on.
71 ${vnfs_list}= Get Ns Vnf List ${NS_ID}
72 ${vim_id}= Get VNF VIM ID ${vnfs_list}[0]
74 Set Suite Variable ${VNF_SERVER_ID} ${vim_id}
76 Get Server Flavor Properties
77 [Documentation] Get from the VIM the flavor properties of the VM with id VNF_SERVER_ID.
78 ${flavor_id}= Get Server Flavor ID ${VNF_SERVER_ID}
79 ${properties}= Get Flavor Properties ${flavor_id}
81 Set Suite Variable ${FLAVOR_PROPERTIES} ${properties}
83 Check Flavor Quota Properties
84 [Documentation] Assert that the flavor properties include the expected EPA parameters included in the descriptor.
85 ${rc}= Run And Return Rc echo ${FLAVOR_PROPERTIES} | grep "cpu_shares_level=custom"
86 Should Be Equal As Integers ${rc} ${SUCCESS_RETURN_CODE}
87 ${rc}= Run And Return Rc echo ${FLAVOR_PROPERTIES} | grep "disk_io_shares_level=custom"
88 Should Be Equal As Integers ${rc} ${SUCCESS_RETURN_CODE}
89 ${rc}= Run And Return Rc echo ${FLAVOR_PROPERTIES} | grep "memory_shares_level=custom"
90 Should Be Equal As Integers ${rc} ${SUCCESS_RETURN_CODE}
93 [Documentation] Delete NS instance.
98 [Documentation] Delete NS package from OSM.
100 Delete NSD ${NSD_NAME}
102 Delete VNF Descriptor
103 [Documentation] Delete VNF package from OSM.
105 Delete VNFD ${VNFD_NAME}
110 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
111 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
112 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
113 Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}