Commit fc07b9ae authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

zdtm.sh: save archive with dump files

An archive is saved in unsuccessful case.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 97ee174a
...@@ -195,10 +195,13 @@ EOF ...@@ -195,10 +195,13 @@ EOF
exit_callback() exit_callback()
{ {
echo $@
[ -n "$ZDTM_ROOT" ] && { [ -n "$ZDTM_ROOT" ] && {
umount -l "$ZDTM_ROOT" umount -l "$ZDTM_ROOT"
rmdir "$ZDTM_ROOT" rmdir "$ZDTM_ROOT"
} }
[[ -n "$ZDTM_FAILED" && -n "$DUMP_ARCHIVE" ]] && tar -czf $DUMP_ARCHIVE dump
[ -n "$TMPFS_DUMP" ] && [ -n "$TMPFS_DUMP" ] &&
umount -l "$TMPFS_DUMP" umount -l "$TMPFS_DUMP"
} }
...@@ -427,6 +430,8 @@ case_error() ...@@ -427,6 +430,8 @@ case_error()
test=${ZP}/${1#ns/} test=${ZP}/${1#ns/}
local test_log=`pwd`/$test.out local test_log=`pwd`/$test.out
ZDTM_FAILED=1
echo "Test: $test" echo "Test: $test"
echo "====================== ERROR ======================" echo "====================== ERROR ======================"
...@@ -507,6 +512,12 @@ while :; do ...@@ -507,6 +512,12 @@ while :; do
mount -t tmpfs none $TMPFS_DUMP || exit 1 mount -t tmpfs none $TMPFS_DUMP || exit 1
continue; continue;
fi fi
if [ "$1" = "-a" ]; then
shift
DUMP_ARCHIVE=$1
shift
continue;
fi
break; break;
done done
...@@ -543,6 +554,7 @@ Options: ...@@ -543,6 +554,7 @@ Options:
-b <commit> : Check backward compatibility -b <commit> : Check backward compatibility
-x <PATTERN>: Exclude pattern -x <PATTERN>: Exclude pattern
-t : mount tmpfs for dump files -t : mount tmpfs for dump files
-a <FILE>.tar.gz : save archive with dump files and logs
EOF EOF
elif [ "${1:0:1}" = '-' ]; then elif [ "${1:0:1}" = '-' ]; then
echo "unrecognized option $1" echo "unrecognized option $1"
......
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