diff options
author | Martin Klozik <martinx.klozik@intel.com> | 2017-08-14 14:36:42 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-08-14 14:36:42 +0000 |
commit | a860c7ba56ee9094e6f4607220a4baecbfc4e6e3 (patch) | |
tree | c9cfbc5647ea1ba15184ed88299e87b53f431da0 /tools | |
parent | 2a4d03a1c5634c7d8b54bd9bda6c14b7a683de6e (diff) | |
parent | 4cd7de5b586b7ab8dc1e7beea1dc8bcf91d24fb8 (diff) |
Merge "xena2544_verify_fix: Fix Xena verify options"
Diffstat (limited to 'tools')
-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, |