2 # Helper script to run WCBench tests in a loop, used for testing
3 # Script assumes it lives in the same dir as wcbench.sh
9 # Output verbose debug info (true) or not (anything else)
12 ###############################################################################
13 # Prints usage message
20 ###############################################################################
26 Run WCBench against OpenDaylight in a loop.
29 -h Show this help message
30 -v Output verbose debug info
31 -l Loop WCBench runs without restarting ODL
32 -r Loop WCBench runs, restart ODL between runs
33 -t <time> Run WCBench for a given number of minutes
34 -p <processors> Pin ODL to given number of processors
38 ###############################################################################
39 # Starts ODL, optionally pinning it to a given number of processors
47 ###############################################################################
50 if "$VERBOSE" = true; then
51 if [ -z $processors ]; then
52 # Start ODL, don't pass processor info
53 echo "Starting ODL, not passing processor info"
56 # Start ODL, pinning it to given number of processors
57 echo "Pinning ODL to $processors processor(s)"
58 ./wcbench.sh -vp $processors -o
61 if [ -z $processors ]; then
62 # Start ODL, don't pass processor info
63 echo "Starting ODL, not passing processor info"
66 # Start ODL, pinning it to given number of processors
67 echo "Pinning ODL to $processors processor(s)"
68 ./wcbench.sh -p $processors -o
73 ###############################################################################
74 # Run WCBench against ODL, optionally passing a WCBench run time
82 ###############################################################################
85 if "$VERBOSE" = true; then
86 if [ -z $run_time ]; then
87 # Flag means run WCBench
88 echo "Running WCBench, not passing run time info"
91 # Flags mean use $run_time WCBench runs, run WCBench
92 echo "Running WCBench with $run_time minute(s) run time"
93 ./wcbench.sh -vt $run_time -r
96 if [ -z $run_time ]; then
97 # Flag means run WCBench
98 echo "Running WCBench, not passing run time info"
101 # Flags mean use $run_time WCBench runs, run WCBench
102 echo "Running WCBench with $run_time minute(s) run time"
103 ./wcbench.sh -t $run_time -r
108 ###############################################################################
109 # Repeatedly run WCBench against ODL without restarting ODL
115 # Exit status of run_wcbench
116 ###############################################################################
119 echo "Looping WCBench against ODL without restarting ODL"
126 ###############################################################################
127 # Repeatedly run WCBench against ODL, restart ODL between runs
133 # WCBench exit status
134 ###############################################################################
137 echo "Looping WCBench against ODL, restarting ODL each run"
142 if "$VERBOSE" = true; then
150 # If executed with no options
151 if [ $# -eq 0 ]; then
156 # Used to output help if no valid action results from arguments
159 # Parse options given from command line
160 while getopts ":hvlp:rt:" opt; do
168 # Output debug info verbosely
172 # Loop without restarting ODL between WCBench runs
177 # Pin a given number of processors
178 # Note that this option must be given before -o (start ODL)
180 if [ $processors -lt 1 ]; then
181 echo "Can't pin ODL to less than one processor"
186 # Restart ODL between each WCBench run
191 # Set length of WCBench run in minutes
195 # Print usage message
201 # Output help message if no valid action was taken
202 if ! "$action_taken" = true; then