Commit 23a2472c authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

test: use the ip tool instead of ifconfig and brctl

I'm too lazy to install new tools on all test hosts.
Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent c63a42ac
......@@ -17,13 +17,13 @@ const char *test_author = "Tycho Andersen <tycho.andersen@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;
......
{'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'}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment