From 29efe42e64f50c69a0622a8403de72882a2495fe Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Mon, 4 Sep 2017 18:41:34 +0200 Subject: testbeds: qemu: Add dev option to ip link set If the dev option is omitted, the command may fail on short names that resemble options. --- rumba/testbeds/qemu.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rumba/testbeds/qemu.py b/rumba/testbeds/qemu.py index 3d30ce2..7e07ec9 100644 --- a/rumba/testbeds/qemu.py +++ b/rumba/testbeds/qemu.py @@ -97,7 +97,7 @@ class Testbed(mod.Testbed): ipcp.ifname = output ssh_support.execute_command( self, node.ssh_config, - "ip link set %(ifname)s up" + "ip link set dev %(ifname)s up" % {'ifname': ipcp.ifname}) def swap_in(self, experiment): @@ -153,7 +153,7 @@ class Testbed(mod.Testbed): ipcps = shim.ipcps command_list = [] command_list += ('sudo brctl addbr %(br)s\n' - 'sudo ip link set %(br)s up' + 'sudo ip link set dev %(br)s up' % {'br': shim.name} ).split('\n') for node in shim.members: # type:mod.Node @@ -163,7 +163,7 @@ class Testbed(mod.Testbed): tap_id = '%s.%02x' % (name, port_id) command_list += ('sudo ip tuntap add mode tap name %(tap)s\n' - 'sudo ip link set %(tap)s up\n' + 'sudo ip link set dev %(tap)s up\n' 'sudo brctl addif %(br)s %(tap)s' % {'tap': tap_id, 'br': shim.name} ).split('\n') @@ -361,7 +361,7 @@ class Testbed(mod.Testbed): commands = [] commands += ('sudo brctl delif %(br)s %(tap)s\n' - 'sudo ip link set %(tap)s down\n' + 'sudo ip link set dev %(tap)s down\n' 'sudo ip tuntap del mode tap name %(tap)s' % {'tap': tap, 'br': shim.name} ).split('\n') @@ -399,7 +399,7 @@ class Testbed(mod.Testbed): for shim in self.shims: commands = [] - commands += ('sudo ip link set %(br)s down\n' + commands += ('sudo ip link set dev %(br)s down\n' 'sudo brctl delbr %(br)s' % {'br': shim.name} ).split('\n') -- cgit v1.2.3