[Asterisk-code-review] sipp.py - fail the test case if the scenario fails (testsuite[16])

Jenkins2 asteriskteam at digium.com
Mon Nov 12 05:31:15 CST 2018


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/10604 )

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

sipp.py - fail the test case if the scenario fails

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(-)

Approvals:
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Verified
  Jenkins2: Approved for Submit



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/10604
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: 16
Gerrit-MessageType: merged
Gerrit-Change-Id: I1cf055cb3125bd5d8f1ad8b353961a4e6577b24d
Gerrit-Change-Number: 10604
Gerrit-PatchSet: 2
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181112/bae4f252/attachment.html>


More information about the asterisk-code-review mailing list