aboutsummaryrefslogtreecommitdiffstats
path: root/vswitches
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2016-05-20 13:24:15 +0100
committerMartin Klozik <martinx.klozik@intel.com>2016-05-23 10:55:13 +0100
commit2e259679732ed4e0464992b4cae04a4cf4d88000 (patch)
tree5447fe57512d63f2a4a42418cbfca23bd2c37ba7 /vswitches
parent0fe49968263ef8aa6094a014eb7dac8d80add311 (diff)
bugfix: Remove dependency on ifconfig
VSPERF uses ifconfig at several places to bring up a networking interface. However ifconfig has been deprecated by iproute2 package and it is not available in standard installation of many Linux distributions. Thus all calls of ifconfig have been replaced by call of 'ip' tool. Change-Id: I935eaf85b6082e4641d12cffea3e0882c634e5ea JIRA: VSPERF-299 Signed-off-by: Martin Klozik <martinx.klozik@intel.com> Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com> Reviewed-by: Al Morton <acmorton@att.com> Reviewed-by: Christian Trautman <ctrautma@redhat.com> Reviewed-by: Brian Castelli <brian.castelli@spirent.com>
Diffstat (limited to 'vswitches')
-rw-r--r--vswitches/ovs_vanilla.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/vswitches/ovs_vanilla.py b/vswitches/ovs_vanilla.py
index a6b720ae..89023a79 100644
--- a/vswitches/ovs_vanilla.py
+++ b/vswitches/ovs_vanilla.py
@@ -94,8 +94,10 @@ class OvsVanilla(IVSwitchOvs):
params = []
# For PVP only
- tasks.run_task(['sudo', 'ifconfig', port_name, '0'],
+ tasks.run_task(['sudo', 'ip', 'addr', 'flush', 'dev', port_name],
self._logger, 'Remove IP', False)
+ tasks.run_task(['sudo', 'ip', 'link', 'set', 'dev', port_name, 'up'],
+ self._logger, 'Bring up ' + port_name, False)
of_port = bridge.add_port(port_name, params)
self._current_id += 1
@@ -119,7 +121,9 @@ class OvsVanilla(IVSwitchOvs):
tap_name, 'mode', 'tap'],
self._logger, 'Creating tap device...', False)
- tasks.run_task(['sudo', 'ifconfig', tap_name, '0'],
+ tasks.run_task(['sudo', 'ip', 'addr', 'flush', 'dev', tap_name],
+ self._logger, 'Remove IP', False)
+ tasks.run_task(['sudo', 'ip', 'link', 'set', 'dev', tap_name, 'up'],
self._logger, 'Bring up ' + tap_name, False)
bridge = self._bridges[switch_name]