From 4d73b3901b80c8b9719c8daaae036f77abec570e Mon Sep 17 00:00:00 2001 From: tierno Date: Thu, 25 May 2017 14:19:48 +0200 Subject: [PATCH] New delete-all argument at basictest.sh Change-Id: Id043d0b0d81a42768a80ce94ed8d5fc1c71ddb5c Signed-off-by: tierno --- test/basictest.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/test/basictest.sh b/test/basictest.sh index e38b208d..3af91a71 100755 --- a/test/basictest.sh +++ b/test/basictest.sh @@ -35,6 +35,7 @@ function usage(){ echo -e " del-openvim detaches and deletes the local openvim datacenter" echo -e " create creates VNFs, scenarios and instances" echo -e " delete deletes the created instances, scenarios and VNFs" + echo -e " delete-all deletes ALL the existing instances, scenarios and vnf at the current tenant" echo -e " OPTIONS:" echo -e " -f --force does not prompt for confirmation" echo -e " -h --help shows this help" @@ -84,7 +85,8 @@ action_list="" for argument in $params do if [[ $argument == reset ]] || [[ $argument == create ]] || [[ $argument == delete ]] || - [[ $argument == add-openvim ]] || [[ $argument == del-openvim ]] || [[ -z "$argument" ]] + [[ $argument == add-openvim ]] || [[ $argument == del-openvim ]] || [[ $argument == delete-all ]] || + [[ -z "$argument" ]] then action_list="$action_list $argument" continue @@ -195,9 +197,20 @@ then $openmano vnf-delete -f linux_2VMs_v02 || echo "fail" $openmano vnf-delete -f dataplaneVNF_2VMs || echo "fail" $openmano vnf-delete -f dataplaneVNF_2VMs_v02 || echo "fail" - $openmano vnf-delete -f dataplaneVNF4 || echo "fail" + $openmano vnf-delete -f dataplaneVNF1 || echo "fail" $openmano vnf-delete -f dataplaneVNF2 || echo "fail" $openmano vnf-delete -f dataplaneVNF3 || echo "fail" + $openmano vnf-delete -f dataplaneVNF4 || echo "fail" + +elif [[ $action == "delete-all" ]] +then + for i in instance-scenario scenario vnf + do + for f in `$openmano $i-list | awk '{print $1}'` + do + [[ -n "$f" ]] && [[ "$f" != No ]] && $openmano ${i}-delete -f ${f} + done + done elif [[ $action == "del-openvim" ]] then -- 2.17.1