Fixing onos-package not to be sensitive to cell settings and instead allowing onos-config (used from onos-install) to be fully sensitive to cell settings.
Added onos-package-test and onos-push-test-bits scripts.

Change-Id: Ie3f829f8a6e6d8a419388428feca56b69635ed44
diff --git a/tools/build/envDefaults b/tools/build/envDefaults
index a7eb8bf..f66d47e 100644
--- a/tools/build/envDefaults
+++ b/tools/build/envDefaults
@@ -20,12 +20,20 @@
 # ONOS Version and onos.tar.gz staging environment
 export ONOS_POM_VERSION="1.1.0-SNAPSHOT"
 export ONOS_VERSION=${ONOS_VERSION:-1.1.0.$BUILD_NUMBER}
+
+# ONOS production bits (onos.tar.gz & onos.zip) staging environment
 export ONOS_BITS=onos-${ONOS_VERSION%~*}
 export ONOS_STAGE_ROOT=${ONOS_STAGE_ROOT:-/tmp}
 export ONOS_STAGE=$ONOS_STAGE_ROOT/$ONOS_BITS
 export ONOS_TAR=$ONOS_STAGE.tar.gz
 export ONOS_ZIP=$ONOS_STAGE.zip
 
+# ONOS test bits (onos-test.tar.gz) staging environment
+export ONOS_TEST_BITS=onos-test-${ONOS_VERSION%~*}
+export ONOS_TEST_STAGE_ROOT=${ONOS_TEST_STAGE_ROOT:-/tmp}
+export ONOS_TEST_STAGE=$ONOS_STAGE_ROOT/$ONOS_TEST_BITS
+export ONOS_TEST_TAR=$ONOS_TEST_STAGE.tar.gz
+
 # Defaults for ONOS testing using remote machines.
 # if [ -n "${ONOS_CELL}" -a -f $ONOS_ROOT/tools/test/cells/${ONOS_CELL} ]; then
 #   . $ONOS_ROOT/tools/test/cells/${ONOS_CELL}
diff --git a/tools/build/onos-package b/tools/build/onos-package
index 31551ea..05b51e6 100755
--- a/tools/build/onos-package
+++ b/tools/build/onos-package
@@ -1,6 +1,6 @@
 #!/bin/bash
 # -----------------------------------------------------------------------------
-# Packages ONOS distributable into onos.tar.gz
+# Packages ONOS distributable into onos.tar.gz and onos.zip
 # -----------------------------------------------------------------------------
 
 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
@@ -57,8 +57,6 @@
         $KARAF_DIST/system/org/onosproject/$artifact/$ONOS_POM_VERSION
 done
 
-export ONOS_FEATURES="${ONOS_FEATURES:-webconsole,onos-api,onos-core,onos-cli,onos-rest,onos-gui,onos-openflow,onos-app-fwd,onos-app-foo}"
-
 # ONOS Patching ----------------------------------------------------------------
 
 # Patch the Apache Karaf distribution file to add ONOS features repository
@@ -66,6 +64,7 @@
     $ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg 
 
 # Patch the Apache Karaf distribution file to load ONOS features
+export ONOS_FEATURES="webconsole,onos-api,onos-core,onos-cli,onos-rest,onos-gui,onos-openflow"
 perl -pi.old -e "s|^(featuresBoot=.*)|\1,$ONOS_FEATURES|" \
     $ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg
 
diff --git a/tools/build/onos-package-test b/tools/build/onos-package-test
new file mode 100755
index 0000000..38a4877
--- /dev/null
+++ b/tools/build/onos-package-test
@@ -0,0 +1,29 @@
+#!/bin/bash
+# -----------------------------------------------------------------------------
+# Packages ONOS test facilities into onos-test.tar.gz
+# -----------------------------------------------------------------------------
+
+[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
+. $ONOS_ROOT/tools/build/envDefaults
+
+# Bail on any errors
+set -e
+
+rm -fr $ONOS_TEST_STAGE # Remove this when package script is completed
+
+# Create the stage directory and warp into it
+mkdir -p $ONOS_TEST_STAGE/tools/test \
+    $ONOS_TEST_STAGE/tools/dev \
+    $ONOS_TEST_STAGE/tools/build \
+    $ONOS_TEST_STAGE/tools/package/config
+
+cp -r $ONOS_ROOT/tools/test $ONOS_TEST_STAGE/tools
+cp $ONOS_ROOT/tools/dev/bash_profile $ONOS_TEST_STAGE/tools/dev
+cp $ONOS_ROOT/tools/build/envDefaults $ONOS_TEST_STAGE/tools/build
+
+cd $ONOS_TEST_STAGE_ROOT
+
+# Now package up the ONOS test tools tar file
+COPYFILE_DISABLE=1 tar zcf $ONOS_TEST_TAR $ONOS_TEST_BITS
+cd $ONOS_TEST_STAGE_ROOT
+# rm -r $ONOS_TEST_STAGE