test/others: add test for check() with libcriu

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This commit is contained in:
Radostin Stoyanov 2025-10-20 10:24:49 +01:00 committed by Andrei Vagin
parent a1dc885027
commit 567f70ce19
3 changed files with 19 additions and 0 deletions

View file

@ -8,6 +8,7 @@ TESTS += test_iters
TESTS += test_errno
TESTS += test_join_ns
TESTS += test_pre_dump
TESTS += test_check
TESTS += test_feature_check
all: $(TESTS)

View file

@ -63,6 +63,7 @@ if [ "$(uname -m)" = "x86_64" ]; then
fi
run_test test_errno
run_test test_join_ns
run_test test_check
if criu check --feature mem_dirty_track > /dev/null; then
export CRIU_FEATURE_MEM_TRACK=1
fi

View file

@ -0,0 +1,17 @@
#include <stdio.h>
#include "criu.h"
#include "lib.h"
int main(int argc, char **argv)
{
int ret;
printf("--- Start check ---\n");
criu_init_opts();
criu_set_service_binary(argv[1]);
if (criu_check())
return -1;
return 0;
}