[asterisk-commits] pabelanger: testsuite/asterisk/trunk r1860 - in /asterisk/trunk: ./ tests/pbx...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 16 19:52:18 CDT 2011


Author: pabelanger
Date: Tue Aug 16 19:52:14 2011
New Revision: 1860

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=1860
Log:
Add the ability to define an asterisk module dependency

Tests now have the ability to define which asterisk modules are required
from test-config.yaml. EG:

properties:
    minversion: '1.8'
    dependencies:
        - asterisk : 'pbx_lua'

Review: https://reviewboard.asterisk.org/r/1366/

Modified:
    asterisk/trunk/runtests.py
    asterisk/trunk/tests/pbx/pbx_lua_background/test-config.yaml
    asterisk/trunk/tests/pbx/pbx_lua_goto/test-config.yaml

Modified: asterisk/trunk/runtests.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/runtests.py?view=diff&rev=1860&r1=1859&r2=1860
==============================================================================
--- asterisk/trunk/runtests.py (original)
+++ asterisk/trunk/runtests.py Tue Aug 16 19:52:14 2011
@@ -22,7 +22,6 @@
 from asterisk.asterisk import Asterisk
 from asterisk import utils
 from sipp.version import SIPpVersion
-
 
 TESTS_CONFIG = "tests.yaml"
 TEST_RESULTS = "asterisk-test-suite-report.xml"
@@ -70,6 +69,10 @@
                     found = True
             if not found:
                 print "Unknown custom dependency - '%s'" % self.name
+        elif "asterisk" in dep:
+            self.name = dep["asterisk"]
+            self.met = self.__find_asterisk_module(self.name)
+
         else:
             print "Unknown dependency type specified."
 
@@ -105,20 +108,27 @@
 
     def depend_fax(self):
         fax_providers = [
-            "app_fax.so",
-            "res_fax_spandsp.so",
-            "res_fax_digium.so",
+            "app_fax",
+            "res_fax_spandsp",
+            "res_fax_digium",
         ]
+
+        for f in fax_providers:
+            if self.__find_asterisk_module(f):
+                return True
+
+        return False
+
+    def __find_asterisk_module(self, name):
         ast = Asterisk()
-
         if "astmoddir" not in ast.directories:
             return False
-        for f in fax_providers:
-            if os.path.exists("%s/%s" % (ast.directories["astmoddir"], f)):
-                return True
+
+        module = "%s/%s.so" % (ast.directories["astmoddir"], name)
+        if os.path.exists(module):
+            return True
 
         return False
-
 
 class TestConfig:
     def __init__(self, test_name, ast_version, options):

Modified: asterisk/trunk/tests/pbx/pbx_lua_background/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/pbx/pbx_lua_background/test-config.yaml?view=diff&rev=1860&r1=1859&r2=1860
==============================================================================
--- asterisk/trunk/tests/pbx/pbx_lua_background/test-config.yaml (original)
+++ asterisk/trunk/tests/pbx/pbx_lua_background/test-config.yaml Tue Aug 16 19:52:14 2011
@@ -8,3 +8,4 @@
     dependencies:
         - python : 'twisted'
         - python : 'starpy'
+        - asterisk : 'pbx_lua'

Modified: asterisk/trunk/tests/pbx/pbx_lua_goto/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/pbx/pbx_lua_goto/test-config.yaml?view=diff&rev=1860&r1=1859&r2=1860
==============================================================================
--- asterisk/trunk/tests/pbx/pbx_lua_goto/test-config.yaml (original)
+++ asterisk/trunk/tests/pbx/pbx_lua_goto/test-config.yaml Tue Aug 16 19:52:14 2011
@@ -8,3 +8,4 @@
     dependencies:
         - python : 'twisted'
         - python : 'starpy'
+        - asterisk : 'pbx_lua'




More information about the asterisk-commits mailing list