summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Banszel <martinx.banszel@intel.com>2017-09-13 17:12:28 +0200
committerRoss Brattain <ross.b.brattain@intel.com>2017-09-18 01:28:28 -0700
commitfa3bb6c5a517564f06096cad24ff1055d9cd1ba0 (patch)
tree667d92c2031d33fb08c8ed8136d2d44585d174c6
parentfc472119a2054dae200d19c2788ada3cd19ad736 (diff)
Fix the offset bug for UDP dst port in the traffic profile
Also sends a new line to the VNF when waiting for prompt. Change-Id: Ib8641093974cd6713594aac9b418595ad5268e87 Signed-off-by: Martin Banszel <martinx.banszel@intel.com>
-rw-r--r--yardstick/network_services/traffic_profile/traffic_profile.py20
-rw-r--r--yardstick/network_services/vnf_generic/vnf/sample_vnf.py5
2 files changed, 14 insertions, 11 deletions
diff --git a/yardstick/network_services/traffic_profile/traffic_profile.py b/yardstick/network_services/traffic_profile/traffic_profile.py
index 894126c09..3feb92bb6 100644
--- a/yardstick/network_services/traffic_profile/traffic_profile.py
+++ b/yardstick/network_services/traffic_profile/traffic_profile.py
@@ -134,7 +134,7 @@ class TrexProfile(TrafficProfile):
seed=0x1235)
self.vm_flow_vars.append(stl_vm_flow_var)
stl_vm_wr_flow_var = STLVmWrFlowVar(fv_name='port_{}'.format(field),
- pkt_offset=self.udp_sport)
+ pkt_offset=self.udp[field])
self.vm_flow_vars.append(stl_vm_wr_flow_var)
return partial
@@ -156,8 +156,10 @@ class TrexProfile(TrafficProfile):
self.ip_packet = None
self.ip6_packet = None
self.udp_packet = None
- self.udp_dport = ''
- self.udp_sport = ''
+ self.udp = {
+ SRC_PORT: '',
+ DST_PORT: '',
+ }
self.qinq_packet = None
self.qinq = False
self.vm_flow_vars = []
@@ -266,8 +268,8 @@ class TrexProfile(TrafficProfile):
ip_params['proto'] = socket.getprotobyname(outer_l3v4['proto'])
if outer_l3v4['proto'] == 'tcp':
self.udp_packet = Pkt.TCP()
- self.udp_dport = 'TCP.dport'
- self.udp_sport = 'TCP.sport'
+ self.udp[DST_PORT] = 'TCP.dport'
+ self.udp[SRC_PORT] = 'TCP.sport'
tcp_params = {'flags': '', 'window': 0}
self._set_proto_fields(UDP, **tcp_params)
if 'ttl' in outer_l3v4:
@@ -289,8 +291,8 @@ class TrexProfile(TrafficProfile):
ip6_params['proto'] = outer_l3v6['proto']
if outer_l3v6['proto'] == 'tcp':
self.udp_packet = Pkt.TCP()
- self.udp_dport = 'TCP.dport'
- self.udp_sport = 'TCP.sport'
+ self.udp[DST_PORT] = 'TCP.dport'
+ self.udp[SRC_PORT] = 'TCP.sport'
tcp_params = {'flags': '', 'window': 0}
self._set_proto_fields(UDP, **tcp_params)
if 'ttl' in outer_l3v6:
@@ -364,8 +366,8 @@ class TrexProfile(TrafficProfile):
self.ip_packet = Pkt.IP()
self.ip6_packet = None
self.udp_packet = Pkt.UDP()
- self.udp_dport = 'UDP.dport'
- self.udp_sport = 'UDP.sport'
+ self.udp[DST_PORT] = 'UDP.dport'
+ self.udp[SRC_PORT] = 'UDP.sport'
self.qinq = False
self.vm_flow_vars = []
outer_l2 = packet_definition.get('outer_l2', None)
diff --git a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py
index 96e703060..c240d3778 100644
--- a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py
+++ b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py
@@ -786,8 +786,9 @@ class SampleVNF(GenericVNF):
LOG.info("Waiting for %s VNF to start.. ", self.APP_NAME)
time.sleep(1)
- # put newline to force new prompt?
- self.q_in.put("\r\n")
+ # Send ENTER to display a new prompt in case the prompt text was corrupted
+ # by other VNF output
+ self.q_in.put('\r\n')
def _build_run_kwargs(self):
self.run_kwargs = {