Changing how ONOS_APPS value is used and defaulted; cleaned up cell defs.

Change-Id: Ie134bd61024738609ef1a02237c696438eff6024
diff --git a/tools/dev/bash_profile b/tools/dev/bash_profile
index 5208643..a66d2b9 100644
--- a/tools/dev/bash_profile
+++ b/tools/dev/bash_profile
@@ -9,6 +9,10 @@
 # the protobuf buck rules can handle symlinks
 ONOS_ROOT=$(pushd $ONOS_ROOT >/dev/null && pwd -P && popd >/dev/null)
 
+# Rely on developer preference for automatically ignited apps
+# Default to drivers and gui2
+export ONOS_APPS=${ONOS_APPS:-drivers,openflow,gui2}
+
 # Setup some environmental context for developers
 if [ -z "${JAVA_HOME}" ]; then
     if [ -x /usr/libexec/java_home ]; then
@@ -54,16 +58,13 @@
         egrep "${1:-$ONOS_ROOT}" | awk '{print length($1)"\t"$1}'  | sort -n | cut -f2 | head -n 1)
 }
 
-# Buck (if "buck" is not on the PATH)
-[ -z "$(which buck)" ] && alias buck="onos-buck"
-
 # Short-hand for ONOS build, package and test.
 alias op="SHLVL=1 bazel build //:onos"
 alias ot="bazel run //:buildifier_check && bazel query 'tests(//...)' | grep -v "coverage" | SHLVL=1 xargs bazel test --test_summary=terse --test_output=errors"
 alias ob="op && ot"
 alias obd="SHLVL=1 bazel build //docs:external //docs:internal"
 
-alias ok="SHLVL=1 bazel run onos-local --"
+alias ok="SHLVL=1 bazel run //:onos-local --"
 alias oh="onos localhost halt"
 
 alias ol='onos-log'
@@ -73,7 +74,6 @@
 
 # Short-hand for tailing and searching the ONOS (karaf) log
 alias tl='$ONOS_ROOT/tools/dev/bin/onos-local-log'
-# alias gl='grep $KARAF_LOG --colour=auto -E -e '
 
 function filterLocalLog {
     tl | grep --colour=always -E -e "${1-org.onlab|org.onosproject}"
@@ -208,12 +208,11 @@
 export CELL_SLAVE_1=$CELL_WARDEN
 export CELL_SLAVE_2="10.192.19.71"
 export CELL_SLAVE_3="10.192.19.70"
-export CELL_SLAVE_4="10.192.19.77"   # disabled
 export CELL_SLAVES="$CELL_SLAVE_1 $CELL_SLAVE_2 $CELL_SLAVE_3"
 
 # Clears cell environment
 function clearCell {
-    unset ONOS_CELL ONOS_NIC ONOS_IP ONOS_APPS ONOS_BOOT_FEATURES
+    unset ONOS_CELL ONOS_IP ONOS_BOOT_FEATURES
     unset OCI OCN OCT ONOS_INSTANCES ONOS_CORES ONOS_FEATURES
     unset ONOS_USER ONOS_GROUP ONOS_WEB_USER ONOS_WEB_PASS
     unset $(env | sed -n 's:\(^OC[0-9]\{1,\}\)=.*:\1 :g p')
@@ -239,9 +238,6 @@
         curl -sS -X POST "http://$CELL_WARDEN:4321/?$query" -d "$(cat ~/.ssh/id_rsa.pub)" > $aux
         . $aux
         rm -f $aux
-        # This is a hack to get master running on the existing cell infrastructure
-        apps=${ONOS_APPS:-}
-        export ONOS_APPS=$apps,gui
         setPrimaryInstance 1 >/dev/null
         setMinorityMajority >/dev/null
         onos-verify-cell
@@ -279,8 +275,6 @@
     esac
 }
 
-[ -n "$ONOS_CELL" -a "$ONOS_CELL" != "borrow" ] && cell $ONOS_CELL > /dev/null
-
 # Lists available cells
 function cells {
     for cell in $(ls -1 $ONOS_ROOT/tools/test/cells); do
diff --git a/tools/test/cells/beast b/tools/test/cells/beast
deleted file mode 100644
index 6f5de2b..0000000
--- a/tools/test/cells/beast
+++ /dev/null
@@ -1,21 +0,0 @@
-# Bare metal cluster (7-node)
-
-# Use the 1G NIC for cluster communications
-export ONOS_NIC="10.192.19.*"
-
-# ONOS Test proxy
-export OCT=10.192.19.69
-
-# Use the 1G NICs for external access
-export OC1=10.192.19.68
-export OC2=10.192.19.67
-export OC3=10.192.19.66
-export OC4=10.192.19.65
-export OC5=10.192.19.64
-export OC6=10.192.19.63
-export OC7=10.192.19.62
-
-# IP address of Mininet
-export OCN=10.192.19.69
-
-export ONOS_APPS="gui,drivers,null,intentperf"
diff --git a/tools/test/cells/beast-1 b/tools/test/cells/beast-1
deleted file mode 100644
index eb20452..0000000
--- a/tools/test/cells/beast-1
+++ /dev/null
@@ -1,15 +0,0 @@
-# Bare metal cluster (7-node)
-
-# Use the 1G NIC for cluster communications
-export ONOS_NIC="10.192.19.*"
-
-# ONOS Test proxy
-export OCT=10.192.19.69
-
-# Use the 1G NICs for external access
-export OC1=10.192.19.68
-
-# IP address of Mininet
-export OCN=10.192.19.69
-
-export ONOS_APPS="gui,drivers,null,intentperf"
diff --git a/tools/test/cells/beast-3 b/tools/test/cells/beast-3
deleted file mode 100644
index d736da7..0000000
--- a/tools/test/cells/beast-3
+++ /dev/null
@@ -1,17 +0,0 @@
-# Bare metal cluster (7-node)
-
-# Use the 1G NIC for cluster communications
-export ONOS_NIC="10.192.19.*"
-
-# ONOS Test proxy
-export OCT=10.192.19.69
-
-# Use the 1G NICs for external access
-export OC1=10.192.19.68
-export OC2=10.192.19.67
-export OC3=10.192.19.66
-
-# IP address of Mininet
-export OCN=10.192.19.69
-
-export ONOS_APPS="gui,drivers,null,intentperf"
diff --git a/tools/test/cells/beast-5 b/tools/test/cells/beast-5
deleted file mode 100644
index a11c2b0..0000000
--- a/tools/test/cells/beast-5
+++ /dev/null
@@ -1,19 +0,0 @@
-# Bare metal cluster (7-node)
-
-# Use the 1G NIC for cluster communications
-export ONOS_NIC="10.192.19.*"
-
-# ONOS Test proxy
-export OCT=10.192.19.69
-
-# Use the 1G NICs for external access
-export OC1=10.192.19.68
-export OC2=10.192.19.67
-export OC3=10.192.19.66
-export OC4=10.192.19.65
-export OC5=10.192.19.64
-
-# IP address of Mininet
-export OCN=10.192.19.69
-
-export ONOS_APPS="gui,drivers,null,intentperf"
diff --git a/tools/test/cells/ec2 b/tools/test/cells/ec2
deleted file mode 100644
index 842f59d..0000000
--- a/tools/test/cells/ec2
+++ /dev/null
@@ -1,18 +0,0 @@
-# EC2-based cluster (7-node)
-
-# Use the 10G NIC for cluster communications
-export ONOS_NIC="192.168.200.*"
-
-# ONOS Test proxy
-export OCT=192.168.200.101
-
-# Use the 1G NICs for external access
-export OC1=192.168.200.101
-export OC2=192.168.200.102
-export OC3=192.168.200.103
-export OC4=192.168.200.104
-export OC5=192.168.200.105
-export OC6=192.168.200.106
-export OC7=192.168.200.107
-
-export ONOS_APPS="gui,drivers,null,intentperf"
diff --git a/tools/test/cells/local b/tools/test/cells/local
deleted file mode 100644
index 5310495..0000000
--- a/tools/test/cells/local
+++ /dev/null
@@ -1,10 +0,0 @@
-# Local VirtualBox-based ONOS instances 1,2 & ONOS mininet box
-
-export ONOS_NIC=192.168.56.*
-export OC1="192.168.56.101"
-export OC2="192.168.56.102"
-export OCC1="192.168.56.101"
-export OCC2="192.168.56.102"
-export OCN="192.168.56.103"
-
-export ONOS_APPS="gui,drivers,openflow,fwd,proxyarp,mobility"
diff --git a/tools/test/cells/office b/tools/test/cells/office
deleted file mode 100644
index 1a03ee2..0000000
--- a/tools/test/cells/office
+++ /dev/null
@@ -1,6 +0,0 @@
-# ONLAB_OF Wifi ProxMox-based cell; single node; no mininet-box
-
-export ONOS_NIC="10.1.10.*"
-export OC1="10.1.10.223"
-
-export ONOS_APPS="gui,drivers,openflow,fwd,proxyarp,mobility"
diff --git a/tools/test/cells/prox b/tools/test/cells/prox
deleted file mode 100644
index 8af4198..0000000
--- a/tools/test/cells/prox
+++ /dev/null
@@ -1,6 +0,0 @@
-# ProxMox-based cell of ONOS instances 1,2 & ONOS mininet box
-
-export ONOS_NIC="10.1.9.*"
-export OC1="10.1.9.94"
-export OC2="10.1.9.82"
-export OCN="10.1.9.93"
diff --git a/tools/test/cells/sdnip-pmox b/tools/test/cells/sdnip-pmox
deleted file mode 100644
index 3e0bed9..0000000
--- a/tools/test/cells/sdnip-pmox
+++ /dev/null
@@ -1,8 +0,0 @@
-# SDN-IP ProxMox cell
-
-export ONOS_NIC=10.128.4.*
-export OC1="10.128.4.65"
-export OC2="10.128.4.66"
-export OC3="10.128.4.67"
-
-export ONOS_APPS="gui,drivers,openflow,fwd,proxyarp,mobility,config,sdnip"
diff --git a/tools/test/cells/simon-single b/tools/test/cells/simon-single
deleted file mode 100644
index 7ce6ec1..0000000
--- a/tools/test/cells/simon-single
+++ /dev/null
@@ -1,7 +0,0 @@
-# Local VirtualBox-based single ONOS instance & ONOS mininet box
-
-export ONOS_NIC=192.168.36.*
-export OC1="192.168.36.1"
-export OCN="192.168.36.101"
-
-export ONOS_APPS="gui,drivers,openflow,fwd,drivermatrix,null"
diff --git a/tools/test/cells/simon-uk b/tools/test/cells/simon-uk
deleted file mode 100644
index 6fae098..0000000
--- a/tools/test/cells/simon-uk
+++ /dev/null
@@ -1,55 +0,0 @@
-# Simon's LXC-based multi ONOS instances & ONOS mininet VM.
-
-###
-###  NOTE:
-###        Assumes a route has been set up
-###         from 192.168.56.0/24 -> 10.0.3.0/24
-###
-###                    {dest-net}  {gateway}  (i.e. container VM)
-###  sudo route -n add 10.0.3.0/24 192.168.56.102
-###
-
-## ONOS Cluster VM (has LXC containers for cluster nodes)
-export OCVM=192.168.56.98
-
-#============================================
-# sdn@ocluster:~$ sudo lxc-ls --fancy
-# NAME   STATE    IPV4        IPV6  AUTOSTART
-# -------------------------------------------
-# onos1  RUNNING  10.0.3.11   -     YES
-# onos2  RUNNING  10.0.3.12   -     YES
-# onos3  RUNNING  10.0.3.13   -     YES
-# onos4  RUNNING  10.0.3.14   -     YES
-#============================================
-
-export ONOS_NIC="10.0.3.*"
-
-## ONOS instances (LXC containers)
-export OC1=10.0.3.11
-export OC2=10.0.3.12
-export OC3=10.0.3.13
-
-## keep this out of the initial cluster...
-## export OC4=10.0.3.14
-
-## default ONOS instance
-export OCI=$OC1
-
-## credentials for logging into ONOS instances
-export ONOS_USER=sdn
-
-## the apps we want activated at startup
-export ONOS_APPS="gui,drivers,openflow,proxyarp,drivermatrix,mlb"
-
-## mininet VM
-export OCN="192.168.56.99"
-
-export ONOS_WEB_USER=onos
-export ONOS_WEB_PASS=rocks
-
-# Verify route to LXC cluster
-netstat -nr | grep 10.0.3 | grep -q $OCVM && echo "Routes to LXC in place" || ( 
-  echo "Route to LXC not found. Adding...";
-  sudo bash -c "route -n delete 10.0.3.0/24; \
-                route -n add 10.0.3.0/24 192.168.56.98" >/dev/null 2>&1
-)
diff --git a/tools/test/cells/simon-uk4 b/tools/test/cells/simon-uk4
deleted file mode 100644
index 5f81f64..0000000
--- a/tools/test/cells/simon-uk4
+++ /dev/null
@@ -1,53 +0,0 @@
-# Simon's LXC-based multi ONOS instances & ONOS mininet VM.
-
-###
-###  NOTE:
-###        Assumes a route has been set up
-###         from 192.168.56.0/24 -> 10.0.3.0/24
-###
-###                    {dest-net}  {gateway}  (i.e. container VM)
-###  sudo route -n add 10.0.3.0/24 192.168.56.102
-###
-
-## ONOS Cluster VM (has LXC containers for cluster nodes)
-export OCVM=192.168.56.98
-
-#============================================
-# sdn@ocluster:~$ sudo lxc-ls --fancy
-# NAME   STATE    IPV4        IPV6  AUTOSTART
-# -------------------------------------------
-# onos1  RUNNING  10.0.3.11   -     YES
-# onos2  RUNNING  10.0.3.12   -     YES
-# onos3  RUNNING  10.0.3.13   -     YES
-# onos4  RUNNING  10.0.3.14   -     YES
-#============================================
-
-export ONOS_NIC="10.0.3.*"
-
-## ONOS instances (LXC containers)
-export OC1=10.0.3.11
-export OC2=10.0.3.12
-export OC3=10.0.3.13
-export OC4=10.0.3.14
-
-## default ONOS instance
-export OCI=$OC1
-
-## credentials for logging into ONOS instances
-export ONOS_USER=sdn
-
-## the apps we want activated at startup
-export ONOS_APPS="gui,drivers,openflow,proxyarp,drivermatrix,mlb"
-
-## mininet VM
-export OCN="192.168.56.99"
-
-export ONOS_WEB_USER=onos
-export ONOS_WEB_PASS=rocks
-
-# Verify route to LXC cluster
-netstat -nr | grep 10.0.3 | grep -q $OCVM && echo "Routes to LXC in place" || (
-  echo "Route to LXC not found. Adding...";
-  sudo bash -c "route -n delete 10.0.3.0/24; \
-                route -n add 10.0.3.0/24 192.168.56.98" >/dev/null 2>&1
-)
diff --git a/tools/test/cells/single b/tools/test/cells/single
deleted file mode 100644
index 1c20c21..0000000
--- a/tools/test/cells/single
+++ /dev/null
@@ -1,7 +0,0 @@
-# Local VirtualBox-based single ONOS instance & ONOS mininet box
-
-export ONOS_NIC=192.168.56.*
-export OC1="192.168.56.101"
-export OCN="192.168.56.103"
-
-export ONOS_APPS="gui,drivers,openflow,fwd,proxyarp,mobility"
diff --git a/tools/test/cells/single_optical b/tools/test/cells/single_optical
deleted file mode 100644
index f95c3bd..0000000
--- a/tools/test/cells/single_optical
+++ /dev/null
@@ -1,7 +0,0 @@
-# Optical use-case VirtualBox-based single ONOS instance & ONOS mininet box
-
-export ONOS_NIC=192.168.56.*
-export OC1="192.168.56.101"
-export OCN="192.168.56.103"
-
-export ONOS_APPS="gui,drivers,drivers.optical,openflow,fwd,proxyarp,mobility,optical"
diff --git a/tools/test/cells/triple b/tools/test/cells/triple
deleted file mode 100644
index 2d882d9..0000000
--- a/tools/test/cells/triple
+++ /dev/null
@@ -1,9 +0,0 @@
-# Local VirtualBox-based ONOS instances 1,2,3 & ONOS mininet box
-
-export ONOS_NIC=192.168.56.*
-export OC1="192.168.56.101"
-export OC2="192.168.56.102"
-export OC3="192.168.56.104"
-export OCN="192.168.56.103"
-
-export ONOS_APPS="gui,drivers,openflow,fwd,proxyarp,mobility"