[Asterisk-code-review] sipp.py - fail the test case if a scenario files (testsuite[13])

Kevin Harwell asteriskteam at digium.com
Thu Nov 8 14:23:23 CST 2018


Kevin Harwell has uploaded this change for review. ( https://gerrit.asterisk.org/10603


Change subject: sipp.py - fail the test case if a scenario files
......................................................................

sipp.py - fail the test case if a scenario files

The result passed to _handle_scenario_finished would always report success
(unless maybe an exception was thrown or something). This would set the test
case itself to passed even if a scenario failed. The SIPpSequence or Scenario
objects would do post checks so the test still failed appropriately. However,
in the log files you'd see messages that the scenario passed and then a bit
later that it failed. Moreso this could cause timing issues if for some reason
you wanted to force a sigabrt in Asterisk on test failure. For instance the
test would initially be marked as passed and start shutting down properly
instead of a forced stop.

This patch makes it so when a scenario finishes it checks the scenario's result
and uses that to set the initial test case result.

Change-Id: I1cf055cb3125bd5d8f1ad8b353961a4e6577b24d
---
M lib/python/asterisk/sipp.py
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/03/10603/1

diff --git a/lib/python/asterisk/sipp.py b/lib/python/asterisk/sipp.py
index 0a28e05..200cac6 100644
--- a/lib/python/asterisk/sipp.py
+++ b/lib/python/asterisk/sipp.py
@@ -194,7 +194,7 @@
     def _handle_scenario_finished(self, result):
         """Handle whether or not a scenario finished successfully"""
         for (success, scenario) in result:
-            if (success):
+            if (success and scenario.passed):
                 LOGGER.info("Scenario %s passed" % (scenario.name))
                 self.set_passed(True)
             else:

-- 
To view, visit https://gerrit.asterisk.org/10603
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1cf055cb3125bd5d8f1ad8b353961a4e6577b24d
Gerrit-Change-Number: 10603
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181108/ccd0410a/attachment.html>


More information about the asterisk-code-review mailing list