[asterisk-commits] mnicholson: testsuite/asterisk/trunk r1827 - in /asterisk/trunk/tests/pbx: ./...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 5 16:25:34 CDT 2011


Author: mnicholson
Date: Fri Aug  5 16:25:31 2011
New Revision: 1827

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=1827
Log:
added disbaled merge_contexts test. The test does not pass because of a bug in asterisk (ASTERISK-18230).

Added:
    asterisk/trunk/tests/pbx/merge_contexts/
    asterisk/trunk/tests/pbx/merge_contexts/configs/
    asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/
    asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/manager.general.conf.inc   (with props)
    asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/sip.conf   (with props)
    asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/
    asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.ael   (with props)
    asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.conf   (with props)
    asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.lua   (with props)
    asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/manager.general.conf.inc   (with props)
    asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/sip.conf   (with props)
    asterisk/trunk/tests/pbx/merge_contexts/run-test   (with props)
    asterisk/trunk/tests/pbx/merge_contexts/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/pbx/tests.yaml

Added: asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/extensions.conf?view=auto&rev=1827
==============================================================================
--- asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/extensions.conf Fri Aug  5 16:25:31 2011
@@ -1,0 +1,4 @@
+[test]
+exten => 1234,1,noop
+exten => 1234,n,Wait(60)
+

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/manager.general.conf.inc
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/manager.general.conf.inc?view=auto&rev=1827
==============================================================================
--- asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/manager.general.conf.inc (added)
+++ asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/manager.general.conf.inc Fri Aug  5 16:25:31 2011
@@ -1,0 +1,2 @@
+enabled = yes
+bindaddr = 127.0.0.1

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/sip.conf?view=auto&rev=1827
==============================================================================
--- asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/sip.conf Fri Aug  5 16:25:31 2011
@@ -1,0 +1,13 @@
+[general]
+bindaddr = 127.0.0.1
+
+[ast2]
+type = friend
+fromuser = ast1
+context = test
+host = 127.0.0.2
+disallow = all
+allow = ulaw
+qualify = no
+insecure = invite
+

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.ael
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.ael?view=auto&rev=1827
==============================================================================
--- asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.ael (added)
+++ asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.ael Fri Aug  5 16:25:31 2011
@@ -1,0 +1,7 @@
+context test {
+	12 => {
+		Answer();
+		UserEvent(TestResult,result: pass);
+	};
+};
+

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.ael
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.ael
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.ael
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.conf?view=auto&rev=1827
==============================================================================
--- asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.conf (added)
+++ asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.conf Fri Aug  5 16:25:31 2011
@@ -1,0 +1,4 @@
+[test]
+exten => 123,1,noop
+exten => 123,n,Answer()
+exten => 123,n,UserEvent(TestResult,result: pass)

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.lua
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.lua?view=auto&rev=1827
==============================================================================
--- asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.lua (added)
+++ asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.lua Fri Aug  5 16:25:31 2011
@@ -1,0 +1,10 @@
+-- vim: sw=4 et:
+
+extensions = {}
+extensions.test = {}
+
+extensions.test[1234] = function(c, e)
+    app.answer()
+    app.userevent("TestResult", "result: pass")
+end
+

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/extensions.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/manager.general.conf.inc
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/manager.general.conf.inc?view=auto&rev=1827
==============================================================================
--- asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/manager.general.conf.inc (added)
+++ asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/manager.general.conf.inc Fri Aug  5 16:25:31 2011
@@ -1,0 +1,2 @@
+enabled = yes
+bindaddr = 127.0.0.2

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/sip.conf?view=auto&rev=1827
==============================================================================
--- asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/sip.conf (added)
+++ asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/sip.conf Fri Aug  5 16:25:31 2011
@@ -1,0 +1,13 @@
+[general]
+bindaddr = 127.0.0.2
+
+[ast1]
+type = friend
+fromuser = ast2
+context = test
+host = 127.0.0.1
+disallow = all
+allow = ulaw
+qualify = no
+insecure = invite
+

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/pbx/merge_contexts/configs/ast2/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/pbx/merge_contexts/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/pbx/merge_contexts/run-test?view=auto&rev=1827
==============================================================================
--- asterisk/trunk/tests/pbx/merge_contexts/run-test (added)
+++ asterisk/trunk/tests/pbx/merge_contexts/run-test Fri Aug  5 16:25:31 2011
@@ -1,0 +1,99 @@
+#!/usr/bin/env python
+# vim: sw=3 et:
+'''
+Copyright (C) 2011, Digium, Inc.
+Matthew Nicholson <mnicholson at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import sys
+import os
+import re
+import shutil
+
+from twisted.internet import reactor
+
+sys.path.append("lib/python")
+from asterisk.asterisk import Asterisk
+from asterisk.TestCase import TestCase
+
+class PbxLuaTest(TestCase):
+   pass_count = 0
+   event_count = 0
+
+   def __init__(self, argv):
+      TestCase.__init__(self, argv)
+      self.create_asterisk(2)
+
+   def ami_connect(self, ami):
+      TestCase.ami_connect(self, ami)
+
+      if ami.id == 0:
+
+         print "sending a calls from ast1 to ast2"
+
+         def handle_failure(reason):
+            print "error sending originate:"
+            print reason.getTraceback()
+            self.stop_reactor()
+
+            return reason
+
+         # pbx_ael
+         df = ami.originate("sip/ast2/12", "test", "1234", 1)
+         df.addErrback(handle_failure)
+
+         # pbx_config
+         df = ami.originate("sip/ast2/123", "test", "1234", 1)
+         df.addErrback(handle_failure)
+         
+         # pbx_lua
+         df = ami.originate("sip/ast2/1234", "test", "1234", 1)
+         df.addErrback(handle_failure)
+      else:
+         ami.registerEvent('UserEvent', self.test_result)
+
+   def test_result(self, ami, event):
+      if event['userevent'] != 'TestResult':
+         return
+
+      self.event_count += 1
+
+      if event['result'] == "pass":
+         print "success"
+         self.pass_count += 1
+      else:
+         print "error:"
+         print "result: %s" % (event['result'],)
+         print "error: %s" % (event['error'],)
+
+      self.are_we_there_yet()
+
+   def are_we_there_yet(self):
+      if event_count == 3:
+         if pass_count == 3:
+            self.passed = True
+
+         self.stop_reactor()
+
+   def run(self):
+      TestCase.run(self)
+      self.create_ami_factory(2)
+
+
+def main(argv = sys.argv):
+   test = PbxLuaTest(argv)
+   test.start_asterisk()
+   reactor.run()
+   test.stop_asterisk()
+
+   if not test.passed:
+      return 1
+
+   return 0
+
+if __name__ == "__main__":
+   sys.exit(main() or 0)
+

Propchange: asterisk/trunk/tests/pbx/merge_contexts/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/pbx/merge_contexts/run-test
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/pbx/merge_contexts/run-test
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/pbx/merge_contexts/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/pbx/merge_contexts/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/pbx/merge_contexts/test-config.yaml?view=auto&rev=1827
==============================================================================
--- asterisk/trunk/tests/pbx/merge_contexts/test-config.yaml (added)
+++ asterisk/trunk/tests/pbx/merge_contexts/test-config.yaml Fri Aug  5 16:25:31 2011
@@ -1,0 +1,13 @@
+testinfo:
+    summary: 'Test mixing pbx_ael, pbx_config, and pbx_lua extensions in the same context.'
+    description: |
+        This test verifies pbx_lua, pbx_ael, and pbx_config can be used in the same context.
+
+    issues:
+        - jira : ASTERISK-18230
+
+properties:
+    minversion: '1.8'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'

Propchange: asterisk/trunk/tests/pbx/merge_contexts/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/pbx/merge_contexts/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/pbx/merge_contexts/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: asterisk/trunk/tests/pbx/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/pbx/tests.yaml?view=diff&rev=1827&r1=1826&r2=1827
==============================================================================
--- asterisk/trunk/tests/pbx/tests.yaml (original)
+++ asterisk/trunk/tests/pbx/tests.yaml Fri Aug  5 16:25:31 2011
@@ -3,5 +3,7 @@
     - test: 'call-files'
     - test: 'pbx_lua_goto'
     - test: 'pbx_lua_background'
+    # this test currently doesn't work due to a bug (ASTERISK-18230)
+    #- test: 'merge_contexts'
     # Temporarily disabled while failures are debugged
     #- test: 'call-files2'




More information about the asterisk-commits mailing list