[asterisk-commits] russell: testsuite/asterisk/trunk r532 - in /asterisk/trunk: ./ lib/python/as...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 21 13:39:30 CDT 2010


Author: russell
Date: Wed Jul 21 13:39:26 2010
New Revision: 532

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=532
Log:
Add a custom dependency for Asterisk fax support.

Modified:
    asterisk/trunk/README.txt
    asterisk/trunk/lib/python/asterisk/asterisk.py
    asterisk/trunk/runtests.py

Modified: asterisk/trunk/README.txt
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/README.txt?view=diff&rev=532&r1=531&r2=532
==============================================================================
--- asterisk/trunk/README.txt (original)
+++ asterisk/trunk/README.txt Wed Jul 21 13:39:26 2010
@@ -264,6 +264,7 @@
         # runtests.py.  For example, if the dependency is 'ipv6', then the
         # depend_ipv6() method is called to determine if the dependency is met.
         - custom : 'ipv6'
+        - custom : 'fax'
 
 
 

Modified: asterisk/trunk/lib/python/asterisk/asterisk.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/asterisk.py?view=diff&rev=532&r1=531&r2=532
==============================================================================
--- asterisk/trunk/lib/python/asterisk/asterisk.py (original)
+++ asterisk/trunk/lib/python/asterisk/asterisk.py Wed Jul 21 13:39:26 2010
@@ -51,6 +51,7 @@
         self.asterisk = Asterisk(base=os.path.join(os.getcwd(),
                                                    "tests/ami-login/tmp"))
         """
+        self.directories = {}
         self.ast_version = AsteriskVersion()
 
         self.astetcdir = "/etc/asterisk"
@@ -198,6 +199,7 @@
             f.write("[%s]\n\n" % c.name)
             if c.name == "directories":
                 for (var, val) in c.options:
+                    self.directories[var] = val
                     f.write("%s = %s%s\n" % (var, self.base, val))
             else:
                 for (var, val) in c.options:

Modified: asterisk/trunk/runtests.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/runtests.py?view=diff&rev=532&r1=531&r2=532
==============================================================================
--- asterisk/trunk/runtests.py (original)
+++ asterisk/trunk/runtests.py Wed Jul 21 13:39:26 2010
@@ -19,6 +19,7 @@
 sys.path.append("lib/python")
 
 from asterisk.version import AsteriskVersion
+from asterisk.asterisk import Asterisk
 
 
 TESTS_CONFIG = "tests/tests.yaml"
@@ -88,6 +89,21 @@
         except:
             return False
 
+    def depend_fax(self):
+        fax_providers = [
+            "app_fax.so",
+            "res_fax_spandsp.so",
+            "res_fax_digium.so",
+        ]
+        ast = Asterisk(base="/tmp/asterisk-testsuite/runtests")
+
+        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
+
+        return False
 
 class TestConfig:
     def __init__(self, test_name, ast_version):




More information about the asterisk-commits mailing list