[CRIU] [PATCH] zdtm/bridge: wait when the tentative flas is disappeared

Andrei Vagin avagin at virtuozzo.com
Mon Apr 30 10:47:07 MSK 2018


From: Andrei Vagin <avagin at openvz.org>

Test output: ================================
3c3
<     inet6 fe80::34d1:2cff:fe9b:a54e/64 scope link

Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 test/zdtm/static/bridge.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/test/zdtm/static/bridge.c b/test/zdtm/static/bridge.c
index 983c262af..0c26c0b0f 100644
--- a/test/zdtm/static/bridge.c
+++ b/test/zdtm/static/bridge.c
@@ -84,6 +84,10 @@ int main(int argc, char **argv)
 	 * (I got this race with zdtm.py, but not with zdtm.sh; not quite sure
 	 * what the environment difference is/was.)
 	 */
+	while (1) {
+		if (system("ip addr list dev " BRIDGE_NAME " | grep tentative"))
+			break;
+	}
 	if (system("ip addr list dev " BRIDGE_NAME " | grep inet | sort > bridge.dump.test")) {
 		pr_perror("can't save net config");
 		fail("Can't save net config");
@@ -93,12 +97,16 @@ int main(int argc, char **argv)
 	test_daemon();
 	test_waitsig();
 
+	while (1) {
+		if (system("ip addr list dev " BRIDGE_NAME " | grep tentative"))
+			break;
+	}
 	if (system("ip addr list dev " BRIDGE_NAME " | grep inet | sort > bridge.rst.test")) {
 		fail("Can't get net config");
 		goto out;
 	}
 
-	if (system("diff bridge.rst.test bridge.dump.test")) {
+	if (system("diff -up bridge.rst.test bridge.dump.test")) {
 		fail("Net config differs after restore");
 		goto out;
 	}
-- 
2.14.3



More information about the CRIU mailing list