summaryrefslogtreecommitdiffstats
path: root/nfvbench/traffic_server.py
diff options
context:
space:
mode:
authorahothan <ahothan@cisco.com>2018-10-07 15:55:25 -0700
committerahothan <ahothan@cisco.com>2018-10-08 10:44:31 -0700
commit391dcf76fefb747888a3411ae3b8df7b1ad26685 (patch)
treeb823ae8a5f0e837bb285f53acb1502e0aad1bdf0 /nfvbench/traffic_server.py
parent99260f95219301bb5c0b58921e793bcad6ec4990 (diff)
2.0 beta NFVBENCH-91 Allow multi-chaining with separate edge networks
Includes complete refactoring of code Beta for NFVbench 2.0 Change-Id: I2997f0fb7722d5ac626cd11a68692ae458c7676e Signed-off-by: ahothan <ahothan@cisco.com>
Diffstat (limited to 'nfvbench/traffic_server.py')
-rw-r--r--nfvbench/traffic_server.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/nfvbench/traffic_server.py b/nfvbench/traffic_server.py
index dcb83fb..2239ec3 100644
--- a/nfvbench/traffic_server.py
+++ b/nfvbench/traffic_server.py
@@ -34,17 +34,17 @@ class TRexTrafficServer(TrafficServer):
assert len(contents) == 1
self.trex_dir = os.path.join(trex_base_dir, contents[0])
- def run_server(self, traffic_profile, vlan_tagging, filename='/etc/trex_cfg.yaml'):
+ def run_server(self, generator_config, filename='/etc/trex_cfg.yaml'):
"""
Runs TRex server for specified traffic profile.
:param traffic_profile: traffic profile object based on config file
:param filename: path where to save TRex config file
"""
- cfg = self.__save_config(traffic_profile, filename)
- cores = traffic_profile.cores
- sw_mode = "--software" if traffic_profile.generator_config.software_mode else ""
- vlan_opt = "--vlan" if vlan_tagging else ""
+ cfg = self.__save_config(generator_config, filename)
+ cores = generator_config.cores
+ sw_mode = "--software" if generator_config.software_mode else ""
+ vlan_opt = "--vlan" if generator_config.vlan_tagging else ""
subprocess.Popen(['nohup', '/bin/bash', '-c',
'./t-rex-64 -i -c {} --iom 0 --no-scapy-server --close-at-end {} '
'{} --cfg {} &> /tmp/trex.log & disown'.format(cores, sw_mode,
@@ -52,10 +52,10 @@ class TRexTrafficServer(TrafficServer):
cwd=self.trex_dir)
LOG.info('TRex server is running...')
- def __save_config(self, traffic_profile, filename):
- ifs = ",".join([repr(pci) for pci in traffic_profile.pcis])
+ def __save_config(self, generator_config, filename):
+ ifs = ",".join([repr(pci) for pci in generator_config.pcis])
- result = """# Config generated by NFVBench tool
+ result = """# Config generated by NFVbench
- port_limit : 2
version : 2
interfaces : [{ifs}]""".format(ifs=ifs)