Eliminating use of Apache Karaf CLI client and of ONOS_USE_SSH env. variable.
All CLI access is now through the raw SSH client.
To enable passwordless access, the 'onos-user-key' tool should be used to add user keys.
Added 'onos-user-password' tool in the similar vein and usage as the 'onos-user-key' tool.
Change-Id: Ic5482fc8012369edc818691402ba45d13f130452
diff --git a/tools/test/bin/onos b/tools/test/bin/onos
index 222ab99..44ba393 100755
--- a/tools/test/bin/onos
+++ b/tools/test/bin/onos
@@ -10,7 +10,7 @@
flags:
- -w : Waits for ONOS instance to reach run-level 100, i.e. to be fully started.
-- -f : (Affects non-secure client only) - use bash's IFS expansion of positional parameters
+- -f : Deprecated - use bash's IFS expansion of positional parameters
options:
- [node] : the node to attach to
@@ -30,19 +30,8 @@
. $ONOS_ROOT/tools/test/bin/find-node.sh
[ "$1" = "-w" ] && shift && onos-wait-for-start $1
-[ "$1" = "-f" ] && shift && flat=1
+[ "$1" = "-f" ] && shift # Deprecated
[ -n "$1" ] && OCI=$(find_node $1) && shift
-if which client 1>/dev/null 2>&1 && [ -z "$ONOS_USE_SSH" ]; then
- # Use Karaf client only if we can and are allowed to
- unset KARAF_HOME
- if [ -z "$flat" ]; then
- client -h $OCI -u karaf "$@" 2>/dev/null
- else
- client -h $OCI -u karaf "$*" 2>/dev/null
- fi
-else
- # Otherwise use raw ssh; strict checking is off for dev environments only
- ssh -p 8101 -o StrictHostKeyChecking=no $OCI "$@"
-fi
+ssh -p 8101 -o StrictHostKeyChecking=no $OCI "$@"
diff --git a/tools/test/bin/onos-check-apps b/tools/test/bin/onos-check-apps
index 55e94f0..f4b21b7 100755
--- a/tools/test/bin/onos-check-apps
+++ b/tools/test/bin/onos-check-apps
@@ -10,11 +10,11 @@
trap "rm -f $aux $aux.1 $aux.2 2>/dev/null" EXIT
for attempt in {1..30}; do
- onos ${1:-$OCI} "onos:apps -s -a" | grep -v /bin/client > $aux
+ onos ${1:-$OCI} "onos:apps -s -a" > $aux
cat $aux
# Normalize the installed apps
- cut -c7- $aux | grep -v '/bin/client' | cut -d\ -f1 | sort > $aux.1
+ cut -c7- $aux | cut -d\ -f1 | sort > $aux.1
# Normalize the expected apps
apps=${2:-$ONOS_APPS}
diff --git a/tools/test/bin/onos-check-node-status b/tools/test/bin/onos-check-node-status
index ba86703..39628b8 100755
--- a/tools/test/bin/onos-check-node-status
+++ b/tools/test/bin/onos-check-node-status
@@ -7,7 +7,7 @@
trap "rm -f $aux 2>/dev/null" EXIT
for attempt in {1..10}; do
- onos ${1:-$OCI} "onos:nodes" | grep -v /bin/client > $aux
+ onos ${1:-$OCI} "onos:nodes" > $aux
cat $aux
# Normalize the node status
diff --git a/tools/test/bin/onos-check-nodes b/tools/test/bin/onos-check-nodes
index 69187b6..5433f38 100755
--- a/tools/test/bin/onos-check-nodes
+++ b/tools/test/bin/onos-check-nodes
@@ -6,7 +6,7 @@
aux=/tmp/stc-$$.log
trap "rm -f $aux $aux.1 $aux.2 2>/dev/null" EXIT
-onos ${1:-$OCI} "onos:nodes" | grep -v /bin/client > $aux
+onos ${1:-$OCI} "onos:nodes" > $aux
cat $aux
# Normalize the nodes
diff --git a/tools/test/bin/onos-secure-ssh b/tools/test/bin/onos-secure-ssh
index d869c67..24a5a48 100755
--- a/tools/test/bin/onos-secure-ssh
+++ b/tools/test/bin/onos-secure-ssh
@@ -28,7 +28,7 @@
ssh $ONOS_USER@$node "
[ ! -f ~/.ssh/id_rsa.pub ] && ssh-keygen -t rsa -f ~/.ssh/id_rsa -P '' -q
$ONOS_INSTALL_DIR/bin/onos-user-key \$(id -un) \$(cut -d\\ -f2 ~/.ssh/id_rsa.pub)
- $ONOS_INSTALL_DIR/bin/onos-secure-ssh -u $user -p $password
+ $ONOS_INSTALL_DIR/bin/onos-user-password $user $password
# Implicitly accept the new server key in dev/test environments
while ! ssh -p 8101 -o StrictHostKeyChecking=no localhost list 2>/dev/null; do
diff --git a/tools/test/bin/onos-user-key b/tools/test/bin/onos-user-key
index b324c1a..df4379f 100755
--- a/tools/test/bin/onos-user-key
+++ b/tools/test/bin/onos-user-key
@@ -1,6 +1,6 @@
#!/bin/bash
# -----------------------------------------------------------------------------
-# Adds or removes a user key for managing passwordless loging to ONOS console.
+# Adds or removes a user key for managing passwordless login to ONOS console.
# -----------------------------------------------------------------------------
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
diff --git a/tools/test/cells/demo b/tools/test/cells/demo
index bb765bb..6211ed9 100644
--- a/tools/test/cells/demo
+++ b/tools/test/cells/demo
@@ -6,7 +6,6 @@
export OC3="10.0.3.103"
export OCN="10.0.3.1"
-unset ONOS_USE_SSH
export ONOS_APPS=drivers,openflow,proxyarp
alias sshnet="ssh onos@$OCN"
diff --git a/tools/test/cells/demo-eu b/tools/test/cells/demo-eu
index 6fb46ce..414fddd 100644
--- a/tools/test/cells/demo-eu
+++ b/tools/test/cells/demo-eu
@@ -11,7 +11,6 @@
export ONOS_SCENARIOS=$ONOS/tools/test/scenarios
export ONOS_TOPO=geant
export ONOS_USER=sdn
-export ONOS_USE_SSH=true
export ONOS_WEB_PASS=rocks
export ONOS_WEB_USER=onos
alias demo-reset='stc net-teardown; stc teardown; topo geant; stc setup && stc net-setup'
diff --git a/tools/test/cells/office b/tools/test/cells/office
index 906694d..09405f3 100644
--- a/tools/test/cells/office
+++ b/tools/test/cells/office
@@ -3,5 +3,4 @@
export ONOS_NIC="10.1.10.*"
export OC1="10.1.10.223"
-unset ONOS_USE_SSH
export ONOS_APPS="drivers,openflow,fwd,proxyarp,mobility"
diff --git a/tools/test/cells/simon-uk b/tools/test/cells/simon-uk
index 6b0fa9a..703be03 100644
--- a/tools/test/cells/simon-uk
+++ b/tools/test/cells/simon-uk
@@ -22,7 +22,6 @@
# onos4 RUNNING 10.0.3.14 - YES
#============================================
-export ONOS_USE_SSH=true
export ONOS_NIC="10.0.3.*"
## ONOS instances (LXC containers)
diff --git a/tools/test/cells/simon-uk4 b/tools/test/cells/simon-uk4
index b86d853..58ea829 100644
--- a/tools/test/cells/simon-uk4
+++ b/tools/test/cells/simon-uk4
@@ -22,7 +22,6 @@
# onos4 RUNNING 10.0.3.14 - YES
#============================================
-export ONOS_USE_SSH=true
export ONOS_NIC="10.0.3.*"
## ONOS instances (LXC containers)
diff --git a/tools/test/cells/tutorial b/tools/test/cells/tutorial
index 28186f4..4e06eed 100644
--- a/tools/test/cells/tutorial
+++ b/tools/test/cells/tutorial
@@ -6,5 +6,4 @@
export OC3="10.0.3.103"
export OCN="10.0.3.1"
-unset ONOS_USE_SSH
export ONOS_APPS=drivers,openflow,proxyarp
diff --git a/tools/test/cells/virtual b/tools/test/cells/virtual
index 0cac447..aa6589e 100644
--- a/tools/test/cells/virtual
+++ b/tools/test/cells/virtual
@@ -6,7 +6,6 @@
export OC3="192.168.56.103"
export OCN="192.168.56.100"
-export ONOS_USE_SSH=true
export ONOS_APPS="drivers,openflow,fwd,proxyarp,mobility"
export ONOS_USER=sdn
diff --git a/tools/test/scenarios/prerequisites.xml b/tools/test/scenarios/prerequisites.xml
index ad6545d..e9dcc29 100644
--- a/tools/test/scenarios/prerequisites.xml
+++ b/tools/test/scenarios/prerequisites.xml
@@ -17,8 +17,6 @@
<group name="Prerequisites">
<step name="Check-Environment"
exec="test -n ${ONOS_ROOT} -a -n ${ONOS_NIC} -a -n ${OC1}"/>
- <step name="Check-Secure-SSH"
- exec="test '${ONOS_USE_SSH}' == 'true' -o '${ONOS_USE_SSH}' == ''"/>
<step name="Check-ONOS-Bits" exec="onos-check-bits"/>
<parallel var="${OC#}">
<step name="Check-Passwordless-Login-${#}"
diff --git a/tools/test/scenarios/setup.xml b/tools/test/scenarios/setup.xml
index dd3db19..845380e 100644
--- a/tools/test/scenarios/setup.xml
+++ b/tools/test/scenarios/setup.xml
@@ -30,8 +30,7 @@
requires="Kill-${#},Push-Bits-${#},Push-Bits"/>
<step name="Secure-SSH-${#}" requires="Install-${#}"
- exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS} ${OC#}"
- if="${ONOS_USE_SSH}"/>
+ exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS} ${OC#}"/>
<step name="Wait-for-Start-${#}" exec="onos-wait-for-start ${OC#}"
requires="Install-${#},~Secure-SSH-${#}"/>
diff --git a/tools/test/scenarios/tar-setup.xml b/tools/test/scenarios/tar-setup.xml
index a0b5f47..c6e8201 100644
--- a/tools/test/scenarios/tar-setup.xml
+++ b/tools/test/scenarios/tar-setup.xml
@@ -16,7 +16,7 @@
<scenario name="tar-setup" description="ONOS cluster setup via onos.tar.gz">
<group name="Setup-Instances">
<step name="Push-Bits" exec="onos-push-bits-through-proxy" if="${OCT}"/>
- <step name="Secure-SSH" exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS}" if="${ONOS_USE_SSH}"/>
+ <step name="Secure-SSH" exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS}"/>
<parallel var="${OC#}">
<step name="Push-Bits-${#}" exec="onos-push-bits ${OC#}" unless="${OCT}"/>