Fix a few bugs in scripts
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 20 Sep 2011 19:58:47 +0000 (21:58 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 20 Sep 2011 19:58:47 +0000 (21:58 +0200)
gw-tests/lib.sh
gw-tests/nop-canalyzer.sh

index 46fc5c1..4bc522b 100644 (file)
@@ -33,7 +33,11 @@ PATH=$PWD/../_compiled/bin/:$PATH
 sshgw() {
     local socket="$HOME/.ssh/cangw-connection"
 
-    if [[ "$NO_GW_NEEDED" ]]; then return; fi
+    if [[ "$1" = "-f" ]]; then
+           shift
+    else
+       if [[ "$NO_GW_NEEDED" ]]; then return; fi
+    fi
 
     if [[ ! -S $socket ]] || ! ssh -x -a -S $socket root@192.168.2.3 true; then
        # Create master connection to speed up subsequenct command.
@@ -163,7 +167,7 @@ _run() {
     else loads=${load:-$OPT_LOAD}
     fi
     hostkvers=${hostkvers:-host-$(uname -r)}
-    kvers=${kvers:-$(sshgw uname -r)}
+    kvers=${kvers:-$(sshgw -f uname -r)}
     test=$(basename $0 .sh)
     for load in $loads; do
     for traffic in $traffics; do
index 8f1cab7..18b1fd3 100755 (executable)
@@ -9,7 +9,7 @@ wait_for_key() {
 }
 
 main() {
-    if ! [ "$INTERACTIVE" ]; then echo "Skipping interactive test $0"; exit 0; fi
+    if ! [ "$INTERACTIVE" ]; then echo "Skipping interactive test $0"; return; fi
 
     sshgw cangw -A -s can0 -d can1
     latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -n len2