Commit 79f09e57 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Pavel Emelyanov

test/zdtm.sh: use case to parse cmdline opts

Looks cleaner this way.
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent e1e9b500
...@@ -603,81 +603,73 @@ checkout() ...@@ -603,81 +603,73 @@ checkout()
cd `dirname $0` || exit 1 cd `dirname $0` || exit 1
while :; do while :; do
if [ "$1" = "-d" ]; then case $1 in
-d)
DUMP_ONLY=1 DUMP_ONLY=1
shift shift
continue ;;
fi -i)
if [ "$1" = "-i" ]; then
shift shift
ITERATIONS=$1 ITERATIONS=$1
shift shift
continue ;;
fi -b)
if [ "$1" = "-b" ]; then
shift shift
checkout $1 || exit 1 checkout $1 || exit 1
CRIU_CPT=$TMP_TREE/criu CRIU_CPT=$TMP_TREE/criu
shift shift
continue ;;
fi -c)
if [ "$1" = "-c" ]; then
shift shift
checkout $1 || exit 1 checkout $1 || exit 1
shift shift
$TMP_TREE/test/zdtm.sh "$@" $TMP_TREE/test/zdtm.sh "$@"
exit exit
fi ;;
if [ "$1" = "-p" ]; then -p)
shift shift
PAGE_SERVER=1 PAGE_SERVER=1
continue ;;
fi -C)
if [ "$1" = "-C" ]; then
shift shift
CLEANUP=1 CLEANUP=1
continue ;;
fi -x)
if [ "$1" = "-x" ]; then
shift shift
EXCLUDE_PATTERN=$1 EXCLUDE_PATTERN=$1
shift shift
continue ;;
fi -t)
if [ "$1" = "-t" ]; then
shift shift
TMPFS_DUMP=dump TMPFS_DUMP=dump
[ -d dump ] || mkdir -p $TMPFS_DUMP [ -d dump ] || mkdir -p $TMPFS_DUMP
mount -t tmpfs none $TMPFS_DUMP || exit 1 mount -t tmpfs none $TMPFS_DUMP || exit 1
continue ;;
fi -a)
if [ "$1" = "-a" ]; then
shift shift
DUMP_ARCHIVE=$1 DUMP_ARCHIVE=$1
shift shift
continue ;;
fi -s)
if [ "$1" = "-s" ]; then
SNAPSHOT=1 SNAPSHOT=1
shift shift
continue ;;
fi -g)
if [ "$1" = "-g" ]; then
COMPILE_ONLY=1 COMPILE_ONLY=1
shift shift
continue ;;
fi -n)
if [ "$1" = "-n" ]; then
BATCH_TEST=1 BATCH_TEST=1
shift shift
continue ;;
fi -r)
if [ "$1" = "-r" ]; then
SPECIFIED_NAME_USED=1 SPECIFIED_NAME_USED=1
shift shift
continue ;;
fi *)
break break
;;
esac
done done
if [ $COMPILE_ONLY -eq 0 ]; then if [ $COMPILE_ONLY -eq 0 ]; then
......
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