mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
tests: move non-zdtm tests to tests/others/
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
a47d2917a5
commit
88aaae3ace
73 changed files with 43 additions and 42 deletions
|
|
@ -1,2 +0,0 @@
|
|||
all:
|
||||
stap -g -d ../../criu/criu parasite.stp $$RANDOM -c 'bash -x ../zdtm.sh -d -x socket-tcp'
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
all: mvlink.so
|
||||
|
||||
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"
|
|||
finf="finish"
|
||||
outf="ns_output"
|
||||
pidf="ns_pid"
|
||||
criu="../../criu/criu"
|
||||
criu="../../../criu/criu"
|
||||
|
||||
export ip
|
||||
export mvln
|
||||
|
|
@ -11,7 +11,7 @@ ttyid = "tty[%x:%x]" % (st.st_rdev, st.st_dev)
|
|||
os.close(slave)
|
||||
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:
|
||||
sys.exit(ret)
|
||||
p.wait()
|
||||
|
|
@ -21,7 +21,7 @@ os.close(master)
|
|||
|
||||
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:
|
||||
sys.exit(ret)
|
||||
os.close(slave)
|
||||
2
test/others/fault-injection/Makefile
Normal file
2
test/others/fault-injection/Makefile
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
all:
|
||||
stap -g -d ../../../criu/criu parasite.stp $$RANDOM -c 'bash -x ../zdtm.sh -d -x socket-tcp'
|
||||
|
|
@ -11,13 +11,13 @@ run: all
|
|||
|
||||
define genb
|
||||
$(1): $(1).o lib.o
|
||||
gcc $$^ -L ../../lib -L ../../protobuf -lcriu -o $$@
|
||||
gcc $$^ -L ../../../../criu/lib/c/ -L ../../../../criu/images/ -lcriu -o $$@
|
||||
endef
|
||||
|
||||
$(foreach t, $(TESTS), $(eval $(call genb, $(t))))
|
||||
|
||||
%.o: %.c
|
||||
gcc -c $^ -I../../lib/ -I../../protobuf -o $@ -Werror
|
||||
gcc -c $^ -I../../../../criu/lib/c/ -I../../../../criu/images/ -o $@ -Werror
|
||||
|
||||
clean:
|
||||
rm -rf $(TESTS) $(TESTS:%=%.o) lib.o
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
source ../env.sh || exit 1
|
||||
set -x
|
||||
source ../../env.sh || exit 1
|
||||
|
||||
echo "== Clean"
|
||||
make clean
|
||||
|
|
@ -11,7 +12,7 @@ echo "== Prepare"
|
|||
mkdir -p wdir/i/
|
||||
|
||||
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 PATH="`dirname ${BASH_SOURCE[0]}`/../../:$PATH"
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
source ../env.sh || exit 1
|
||||
source ../../env.sh || exit 1
|
||||
|
||||
function fail {
|
||||
echo "$@"
|
||||
|
|
@ -15,7 +15,7 @@ mkdir "$IMGDIR"
|
|||
|
||||
function launch_test {
|
||||
echo "Launching test"
|
||||
cd ../zdtm/live/static/
|
||||
cd ../../zdtm/live/static/
|
||||
make cleanout
|
||||
make maps04
|
||||
make maps04.pid || fail "Can't start test"
|
||||
|
|
@ -26,7 +26,7 @@ function launch_test {
|
|||
|
||||
function stop_test {
|
||||
wtime=1
|
||||
cd ../zdtm/live/static/
|
||||
cd ../../zdtm/live/static/
|
||||
make maps04.stop
|
||||
cat maps04.out | fgrep PASS || fail "Test failed"
|
||||
echo "OK"
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
source ../env.sh || exit 1
|
||||
source ../../env.sh || exit 1
|
||||
|
||||
USEPS=0
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ rm -rf "$IMGDIR"
|
|||
mkdir "$IMGDIR"
|
||||
|
||||
echo "Launching test"
|
||||
cd ../zdtm/live/static/
|
||||
cd ../../zdtm//live/static/
|
||||
make cleanout
|
||||
make mem-touch
|
||||
make mem-touch.pid || fail "Can't start test"
|
||||
|
|
@ -70,7 +70,7 @@ done
|
|||
echo "Restoring"
|
||||
${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
|
||||
cat mem-touch.out | fgrep PASS || fail "Test failed"
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
source ../env.sh || exit 1
|
||||
source ../../env.sh || exit 1
|
||||
|
||||
USEPS=0
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ rm -rf "$IMGDIR"
|
|||
mkdir "$IMGDIR"
|
||||
|
||||
echo "Launching test"
|
||||
cd ../zdtm/live/static/
|
||||
cd ../../zdtm//live/static/
|
||||
make cleanout
|
||||
make mem-touch
|
||||
make mem-touch.pid || fail "Can't start test"
|
||||
|
|
@ -82,7 +82,7 @@ fi
|
|||
echo "Restoring"
|
||||
${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
|
||||
cat mem-touch.out | fgrep PASS || fail "Test failed"
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
source ../env.sh || exit 1
|
||||
source ../../env.sh || exit 1
|
||||
|
||||
USEPS=0
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ rm -rf "$IMGDIR"
|
|||
mkdir "$IMGDIR"
|
||||
|
||||
echo "Launching test"
|
||||
cd ../zdtm/live/static/
|
||||
cd ../../zdtm//live/static/
|
||||
make cleanout
|
||||
make mem-touch
|
||||
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
|
|||
restore_dedup_ok=1
|
||||
fi
|
||||
|
||||
cd ../zdtm/live/static/
|
||||
cd ../../zdtm//live/static/
|
||||
make mem-touch.stop
|
||||
cat mem-touch.out | fgrep PASS || fail "Test failed"
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
source ../env.sh || exit 1
|
||||
source ../../env.sh || exit 1
|
||||
|
||||
USEPS=0
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ rm -rf "$IMGDIR"
|
|||
mkdir "$IMGDIR"
|
||||
|
||||
echo "Launching test"
|
||||
cd ../zdtm/live/static/
|
||||
cd ../../zdtm/live/static/
|
||||
make cleanout
|
||||
make mem-touch
|
||||
make mem-touch.pid || fail "Can't start test"
|
||||
|
|
@ -88,7 +88,7 @@ fi
|
|||
echo "Restoring"
|
||||
${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
|
||||
cat mem-touch.out | fgrep PASS || fail "Test failed"
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
source ../env.sh || exit 1
|
||||
source ../../env.sh || exit 1
|
||||
|
||||
USEPS=0
|
||||
|
||||
|
|
@ -31,10 +31,10 @@ fi
|
|||
rm -rf "$IMGDIR/*"
|
||||
|
||||
echo "Launching test"
|
||||
make -C ../zdtm/live/static/ cleanout
|
||||
make -C ../zdtm/live/static/ maps04
|
||||
make -C ../zdtm/live/static/ maps04.pid || fail "Can't start test"
|
||||
PID=$(cat ../zdtm/live/static/maps04.pid)
|
||||
make -C ../../zdtm//live/static/ cleanout
|
||||
make -C ../../zdtm//live/static/ maps04
|
||||
make -C ../../zdtm//live/static/ maps04.pid || fail "Can't start test"
|
||||
PID=$(cat ../../zdtm//live/static/maps04.pid)
|
||||
kill -0 $PID || fail "Test haven't started"
|
||||
|
||||
mkdir "$IMGDIR/$NRSNAP/"
|
||||
|
|
@ -55,7 +55,7 @@ fi
|
|||
echo "Restoring"
|
||||
${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
|
||||
|
||||
cat "../zdtm/live/static/maps04.out" | fgrep PASS || fail "Test failed"
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
source ../env.sh || exit 1
|
||||
source ../../env.sh || exit 1
|
||||
|
||||
USEPS=0
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ rm -rf "$IMGDIR"
|
|||
mkdir "$IMGDIR"
|
||||
|
||||
echo "Launching test"
|
||||
cd ../zdtm/live/static/
|
||||
cd ../../zdtm/live/static/
|
||||
make cleanout
|
||||
make mem-touch
|
||||
make mem-touch.pid || fail "Can't start test"
|
||||
|
|
@ -67,7 +67,7 @@ done
|
|||
echo "Restoring"
|
||||
${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
|
||||
cat mem-touch.out | fgrep PASS || fail "Test failed"
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
CRIU=../../criu
|
||||
CRIU=../../../criu
|
||||
set -x
|
||||
|
||||
mkdir -p dump
|
||||
|
|
@ -84,7 +84,7 @@ typedef unsigned long ulong;
|
|||
|
||||
#define MAX_FORKS 3 /* child, checkpoint, restore */
|
||||
|
||||
#define CRIU_BINARY "../../criu"
|
||||
#define CRIU_BINARY "../../../criu/criu"
|
||||
#define IMG_DIR "images"
|
||||
#define DUMP_LOG_FILE "dump.log"
|
||||
#define RESTORE_LOG_FILE "restore.log"
|
||||
|
|
@ -9,8 +9,8 @@ run: all
|
|||
chmod a+rwx build
|
||||
sudo -g '#1000' -u '#1000' ./run.sh
|
||||
|
||||
criu: ../../criu/criu
|
||||
cp ../../criu/criu $@
|
||||
criu: ../../../criu/criu
|
||||
cp ../../../criu/criu $@
|
||||
chmod u+s $@
|
||||
|
||||
test-c: rpc.pb-c.o test-c.o
|
||||
1
test/others/rpc/rpc.proto
Symbolic link
1
test/others/rpc/rpc.proto
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../images/rpc.proto
|
||||
|
|
@ -13,10 +13,10 @@ export DIR LOOP PIDFILE IMGS CRIU ROOT USR1 USR2
|
|||
run: testdir users
|
||||
./run.sh
|
||||
|
||||
testdir: ../../criu/criu
|
||||
testdir: ../../../criu/criu
|
||||
mkdir -p $(DIR)
|
||||
mkdir -p $(IMGS)
|
||||
cp ../../criu/criu $(CRIU)
|
||||
cp ../../../criu/criu $(CRIU)
|
||||
chmod u+s $(CRIU)
|
||||
cp loop.sh $(LOOP)
|
||||
chmod 777 $(DIR)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
source ../env.sh || exit 1
|
||||
source ../../env.sh || exit 1
|
||||
|
||||
set -x
|
||||
|
||||
|
|
@ -1 +0,0 @@
|
|||
../../protobuf/rpc.proto
|
||||
Loading…
Add table
Add a link
Reference in a new issue