[CRIU] [PATCH] test: use .pid.inprogress file for macvlan test

Tycho Andersen tycho.andersen at canonical.com
Wed Oct 26 09:23:48 PDT 2016


Note, this depends on Pavel's patch here:
https://lists.openvz.org/pipermail/criu/2016-October/032499.html which is
not yet applied.

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
 test/zdtm/static/macvlan.hook | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/test/zdtm/static/macvlan.hook b/test/zdtm/static/macvlan.hook
index 0dea7d1..d0a06b6 100755
--- a/test/zdtm/static/macvlan.hook
+++ b/test/zdtm/static/macvlan.hook
@@ -6,7 +6,8 @@ if [ "$1" == "--post-start" ]; then
 	set -e
 
 	i=0
-	while [ -z "$(pidof -s macvlan)" ]; do
+	PIDF="zdtm/static/macvlan.pid.inprogress"
+	while [ ! -f "$PIDF" ]; do
 		i=$(($i+1))
 		if [ "$i" -eq "10" ]; then
 			echo "failed to create macvlan test"
@@ -15,12 +16,14 @@ if [ "$1" == "--post-start" ]; then
 		sleep 1
 	done
 
+	TPID=$(cat $PIDF)
+
 	ip link add zdtmbr0 type bridge
 	ip addr add 10.0.55.55/32 dev zdtmbr0
 	ip link set zdtmbr0 up
 	ip link add zdtmmvlan0 link zdtmbr0 type macvlan mode bridge
 	ip addr add 10.0.55.56/32 dev zdtmmvlan0
-	ip link set zdtmmvlan0 netns $(pidof -s macvlan)
+	ip link set zdtmmvlan0 netns $TPID
 else
 	ip link del zdtmmvlan0 || true
 
-- 
2.9.3



More information about the CRIU mailing list