Step 1: Move vm scripts to the right place
[integration/test.git] / test / tools / odl-mdsal-clustering-tests / clustering-performance-test / ovs-scripts / get-total-reported.sh
1 #!/bin/bash
2
3 # author__ = "Jan Medved"
4 # copyright__ = "Copyright(c) 2014, Cisco Systems, Inc."
5 # license__ = "New-style BSD"
6 # email__ = "jmedved@cisco.com"
7
8 ECHO=`which echo`
9 TOTAL=0
10 dname=`dirname $0`
11 i=1
12
13 while true;
14 do
15     CURSTRING=`${dname}/OVS-dump-tables.sh.13 s$i 2> /dev/null | grep -v "active=0" | grep "active"`
16
17     if [ "$CURSTRING" = "" ];
18     then
19         break
20     else
21         CUR=`echo $CURSTRING | awk -F'[:=,]' '{print $3}'`
22         TOTAL=$(($TOTAL + $CUR))
23         printf "Switch s%d:\n" $i
24         echo "  Table " $CURSTRING
25         i=$(($i + 1))
26     fi
27 done
28
29 printf "\nTotal: %d\n\n" $TOTAL
30