[asterisk-commits] mjordan: testsuite/asterisk/trunk r5872 - in /asterisk/trunk/tests/rest_api: ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Nov 1 20:40:50 CDT 2014


Author: mjordan
Date: Sat Nov  1 20:40:43 2014
New Revision: 5872

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=5872
Log:
rest_api/continue|bridges/move: Fix stability issues

These tests fail more rarely, but they still do! Again, trigger the end of
the test when the last expected event is received.

Modified:
    asterisk/trunk/tests/rest_api/bridges/move/bridge_move.py
    asterisk/trunk/tests/rest_api/bridges/move/test-config.yaml
    asterisk/trunk/tests/rest_api/continue/rest_continue.py
    asterisk/trunk/tests/rest_api/continue/test-config.yaml

Modified: asterisk/trunk/tests/rest_api/bridges/move/bridge_move.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/move/bridge_move.py?view=diff&rev=5872&r1=5871&r2=5872
==============================================================================
--- asterisk/trunk/tests/rest_api/bridges/move/bridge_move.py (original)
+++ asterisk/trunk/tests/rest_api/bridges/move/bridge_move.py Sat Nov  1 20:40:43 2014
@@ -53,3 +53,8 @@
     assert TEST.channel_id == channel_id
     assert TEST.bridge1_id == bridge_id or TEST.bridge2_id == bridge_id
     return True
+
+
+def on_end(ari, event, test_object):
+    test_object.stop_reactor()
+    return True

Modified: asterisk/trunk/tests/rest_api/bridges/move/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/move/test-config.yaml?view=diff&rev=5872&r1=5871&r2=5872
==============================================================================
--- asterisk/trunk/tests/rest_api/bridges/move/test-config.yaml (original)
+++ asterisk/trunk/tests/rest_api/bridges/move/test-config.yaml Sat Nov  1 20:40:43 2014
@@ -11,6 +11,9 @@
     modules:
         -   config-section: ari-config
             typename: ari.WebSocketEventModule
+
+test-object-config:
+    stop-on-end: False
 
 ari-config:
     apps: testsuite
@@ -45,6 +48,9 @@
                     type: StasisEnd
                     application: testsuite
             count: 1
+            callback:
+                module: bridge_move
+                method: on_end
 
 properties:
     minversion: '12.0.0'

Modified: asterisk/trunk/tests/rest_api/continue/rest_continue.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/continue/rest_continue.py?view=diff&rev=5872&r1=5871&r2=5872
==============================================================================
--- asterisk/trunk/tests/rest_api/continue/rest_continue.py (original)
+++ asterisk/trunk/tests/rest_api/continue/rest_continue.py Sat Nov  1 20:40:43 2014
@@ -12,6 +12,8 @@
 
 id = None
 
+STASIS_END_EVENTS = 0
+
 
 def on_start(ari, event, test_object):
     logger.debug("on_start(%r)" % event)
@@ -23,7 +25,13 @@
 
 def on_end(ari, event, test_object):
     global id
+    global STASIS_END_EVENTS
+
     logger.debug("on_end(%r)" % event)
+    STASIS_END_EVENTS += 1
+    if (STASIS_END_EVENTS == 2):
+        test_object.stop_reactor()
+
     return id == event['channel']['id']
 
 

Modified: asterisk/trunk/tests/rest_api/continue/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/continue/test-config.yaml?view=diff&rev=5872&r1=5871&r2=5872
==============================================================================
--- asterisk/trunk/tests/rest_api/continue/test-config.yaml (original)
+++ asterisk/trunk/tests/rest_api/continue/test-config.yaml Sat Nov  1 20:40:43 2014
@@ -14,7 +14,7 @@
             typename: ari.WebSocketEventModule
 
 test-object-config:
-
+    stop-on-end: False
 
 ari-config:
     events:




More information about the asterisk-commits mailing list