ONOS-470: Allow ONOS service to be run with customized username
Change-Id: I643b61842577f68c33bee6383638647615528da4
diff --git a/tools/test/bin/onos-install b/tools/test/bin/onos-install
index 27a478a..4bc41a4 100755
--- a/tools/test/bin/onos-install
+++ b/tools/test/bin/onos-install
@@ -43,6 +43,9 @@
[ -z "$nostart" ] && sudo cp $ONOS_INSTALL_DIR/debian/onos.conf /etc/init/onos.conf
echo 'export ONOS_OPTS=debug' > $ONOS_INSTALL_DIR/options
+ # Setup correct user to run onos-service
+ echo 'export ONOS_USER="${ONOS_USER:-sdn}"' >> $ONOS_INSTALL_DIR/options
+
# Remove any previous ON.Lab bits from ~/.m2 repo and re-stage it.
rm -fr ~/.m2/repository/org/onosproject
cp -r $ONOS_INSTALL_DIR/$KARAF_DIST/system/org/onosproject ~/.m2/repository/org/onosproject