Commit 88aaae3a authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

tests: move non-zdtm tests to tests/others/

Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent a47d2917
all:
stap -g -d ../../criu/criu parasite.stp $$RANDOM -c 'bash -x ../zdtm.sh -d -x socket-tcp'
all: mvlink.so all: mvlink.so
mvlink.so: mvlink.c mvlink.so: mvlink.c
gcc -g -Werror -Wall -shared -nostartfiles mvlink.c -o mvlink.so -iquote ../../include -fPIC gcc -g -Werror -Wall -shared -nostartfiles mvlink.c -o mvlink.so -iquote ../../../criu/include -fPIC
...@@ -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/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/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/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:
stap -g -d ../../../criu/criu parasite.stp $$RANDOM -c 'bash -x ../zdtm.sh -d -x socket-tcp'
...@@ -11,13 +11,13 @@ run: all ...@@ -11,13 +11,13 @@ run: all
define genb define genb
$(1): $(1).o lib.o $(1): $(1).o lib.o
gcc $$^ -L ../../lib -L ../../protobuf -lcriu -o $$@ gcc $$^ -L ../../../../criu/lib/c/ -L ../../../../criu/images/ -lcriu -o $$@
endef endef
$(foreach t, $(TESTS), $(eval $(call genb, $(t)))) $(foreach t, $(TESTS), $(eval $(call genb, $(t))))
%.o: %.c %.o: %.c
gcc -c $^ -I../../lib/ -I../../protobuf -o $@ -Werror gcc -c $^ -I../../../../criu/lib/c/ -I../../../../criu/images/ -o $@ -Werror
clean: clean:
rm -rf $(TESTS) $(TESTS:%=%.o) lib.o rm -rf $(TESTS) $(TESTS:%=%.o) lib.o
......
#!/bin/bash #!/bin/bash
source ../env.sh || exit 1 set -x
source ../../env.sh || exit 1
echo "== Clean" echo "== Clean"
make clean make clean
...@@ -11,7 +12,7 @@ echo "== Prepare" ...@@ -11,7 +12,7 @@ echo "== Prepare"
mkdir -p wdir/i/ mkdir -p wdir/i/
echo "== Run tests" echo "== Run tests"
ln -s ../../lib/libcriu.so libcriu.so.1 ln -s ../../../../criu/lib/c/libcriu.so libcriu.so.1
export LD_LIBRARY_PATH=. export LD_LIBRARY_PATH=.
export PATH="`dirname ${BASH_SOURCE[0]}`/../../:$PATH" export PATH="`dirname ${BASH_SOURCE[0]}`/../../:$PATH"
......
#!/bin/bash #!/bin/bash
source ../env.sh || exit 1 source ../../env.sh || exit 1
function fail { function fail {
echo "$@" echo "$@"
...@@ -15,7 +15,7 @@ mkdir "$IMGDIR" ...@@ -15,7 +15,7 @@ mkdir "$IMGDIR"
function launch_test { function launch_test {
echo "Launching test" echo "Launching test"
cd ../zdtm/live/static/ cd ../../zdtm/live/static/
make cleanout make cleanout
make maps04 make maps04
make maps04.pid || fail "Can't start test" make maps04.pid || fail "Can't start test"
...@@ -26,7 +26,7 @@ function launch_test { ...@@ -26,7 +26,7 @@ function launch_test {
function stop_test { function stop_test {
wtime=1 wtime=1
cd ../zdtm/live/static/ cd ../../zdtm/live/static/
make maps04.stop make maps04.stop
cat maps04.out | fgrep PASS || fail "Test failed" cat maps04.out | fgrep PASS || fail "Test failed"
echo "OK" echo "OK"
......
#!/bin/bash #!/bin/bash
source ../env.sh || exit 1 source ../../env.sh || exit 1
USEPS=0 USEPS=0
...@@ -26,7 +26,7 @@ rm -rf "$IMGDIR" ...@@ -26,7 +26,7 @@ rm -rf "$IMGDIR"
mkdir "$IMGDIR" mkdir "$IMGDIR"
echo "Launching test" echo "Launching test"
cd ../zdtm/live/static/ cd ../../zdtm//live/static/
make cleanout make cleanout
make mem-touch make mem-touch
make mem-touch.pid || fail "Can't start test" make mem-touch.pid || fail "Can't start test"
...@@ -70,7 +70,7 @@ done ...@@ -70,7 +70,7 @@ done
echo "Restoring" echo "Restoring"
${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v4 || fail "Fail to restore server" ${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v4 || fail "Fail to restore server"
cd ../zdtm/live/static/ cd ../../zdtm//live/static/
make mem-touch.stop make mem-touch.stop
cat mem-touch.out | fgrep PASS || fail "Test failed" cat mem-touch.out | fgrep PASS || fail "Test failed"
......
#!/bin/bash #!/bin/bash
source ../env.sh || exit 1 source ../../env.sh || exit 1
USEPS=0 USEPS=0
...@@ -26,7 +26,7 @@ rm -rf "$IMGDIR" ...@@ -26,7 +26,7 @@ rm -rf "$IMGDIR"
mkdir "$IMGDIR" mkdir "$IMGDIR"
echo "Launching test" echo "Launching test"
cd ../zdtm/live/static/ cd ../../zdtm//live/static/
make cleanout make cleanout
make mem-touch make mem-touch
make mem-touch.pid || fail "Can't start test" make mem-touch.pid || fail "Can't start test"
...@@ -82,7 +82,7 @@ fi ...@@ -82,7 +82,7 @@ fi
echo "Restoring" echo "Restoring"
${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v4 || fail "Fail to restore server" ${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v4 || fail "Fail to restore server"
cd ../zdtm/live/static/ cd ../../zdtm//live/static/
make mem-touch.stop make mem-touch.stop
cat mem-touch.out | fgrep PASS || fail "Test failed" cat mem-touch.out | fgrep PASS || fail "Test failed"
......
#!/bin/bash #!/bin/bash
source ../env.sh || exit 1 source ../../env.sh || exit 1
USEPS=0 USEPS=0
...@@ -26,7 +26,7 @@ rm -rf "$IMGDIR" ...@@ -26,7 +26,7 @@ rm -rf "$IMGDIR"
mkdir "$IMGDIR" mkdir "$IMGDIR"
echo "Launching test" echo "Launching test"
cd ../zdtm/live/static/ cd ../../zdtm//live/static/
make cleanout make cleanout
make mem-touch make mem-touch
make mem-touch.pid || fail "Can't start test" make mem-touch.pid || fail "Can't start test"
...@@ -76,7 +76,7 @@ if [[ $size_last1 -ne 0 || $size_last2 -ne 0 || $size_last3 -ne 0 ]]; then ...@@ -76,7 +76,7 @@ if [[ $size_last1 -ne 0 || $size_last2 -ne 0 || $size_last3 -ne 0 ]]; then
restore_dedup_ok=1 restore_dedup_ok=1
fi fi
cd ../zdtm/live/static/ cd ../../zdtm//live/static/
make mem-touch.stop make mem-touch.stop
cat mem-touch.out | fgrep PASS || fail "Test failed" cat mem-touch.out | fgrep PASS || fail "Test failed"
......
#!/bin/bash #!/bin/bash
source ../env.sh || exit 1 source ../../env.sh || exit 1
USEPS=0 USEPS=0
...@@ -26,7 +26,7 @@ rm -rf "$IMGDIR" ...@@ -26,7 +26,7 @@ rm -rf "$IMGDIR"
mkdir "$IMGDIR" mkdir "$IMGDIR"
echo "Launching test" echo "Launching test"
cd ../zdtm/live/static/ cd ../../zdtm/live/static/
make cleanout make cleanout
make mem-touch make mem-touch
make mem-touch.pid || fail "Can't start test" make mem-touch.pid || fail "Can't start test"
...@@ -88,7 +88,7 @@ fi ...@@ -88,7 +88,7 @@ fi
echo "Restoring" echo "Restoring"
${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v4 || fail "Fail to restore server" ${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v4 || fail "Fail to restore server"
cd ../zdtm/live/static/ cd ../../zdtm/live/static/
make mem-touch.stop make mem-touch.stop
cat mem-touch.out | fgrep PASS || fail "Test failed" cat mem-touch.out | fgrep PASS || fail "Test failed"
......
#!/bin/bash #!/bin/bash
source ../env.sh || exit 1 source ../../env.sh || exit 1
USEPS=0 USEPS=0
...@@ -31,10 +31,10 @@ fi ...@@ -31,10 +31,10 @@ fi
rm -rf "$IMGDIR/*" rm -rf "$IMGDIR/*"
echo "Launching test" echo "Launching test"
make -C ../zdtm/live/static/ cleanout make -C ../../zdtm//live/static/ cleanout
make -C ../zdtm/live/static/ maps04 make -C ../../zdtm//live/static/ maps04
make -C ../zdtm/live/static/ maps04.pid || fail "Can't start test" make -C ../../zdtm//live/static/ maps04.pid || fail "Can't start test"
PID=$(cat ../zdtm/live/static/maps04.pid) PID=$(cat ../../zdtm//live/static/maps04.pid)
kill -0 $PID || fail "Test haven't started" kill -0 $PID || fail "Test haven't started"
mkdir "$IMGDIR/$NRSNAP/" mkdir "$IMGDIR/$NRSNAP/"
...@@ -55,7 +55,7 @@ fi ...@@ -55,7 +55,7 @@ fi
echo "Restoring" echo "Restoring"
${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log --auto-dedup -d -v4 || fail "Fail to restore" ${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log --auto-dedup -d -v4 || fail "Fail to restore"
make -C ../zdtm/live/static/ maps04.stop make -C ../../zdtm//live/static/ maps04.stop
sleep 1 sleep 1
cat "../zdtm/live/static/maps04.out" | fgrep PASS || fail "Test failed" cat "../zdtm/live/static/maps04.out" | fgrep PASS || fail "Test failed"
......
#!/bin/bash #!/bin/bash
source ../env.sh || exit 1 source ../../env.sh || exit 1
USEPS=0 USEPS=0
...@@ -26,7 +26,7 @@ rm -rf "$IMGDIR" ...@@ -26,7 +26,7 @@ rm -rf "$IMGDIR"
mkdir "$IMGDIR" mkdir "$IMGDIR"
echo "Launching test" echo "Launching test"
cd ../zdtm/live/static/ cd ../../zdtm/live/static/
make cleanout make cleanout
make mem-touch make mem-touch
make mem-touch.pid || fail "Can't start test" make mem-touch.pid || fail "Can't start test"
...@@ -67,7 +67,7 @@ done ...@@ -67,7 +67,7 @@ done
echo "Restoring" echo "Restoring"
${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v4 || fail "Fail to restore server" ${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v4 || fail "Fail to restore server"
cd ../zdtm/live/static/ cd ../../zdtm/live/static/
make mem-touch.stop make mem-touch.stop
cat mem-touch.out | fgrep PASS || fail "Test failed" cat mem-touch.out | fgrep PASS || fail "Test failed"
......
#!/bin/bash #!/bin/bash
CRIU=../../criu CRIU=../../../criu
set -x set -x
mkdir -p dump mkdir -p dump
......
...@@ -84,7 +84,7 @@ typedef unsigned long ulong; ...@@ -84,7 +84,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"
......
...@@ -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/criu
cp ../../criu/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
......
../../../images/rpc.proto
\ No newline at end of file
...@@ -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/criu testdir: ../../../criu/criu
mkdir -p $(DIR) mkdir -p $(DIR)
mkdir -p $(IMGS) mkdir -p $(IMGS)
cp ../../criu/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)
......
#!/bin/bash #!/bin/bash
source ../env.sh || exit 1 source ../../env.sh || exit 1
set -x set -x
......
../../protobuf/rpc.proto
\ No newline at end of file
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