Commit f96718b3 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

test: zdtm.py -- Fix criu reference

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 06a96d22
#!/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" ...@@ -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) ...@@ -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) ...@@ -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)
......
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'
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 ...@@ -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") ...@@ -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 { ...@@ -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 @@ ...@@ -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 ...@@ -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 ...@@ -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; ...@@ -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 } ...@@ -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
......
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