ONOS-487: Allow ONOS to be installed using different user/group
Change-Id: Ica926a2a6e0870e3aeab1e1585073196358c8184
diff --git a/tools/build/envDefaults b/tools/build/envDefaults
index 81405d8..a7eb8bf 100644
--- a/tools/build/envDefaults
+++ b/tools/build/envDefaults
@@ -33,4 +33,5 @@
export ONOS_INSTALL_DIR="/opt/onos" # Installation directory on remote
export OCI="${OCI:-192.168.56.101}" # ONOS Controller Instance
export ONOS_USER="${ONOS_USER:-sdn}" # ONOS user on remote system
+export ONOS_GROUP="${ONOS_GROUP:-sdn}" # ONOS group on remote system
export ONOS_PWD="rocks" # ONOS user password on remote system
diff --git a/tools/dev/bash_profile b/tools/dev/bash_profile
index 6aff05b..0906beb 100644
--- a/tools/dev/bash_profile
+++ b/tools/dev/bash_profile
@@ -77,7 +77,7 @@
if [ -n "$1" ]; then
[ ! -f $ONOS_ROOT/tools/test/cells/$1 ] && \
echo "No such cell: $1" >&2 && return 1
- unset ONOS_CELL ONOS_NIC ONOS_FEATURES
+ unset ONOS_CELL ONOS_NIC ONOS_FEATURES ONOS_USER ONOS_GROUP
unset OC0 OC1 OC2 OC3 OC4 OC5 OC6 OC7 OC8 OC9 OCN OCI
export ONOS_CELL=$1
. $ONOS_ROOT/tools/test/cells/$1
diff --git a/tools/test/bin/onos-install b/tools/test/bin/onos-install
index 4bc41a4..4cb78eb 100755
--- a/tools/test/bin/onos-install
+++ b/tools/test/bin/onos-install
@@ -27,7 +27,7 @@
[ -d $ONOS_INSTALL_DIR/bin ] && echo \"ONOS is already installed\" && exit 1
# Prepare a landing zone and unroll the bits
- sudo mkdir -p $ONOS_INSTALL_DIR && sudo chown ${ONOS_USER}:${ONOS_USER} $ONOS_INSTALL_DIR
+ sudo mkdir -p $ONOS_INSTALL_DIR && sudo chown ${ONOS_USER}:${ONOS_GROUP} $ONOS_INSTALL_DIR
tar zxmf /tmp/$ONOS_BITS.tar.gz -C $ONOS_INSTALL_DIR --strip-components=1
# Make a link to the log file directory and make a home for auxiliaries