2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 01:51:51 +00:00

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: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Andrey Vagin 2018-03-08 01:43:07 +03:00 committed by Andrei Vagin
parent 4960d44129
commit 6a66b87e12
2 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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)