self._packet_sizes = None
packet_sizes_cli = get_test_param('pkt_sizes')
if packet_sizes_cli:
- self._packet_sizes = [int(x.strip()) for x in packet_sizes_cli.split(',')]
+ self._packet_sizes = [int(x.strip())
+ for x in packet_sizes_cli.split(',')]
else:
self._packet_sizes = settings.getValue('TRAFFICGEN_PKT_SIZES')
:param result_dict: Dictionary containing results from trafficgen
:param packet_size: Packet size value.
- :returns: dictionary of results with addictional entries.
+ :returns: dictionary of results with additional entries.
"""
ret_value = result_dict
- #TODO Old TOIT controller had knowledge about scenario beeing
- #executed, should new controller also fill Configuration & ID,
+ # TODO Old TOIT controller had knowledge about scenario beeing
+ # executed, should new controller also fill Configuration & ID,
# or this should be passed to TestCase?
ret_value[ResultsConstants.TYPE] = 'rfc2544'
ret_value[ResultsConstants.PACKET_SIZE] = str(packet_size)
if traffic['traffic_type'] == 'back2back':
result = self._traffic_gen_class.send_rfc2544_back2back(
- traffic, trials=self._trials,
- duration=self._duration)
+ traffic, trials=self._trials, duration=self._duration)
elif traffic['traffic_type'] == 'continuous':
result = self._traffic_gen_class.send_cont_traffic(
- traffic, time=int(get_test_param('rfc2544_duration', 30)))
+ traffic, duration=self._duration)
else:
result = self._traffic_gen_class.send_rfc2544_throughput(
- traffic, trials=self._trials,
- duration=self._duration)
+ traffic, trials=self._trials, duration=self._duration)
result = TrafficControllerRFC2544._append_results(result,
packet_size)
logging.info(" Key: " + str(key) +
", Value: " + str(value))
-
def get_results(self):
"""IResult interface implementation.
"""
return self._results
+
+ def validate_send_traffic(self, result, traffic):
+ """Verify that send traffic has succeeded
+ """
+ if len(self._results):
+ if 'b2b_frames' in self._results[-1]:
+ return float(self._results[-1]['b2b_frames']) > 0
+ elif 'throughput_rx_fps' in self._results[-1]:
+ return float(self._results[-1]['throughput_rx_fps']) > 0
+ else:
+ return True
+ else:
+ return False