diff options
author | mortenhillbom <mhillbom@cisco.com> | 2018-03-20 14:05:48 -0700 |
---|---|---|
committer | mortenhillbom <mhillbom@cisco.com> | 2018-03-20 14:05:48 -0700 |
commit | 5cd74e4476272970d328467e37ffa164757300d7 (patch) | |
tree | d8347edf565c24c9076bf06f36f2ad15c2bad845 | |
parent | 8450089d5aa09e1c4de4b5701f5210b8f8f7dfdc (diff) |
NFVBENCH-73 vlan_tagging parameter cause exception
Change-Id: Ia2f091dfd05004806637e3e15076e04aa31bd433
Signed-off-by: mortenhillbom <mhillbom@cisco.com>
-rw-r--r-- | nfvbench/traffic_gen/trex.py | 2 | ||||
-rw-r--r-- | nfvbench/traffic_server.py | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/nfvbench/traffic_gen/trex.py b/nfvbench/traffic_gen/trex.py index 1e7c133..68ab95a 100644 --- a/nfvbench/traffic_gen/trex.py +++ b/nfvbench/traffic_gen/trex.py @@ -321,7 +321,7 @@ class TRex(AbstractTrafficGenerator): def __start_server(self): server = TRexTrafficServer() - server.run_server(self.config.generator_config) + server.run_server(self.config.generator_config, self.config.vlan_tagging) def resolve_arp(self): self.client.set_service_mode(ports=self.port_handle) diff --git a/nfvbench/traffic_server.py b/nfvbench/traffic_server.py index 007998e..dcb83fb 100644 --- a/nfvbench/traffic_server.py +++ b/nfvbench/traffic_server.py @@ -34,7 +34,7 @@ class TRexTrafficServer(TrafficServer): assert len(contents) == 1 self.trex_dir = os.path.join(trex_base_dir, contents[0]) - def run_server(self, traffic_profile, filename='/etc/trex_cfg.yaml'): + def run_server(self, traffic_profile, vlan_tagging, filename='/etc/trex_cfg.yaml'): """ Runs TRex server for specified traffic profile. @@ -44,9 +44,11 @@ class TRexTrafficServer(TrafficServer): 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 "" subprocess.Popen(['nohup', '/bin/bash', '-c', './t-rex-64 -i -c {} --iom 0 --no-scapy-server --close-at-end {} ' - '--vlan --cfg {} &> /tmp/trex.log & disown'.format(cores, sw_mode, cfg)], + '{} --cfg {} &> /tmp/trex.log & disown'.format(cores, sw_mode, + vlan_opt, cfg)], cwd=self.trex_dir) LOG.info('TRex server is running...') |