Commit 6a66b87e authored by Andrey Vagin's avatar Andrey Vagin Committed by Andrei Vagin

zdtm: check an exit code of a straced restore

Currently zdtm doesn't detect when restore failed, if it is executed
with strace. With this patch, fake-restore.sh creates a test file, and
zdtm is able to distinguish when restore failed.
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 4960d441
......@@ -8,6 +8,7 @@
# criu restore <options> --action-script $(pwd)/scripts/fake-restore.sh
#
if [ "$CRTOOLS_SCRIPT_ACTION" == "post-restore" ]; then
touch restore-succeeded
exit 1
else
exit 0
......
......@@ -959,7 +959,8 @@ class criu:
grep_errors(os.path.join(__ddir, log))
if ret == 0:
return
if self.__test.blocking() or (self.__sat and action == 'restore'):
rst_succeeded = os.access(os.path.join(__ddir, "restore-succeeded"), os.F_OK)
if self.__test.blocking() or (self.__sat and action == 'restore' and rst_succeeded):
raise test_fail_expected_exc(action)
else:
raise test_fail_exc("CRIU %s" % action)
......
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