Added the folder with scripts that show flow statistics summaries in a mininet with...
authorJan Medved <jmedved@cisco.com>
Wed, 3 Dec 2014 02:20:16 +0000 (18:20 -0800)
committerJan Medved <jmedved@cisco.com>
Wed, 3 Dec 2014 02:21:44 +0000 (18:21 -0800)
Change-Id: I671c4e236faa74cbe4a94bf230b2f4249cfcb86b
Signed-off-by: Jan Medved <jmedved@cisco.com>
test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/OVS-dump-flows.sh.13 [new symlink]
test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/OVS-dump-tables.sh.13 [new file with mode: 0755]
test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/README [new file with mode: 0644]
test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/get-total-found.sh [new file with mode: 0755]
test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/get-total-reported.sh [new file with mode: 0755]
test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/get-totals.sh [new file with mode: 0755]

diff --git a/test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/OVS-dump-flows.sh.13 b/test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/OVS-dump-flows.sh.13
new file mode 120000 (symlink)
index 0000000..a5d7cff
--- /dev/null
@@ -0,0 +1 @@
+_OVS-dump-flows.sh
\ No newline at end of file
diff --git a/test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/OVS-dump-tables.sh.13 b/test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/OVS-dump-tables.sh.13
new file mode 100755 (executable)
index 0000000..ce9c494
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# author__ = "Michal Rehak"
+# copyright__ = "Copyright(c) 2014, Cisco Systems, Inc."
+# license__ = "New-style BSD"
+# email__ = "jmedved@cisco.com"
+
+if [ -z "$1" ]; then
+    echo "usage:: $0 <switch name, e.g.: s1>"
+    exit 1
+fi
+
+key="${0##*.}"
+#echo "${key}"
+
+sudo ovs-ofctl -O OpenFlow${key} dump-tables $1
diff --git a/test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/README b/test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/README
new file mode 100644 (file)
index 0000000..24fe3e8
--- /dev/null
@@ -0,0 +1,11 @@
+Put these files into a directory on your mininet VM.
+
+To find the number of all flows reported on all OVS switches running in
+mininet, type:
+
+> ./get-total-found.sh
+
+To find the number of all flows reported in table statistics in all OVS
+switches running in mininet, type:
+
+> ./get-total-reported.sh
diff --git a/test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/get-total-found.sh b/test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/get-total-found.sh
new file mode 100755 (executable)
index 0000000..d68728a
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# author__ = "Jan Medved"
+# copyright__ = "Copyright(c) 2014, Cisco Systems, Inc."
+# license__ = "New-style BSD"
+# email__ = "jmedved@cisco.com"
+
+ECHO=`which echo`
+
+TOTAL=0
+i=1
+
+while true;
+do
+    CUR=$((`./OVS-dump-flows.sh.13 s$i 2> /dev/null |  grep -v "flags=\[more\]" | wc -l` - 1))
+
+    if [ "$CUR" == "-1" ];
+    then 
+       break
+    else
+        printf "Switch s%d: %d flows\n" $i $CUR
+        TOTAL=$(($TOTAL + $CUR))
+        i=$(($i + 1))
+    fi
+done
+
+printf "\nTotal: %d\n\n" $TOTAL
\ No newline at end of file
diff --git a/test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/get-total-reported.sh b/test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/get-total-reported.sh
new file mode 100755 (executable)
index 0000000..75ad1ae
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# author__ = "Jan Medved"
+# copyright__ = "Copyright(c) 2014, Cisco Systems, Inc."
+# license__ = "New-style BSD"
+# email__ = "jmedved@cisco.com"
+
+ECHO=`which echo`
+TOTAL=0
+
+i=1
+
+while true;
+do
+    CURSTRING=`./OVS-dump-tables.sh.13 s$i 2> /dev/null | grep -v "active=0" | grep "active"`
+
+    if [ "$CURSTRING" = "" ];
+    then 
+       break
+    else
+        CUR=`echo $CURSTRING | awk -F'[:=,]' '{print $3}'` 
+        TOTAL=$(($TOTAL + $CUR))
+        printf "Switch s%d:\n" $i
+        echo "  Table " $CURSTRING
+        i=$(($i + 1))
+    fi
+done
+
+printf "\nTotal: %d\n\n" $TOTAL
\ No newline at end of file
diff --git a/test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/get-totals.sh b/test/tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/get-totals.sh
new file mode 100755 (executable)
index 0000000..73594b6
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+ECHO=`which echo`
+
+TOTAL=0
+
+i=1
+
+while true;
+do
+    CUR=$((`./OVS-dump-flows.sh.13 s$i 2> /dev/null |wc -l` - 1))
+
+    if [ "$CUR" == "-1" ];
+    then 
+       break
+    else
+        printf "Switch s%d: %d flows\n" $i $CUR
+        TOTAL=$(($TOTAL + $CUR))
+        i=$(($i + 1))
+    fi
+done
+
+printf "\nTotal: %d\n\n" $TOTAL
\ No newline at end of file