X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Ftests%2Fclear-all.sh;h=75599e507ad33a63d219db0bc4f8acef87d32089;hp=e53df12185805c4ac4b8197c69b6e9c4f7ce8f62;hb=ace34903be528e8e10e096d3d059b81df30ddaa9;hpb=b24258aa9716c1e375fde230a817f7c9faaf6c2a diff --git a/osm_nbi/tests/clear-all.sh b/osm_nbi/tests/clear-all.sh index e53df12..75599e5 100755 --- a/osm_nbi/tests/clear-all.sh +++ b/osm_nbi/tests/clear-all.sh @@ -1,4 +1,18 @@ #! /bin/bash + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # author: Alfonso Tierno # Script that uses the test NBI URL to clean database. See usage @@ -66,14 +80,14 @@ then done fi -for item in vim_accounts sdns nsrs vnfrs nslcmops nsds vnfds projects # vims +for item in vim_accounts wim_accounts sdns nsrs vnfrs nslcmops nsds vnfds projects pdus nsts nsis nsilcmops # vims do curl --insecure ${OSMNBI_URL}/test/db-clear/${item} - echo " ${item}" done + curl --insecure ${OSMNBI_URL}/test/fs-clear if [ -n "$OSMNBI_COMPLETELY" ] ; then - curl --insecure ${OSMNBI_URL}/test/db-clear/users && echo " ${item}" - curl --insecure ${OSMNBI_URL}/test/db-clear/version && echo " ${item}" + curl --insecure ${OSMNBI_URL}/test/db-clear/users + curl --insecure ${OSMNBI_URL}/test/db-clear/admin else # delete all users except admin curl --insecure ${OSMNBI_URL}/test/db-clear/users?username.ne=admin @@ -84,10 +98,18 @@ then for dc in `openmano datacenter-list | awk '{print $1}'` ; do openmano datacenter-detach $dc ; done for dc in `openmano datacenter-list --all | awk '{print $1}'` ; do openmano datacenter-delete -f $dc ; done for dc in `openmano sdn-controller-list | awk '{print $1}'` ; do openmano sdn-controller-delete -f $dc ; done + for dc in `openmano wim-list | awk '{print $1}'` ; do openmano wim-detach $dc ; done + for dc in `openmano wim-list --all | awk '{print $1}'` ; do openmano wim-delete -f $dc ; done fi if [ -n "$OSMNBI_CLEAN_VCA" ] then - juju destroy-model -y default - juju add-model default + for juju_model in `juju models | grep lxd | grep -v controller | grep -v default | awk '{print$1}'` + do + echo + echo juju destroy-model $juju_model + juju destroy-model -y $juju_model + done + # juju destroy-model -y default + # juju add-model default fi