mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 06:15:24 +00:00
test/zdtm: use TEST_PATTERN as argument
Use TEST_PATTERN instead of TEST_NAME as argument. All previous zdtm commands can be used still. It is useful to run certain part of tests. Example of running in-namespace tests only: ./test/zdtm.sh ^ns/.* Signed-off-by: Yicheng Qin <yichengq@google.com> Acked-by: Andrew Vagin <avagin@parallels.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
8891bb759d
commit
073af12d5f
51
test/zdtm.sh
51
test/zdtm.sh
@@ -621,32 +621,14 @@ if [ $COMPILE_ONLY -eq 0 ]; then
|
|||||||
check_criu || exit 1
|
check_criu || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ "$1" = "-l" ]; then
|
||||||
|
|
||||||
if [ $COMPILE_ONLY -eq 0 ]; then
|
|
||||||
check_mainstream || exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
for t in $TEST_LIST; do
|
|
||||||
run_test $t || case_error $t
|
|
||||||
done
|
|
||||||
for t in $UTS_TEST_LIST; do
|
|
||||||
run_test $t -n uts || case_error $t
|
|
||||||
done
|
|
||||||
for t in $MNT_TEST_LIST; do
|
|
||||||
run_test $t -n mnt || case_error $t
|
|
||||||
done
|
|
||||||
for t in $IPC_TEST_LIST; do
|
|
||||||
run_test $t -n ipc || case_error $t
|
|
||||||
done
|
|
||||||
elif [ "$1" = "-l" ]; then
|
|
||||||
echo $TEST_LIST $UTS_TEST_LIST $MNT_TEST_LIST $IPC_TEST_LIST | tr ' ' '\n'
|
echo $TEST_LIST $UTS_TEST_LIST $MNT_TEST_LIST $IPC_TEST_LIST | tr ' ' '\n'
|
||||||
elif [ "$1" = "-h" ]; then
|
elif [ "$1" = "-h" ]; then
|
||||||
cat >&2 <<EOF
|
cat >&2 <<EOF
|
||||||
This script is used for executing unit tests.
|
This script is used for executing unit tests.
|
||||||
Usage:
|
Usage:
|
||||||
zdtm.sh [OPTIONS]
|
zdtm.sh [OPTIONS]
|
||||||
zdtm.sh [OPTIONS] [TEST NAME]
|
zdtm.sh [OPTIONS] [TEST PATTERN]
|
||||||
Options:
|
Options:
|
||||||
-l : Show list of tests.
|
-l : Show list of tests.
|
||||||
-d : Dump a test process and check that this process can continue working.
|
-d : Dump a test process and check that this process can continue working.
|
||||||
@@ -662,15 +644,28 @@ EOF
|
|||||||
elif [ "${1:0:1}" = '-' ]; then
|
elif [ "${1:0:1}" = '-' ]; then
|
||||||
echo "unrecognized option $1"
|
echo "unrecognized option $1"
|
||||||
else
|
else
|
||||||
if echo $UTS_TEST_LIST | fgrep -qw $1; then
|
if [ $COMPILE_ONLY -eq 0 ]; then
|
||||||
run_test $1 -n uts || case_error $1
|
check_mainstream || exit 1
|
||||||
elif echo $MNT_TEST_LIST | fgrep -qw $1; then
|
|
||||||
run_test $1 -n mnt || case_error $1
|
|
||||||
elif echo $IPC_TEST_LIST | fgrep -qw $1; then
|
|
||||||
run_test $1 -n ipc || case_error $1
|
|
||||||
else
|
|
||||||
run_test $1 || case_error $1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
pattern='.*'
|
||||||
|
else
|
||||||
|
pattern=$1
|
||||||
|
fi
|
||||||
|
|
||||||
|
for t in $(echo "$TEST_LIST" | grep -x "$pattern"); do
|
||||||
|
run_test $t || case_error $t
|
||||||
|
done
|
||||||
|
for t in $(echo "$UTS_TEST_LIST" | grep -x "$pattern"); do
|
||||||
|
run_test $t -n uts || case_error $t
|
||||||
|
done
|
||||||
|
for t in $(echo "$MNT_TEST_LIST" | grep -x "$pattern"); do
|
||||||
|
run_test $t -n mnt || case_error $t
|
||||||
|
done
|
||||||
|
for t in $(echo "$IPC_TEST_LIST" | grep -x "$pattern"); do
|
||||||
|
run_test $t -n ipc || case_error $t
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -n "$TMP_TREE" ] && rm -rf $TMP_TREE || exit 0
|
[ -n "$TMP_TREE" ] && rm -rf $TMP_TREE || exit 0
|
||||||
|
Reference in New Issue
Block a user