Commit 7df15e6c authored by David Ahern's avatar David Ahern Committed by David S. Miller

selftests: fib_tests: Add option to pause after each test

Add option to pause after each test before cleanup is done. Allows
user to do manual inspection or more ad-hoc testing after each test
with the setup in tact.
Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1c7447b4
...@@ -9,6 +9,7 @@ ret=0 ...@@ -9,6 +9,7 @@ ret=0
TESTS="unregister down carrier nexthop" TESTS="unregister down carrier nexthop"
VERBOSE=0 VERBOSE=0
PAUSE_ON_FAIL=no PAUSE_ON_FAIL=no
PAUSE=no
IP="ip -netns testns" IP="ip -netns testns"
log_test() log_test()
...@@ -31,6 +32,13 @@ log_test() ...@@ -31,6 +32,13 @@ log_test()
[ "$a" = "q" ] && exit 1 [ "$a" = "q" ] && exit 1
fi fi
fi fi
if [ "${PAUSE}" = "yes" ]; then
echo
echo "hit enter to continue, 'q' to quit"
read a
[ "$a" = "q" ] && exit 1
fi
} }
setup() setup()
...@@ -576,6 +584,7 @@ usage: ${0##*/} OPTS ...@@ -576,6 +584,7 @@ usage: ${0##*/} OPTS
-t <test> Test(s) to run (default: all) -t <test> Test(s) to run (default: all)
(options: $TESTS) (options: $TESTS)
-p Pause on fail -p Pause on fail
-P Pause after each test before cleanup
-v verbose mode (show commands and output) -v verbose mode (show commands and output)
EOF EOF
} }
...@@ -588,6 +597,7 @@ do ...@@ -588,6 +597,7 @@ do
case $o in case $o in
t) TESTS=$OPTARG;; t) TESTS=$OPTARG;;
p) PAUSE_ON_FAIL=yes;; p) PAUSE_ON_FAIL=yes;;
P) PAUSE=yes;;
v) VERBOSE=$(($VERBOSE + 1));; v) VERBOSE=$(($VERBOSE + 1));;
h) usage; exit 0;; h) usage; exit 0;;
*) usage; exit 1;; *) usage; exit 1;;
...@@ -596,6 +606,9 @@ done ...@@ -596,6 +606,9 @@ done
PEER_CMD="ip netns exec ${PEER_NS}" PEER_CMD="ip netns exec ${PEER_NS}"
# make sure we don't pause twice
[ "${PAUSE}" = "yes" ] && PAUSE_ON_FAIL=no
if [ "$(id -u)" -ne 0 ];then if [ "$(id -u)" -ne 0 ];then
echo "SKIP: Need root privileges" echo "SKIP: Need root privileges"
exit 0 exit 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment