Removed defunct cell definitions

 Moved implementation of the cell command into a script.

Change-Id: Iee307d1deca5d91fb0bdb548f67a7276bcf82f22
diff --git a/tools/dev/bash_profile b/tools/dev/bash_profile
index 3034375..91a31f9 100644
--- a/tools/dev/bash_profile
+++ b/tools/dev/bash_profile
@@ -106,57 +106,7 @@
 # ON.Lab shared test cell warden address
 export CELL_WARDEN="10.254.1.19"
 
-# Applies the settings in the specified cell file or lists current cell definition
-# if no cell file is given.
-function cell {
-    cell=$1
-    case "$cell" in
-    "borrow")
-        aux="/tmp/cell-$$"
-        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
-        onos-verify-cell
-        ;;
-    "return")
-        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')
-        ;;
-
-    "status")
-        curl -sS "http://$CELL_WARDEN:4321/" | sort
-        ;;
-
-    "")
-        env | egrep "ONOS_CELL"
-        env | egrep "OCI"
-        env | egrep "OC[0-9]+" | sort
-        env | egrep "OC[NT]"
-        env | egrep "ONOS_" | egrep -v 'ONOS_ROOT|ONOS_CELL|ONOS_INSTANCES' | sort
-        ;;
-
-    *)
-        [ ! -f $ONOS_ROOT/tools/test/cells/$1 ] && \
-            echo "No such cell: $1" >&2 && return 1
-        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')
-        export ONOS_USER=${ONOS_USER:-sdn}
-        export ONOS_GROUP=${ONOS_GROUP:-sdn}
-        export ONOS_WEB_USER=onos
-        export ONOS_WEB_PASS=rocks
-        export ONOS_CELL=$1
-        . $ONOS_ROOT/tools/test/cells/$1
-        export ONOS_INSTANCES=$(env | grep 'OC[0-9]*=' | sort | cut -d= -f2)
-        setPrimaryInstance 1 >/dev/null
-        cell
-    esac
-}
+alias cell='onos-cell'
 
 [ -n "$ONOS_CELL" -a "$ONOS_CELL" != "borrow" ] && cell $ONOS_CELL > /dev/null
 
diff --git a/tools/test/bin/onos-cell b/tools/test/bin/onos-cell
index 45a68b9..f2b9908 100755
--- a/tools/test/bin/onos-cell
+++ b/tools/test/bin/onos-cell
@@ -1,9 +1,53 @@
 #!/bin/bash
 # -----------------------------------------------------------------------------
-# List available ONOS cells configuration.
+# Applies the settings in the specified cell file or lists current cell
+# definition if no cell file is given.
 # -----------------------------------------------------------------------------
 
-[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
-. $ONOS_ROOT/tools/dev/bash_profile
+cell=$1
+case "$cell" in
+"borrow")
+    aux="/tmp/cell-$$"
+    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
+    onos-verify-cell
+    ;;
+"return")
+    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')
+    ;;
 
-cell "$@"
\ No newline at end of file
+"status")
+    curl -sS "http://$CELL_WARDEN:4321/" | sort
+    ;;
+
+"")
+    env | egrep "ONOS_CELL"
+    env | egrep "OCI"
+    env | egrep "OC[0-9]+" | sort
+    env | egrep "OC[NT]"
+    env | egrep "ONOS_" | egrep -v 'ONOS_ROOT|ONOS_CELL|ONOS_INSTANCES' | sort
+    ;;
+
+*)
+    [ ! -f $ONOS_ROOT/tools/test/cells/$1 ] && \
+        echo "No such cell: $1" >&2 && return 1
+    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')
+    export ONOS_USER=${ONOS_USER:-sdn}
+    export ONOS_GROUP=${ONOS_GROUP:-sdn}
+    export ONOS_WEB_USER=onos
+    export ONOS_WEB_PASS=rocks
+    export ONOS_CELL=$1
+    . $ONOS_ROOT/tools/test/cells/$1
+    export ONOS_INSTANCES=$(env | grep 'OC[0-9]*=' | sort | cut -d= -f2)
+    setPrimaryInstance 1 >/dev/null
+    cell
+esac
\ No newline at end of file
diff --git a/tools/test/cells/andrea b/tools/test/cells/andrea
deleted file mode 100644
index a25de78..0000000
--- a/tools/test/cells/andrea
+++ /dev/null
@@ -1,11 +0,0 @@
-# Andrea's ProxMox ONOS instances 1,2,3 & ONOS mininet box
-
-export ONOS_NIC="10.128.12.*"
-export OC1="10.128.12.11"
-export OC2="10.128.12.12"
-export OC3="10.128.12.13"
-export OCN="10.128.12.14"
-
-export OCT=$OC1
-export ONOS_USE_SSH=true
-export ONOS_APPS=drivers,openflow,proxyarp,ovsdb,pathpainter
\ No newline at end of file
diff --git a/tools/test/cells/bramble b/tools/test/cells/bramble
deleted file mode 100644
index 7f17d2f..0000000
--- a/tools/test/cells/bramble
+++ /dev/null
@@ -1,8 +0,0 @@
-export ONOS_NIC=192.168.1.*
-export OC1="192.168.1.11"
-export OC2="192.168.1.12"
-export OC3="192.168.1.13"
-export OC4="192.168.1.14"
-# export OC5="192.168.1.15"
-export OCN="192.168.1.15"
-export OCI="${OC1}"
diff --git a/tools/test/cells/brian b/tools/test/cells/brian
deleted file mode 100644
index 5208e99..0000000
--- a/tools/test/cells/brian
+++ /dev/null
@@ -1,11 +0,0 @@
-# Brians's ProxMox ONOS instances 1,2,3 & ONOS mininet box
-
-export ONOS_NIC="10.128.3.*"
-export OC1="10.128.3.1"
-export OC2="10.128.3.2"
-export OC3="10.128.3.3"
-export OCN="10.128.3.4"
-
-export OCT=$OC1
-export ONOS_USE_SSH=true
-export ONOS_APPS=drivers,openflow,proxyarp,mobility,pathpainter
diff --git a/tools/test/cells/jian b/tools/test/cells/jian
deleted file mode 100644
index d9808d5..0000000
--- a/tools/test/cells/jian
+++ /dev/null
@@ -1,11 +0,0 @@
-# Jian's ProxMox ONOS instances 1,2,3 & ONOS mining box
-
-export ONOS_NIC="10.128.1.*"
-export OC1="10.128.1.1"
-export OC2="10.128.1.2"
-export OC3="10.128.1.3"
-export OCN="10.128.1.4"
-
-export OCT=$OC1
-export ONOS_USE_SSH=true
-export ONOS_APPS=drivers,openflow,proxyarp,mobility
\ No newline at end of file
diff --git a/tools/test/cells/madan3 b/tools/test/cells/madan3
deleted file mode 100644
index 857d096..0000000
--- a/tools/test/cells/madan3
+++ /dev/null
@@ -1,7 +0,0 @@
-# Madan's ProxMox ONOS instances 1,2,3 & ONOS mininet box
-
-export ONOS_NIC="10.128.4.*"
-export OC1="10.128.4.2"
-export OC2="10.128.4.3"
-export OC3="10.128.4.4"
-export OCN="10.128.4.5"
diff --git a/tools/test/cells/simon b/tools/test/cells/simon
deleted file mode 100644
index 7188335..0000000
--- a/tools/test/cells/simon
+++ /dev/null
@@ -1,11 +0,0 @@
-# Simon's ProxMox ONOS instances 1,2,3 & ONOS mininet box
-
-export ONOS_NIC="10.128.2.*"
-export OC1="10.128.2.1"
-export OC2="10.128.2.2"
-export OC3="10.128.2.3"
-export OCN="10.128.2.4"
-
-export OCT=$OC1
-export ONOS_USE_SSH=true
-export ONOS_APPS=drivers,openflow,proxyarp,mobility
\ No newline at end of file
diff --git a/tools/test/cells/tom b/tools/test/cells/tom
deleted file mode 100644
index 1d44d8b..0000000
--- a/tools/test/cells/tom
+++ /dev/null
@@ -1,11 +0,0 @@
-# Thomas' VirtualBox-based 3 ONOS instances & ONOS mininet box
-
-export ONOS_NIC=192.168.56.*
-export OC1="192.168.56.5"
-export OC2="192.168.56.6"
-export OC3="192.168.56.7"
-export OCN="192.168.56.8"
-#export OCN="10.128.11.4"
-
-export ONOS_USE_SSH=true
-export ONOS_APPS=drivers,openflow,proxyarp,mobility,pathpainter
\ No newline at end of file