minor improvement to be able to run the script from any location
authorPeter Gubka <pgubka@cisco.com>
Tue, 7 Jul 2015 10:21:52 +0000 (12:21 +0200)
committerPeter Gubka <pgubka@cisco.com>
Tue, 7 Jul 2015 10:42:52 +0000 (12:42 +0200)
Change-Id: Ice274084144499f4fdab4e3fdcb360e59f2204c3
Signed-off-by: Peter Gubka <pgubka@cisco.com>
test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/get-total-found.sh
test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/get-total-reported.sh

index d68728aec21cf9ff3ea979074538b3aa62f49481..c1792a794c9a5d4992702abb1dd5c23d14101035 100755 (executable)
@@ -9,14 +9,15 @@ ECHO=`which echo`
 
 TOTAL=0
 i=1
+dname=`dirname $0`
 
 while true;
 do
-    CUR=$((`./OVS-dump-flows.sh.13 s$i 2> /dev/null |  grep -v "flags=\[more\]" | wc -l` - 1))
+    CUR=$((`${dname}/OVS-dump-flows.sh.13 s$i 2> /dev/null |  grep -v "flags=\[more\]" | wc -l` - 1))
 
     if [ "$CUR" == "-1" ];
-    then 
-       break
+    then
+        break
     else
         printf "Switch s%d: %d flows\n" $i $CUR
         TOTAL=$(($TOTAL + $CUR))
@@ -24,4 +25,5 @@ do
     fi
 done
 
-printf "\nTotal: %d\n\n" $TOTAL
\ No newline at end of file
+printf "\nTotal: %d\n\n" $TOTAL
+
index 75ad1aeb88ff1fc1a447c917ff9db37c842a50f4..d88792a0cbb386fd87234d0e39c761c44b7c9da4 100755 (executable)
@@ -7,18 +7,18 @@
 
 ECHO=`which echo`
 TOTAL=0
-
+dname=`dirname $0`
 i=1
 
 while true;
 do
-    CURSTRING=`./OVS-dump-tables.sh.13 s$i 2> /dev/null | grep -v "active=0" | grep "active"`
+    CURSTRING=`${dname}/OVS-dump-tables.sh.13 s$i 2> /dev/null | grep -v "active=0" | grep "active"`
 
     if [ "$CURSTRING" = "" ];
-    then 
-       break
+    then
+        break
     else
-        CUR=`echo $CURSTRING | awk -F'[:=,]' '{print $3}'` 
+        CUR=`echo $CURSTRING | awk -F'[:=,]' '{print $3}'`
         TOTAL=$(($TOTAL + $CUR))
         printf "Switch s%d:\n" $i
         echo "  Table " $CURSTRING
@@ -26,4 +26,5 @@ do
     fi
 done
 
-printf "\nTotal: %d\n\n" $TOTAL
\ No newline at end of file
+printf "\nTotal: %d\n\n" $TOTAL
+