3 # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
4 # This file is part of openvim
7 # Licensed under the Apache License, Version 2.0 (the "License"); you may
8 # not use this file except in compliance with the License. You may obtain
9 # a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 # License for the specific language governing permissions and limitations
19 # For those usages not covered by the Apache License, Version 2.0 please
20 # contact with: nfvlabs@tid.es
24 #author Alfonso Tierno
26 #script to test openvim with the creation of flavors and interfaces
30 echo " Creates 1 flavor, 3 nets, 2 VMs (US)
31 WITHOUT huge pages, nor NUMA assigment
32 network attach after creation"
34 echo "Press enter to continue"
38 imagePath
=/mnt
/powervault
/virtualization
/vnfs
/os
/US1404.qcow2
39 #image to load as an extra disk, can be any
40 imagePath_extra
=/mnt
/powervault
/virtualization
/vnfs
/os
/US1404user.qcow2
41 #default network to use
47 function del_rubbish
(){
48 echo "Press enter to delete the deployed things"
50 [ -n "$DEL_server" ] && ${DIRNAME}/test_openvim.py
-f del server
$DEL_server
51 [ -n "$DEL_network" ] && ${DIRNAME}/test_openvim.py
-f del network
$DEL_network
52 [ -n "$DEL_flavor" ] && ${DIRNAME}/test_openvim.py
-f del flavor
$DEL_flavor
53 [ -n "$DEL_image" ] && ${DIRNAME}/test_openvim.py
-f del image
$DEL_image
57 function proccess_out
(){ # action_text field to retrieve
58 if egrep -q "\"error\"" kk.out
65 if [ -z "$2" ] ; then pattern
='"id"' ; else pattern
="$2" ; fi
66 value
=`egrep "$pattern" kk.out `
71 echo "not found the field" $2
78 #proccess_out "insert server tidgen1" '^ "id"'
84 echo -n "get ${imagePath##*/} image: "
85 ${DIRNAME}/test_openvim.py
-F"path=$imagePath" images
> kk.out
86 proccess_out
"get ${imagePath##*/}"
91 echo -n "get ${imagePath_extra##*/} image: "
92 ${DIRNAME}/test_openvim.py
-F"path=$imagePath_extra" images
> kk.out
93 proccess_out
"get ${imagePath_extra##*/}"
98 echo -n "get ${network_eth0} network: "
99 ${DIRNAME}/test_openvim.py
-F"name=$network_eth0" network
> kk.out
100 proccess_out
"get ${network_eth0} network"
105 echo -n "insert flavor: "
106 ${DIRNAME}/test_openvim.py new flavor
'
110 description: normal cloud image with 1G, 1core
114 proccess_out
"insert flavor"
117 DEL_flavor
="$DEL_flavor $flavor1"
121 echo "Press enter to continue"
124 echo -n "insert bridge network net2: "
125 ${DIRNAME}/test_openvim.py new network
'
131 proccess_out
"insert network 2"
134 DEL_network
="$DEL_network $value"
136 echo -n "insert test VM 1: "
137 ${DIRNAME}/test_openvim.py new server
"
141 descrition: US 1 core
143 flavorRef: '$flavor1'
147 uuid: ${network_eth0}
148 mac_address: '10:10:10:10:10:12'
152 mac_address: '10:10:10:10:10:13'
154 proccess_out
"insert test VM 2" '^ "id"'
157 DEL_server
="$DEL_server $value"
161 echo "Press enter to continue"
164 echo -n "insert test VM 2: "
165 ${DIRNAME}/test_openvim.py new server
"
169 descrition: US 1G 1core
171 flavorRef: '$flavor1'
177 uuid: ${network_eth0}
178 mac_address: '10:10:10:10:aa:12'
182 mac_address: '10:10:10:10:aa:13'
188 proccess_out
"insert test VM 2" '^ "id"'
191 DEL_server
="$DEL_server $value"
194 echo finsish. Check connections
!!