[CRIU] [PATCH 4/5] test/other: check criu exec

Andrey Vagin avagin at openvz.org
Thu Jul 14 11:44:17 PDT 2016


From: Andrew Vagin <avagin at virtuozzo.com>

Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 test/others/exec/Makefile |  2 ++
 test/others/exec/run.sh   | 16 ++++++++++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 test/others/exec/Makefile
 create mode 100755 test/others/exec/run.sh

diff --git a/test/others/exec/Makefile b/test/others/exec/Makefile
new file mode 100644
index 0000000..7779a99
--- /dev/null
+++ b/test/others/exec/Makefile
@@ -0,0 +1,2 @@
+run:
+	./run.sh
diff --git a/test/others/exec/run.sh b/test/others/exec/run.sh
new file mode 100755
index 0000000..c3f497e
--- /dev/null
+++ b/test/others/exec/run.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+CRIU=../../../criu/criu
+
+set -e -m -x
+
+cat < /dev/zero > /dev/null &
+pid=$!
+sleep 1
+lsof -p $pid
+
+$CRIU exec -t $pid fake_syscall && exit 1 || true
+fd=`$CRIU exec -t $pid open '&/dev/null' 0 | sed 's/.*(\(.*\))/\1/'`
+$CRIU exec -t $pid dup2 $fd 0
+wait $pid
+echo PASS
-- 
2.7.4



More information about the CRIU mailing list