9 echo "Run all ONE tests"
11 echo This must be run with superuser privileges.
13 echo " ./run.sh [vhc] [--config-method vat|cli]"
15 echo " -v : verbose output"
17 echo " -h : show help"
18 echo " --config-method : select configuration method. Default is VAT."
26 while [ $# -gt 0 ] ; do
30 if [ $arg == "-v" ]; then
32 elif [ $arg == "-h" ] ; then
35 elif [ $arg == "-c" ] ; then
38 elif [ $arg == "--config-method" ] ; then
41 if [ $type != "vat" -a $type != "cli" ] ; then
42 echo "ERROR: expected one of 'cli' or 'vat' "
46 export CFG_METHOD=$type
64 if [[ $(id -u) != 0 ]]; then
65 echo "Superuser privileges needed!"
69 # check whether ODL is running
74 test_num=`ls -l "$TESTS_DIR"/test_* | wc -l`
75 disabled_num=`ls -l "$TESTS_DIR"/disabled_test_* | wc -l`
76 manual_num=`ls -l "$TESTS_DIR"/manual_test_* | wc -l`
79 echo "Running VPP lite test suite."
81 echo "Config method: $CFG_METHOD"
84 for test_case in "$TESTS_DIR"/test_*
86 let "count=$count + 1"
89 base_name=`basename -a "$test_case"`
90 printf "*** %2d/%d : %-48s" $count $test_num "$base_name"
91 logger "*** test start $base_name"
93 if [ $verbose -ne 0 ] ; then
96 "$test_case" &> /dev/null
100 if [ $rc -ne 0 ] ; then
102 failed_tcs+=("$test_case")
103 let "failed_num=$failed_num + 1"
106 let "passed_num=$passed_num + 1"
108 logger "*** test end $base_name: result: $rc"
113 runtime=$((end_time-start_time))
116 echo "------------------------------------------------------"
117 echo "Runtime: " `date -u -d @${runtime} +"%M min %S sec"`
120 if [ $failed_num -eq 0 ]; then
121 echo "All tests have passed."
123 echo "List of failed test cases:"
124 for tc in "${failed_tcs[@]}"
131 if [ $disabled_num -ne 0 ] ; then
132 echo "Skipped tests: " $disabled_num
135 if [ $manual_num -ne 0 ] ; then
136 echo "Manual tests: " $manual_num
140 echo "------------------------------------------------------"