[asterisk-commits] mmichelson: testsuite/asterisk/trunk r3339 - in /asterisk/trunk/tests/channel...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 19 13:56:41 CDT 2012


Author: mmichelson
Date: Thu Jul 19 13:56:37 2012
New Revision: 3339

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3339
Log:
Fix SIP presence tests intolerance for specific test events.

The problem is that they were incrementing their notify count before checking
that the event was actually relevant. This resulted in unrelated test events
contributing to the count, resulting in a count that was too high.


Modified:
    asterisk/trunk/tests/channels/SIP/sip_custom_presence/multiple_state_change/run-test
    asterisk/trunk/tests/channels/SIP/sip_custom_presence/nominal_state_change/run-test
    asterisk/trunk/tests/channels/SIP/sip_custom_presence/non_digium_state_change/run-test
    asterisk/trunk/tests/channels/SIP/sip_custom_presence/resubscribe/run-test

Modified: asterisk/trunk/tests/channels/SIP/sip_custom_presence/multiple_state_change/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_custom_presence/multiple_state_change/run-test?view=diff&rev=3339&r1=3338&r2=3339
==============================================================================
--- asterisk/trunk/tests/channels/SIP/sip_custom_presence/multiple_state_change/run-test (original)
+++ asterisk/trunk/tests/channels/SIP/sip_custom_presence/multiple_state_change/run-test Thu Jul 19 13:56:37 2012
@@ -58,9 +58,10 @@
         # Second one is when the presence is changed to "available"
         # Third one is when the subscribption is terminated.
         # The final two  should have the same values present.
-        self.num_notifies = self.num_notifies + 1
         if event.get("state") != "DIGIUM_PRESENCE_SENT":
             return
+
+        self.num_notifies = self.num_notifies + 1
 
         if self.num_notifies > 3:
             logger.error("Too many NOTIFYs!")

Modified: asterisk/trunk/tests/channels/SIP/sip_custom_presence/nominal_state_change/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_custom_presence/nominal_state_change/run-test?view=diff&rev=3339&r1=3338&r2=3339
==============================================================================
--- asterisk/trunk/tests/channels/SIP/sip_custom_presence/nominal_state_change/run-test (original)
+++ asterisk/trunk/tests/channels/SIP/sip_custom_presence/nominal_state_change/run-test Thu Jul 19 13:56:37 2012
@@ -51,9 +51,10 @@
         # First one is when the presence is changed.
         # Second one is when the subscribption is terminated.
         # Both should have the same values present.
-        self.num_notifies = self.num_notifies + 1
         if event.get("state") != "DIGIUM_PRESENCE_SENT":
             return
+
+        self.num_notifies = self.num_notifies + 1
 
         if self.num_notifies > 2:
             logger.error("Too many NOTIFYs!")

Modified: asterisk/trunk/tests/channels/SIP/sip_custom_presence/non_digium_state_change/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_custom_presence/non_digium_state_change/run-test?view=diff&rev=3339&r1=3338&r2=3339
==============================================================================
--- asterisk/trunk/tests/channels/SIP/sip_custom_presence/non_digium_state_change/run-test (original)
+++ asterisk/trunk/tests/channels/SIP/sip_custom_presence/non_digium_state_change/run-test Thu Jul 19 13:56:37 2012
@@ -56,7 +56,7 @@
     def inspectPresence(self, ami, event):
         # For this test, we expect none of these events.
         # If we get any, we fail.
-        if event.get("state") == "DIGIUM_PRESENCE_SENT":
+        if event.get("state") != "DIGIUM_PRESENCE_SENT":
             return
 
         logger.error("Unexpected Digium Presence NOTIFY received")

Modified: asterisk/trunk/tests/channels/SIP/sip_custom_presence/resubscribe/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_custom_presence/resubscribe/run-test?view=diff&rev=3339&r1=3338&r2=3339
==============================================================================
--- asterisk/trunk/tests/channels/SIP/sip_custom_presence/resubscribe/run-test (original)
+++ asterisk/trunk/tests/channels/SIP/sip_custom_presence/resubscribe/run-test Thu Jul 19 13:56:37 2012
@@ -76,9 +76,10 @@
         # Third one is when the subscription is re-established.
         # Fourth one is when the subscription is re-terminated.
         # The first two and last two should have the same values present.
-        self.num_notifies = self.num_notifies + 1
         if event.get("state") != "DIGIUM_PRESENCE_SENT":
             return
+
+        self.num_notifies = self.num_notifies + 1
 
         if self.num_notifies > 4:
             logger.error("Too many NOTIFYs!")




More information about the asterisk-commits mailing list