1 # Licensed under the Apache License, Version 2.0 (the "License");
2 # you may not use this file except in compliance with the License.
3 # You may obtain a copy of the License at
5 # http://www.apache.org/licenses/LICENSE-2.0
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS,
9 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 # See the License for the specific language governing permissions and
11 # limitations under the License.
14 Documentation [FAIL-01] A single VNF with 2 VDUs, one of them unallocatable because of resources.
16 Library OperatingSystem
21 Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot
22 Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot
23 Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot
24 Resource %{ROBOT_DEVOPS_FOLDER}/lib/openstack_lib.robot
26 Force Tags fail_01 cluster_main daily regression
28 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
32 # NS and VNF descriptor package folder and ids
33 ${vnfd_pkg} simple_2vm_vnf
34 ${vnfd_name} simple_2vm-vnf
35 ${nsd_pkg} simple_2vm_ns
36 ${nsd_name} simple_2vm-ns
38 # NS instance name and configuration
39 ${ns_name_prefix} fail_01
40 ${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
43 ${publickey} %{HOME}/.ssh/id_rsa.pub
45 # Default memory in GB for dataVM VDU (can be overwritten by VM_MEMORY_OVERRIDE environment variable)
46 # Only used if no quota is defined in Openstack's project (VDU tries to allocate the full memory of the quota)
49 # NS launch timeout and polling time
50 ${ns_launch_max_wait_time} 5min
51 ${ns_launch_pol_time} 15
53 # Openstack delete operation timeout and polling time
54 ${os_delete_max_wait_time} 6min
55 ${os_delete_pol_time} 20
61 ${ram_quota}= Get Project Quota ram
63 ${memory}= Get Environment Variable VM_MEMORY_OVERRIDE default=${default_memory}
65 ${memory}= Evaluate ${ram_quota} / 1000
68 Create VNFD Overriding Fields '%{PACKAGES_FOLDER}/${vnfd_pkg}' virtual-compute-desc.1.virtual-memory.size=${memory}
73 Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'
76 Cannot Instantiate Network Service
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
94 Delete NS Instance And Check VIM
98 WAIT UNTIL KEYWORD SUCCEEDS ${os_delete_max_wait_time} ${os_delete_pol_time} Check NS Servers In VIM ${ns_name} 0
104 Delete NSD ${nsd_name}
107 Delete VNF Descriptor
110 Delete VNFD ${vnfd_name}
115 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
117 Run Keyword If Any Tests Failed Delete NS ${ns_name}
118 Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
119 Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}