diff options
author | Christian Trautman <ctrautma@redhat.com> | 2017-08-08 14:09:53 -0400 |
---|---|---|
committer | Christian Trautman <ctrautma@redhat.com> | 2017-08-08 14:39:27 -0400 |
commit | 4cd7de5b586b7ab8dc1e7beea1dc8bcf91d24fb8 (patch) | |
tree | fd4000a8a34e24162cc3a82125125473fd93a5ab | |
parent | 73025baf2e393c61c59957e8714d2ddd54d25e51 (diff) |
xena2544_verify_fix: Fix Xena verify options
Fixes issue when running multiple packets sizes and using the Xena
verify option. Original values are restored to settings for each
new packet size or test case.
Also fixes a minor issue where if the test failed, the verify would
run regardless.
JIRA: VSPERF-515
Change-Id: I6b6ce5160b66e7ed4a3847711c4f05529ae8ca54
Signed-off-by: Christian Trautman <ctrautma@redhat.com>
-rwxr-xr-x | tools/pkt_gen/xena/xena.py | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/tools/pkt_gen/xena/xena.py b/tools/pkt_gen/xena/xena.py index b72a59dd..19b44f0b 100755 --- a/tools/pkt_gen/xena/xena.py +++ b/tools/pkt_gen/xena/xena.py @@ -274,10 +274,11 @@ class Xena(ITrafficGenerator): enable the pairs topology :return: None """ + # set duplex mode, this code is valid, pylint complaining with a + # warning that many have complained about online. + # pylint: disable=redefined-variable-type + try: - # set duplex mode, this code is valid, pylint complaining with a - # warning that many have complained about online. - # pylint: disable=redefined-variable-type if self._params['traffic']['bidir'] == "True": j_file = XenaJSONMesh() elif self._params['traffic']['bidir'] == "False": @@ -635,12 +636,25 @@ class Xena(ITrafficGenerator): root = ET.parse(os.path.join(_CURR_DIR, "xena2544-report.xml")).getroot() if settings.getValue('TRAFFICGEN_XENA_RFC2544_VERIFY'): + # make sure we have a pass before even trying the verify. No need + # to run verify on a failed iteration. + root = ET.parse( + os.path.join(_CURR_DIR, "xena2544-report.xml")).getroot() + if root[0][1][0].get('TestState') == "FAIL": + self._logger.info('Test failed, skipping verify') + return Xena._create_throughput_result(root) + # record the previous settings so we can revert to them if needed to # run the binary search again if the verify fails. old_tests = tests old_duration = self._duration old_min = settings.getValue('TRAFFICGEN_XENA_2544_TPUT_MIN_VALUE') + # record the original values to restore after execution + orig_min = settings.getValue('TRAFFICGEN_XENA_2544_TPUT_MIN_VALUE') + orig_max = settings.getValue('TRAFFICGEN_XENA_2544_TPUT_MAX_VALUE') + orig_init = settings.getValue('TRAFFICGEN_XENA_2544_TPUT_INIT_VALUE') + for attempt in range( 1, settings.getValue( 'TRAFFICGEN_XENA_RFC2544_MAXIMUM_VERIFY_ATTEMPTS')+1): @@ -708,6 +722,11 @@ class Xena(ITrafficGenerator): self._logger.error( 'Maximum number of verify attempts reached. Reporting last result') + #restore original values + settings.setValue('TRAFFICGEN_XENA_2544_TPUT_MIN_VALUE', orig_min) + settings.setValue('TRAFFICGEN_XENA_2544_TPUT_MAX_VALUE', orig_max) + settings.setValue('TRAFFICGEN_XENA_2544_TPUT_INIT_VALUE', orig_init) + return Xena._create_throughput_result(root) def start_rfc2544_throughput(self, traffic=None, tests=1, duration=20, |