mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 14:55:39 +00:00
test: zdtm.py -- Fix criu reference
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
06a96d22cd
commit
f96718b3e3
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
CRIU=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../criu)
|
CRIU=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../criu/criu)
|
||||||
criu=$CRIU
|
criu=$CRIU
|
||||||
|
@@ -5,7 +5,7 @@ mvln="mv0"
|
|||||||
finf="finish"
|
finf="finish"
|
||||||
outf="ns_output"
|
outf="ns_output"
|
||||||
pidf="ns_pid"
|
pidf="ns_pid"
|
||||||
criu="../../criu"
|
criu="../../criu/criu"
|
||||||
|
|
||||||
export ip
|
export ip
|
||||||
export mvln
|
export mvln
|
||||||
|
@@ -11,7 +11,7 @@ ttyid = "tty[%x:%x]" % (st.st_rdev, st.st_dev)
|
|||||||
os.close(slave)
|
os.close(slave)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
ret = subprocess.Popen(["../../criu", "dump", "-t", str(p.pid), "-v4", "--external", ttyid]).wait()
|
ret = subprocess.Popen(["../../criu/criu", "dump", "-t", str(p.pid), "-v4", "--external", ttyid]).wait()
|
||||||
if ret:
|
if ret:
|
||||||
sys.exit(ret)
|
sys.exit(ret)
|
||||||
p.wait()
|
p.wait()
|
||||||
@@ -21,7 +21,7 @@ os.close(master)
|
|||||||
|
|
||||||
ttyid = "fd[%d]:tty[%x:%x]" % (slave, st.st_rdev, st.st_dev)
|
ttyid = "fd[%d]:tty[%x:%x]" % (slave, st.st_rdev, st.st_dev)
|
||||||
|
|
||||||
ret = subprocess.Popen(["../../criu", "restore", "-v4", "--inherit-fd", ttyid, "--restore-sibling", "--restore-detach"]).wait()
|
ret = subprocess.Popen(["../../criu/criu", "restore", "-v4", "--inherit-fd", ttyid, "--restore-sibling", "--restore-detach"]).wait()
|
||||||
if ret:
|
if ret:
|
||||||
sys.exit(ret)
|
sys.exit(ret)
|
||||||
os.close(slave)
|
os.close(slave)
|
||||||
|
@@ -1,2 +1,2 @@
|
|||||||
all:
|
all:
|
||||||
stap -g -d ../../criu parasite.stp $$RANDOM -c 'bash -x ../zdtm.sh -d -x socket-tcp'
|
stap -g -d ../../criu/criu parasite.stp $$RANDOM -c 'bash -x ../zdtm.sh -d -x socket-tcp'
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
global i, n, fini_cmd = -1, last_cmd
|
global i, n, fini_cmd = -1, last_cmd
|
||||||
|
|
||||||
probe process("../../criu").begin
|
probe process("../../criu/criu").begin
|
||||||
{
|
{
|
||||||
i = 0;
|
i = 0;
|
||||||
/* randint() returns numbers multiple of 5 */
|
/* randint() returns numbers multiple of 5 */
|
||||||
@@ -8,7 +8,7 @@ probe process("../../criu").begin
|
|||||||
printf("The %d command will be replaced on -1\n", n);
|
printf("The %d command will be replaced on -1\n", n);
|
||||||
}
|
}
|
||||||
|
|
||||||
probe process("../../criu").function("__parasite_execute_daemon")
|
probe process("../../criu/criu").function("__parasite_execute_daemon")
|
||||||
{
|
{
|
||||||
printf("%s\n", $$parms);
|
printf("%s\n", $$parms);
|
||||||
last_cmd = $cmd;
|
last_cmd = $cmd;
|
||||||
@@ -18,12 +18,12 @@ probe process("../../criu").function("__parasite_execute_daemon")
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
probe process("../../criu").function("__parasite_execute_daemon").return
|
probe process("../../criu/criu").function("__parasite_execute_daemon").return
|
||||||
{
|
{
|
||||||
printf("%d\n", $return);
|
printf("%d\n", $return);
|
||||||
}
|
}
|
||||||
|
|
||||||
probe process("../../criu").function("main").return
|
probe process("../../criu/criu").function("main").return
|
||||||
{
|
{
|
||||||
printf("CRIU exits with code %d\n", $return);
|
printf("CRIU exits with code %d\n", $return);
|
||||||
if ( i > n) {
|
if ( i > n) {
|
||||||
|
@@ -9,7 +9,7 @@ function fail {
|
|||||||
|
|
||||||
make || fail "Can't compile library or ns init"
|
make || fail "Can't compile library or ns init"
|
||||||
|
|
||||||
criu="../../../criu"
|
criu="../../../criu/criu"
|
||||||
|
|
||||||
# New root for namespace
|
# New root for namespace
|
||||||
NSROOT="nsroot"
|
NSROOT="nsroot"
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
CRIU=../../../criu
|
CRIU=../../../criu/criu
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
setup_mount
|
setup_mount
|
||||||
|
@@ -9,8 +9,8 @@ run: all
|
|||||||
chmod a+rwx build
|
chmod a+rwx build
|
||||||
sudo -g '#1000' -u '#1000' ./run.sh
|
sudo -g '#1000' -u '#1000' ./run.sh
|
||||||
|
|
||||||
criu: ../../criu
|
criu: ../../criu/criu
|
||||||
cp ../../criu $@
|
cp ../../criu/criu $@
|
||||||
chmod u+s $@
|
chmod u+s $@
|
||||||
|
|
||||||
test-c: rpc.pb-c.o test-c.o
|
test-c: rpc.pb-c.o test-c.o
|
||||||
|
@@ -13,10 +13,10 @@ export DIR LOOP PIDFILE IMGS CRIU ROOT USR1 USR2
|
|||||||
run: testdir users
|
run: testdir users
|
||||||
./run.sh
|
./run.sh
|
||||||
|
|
||||||
testdir: ../../criu
|
testdir: ../../criu/criu
|
||||||
mkdir -p $(DIR)
|
mkdir -p $(DIR)
|
||||||
mkdir -p $(IMGS)
|
mkdir -p $(IMGS)
|
||||||
cp ../../criu $(CRIU)
|
cp ../../criu/criu $(CRIU)
|
||||||
chmod u+s $(CRIU)
|
chmod u+s $(CRIU)
|
||||||
cp loop.sh $(LOOP)
|
cp loop.sh $(LOOP)
|
||||||
chmod 777 $(DIR)
|
chmod 777 $(DIR)
|
||||||
|
@@ -46,7 +46,7 @@ typedef unsigned long ulong;
|
|||||||
|
|
||||||
#define MAX_FORKS 3 /* child, checkpoint, restore */
|
#define MAX_FORKS 3 /* child, checkpoint, restore */
|
||||||
|
|
||||||
#define CRIU_BINARY "../../criu"
|
#define CRIU_BINARY "../../criu/criu"
|
||||||
#define IMG_DIR "images"
|
#define IMG_DIR "images"
|
||||||
#define DUMP_LOG_FILE "dump.log"
|
#define DUMP_LOG_FILE "dump.log"
|
||||||
#define RESTORE_LOG_FILE "restore.log"
|
#define RESTORE_LOG_FILE "restore.log"
|
||||||
|
@@ -582,7 +582,7 @@ test_classes = { 'zdtm': zdtm_test, 'inhfd': inhfd_test, 'groups': groups_test }
|
|||||||
# CRIU when launched using CLI
|
# CRIU when launched using CLI
|
||||||
#
|
#
|
||||||
|
|
||||||
criu_bin = "../criu"
|
criu_bin = "../criu/criu"
|
||||||
class criu_cli:
|
class criu_cli:
|
||||||
def __init__(self, opts):
|
def __init__(self, opts):
|
||||||
self.__test = None
|
self.__test = None
|
||||||
|
Reference in New Issue
Block a user