summaryrefslogtreecommitdiffstats
path: root/yardstick/vTC/apexlake/experimental_framework/packet_generators/dpdk_packet_generator.py
diff options
context:
space:
mode:
authoruser <user@TRAFCLASS-PACKET1.fuel.local>2016-01-13 12:36:50 -0500
committerVincenzo Riccobene <vincenzox.m.riccobene@intel.com>2016-01-14 09:12:00 +0000
commit174560a6b7d4a23763564fcfc87c2dd7e60aa241 (patch)
treefae381ec8b1dc4d278990f780c3b71997ee33364 /yardstick/vTC/apexlake/experimental_framework/packet_generators/dpdk_packet_generator.py
parent55f7c41c927320a3dac5a0907ebf66647aafd8a8 (diff)
Fix small bugs for running Apexlake on Montreal testbed
JIRA: YARDSTICK-219 Change-Id: I5f403e6c922f5e6ea790dc9cdb589cbc98e66ded Signed-off-by: user <user@TRAFCLASS-PACKET1.fuel.local>
Diffstat (limited to 'yardstick/vTC/apexlake/experimental_framework/packet_generators/dpdk_packet_generator.py')
-rw-r--r--yardstick/vTC/apexlake/experimental_framework/packet_generators/dpdk_packet_generator.py34
1 files changed, 21 insertions, 13 deletions
diff --git a/yardstick/vTC/apexlake/experimental_framework/packet_generators/dpdk_packet_generator.py b/yardstick/vTC/apexlake/experimental_framework/packet_generators/dpdk_packet_generator.py
index 347d51af3..6dc32b671 100644
--- a/yardstick/vTC/apexlake/experimental_framework/packet_generators/dpdk_packet_generator.py
+++ b/yardstick/vTC/apexlake/experimental_framework/packet_generators/dpdk_packet_generator.py
@@ -111,7 +111,7 @@ class DpdkPacketGenerator(base_packet_generator.BasePacketGenerator):
# Avoid to show the output of the packet generator
self.command_options.append('> /dev/null')
# Prepare the command to be invoked
- self.command = self.directory + self.program_name
+ self.command = 'sudo ' + self.directory + self.program_name
for opt in self.command_options:
self.command += (' ' + opt)
if pcap_file_0 and vlan_0:
@@ -212,22 +212,26 @@ class DpdkPacketGenerator(base_packet_generator.BasePacketGenerator):
# Initialize NIC 1
# bus_address_1 = dpdk_vars[conf_file.CFSP_DPDK_BUS_SLOT_NIC_1]
interface_1 = dpdk_vars[conf_file.CFSP_DPDK_NAME_IF_1]
- common.run_command('ifconfig ' + interface_1 + ' down')
- common.run_command(dpdk_vars[conf_file.CFSP_DPDK_DPDK_DIRECTORY] +
+ common.run_command('sudo ifconfig ' + interface_1 + ' down')
+ common.run_command('sudo ' +
+ dpdk_vars[conf_file.CFSP_DPDK_DPDK_DIRECTORY] +
'tools/dpdk_nic_bind.py --unbind ' +
dpdk_vars[conf_file.CFSP_DPDK_BUS_SLOT_NIC_1])
- common.run_command(dpdk_vars[conf_file.CFSP_DPDK_DPDK_DIRECTORY] +
+ common.run_command('sudo ' +
+ dpdk_vars[conf_file.CFSP_DPDK_DPDK_DIRECTORY] +
'tools/dpdk_nic_bind.py --bind=igb_uio ' +
dpdk_vars[conf_file.CFSP_DPDK_BUS_SLOT_NIC_1])
if dpdk_interfaces == 2:
# Initialize NIC 2
# bus_address_2 = dpdk_vars[conf_file.CFSP_DPDK_BUS_SLOT_NIC_2]
interface_2 = dpdk_vars[conf_file.CFSP_DPDK_NAME_IF_2]
- common.run_command('ifconfig ' + interface_2 + ' down')
- common.run_command(dpdk_vars[conf_file.CFSP_DPDK_DPDK_DIRECTORY] +
+ common.run_command('sudo ifconfig ' + interface_2 + ' down')
+ common.run_command('sudo ' +
+ dpdk_vars[conf_file.CFSP_DPDK_DPDK_DIRECTORY] +
'tools/dpdk_nic_bind.py --unbind ' +
dpdk_vars[conf_file.CFSP_DPDK_BUS_SLOT_NIC_2])
- common.run_command(dpdk_vars[conf_file.CFSP_DPDK_DPDK_DIRECTORY] +
+ common.run_command('sudo ' +
+ dpdk_vars[conf_file.CFSP_DPDK_DPDK_DIRECTORY] +
'tools/dpdk_nic_bind.py --bind=igb_uio ' +
dpdk_vars[conf_file.CFSP_DPDK_BUS_SLOT_NIC_2])
@@ -244,26 +248,30 @@ class DpdkPacketGenerator(base_packet_generator.BasePacketGenerator):
'generation usage. Please specify one or two '
'NICs')
# Initialize NIC 1
- common.run_command(dpdk_vars[conf_file.CFSP_DPDK_DPDK_DIRECTORY] +
+ common.run_command('sudo ' +
+ dpdk_vars[conf_file.CFSP_DPDK_DPDK_DIRECTORY] +
'tools/dpdk_nic_bind.py --unbind ' +
dpdk_vars[conf_file.CFSP_DPDK_BUS_SLOT_NIC_1])
time.sleep(5)
- common.run_command(dpdk_vars[conf_file.CFSP_DPDK_DPDK_DIRECTORY] +
+ common.run_command('sudo ' +
+ dpdk_vars[conf_file.CFSP_DPDK_DPDK_DIRECTORY] +
'tools/dpdk_nic_bind.py --bind=ixgbe ' +
dpdk_vars[conf_file.CFSP_DPDK_BUS_SLOT_NIC_1])
- common.run_command('ifconfig ' +
+ common.run_command('sudo ifconfig ' +
dpdk_vars[conf_file.CFSP_DPDK_NAME_IF_1] +
' up')
if dpdk_interfaces == 2:
# Initialize NIC 2
- common.run_command(dpdk_vars[conf_file.CFSP_DPDK_DPDK_DIRECTORY] +
+ common.run_command('sudo ' +
+ dpdk_vars[conf_file.CFSP_DPDK_DPDK_DIRECTORY] +
'tools/dpdk_nic_bind.py --unbind ' +
dpdk_vars[conf_file.CFSP_DPDK_BUS_SLOT_NIC_2])
time.sleep(5)
- common.run_command(dpdk_vars[conf_file.CFSP_DPDK_DPDK_DIRECTORY] +
+ common.run_command('sudo ' +
+ dpdk_vars[conf_file.CFSP_DPDK_DPDK_DIRECTORY] +
'tools/dpdk_nic_bind.py --bind=ixgbe ' +
dpdk_vars[conf_file.CFSP_DPDK_BUS_SLOT_NIC_2])
- common.run_command('ifconfig ' +
+ common.run_command('sudo ifconfig ' +
dpdk_vars[conf_file.CFSP_DPDK_NAME_IF_2] +
' up')