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 [FAIL-01] A single VNF with 2 VDUs, one of them unallocatable because of resources.
18 Library OperatingSystem
23 Resource ../lib/vnfd_lib.resource
24 Resource ../lib/nsd_lib.resource
25 Resource ../lib/ns_lib.resource
26 Resource ../lib/openstack_lib.resource
28 Test Tags fail_01 cluster_main daily regression
30 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
34 # NS and VNF descriptor package folder and ids
35 ${VNFD_PKG} simple_2vm_vnf
36 ${VNFD_NAME} simple_2vm-vnf
37 ${NSD_PKG} simple_2vm_ns
38 ${NSD_NAME} simple_2vm-ns
40 # NS instance name and configuration
41 ${NS_NAME_PREFIX} fail_01
42 ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
45 ${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub
47 # Default memory in GB for dataVM VDU (can be overwritten by VM_MEMORY_OVERRIDE environment variable)
48 # Only used if no quota is defined in Openstack's project (VDU tries to allocate the full memory of the quota)
51 # NS launch timeout and polling time
52 ${NS_LAUNCH_MAX_WAIT_TIME} 5min
53 ${NS_LAUNCH_POL_TIME} 15
55 # Openstack delete operation timeout and polling time
56 ${OS_DELETE_MAX_WAIT_TIME} 6min
57 ${OS_DELETE_POL_TIME} 20
62 [Documentation] Upload VNF package for the testsuite.
63 ${ram_quota}= Get Project Quota ram
65 ${memory}= Get Environment Variable VM_MEMORY_OVERRIDE default=${DEFAULT_MEMORY}
67 ${memory}= Evaluate ${ram_quota} / 1000
70 Create VNFD Overriding Fields '%{PACKAGES_FOLDER}/${VNFD_PKG}' virtual-compute-desc.1.virtual-memory.size=${memory}
73 [Documentation] Upload NS package for the testsuite.
74 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
76 Cannot Instantiate Network Service
77 [Documentation] Assert failure when trying to instantiate the NS instance and there are not enough resources in the VIM.
78 ${rand}= Generate Random String 4 [NUMBERS]
79 ${ns_name}= Catenate SEPARATOR=_ ${NS_NAME_PREFIX} ${rand}
80 Set Suite Variable ${NS_NAME}
82 ${id}= Instantiate Network Service ${NS_NAME} ${NSD_NAME} %{VIM_TARGET} --config '${NS_CONFIG}' --ssh_keys ${PUBLICKEY}
84 Set Suite Variable ${NS_ID} ${id}
85 WAIT UNTIL KEYWORD SUCCEEDS ${NS_LAUNCH_MAX_WAIT_TIME} ${NS_LAUNCH_POL_TIME} Check For Ns Instance To Configured ${NS_NAME}
86 ${rc} ${stdout}= Run And Return Rc And Output osm ns-list --filter id="${NS_ID}" | grep ${NS_ID} | awk '{print $8}'
88 Should Contain ${stdout} BROKEN
89 ${rc} ${stdout}= Run And Return Rc And Output osm ns-show ${NS_ID} --literal | yq .errorDetail
91 Should Contain ${stdout} Deploying at VIM: Error at create vdu
93 Delete NS Instance And Check VIM
94 [Documentation] Delete NS instance and check that the VMs have been deleted.
97 WAIT UNTIL KEYWORD SUCCEEDS ${OS_DELETE_MAX_WAIT_TIME} ${OS_DELETE_POL_TIME} Check NS Servers In VIM ${NS_NAME} 0
100 [Documentation] Delete NS package from OSM.
102 Delete NSD ${NSD_NAME}
104 Delete VNF Descriptor
105 [Documentation] Delete VNF package from OSM.
107 Delete VNFD ${VNFD_NAME}
112 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
113 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
114 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
115 Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}