test_cleanup_vxlanX_exception 4
 }
 
+run_test() {
+       (
+       tname="$1"
+       tdesc="$2"
+
+       unset IFS
+
+       if [ "$VERBOSE" = "1" ]; then
+               printf "\n##########################################################################\n\n"
+       fi
+
+       eval test_${tname}
+       ret=$?
+
+       if [ $ret -eq 0 ]; then
+               printf "TEST: %-60s  [ OK ]\n" "${tdesc}"
+       elif [ $ret -eq 1 ]; then
+               printf "TEST: %-60s  [FAIL]\n" "${tdesc}"
+               if [ "${PAUSE_ON_FAIL}" = "yes" ]; then
+                       echo
+                       echo "Pausing. Hit enter to continue"
+                       read a
+               fi
+               err_flush
+               exit 1
+       elif [ $ret -eq 2 ]; then
+               printf "TEST: %-60s  [SKIP]\n" "${tdesc}"
+               err_flush
+       fi
+
+       return $ret
+       )
+       [ $? -ne 0 ] && exitcode=1
+}
+
 usage() {
        echo
        echo "$0 [OPTIONS] [TEST]..."
        done
        [ $run_this -eq 0 ] && continue
 
-       (
-               unset IFS
-
-               if [ "$VERBOSE" = "1" ]; then
-                       printf "\n##########################################################################\n\n"
-               fi
-
-               eval test_${name}
-               ret=$?
-
-               if [ $ret -eq 0 ]; then
-                       printf "TEST: %-60s  [ OK ]\n" "${t}"
-               elif [ $ret -eq 1 ]; then
-                       printf "TEST: %-60s  [FAIL]\n" "${t}"
-                       if [ "${PAUSE_ON_FAIL}" = "yes" ]; then
-                               echo
-                               echo "Pausing. Hit enter to continue"
-                               read a
-                       fi
-                       err_flush
-                       exit 1
-               elif [ $ret -eq 2 ]; then
-                       printf "TEST: %-60s  [SKIP]\n" "${t}"
-                       err_flush
-               fi
-       )
-       [ $? -ne 0 ] && exitcode=1
+       run_test "${name}" "${t}"
 done
 
 exit ${exitcode}