diff options
author | Oleksandr Naumets <oleksandrx.naumets@intel.com> | 2019-02-12 18:40:26 +0000 |
---|---|---|
committer | Oleksandr Naumets <oleksandrx.naumets@intel.com> | 2019-02-12 18:40:26 +0000 |
commit | 0cce2819d798b5365d15dc174f6b4e6d06c18fbf (patch) | |
tree | bbcca77cef8b8a96bafa07d6a91def91dbe7111c /yardstick/network_services/traffic_profile | |
parent | 0dbd3bb46b6d2aaa71c6bf2be046c3c0f877466b (diff) |
Extend TRex RFC2544 test case collected stats
Added new fields into Yardstick NSB TRex RFC2544 test case results:
- Iteration
- PktSize
- Status
JIRA: YARDSTICK-1592
Change-Id: Id746b537a0ef55a891653719cc1db29ef7e994fc
Signed-off-by: Oleksandr Naumets <oleksandrx.naumets@intel.com>
Diffstat (limited to 'yardstick/network_services/traffic_profile')
3 files changed, 29 insertions, 14 deletions
diff --git a/yardstick/network_services/traffic_profile/ixia_rfc2544.py b/yardstick/network_services/traffic_profile/ixia_rfc2544.py index aded2d347..5a9c06aba 100644 --- a/yardstick/network_services/traffic_profile/ixia_rfc2544.py +++ b/yardstick/network_services/traffic_profile/ixia_rfc2544.py @@ -35,6 +35,7 @@ class IXIARFC2544Profile(trex_traffic_profile.TrexProfile): super(IXIARFC2544Profile, self).__init__(yaml_data) self.rate = self.config.frame_rate self.rate_unit = self.config.rate_unit + self.iteration = 0 self.full_profile = {} def _get_ip_and_mask(self, ip_range): @@ -170,19 +171,6 @@ class IXIARFC2544Profile(trex_traffic_profile.TrexProfile): self.ports = [port for port in port_generator()] - def _get_framesize(self): - framesizes = [] - traffic = self._get_ixia_traffic_profile(self.full_profile) - for v in traffic.values(): - framesize = v['outer_l2']['framesize'] - for size in (s for s, w in framesize.items() if int(w) != 0): - framesizes.append(size) - if len(set(framesizes)) == 0: - return '' - elif len(set(framesizes)) == 1: - return framesizes[0] - return 'IMIX' - def execute_traffic(self, traffic_generator, ixia_obj=None, mac=None): mac = {} if mac is None else mac first_run = self.first_run @@ -194,6 +182,7 @@ class IXIARFC2544Profile(trex_traffic_profile.TrexProfile): else: self.rate = self._get_next_rate() + self.iteration = traffic_generator.rfc_helper.iteration.value traffic = self._get_ixia_traffic_profile(self.full_profile, mac) self._ixia_traffic_generate(traffic, ixia_obj, traffic_generator) return first_run @@ -278,6 +267,7 @@ class IXIARFC2544Profile(trex_traffic_profile.TrexProfile): samples['latency_ns_max'] = latency_ns_max samples['Rate'] = last_rate samples['PktSize'] = self._get_framesize() + samples['Iteration'] = self.iteration return completed, samples @@ -401,6 +391,7 @@ class IXIARFC2544PppoeScenarioProfile(IXIARFC2544Profile): samples['priority'] = priority_stats samples['Rate'] = last_rate samples['PktSize'] = self._get_framesize() + samples['Iteration'] = self.iteration samples.update(summary_subs_stats) if tc_rfc2544_opts: diff --git a/yardstick/network_services/traffic_profile/rfc2544.py b/yardstick/network_services/traffic_profile/rfc2544.py index b838bf814..4225f31b7 100644 --- a/yardstick/network_services/traffic_profile/rfc2544.py +++ b/yardstick/network_services/traffic_profile/rfc2544.py @@ -72,10 +72,13 @@ class RFC2544Profile(trex_traffic_profile.TrexProfile): """TRex RFC2544 traffic profile""" TOLERANCE_LIMIT = 0.01 + STATUS_SUCCESS = "Success" + STATUS_FAIL = "Failure" def __init__(self, traffic_generator): super(RFC2544Profile, self).__init__(traffic_generator) self.generator = None + self.iteration = 0 self.rate = self.config.frame_rate self.max_rate = self.config.frame_rate self.min_rate = 0 @@ -126,6 +129,7 @@ class RFC2544Profile(trex_traffic_profile.TrexProfile): self.generator.client.start(ports=ports, duration=self.config.duration, force=True) + self.iteration = self.generator.rfc2544_helper.iteration.value return ports, port_pg_id def _create_profile(self, profile_data, rate, port_pg_id, enable_latency): @@ -274,6 +278,7 @@ class RFC2544Profile(trex_traffic_profile.TrexProfile): correlated_traffic, resolution): """Calculate the drop percentage and run the traffic""" completed = False + status = self.STATUS_FAIL out_pkt_end = sum(port['out_packets'] for port in samples[-1].values()) in_pkt_end = sum(port['in_packets'] for port in samples[-1].values()) out_pkt_ini = sum(port['out_packets'] for port in samples[0].values()) @@ -304,6 +309,7 @@ class RFC2544Profile(trex_traffic_profile.TrexProfile): elif drop_percent < tol_low: self.min_rate = self.rate else: + status = self.STATUS_SUCCESS completed = True last_rate = self.rate @@ -332,6 +338,9 @@ class RFC2544Profile(trex_traffic_profile.TrexProfile): 'Throughput': throughput, 'DropPercentage': self.drop_percent_max, 'Rate': last_rate, - 'Latency': latency + 'Latency': latency, + 'PktSize': self._get_framesize(), + 'Iteration': self.iteration, + 'Status': status } return completed, output diff --git a/yardstick/network_services/traffic_profile/trex_traffic_profile.py b/yardstick/network_services/traffic_profile/trex_traffic_profile.py index 2d2c2d8b6..cf538d488 100644 --- a/yardstick/network_services/traffic_profile/trex_traffic_profile.py +++ b/yardstick/network_services/traffic_profile/trex_traffic_profile.py @@ -344,6 +344,21 @@ class TrexProfile(base.TrafficProfile): rate = round(float(self.max_rate + self.min_rate)/2.0, self.RATE_ROUND) return rate + def _get_framesize(self): + framesizes = [] + for traffickey, value in self.params.items(): + if not traffickey.startswith((self.UPLINK, self.DOWNLINK)): + continue + for _, data in value.items(): + framesize = data['outer_l2']['framesize'] + for size in (s for s, w in framesize.items() if int(w) != 0): + framesizes.append(size) + if len(set(framesizes)) == 0: + return '' + elif len(set(framesizes)) == 1: + return framesizes[0] + return 'IMIX' + @classmethod def _count_ip(cls, start_ip, end_ip): start = ipaddress.ip_address(six.u(start_ip)) |