Thomas Vachuska
Committed by Gerrit Code Review

Changing onos-secure-ssh test tool and scenario to allow parallel execution of t…

…he onos-secure-ssh tool.

Change-Id: I83b6649f721da4e25c741c0d1fbd90a6ba015135
...@@ -6,7 +6,18 @@ ...@@ -6,7 +6,18 @@
6 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 6 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7 . $ONOS_ROOT/tools/build/envDefaults 7 . $ONOS_ROOT/tools/build/envDefaults
8 8
9 -nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2) 9 +# Scan arguments for user/password or other options...
10 +while getopts u:p: o; do
11 + case "$o" in
12 + u) user=$OPTARG;;
13 + p) password=$OPTARG;;
14 + esac
15 +done
16 +password=${password:-$user} # password defaults to the user if not specified
17 +let OPC=$OPTIND-1
18 +shift $OPC
19 +
20 +nodes=${1:-$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)}
10 21
11 for node in $nodes; do 22 for node in $nodes; do
12 # Prune the node entry from the known hosts file since server key changes 23 # Prune the node entry from the known hosts file since server key changes
...@@ -17,7 +28,7 @@ for node in $nodes; do ...@@ -17,7 +28,7 @@ for node in $nodes; do
17 ssh $ONOS_USER@$node " 28 ssh $ONOS_USER@$node "
18 [ ! -f ~/.ssh/id_rsa.pub ] && ssh-keygen -t rsa -f ~/.ssh/id_rsa -P '' -q 29 [ ! -f ~/.ssh/id_rsa.pub ] && ssh-keygen -t rsa -f ~/.ssh/id_rsa -P '' -q
19 $ONOS_INSTALL_DIR/bin/onos-user-key \$(id -un) \$(cut -d\\ -f2 ~/.ssh/id_rsa.pub) 30 $ONOS_INSTALL_DIR/bin/onos-user-key \$(id -un) \$(cut -d\\ -f2 ~/.ssh/id_rsa.pub)
20 - $ONOS_INSTALL_DIR/bin/onos-secure-ssh "$@" 31 + $ONOS_INSTALL_DIR/bin/onos-secure-ssh -u $user -p $password
21 32
22 # Implicitly accept the new server key in dev/test environments 33 # Implicitly accept the new server key in dev/test environments
23 while ! ssh -p 8101 -o StrictHostKeyChecking=no localhost list 2>/dev/null; do 34 while ! ssh -p 8101 -o StrictHostKeyChecking=no localhost list 2>/dev/null; do
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
16 <scenario name="setup" description="ONOS cluster setup"> 16 <scenario name="setup" description="ONOS cluster setup">
17 <group name="Setup"> 17 <group name="Setup">
18 <step name="Push-Bits" exec="onos-push-bits-through-proxy" if="${OCT}"/> 18 <step name="Push-Bits" exec="onos-push-bits-through-proxy" if="${OCT}"/>
19 - <step name="Secure-SSH" exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS}" if="${ONOS_USE_SSH}"/>
20 <step name="Enable-Flow-Objective-Intents" if="${ONOS_USE_FOI}" 19 <step name="Enable-Flow-Objective-Intents" if="${ONOS_USE_FOI}"
21 exec="onos ${OC1} cfg set org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator useFlowObjectives true"/> 20 exec="onos ${OC1} cfg set org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator useFlowObjectives true"/>
22 21
...@@ -30,10 +29,12 @@ ...@@ -30,10 +29,12 @@
30 <step name="Install-${#}" exec="onos-install ${OC#}" 29 <step name="Install-${#}" exec="onos-install ${OC#}"
31 requires="Kill-${#},Push-Bits-${#},Push-Bits"/> 30 requires="Kill-${#},Push-Bits-${#},Push-Bits"/>
32 31
33 - <dependency name="Secure-SSH" requires="Install-${#}"/> 32 + <step name="Secure-SSH-${#}" requires="Install-${#}"
33 + exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS} ${OC#}"
34 + if="${ONOS_USE_SSH}"/>
34 35
35 <step name="Wait-for-Start-${#}" exec="onos-wait-for-start ${OC#}" 36 <step name="Wait-for-Start-${#}" exec="onos-wait-for-start ${OC#}"
36 - requires="Install-${#},~Secure-SSH"/> 37 + requires="Install-${#},~Secure-SSH-${#}"/>
37 38
38 <step name="Check-Nodes-${#}" exec="onos-check-nodes ${OC#}" delay="3" 39 <step name="Check-Nodes-${#}" exec="onos-check-nodes ${OC#}" delay="3"
39 requires="~Wait-for-Start-${#}"/> 40 requires="~Wait-for-Start-${#}"/>
......