[CRIU] [PATCH] test: use the ip tool instead of ifconfig and brctl

Andrey Vagin avagin at openvz.org
Thu Nov 12 00:58:34 PST 2015


From: Andrew Vagin <avagin at virtuozzo.com>

I'm too lazy to install new tools on all test hosts.

Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 test/zdtm/live/static/bridge.c    | 10 +++++-----
 test/zdtm/live/static/bridge.desc |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/zdtm/live/static/bridge.c b/test/zdtm/live/static/bridge.c
index 2735595..0aca514 100644
--- a/test/zdtm/live/static/bridge.c
+++ b/test/zdtm/live/static/bridge.c
@@ -17,13 +17,13 @@ const char *test_author	= "Tycho Andersen <tycho.andersen at canonical.com>";
 
 int add_bridge(void)
 {
-	if (system("brctl addbr " BRIDGE_NAME))
+	if (system("ip link add " BRIDGE_NAME " type bridge"))
 		return -1;
 
-	if (system("ifconfig " BRIDGE_NAME " 10.0.55.55"))
+	if (system("ip addr add 10.0.55.55/32 dev " BRIDGE_NAME))
 		return -1;
 
-	if (system("ifconfig " BRIDGE_NAME " up"))
+	if (system("ip link set " BRIDGE_NAME " up"))
 		return -1;
 
 	return 0;
@@ -32,9 +32,9 @@ int add_bridge(void)
 int del_bridge(void)
 {
 	/* don't check for errors, let's try to make sure it's deleted */
-	system("ifconfig " BRIDGE_NAME " down");
+	system("ip link set " BRIDGE_NAME " down");
 
-	if (system("brctl delbr " BRIDGE_NAME))
+	if (system("ip link del " BRIDGE_NAME))
 		return -1;
 
 	return 0;
diff --git a/test/zdtm/live/static/bridge.desc b/test/zdtm/live/static/bridge.desc
index 59f7d39..bfbd0d9 100644
--- a/test/zdtm/live/static/bridge.desc
+++ b/test/zdtm/live/static/bridge.desc
@@ -1 +1 @@
-{'flavor': 'ns uns', 'deps': [ '/bin/sh', '/bin/grep', '/sbin/ip', '/sbin/brctl', '/sbin/ifconfig', '/usr/bin/diff'], 'flags': 'suid'}
+{'flavor': 'ns uns', 'deps': [ '/bin/sh', '/bin/grep', '/sbin/ip', '/usr/bin/diff'], 'flags': 'suid'}
-- 
2.4.3



More information about the CRIU mailing list