[asterisk-commits] pabelanger: branch pabelanger/digiumphones r3083 - in /asterisk/team/pabelang...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 6 10:47:55 CST 2012


Author: pabelanger
Date: Tue Mar  6 10:47:50 2012
New Revision: 3083

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3083
Log:
Add new skip properly

Modified:
    asterisk/team/pabelanger/digiumphones/lib/python/asterisk/TestConfig.py
    asterisk/team/pabelanger/digiumphones/lib/python/asterisk/version.py
    asterisk/team/pabelanger/digiumphones/runtests.py
    asterisk/team/pabelanger/digiumphones/tests/channels/SIP/message_auth/test-config.yaml

Modified: asterisk/team/pabelanger/digiumphones/lib/python/asterisk/TestConfig.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/digiumphones/lib/python/asterisk/TestConfig.py?view=diff&rev=3083&r1=3082&r2=3083
==============================================================================
--- asterisk/team/pabelanger/digiumphones/lib/python/asterisk/TestConfig.py (original)
+++ asterisk/team/pabelanger/digiumphones/lib/python/asterisk/TestConfig.py Tue Mar  6 10:47:50 2012
@@ -83,6 +83,19 @@
             obj = m(self)
             return obj
         return None
+
+
+class Skip:
+    def __init__(self, skip):
+        self.name = ""
+        self.met = True
+        if "branch" in skip:
+            self.name = skip["branch"]
+            tmp = "%s-%s-%s" % ("SVN-branch", skip["branch"], "r12345")
+            ast_version = AsteriskVersion()
+            version = AsteriskVersion(tmp)
+            if (ast_version.branch == version.branch) and (ast_version.phone == version.phone):
+                self.met = False
 
 
 class Dependency:
@@ -281,9 +294,6 @@
         if "testinfo" not in self.config:
             return
         testinfo = self.config["testinfo"]
-        if "skip" in testinfo:
-            self.skip = testinfo['skip']
-            self.can_run = False
         if "summary" in testinfo:
             self.summary = testinfo["summary"]
         if "description" in testinfo:
@@ -304,6 +314,8 @@
                         properties["expectedResult"]
         if "tags" in properties:
             self.tags = properties["tags"]
+        if "skip" in properties:
+            self.skip = properties["skip"]
 
     def __parse_config(self):
         test_config = "%s/test-config.yaml" % self.test_name
@@ -378,6 +390,21 @@
 
         for d in self.deps:
             if d.met is False:
+                self.can_run = False
+                break
+        return self.can_run
+
+    def check_skip(self, ast_version):
+        if not self.config:
+            return False
+
+        self.skips = [
+            Skip(s)
+                for s in self.config["properties"].get("skip") or []
+        ]
+
+        for s in self.skips:
+            if s.met is False:
                 self.can_run = False
                 break
         return self.can_run

Modified: asterisk/team/pabelanger/digiumphones/lib/python/asterisk/version.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/digiumphones/lib/python/asterisk/version.py?view=diff&rev=3083&r1=3082&r2=3083
==============================================================================
--- asterisk/team/pabelanger/digiumphones/lib/python/asterisk/version.py (original)
+++ asterisk/team/pabelanger/digiumphones/lib/python/asterisk/version.py Tue Mar  6 10:47:50 2012
@@ -358,6 +358,7 @@
         v2 = AsteriskVersion("1.8.5.1")
         self.assertTrue(v1 < v2)
 
+
 def main():
     unittest.main()
 

Modified: asterisk/team/pabelanger/digiumphones/runtests.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/digiumphones/runtests.py?view=diff&rev=3083&r1=3082&r2=3083
==============================================================================
--- asterisk/team/pabelanger/digiumphones/runtests.py (original)
+++ asterisk/team/pabelanger/digiumphones/runtests.py Tue Mar  6 10:47:50 2012
@@ -140,7 +140,8 @@
     def __check_can_run(self, ast_version):
         """Check tags and dependencies in the test config."""
         if self.test_config.check_deps(ast_version) and \
-                self.test_config.check_tags(self.options.tags):
+                self.test_config.check_tags(self.options.tags) and \
+                self.test_config.check_skip(ast_version):
             self.can_run = True
 
     def __parse_run_output(self, output):
@@ -225,6 +226,9 @@
                 else:
                     print "      --> Dependency: %s -- Met: %s" % (d.name,
                              str(d.met))
+            for s in t.test_config.skips:
+                    print "      --> Skip: %s -- Met: %s" % (s.name, str(s.met))
+
             i += 1
 
     def run(self):
@@ -232,14 +236,12 @@
 
         for t in self.tests:
             if t.can_run is False:
-                if t.test_config.skip is not None:
-                    print "--> %s ... skipped '%s'" % (t.test_name, t.test_config.skip)
-                    continue
-
                 print "--> Cannot run test '%s'" % t.test_name
                 print "--- --> Tags: %s" % (t.test_config.tags)
                 for d in t.test_config.deps:
                     print "--- --> Dependency: %s - %s" % (d.name, str(d.met))
+                for s in t.test_config.skips:
+                    print "--- --> Skip: %s - %s" % (s.name, str(s.met))
                 print
                 continue
             if self.global_config != None:

Modified: asterisk/team/pabelanger/digiumphones/tests/channels/SIP/message_auth/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/digiumphones/tests/channels/SIP/message_auth/test-config.yaml?view=diff&rev=3083&r1=3082&r2=3083
==============================================================================
--- asterisk/team/pabelanger/digiumphones/tests/channels/SIP/message_auth/test-config.yaml (original)
+++ asterisk/team/pabelanger/digiumphones/tests/channels/SIP/message_auth/test-config.yaml Tue Mar  6 10:47:50 2012
@@ -4,7 +4,10 @@
         'Send Asterisk a MESSAGE and wait for Asterisk to send it back with authentication.'
 
 properties:
-    minversion: '10'
+    skip:
+        - branch : '1.4'
+        - branch : '1.6.2'
+        - branch : '1.8'
     dependencies:
         - sipp :
             version : 'v3.0'




More information about the asterisk-commits mailing list