Commit 86bb235b authored by Ruslan Kuprieiev's avatar Ruslan Kuprieiev Committed by Pavel Emelyanov

test: libcriu: switch to using swrk instead of service

As our tests serve as an example for people on how to preferably
use criu, we need to also switch to swrk.
Signed-off-by: 's avatarRuslan Kuprieiev <rkuprieiev@cloudlinux.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent f39bb8f9
......@@ -8,10 +8,7 @@ rm -rf wdir
rm -f ./libcriu.so.1
echo "== Prepare"
mkdir -p wdir/s/
mkdir wdir/i/
echo "== Start service"
${CRIU} service -v4 -o service.log --address cs.sk -d --pidfile pidfile -W wdir/s/ || { echo "FAIL service start"; exit 1; }
mkdir -p wdir/i/
echo "== Run tests"
ln -s ../../lib/libcriu.so libcriu.so.1
......@@ -28,7 +25,7 @@ function run_test {
else
echo "== Test $1"
mkdir wdir/i/$1/
if ! setsid ./$1 wdir/s/cs.sk wdir/i/$1/ < /dev/null &>> wdir/i/$1/test.log; then
if ! setsid ./$1 ${CRIU} wdir/i/$1/ < /dev/null &>> wdir/i/$1/test.log; then
echo "$1: FAIL"
RESULT=1
fi
......@@ -41,8 +38,7 @@ run_test test_notify
run_test test_iters
run_test test_errno
echo "== Stopping service"
kill -TERM $(cat wdir/s/pidfile)
echo "== Tests done"
unlink libcriu.so.1
[ $RESULT -eq 0 ] && echo "Success" || echo "FAIL"
exit $RESULT
......@@ -30,7 +30,7 @@ static int init(char *argv[])
static void get_base_req(void)
{
criu_init_opts();
criu_set_service_address(service);
criu_set_service_binary(service);
criu_set_images_dir_fd(dir_fd);
criu_set_log_level(4);
}
......
......@@ -103,7 +103,7 @@ int main(int argc, char **argv)
printf("--- Dump loop ---\n");
criu_init_opts();
criu_set_service_address(argv[1]);
criu_set_service_binary(argv[1]);
criu_set_pid(pid);
criu_set_log_file("dump.log");
criu_set_log_level(4);
......
......@@ -68,7 +68,7 @@ int main(int argc, char **argv)
printf("--- Dump loop ---\n");
criu_init_opts();
criu_set_service_address(argv[1]);
criu_set_service_binary(argv[1]);
criu_set_pid(pid);
criu_set_log_file("dump.log");
criu_set_log_level(4);
......
......@@ -22,7 +22,7 @@ int main(int argc, char *argv[])
}
criu_init_opts();
criu_set_service_address(argv[1]);
criu_set_service_binary(argv[1]);
criu_set_images_dir_fd(fd);
criu_set_log_level(4);
......
......@@ -66,7 +66,7 @@ int main(int argc, char **argv)
printf("--- Dump loop ---\n");
criu_init_opts();
criu_set_service_address(argv[1]);
criu_set_service_binary(argv[1]);
criu_set_pid(pid);
criu_set_log_file("dump.log");
criu_set_log_level(4);
......
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