X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=test%2Fbasictest.sh;h=7effee99ce52940caaaee6dcd9acac0590278d76;hb=aa5832d48e1f101b8cb00d6a954650c84d82afb0;hp=0d4fcea561f3a59b8594f4d80951eb01b56693aa;hpb=70d4c7a9aa85e92a7842b06a5b2ff05e32467fb7;p=osm%2FRO.git diff --git a/test/basictest.sh b/test/basictest.sh index 0d4fcea5..7effee99 100755 --- a/test/basictest.sh +++ b/test/basictest.sh @@ -39,6 +39,7 @@ function usage(){ echo -e " --screen forces to run openmano (and openvim) service in a screen" echo -e " --insert-bashrc insert the created tenant,datacenter variables at" echo -e " ~/.bashrc to be available by openmano CLI" + echo -e " --install-openvim install openvim in test mode" echo -e " --init-openvim if openvim runs locally, an init is called to clean openvim" echo -e " database and add fake hosts" } @@ -57,7 +58,7 @@ DIRscript=${DIRmano}/scripts #process options -source ${DIRscript}/get-options.sh "force:f help:h insert-bashrc init-openvim screen" $* || $_exit 1 +source ${DIRscript}/get-options.sh "force:f help:h insert-bashrc init-openvim install-openvim screen" $* || $_exit 1 #help [ -n "$option_help" ] && usage && $_exit 0 @@ -72,7 +73,7 @@ action_list="" for argument in $params do - if [[ $argument == reset ]] || [[ $argument == create ]] || [[ $argument == delete ]] + if [[ $argument == reset ]] || [[ $argument == create ]] || [[ $argument == delete ]] || [[ -z "$argument" ]] then action_list="$action_list $argument" continue @@ -88,6 +89,19 @@ export OPENMANO_PORT=9090 #by default action should be reset and create [[ -z $action_list ]] && action_list="reset create delete" + +if [[ -n "$option_install_openvim" ]] +then + pushd ${DIRmano}/.. + echo "installing openvim at $PWD/openvim ... " + wget -O install-openvim.sh "https://osm.etsi.org/gitweb/?p=osm/openvim.git;a=blob_plain;f=scripts/install-openvim.sh" + chmod +x install-openvim.sh + sudo ./install-openvim.sh --no-install-packages --force --quiet --develop + alias initopenvim="${PWD}/openvim/scripts/initopenvim.sh" + alias openvim="${PWD}/openvim/scripts/openvim" + option_init_openvim="-" + popd +fi [[ -z "$option_init_openvim" ]] || initopenvim${force_param}${insert_bashrc_param}${screen_vim_param} || echo "WARNING openvim cannot be initialized. The rest of test can fail!" #check openvim client variables are set @@ -144,6 +158,7 @@ then ${DIRmano}/openmano vnf-delete -f linux_2VMs_v02 || echo "fail" ${DIRmano}/openmano vnf-delete -f dataplaneVNF_2VMs || echo "fail" ${DIRmano}/openmano vnf-delete -f dataplaneVNF_2VMs_v02 || echo "fail" + ${DIRmano}/openmano vnf-delete -f dataplaneVNF4 || echo "fail" ${DIRmano}/openmano vnf-delete -f dataplaneVNF2 || echo "fail" ${DIRmano}/openmano vnf-delete -f dataplaneVNF3 || echo "fail" ${DIRmano}/openmano datacenter-detach TEST-dc || echo "fail" @@ -166,8 +181,8 @@ then [[ -z $OPENVIM_HOST ]] && OPENVIM_HOST=localhost [[ -z $OPENVIM_PORT ]] && OPENVIM_PORT=9080 URL_ADMIN_PARAM="" - [[ -n $OPENVIM_ADMIN_PORT ]] && URL_ADMIN_PARAM="--url_admin=http://${$OPENVIM_HOST}:${OPENVIM_ADMIN_PORT}/openvim" - result=`${DIRmano}/openmano datacenter-create TEST-dc "http://${OPENVIM_HOST}:${OPENVIM_PORT}/openvim" --type=openvim $URL_ADMIN_PARAM` + [[ -n $OPENVIM_ADMIN_PORT ]] && URL_ADMIN_PARAM=" --url_admin=http://${OPENVIM_HOST}:${OPENVIM_ADMIN_PORT}/openvim" + result=`${DIRmano}/openmano datacenter-create TEST-dc "http://${OPENVIM_HOST}:${OPENVIM_PORT}/openvim" --type=openvim${URL_ADMIN_PARAM} --config="{test: no use just for test}"` datacenter=`echo $result |gawk '{print $1}'` #check a valid uuid is obtained ! is_valid_uuid $datacenter && echo "FAIL" && echo " $result" && $_exit 1 @@ -176,7 +191,7 @@ then [[ -n "$option_insert_bashrc" ]] && echo -e "\nexport OPENMANO_DATACENTER=$datacenter" >> ~/.bashrc printf "%-50s" "Attaching openmano tenant to the datacenter:" - result=`${DIRmano}/openmano datacenter-attach TEST-dc` + result=`${DIRmano}/openmano datacenter-attach TEST-dc --config="{test: no use just for test}"` [[ $? != 0 ]] && echo "FAIL" && echo " $result" && $_exit 1 echo OK @@ -187,7 +202,7 @@ then [[ $? != 0 ]] && echo "FAIL" && echo " $result" && $_exit 1 echo OK - for VNF in linux dataplaneVNF1 dataplaneVNF2 dataplaneVNF_2VMs dataplaneVNF_2VMs_v02 dataplaneVNF3 linux_2VMs_v02 + for VNF in linux dataplaneVNF1 dataplaneVNF2 dataplaneVNF_2VMs dataplaneVNF_2VMs_v02 dataplaneVNF3 linux_2VMs_v02 dataplaneVNF4 do printf "%-50s" "Creating VNF '${VNF}': " result=`$DIRmano/openmano vnf-create $DIRmano/vnfs/examples/${VNF}.yaml`