mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 13:28:27 +00:00
test: Check nomemfd parasite injection
By default criu tries to create parasite mem with memfd syscall, which is present in many systems. Let's check also the legacy way. Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
5c17b30236
commit
070d420be6
@ -8,6 +8,7 @@ enum faults {
|
||||
FI_RESTORE_ROOT_ONLY,
|
||||
/* not fatal */
|
||||
FI_CHECK_OPEN_HANDLE = 128,
|
||||
FI_NO_MEMFD = 129,
|
||||
FI_MAX,
|
||||
};
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "vma.h"
|
||||
#include "proc_parse.h"
|
||||
#include "aio.h"
|
||||
#include "fault-injection.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
@ -1192,6 +1193,9 @@ static int parasite_memfd_exchange(struct parasite_ctl *ctl, unsigned long size)
|
||||
unsigned long sret = -ENOSYS;
|
||||
int ret, fd, lfd;
|
||||
|
||||
if (fault_injected(FI_NO_MEMFD))
|
||||
return 1;
|
||||
|
||||
BUILD_BUG_ON(sizeof(orig_code) < sizeof(long));
|
||||
|
||||
if (ptrace_swap_area(pid, where, (void *)orig_code, sizeof(orig_code))) {
|
||||
|
@ -5,3 +5,4 @@ prep
|
||||
./test/zdtm.py run -t zdtm/static/env00 --fault 1 --keep-going --report report -f h || fail
|
||||
./test/zdtm.py run -t zdtm/static/unlink_fstat00 --fault 2 --keep-going --report report -f h || fail
|
||||
./test/zdtm.py run -t zdtm/static/inotify_irmap --fault 128 --keep-going --pre 2 -f uns || fail
|
||||
./test/zdtm.py run -t zdtm/static/env00 --fault 129 -f uns || fail
|
||||
|
Loading…
x
Reference in New Issue
Block a user