[CRIU] [PATCH 3/3] netns_ext: make test work on CentOS
Adrian Reber
adrian at lisas.de
Mon Jul 23 22:13:33 MSK 2018
From: Adrian Reber <areber at redhat.com>
It seems CentOS versions of ip does not understand some commands from
newer iproute packages. This makes the netns_ext test work on CentOS
and also cleans up a few files at the end of the test.
Signed-off-by: Adrian Reber <areber at redhat.com>
---
test/others/netns_ext/Makefile | 2 ++
test/others/netns_ext/run.sh | 4 +++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/test/others/netns_ext/Makefile b/test/others/netns_ext/Makefile
index 7779a9903..a2e394ac6 100644
--- a/test/others/netns_ext/Makefile
+++ b/test/others/netns_ext/Makefile
@@ -1,2 +1,4 @@
run:
./run.sh
+clean:
+ rm -f pidfile pidfile2 pidfile3 test_netns test_netns2 output
diff --git a/test/others/netns_ext/run.sh b/test/others/netns_ext/run.sh
index 04e447f7c..3e6a9adc2 100755
--- a/test/others/netns_ext/run.sh
+++ b/test/others/netns_ext/run.sh
@@ -3,7 +3,7 @@
set -e
CRIU=../../../criu/criu
-setsid unshare -n bash -c 'unshare -n sh _run.sh pidfile2 & unshare -n sh _run.sh pidfile3 & ip link add xxx type veth && ip link add mymacvlan1 link xxx type macvlan mode bridge && . _run.sh pidfile' < /dev/zero &> output &
+setsid unshare -n bash -c 'unshare -n sh _run.sh pidfile2 & unshare -n sh _run.sh pidfile3 & ip link add xxx type veth peer name yyy && ip link add mymacvlan1 link xxx type macvlan mode bridge && . _run.sh pidfile' < /dev/zero &> output &
sleep 1
while :; do
test -f pidfile && test -f pidfile2 && break;
@@ -13,6 +13,8 @@ done
pid=$(cat pidfile)
pid2=$(cat pidfile2)
+trap "umount -l test_netns; umount -l test_netns2" EXIT
+
touch test_netns
mount --bind /proc/$pid/ns/net test_netns
touch test_netns2
--
2.18.0
More information about the CRIU
mailing list