Modified warden to create borrowed cells on-demand and to scrap returned ones.
Change-Id: If32a0da18ff9d4c05645017e5cc7481bbd1ab0cd
diff --git a/tools/dev/bash_profile b/tools/dev/bash_profile
index 1825264..3034375 100644
--- a/tools/dev/bash_profile
+++ b/tools/dev/bash_profile
@@ -113,17 +113,16 @@
case "$cell" in
"borrow")
aux="/tmp/cell-$$"
- curl -sS -X POST "http://$CELL_WARDEN:4321/?user=$(id -un)&duration=${2:-0}" \
+ curl -sS -X POST "http://$CELL_WARDEN:4321/?duration=${2:-0}&user=${3:-$(id -un)}" \
-d "$(cat ~/.ssh/id_rsa.pub)" > $aux
. $aux
rm -f $aux
export ONOS_INSTANCES=$(env | grep 'OC[0-9]*=' | sort | cut -d= -f2)
setPrimaryInstance 1 >/dev/null
- cell
onos-verify-cell
;;
"return")
- curl -sS -X DELETE "http://$CELL_WARDEN:4321/?user=$(id -un)"
+ curl -sS -X DELETE "http://$CELL_WARDEN:4321/?user=${2:-$(id -un)}"
unset ONOS_CELL ONOS_NIC ONOS_IP ONOS_APPS ONOS_BOOT_FEATURES
unset OCI OCN OCT ONOS_INSTANCES ONOS_FEATURES
unset $(env | sed -n 's:\(^OC[0-9]\{1,\}\)=.*:\1 :g p')
diff --git a/tools/test/bin/onos-verify-cell b/tools/test/bin/onos-verify-cell
index 4b3a0ee..ec34cab 100755
--- a/tools/test/bin/onos-verify-cell
+++ b/tools/test/bin/onos-verify-cell
@@ -6,6 +6,6 @@
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
. $ONOS_ROOT/tools/build/envDefaults
-for node in $(env | sort | egrep "OC[0-9N]+" | cut -d= -f2); do
- printf "%s: " $node; ssh -n -o PasswordAuthentication=no $ONOS_USER@$node date
+for node in $OCN $(env | sort | egrep "OC[0-9]+" | cut -d= -f2); do
+ printf "%s: " $node; ssh -n -o StrictHostKeyChecking=no -o PasswordAuthentication=no $ONOS_USER@$node hostname
done