Commit 19882ecb authored by Jian Yang's avatar Jian Yang Committed by David S. Miller

selftests: txtimestamp: allow individual txtimestamp tests.

The wrapper script txtimestamp.sh executes a pre-defined list of testcases
sequentially without configuration options available.

Add an option (-r/--run) to setup the test namespace and pass remaining
arguments to txtimestamp binary. The script still runs all tests when no
argument is passed.
Signed-off-by: default avatarJian Yang <jianyang@google.com>
Acked-by: default avatarWillem de Bruijn <willemb@google.com>
Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e2859601
...@@ -43,15 +43,40 @@ run_test_tcpudpraw() { ...@@ -43,15 +43,40 @@ run_test_tcpudpraw() {
} }
run_test_all() { run_test_all() {
setup
run_test_tcpudpraw # setsockopt run_test_tcpudpraw # setsockopt
run_test_tcpudpraw -C # cmsg run_test_tcpudpraw -C # cmsg
run_test_tcpudpraw -n # timestamp w/o data run_test_tcpudpraw -n # timestamp w/o data
echo "OK. All tests passed"
}
run_test_one() {
setup
./txtimestamp $@
}
usage() {
echo "Usage: $0 [ -r | --run ] <txtimestamp args> | [ -h | --help ]"
echo " (no args) Run all tests"
echo " -r|--run Run an individual test with arguments"
echo " -h|--help Help"
}
main() {
if [[ $# -eq 0 ]]; then
run_test_all
else
if [[ "$1" = "-r" || "$1" == "--run" ]]; then
shift
run_test_one $@
else
usage
fi
fi
} }
if [[ "$(ip netns identify)" == "root" ]]; then if [[ "$(ip netns identify)" == "root" ]]; then
../../net/in_netns.sh $0 $@ ../../net/in_netns.sh $0 $@
else else
setup main $@
run_test_all
echo "OK. All tests passed"
fi fi
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