[svn-commits] pabelanger: branch pabelanger/tests_yaml r936 - in /asterisk/team/pabelanger/...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Nov 24 11:17:46 CST 2010


Author: pabelanger
Date: Wed Nov 24 11:17:35 2010
New Revision: 936

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=936
Log:
Update tests.yaml and parsing logic

Added:
    asterisk/team/pabelanger/tests_yaml/tests/cdr/tests.yaml   (with props)
    asterisk/team/pabelanger/tests_yaml/tests/chanspy/tests.yaml   (with props)
    asterisk/team/pabelanger/tests_yaml/tests/fastagi/tests.yaml   (with props)
    asterisk/team/pabelanger/tests_yaml/tests/fax/tests.yaml   (with props)
    asterisk/team/pabelanger/tests_yaml/tests/iax2/tests.yaml   (with props)
    asterisk/team/pabelanger/tests_yaml/tests/manager/tests.yaml   (with props)
    asterisk/team/pabelanger/tests_yaml/tests/pbx/tests.yaml   (with props)
    asterisk/team/pabelanger/tests_yaml/tests/queues/tests.yaml   (with props)
    asterisk/team/pabelanger/tests_yaml/tests/sip/tests.yaml   (with props)
Modified:
    asterisk/team/pabelanger/tests_yaml/runtests.py
    asterisk/team/pabelanger/tests_yaml/tests/tests.yaml

Modified: asterisk/team/pabelanger/tests_yaml/runtests.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/tests_yaml/runtests.py?view=diff&rev=936&r1=935&r2=936
==============================================================================
--- asterisk/team/pabelanger/tests_yaml/runtests.py (original)
+++ asterisk/team/pabelanger/tests_yaml/runtests.py Wed Nov 24 11:17:35 2010
@@ -23,7 +23,7 @@
 from asterisk import utils
 
 
-TESTS_CONFIG = "tests/tests.yaml"
+TESTS_CONFIG = "tests.yaml"
 TEST_RESULTS = "asterisk-test-suite-report.xml"
 
 BIG_WARNING = "\n" \
@@ -125,13 +125,13 @@
         self.did_run = True
         start_time = time.time()
         cmd = [
-            "tests/%s/run-test" % self.test_name,
+            "%s/run-test" % self.test_name,
             "-v", str(self.ast_version)
         ]
         if os.path.exists(cmd[0]) and os.access(cmd[0], os.X_OK):
             print "Running %s ..." % cmd
             try:
-                f = open("tests/%s/test-output.txt" % self.test_name, "w")
+                f = open("%s/test-output.txt" % self.test_name, "w")
             except IOError:
                 print "FAILURE: Failed to open file for test output"
                 return
@@ -181,7 +181,7 @@
                         properties["maxversion"]
 
     def __parse_config(self):
-        test_config = "tests/%s/test-config.yaml" % self.test_name
+        test_config = "%s/test-config.yaml" % self.test_name
         try:
             f = open(test_config, "r")
         except IOError:
@@ -231,27 +231,38 @@
 
 class TestSuite:
     def __init__(self, ast_version, options):
-        try:
-            f = open(TESTS_CONFIG, "r")
-        except IOError:
-            print "Failed to open %s" % TESTS_CONFIG
-            return
-        except:
-            print "Unexpected error: %s" % sys.exc_info()[0]
-            return
-
         self.options = options
 
-        self.config = yaml.load(f)
-        f.close()
+        self.tests = []
+        self.tests = self._parse_test_yaml("tests", ast_version)
 
         self.total_time = 0.0
         self.total_count = 0
         self.total_failures = 0
 
-        self.tests = [
-            TestConfig(t["test"], ast_version) for t in self.config["tests"]
-        ]
+    def _parse_test_yaml(self, test_dir, ast_version):
+        tests = []
+        try:
+            f = open("%s/%s" % (test_dir, TESTS_CONFIG), "r")
+        except IOError:
+            print "Failed to open %s" % TESTS_CONFIG
+            return
+        except:
+            print "Unexpected error: %s" % sys.exc_info()[0]
+            return
+
+        config = yaml.load(f)
+        f.close()
+
+        for t in config["tests"]:
+            for val in t:
+                path = "%s/%s" % (test_dir, t[val])
+                if val == "test":
+                    tests.append(TestConfig(path, ast_version))
+                elif val == "dir":
+                    tests += self._parse_test_yaml(path, ast_version)
+
+        return tests
 
     def list_tests(self):
         print "Configured tests:"
@@ -335,7 +346,7 @@
                 continue
             f.write(">\n\t\t<failure><![CDATA[\n")
             try:
-                test_output = open("tests/%s/test-output.txt" % t.test_name, "r")
+                test_output = open("%s/test-output.txt" % t.test_name, "r")
                 f.write("%s" % test_output.read())
                 test_output.close()
             except IOError:

Added: asterisk/team/pabelanger/tests_yaml/tests/cdr/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/tests_yaml/tests/cdr/tests.yaml?view=auto&rev=936
==============================================================================
--- asterisk/team/pabelanger/tests_yaml/tests/cdr/tests.yaml (added)
+++ asterisk/team/pabelanger/tests_yaml/tests/cdr/tests.yaml Wed Nov 24 11:17:35 2010
@@ -1,0 +1,14 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+    - test: 'console_dial_sip_answer'
+    - test: 'console_dial_sip_busy'
+    - test: 'console_dial_sip_congestion'
+    - test: 'console_dial_sip_transfer'
+    - test: 'console_fork_after_busy_forward'
+    - test: 'console_fork_before_dial'
+    - test: 'cdr_unanswered_yes'
+    - test: 'cdr_userfield'
+    - test: 'nocdr'
+    - test: 'app_queue'
+    - test: 'blind-transfer-accountcode'
+    - test: 'originate-cdr-disposition'

Propchange: asterisk/team/pabelanger/tests_yaml/tests/cdr/tests.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/pabelanger/tests_yaml/tests/cdr/tests.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/pabelanger/tests_yaml/tests/cdr/tests.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/pabelanger/tests_yaml/tests/chanspy/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/tests_yaml/tests/chanspy/tests.yaml?view=auto&rev=936
==============================================================================
--- asterisk/team/pabelanger/tests_yaml/tests/chanspy/tests.yaml (added)
+++ asterisk/team/pabelanger/tests_yaml/tests/chanspy/tests.yaml Wed Nov 24 11:17:35 2010
@@ -1,0 +1,3 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+    - test: 'chanspy_barge'

Propchange: asterisk/team/pabelanger/tests_yaml/tests/chanspy/tests.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/pabelanger/tests_yaml/tests/chanspy/tests.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/pabelanger/tests_yaml/tests/chanspy/tests.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/pabelanger/tests_yaml/tests/fastagi/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/tests_yaml/tests/fastagi/tests.yaml?view=auto&rev=936
==============================================================================
--- asterisk/team/pabelanger/tests_yaml/tests/fastagi/tests.yaml (added)
+++ asterisk/team/pabelanger/tests_yaml/tests/fastagi/tests.yaml Wed Nov 24 11:17:35 2010
@@ -1,0 +1,20 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+    - test: 'connect'
+    - test: 'channel-status'
+    - test: 'hangup'
+    - test: 'stream-file'
+    - test: 'control-stream-file'
+    - test: 'database'
+    - test: 'execute'
+    - test: 'get-data'
+    - test: 'record-file'
+    - test: 'say-alpha'
+    - test: 'say-date'
+    - test: 'say-datetime'
+    - test: 'say-time'
+    - test: 'say-digits'
+    - test: 'say-number'
+    - test: 'say-phonetic'
+    # Requires patch to StarPy.
+    #- test: 'wait-for-digit'

Propchange: asterisk/team/pabelanger/tests_yaml/tests/fastagi/tests.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/pabelanger/tests_yaml/tests/fastagi/tests.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/pabelanger/tests_yaml/tests/fastagi/tests.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/pabelanger/tests_yaml/tests/fax/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/tests_yaml/tests/fax/tests.yaml?view=auto&rev=936
==============================================================================
--- asterisk/team/pabelanger/tests_yaml/tests/fax/tests.yaml (added)
+++ asterisk/team/pabelanger/tests_yaml/tests/fax/tests.yaml Wed Nov 24 11:17:35 2010
@@ -1,0 +1,3 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+    - test: 'local_channel_t38_queryoption'

Propchange: asterisk/team/pabelanger/tests_yaml/tests/fax/tests.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/pabelanger/tests_yaml/tests/fax/tests.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/pabelanger/tests_yaml/tests/fax/tests.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/pabelanger/tests_yaml/tests/iax2/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/tests_yaml/tests/iax2/tests.yaml?view=auto&rev=936
==============================================================================
--- asterisk/team/pabelanger/tests_yaml/tests/iax2/tests.yaml (added)
+++ asterisk/team/pabelanger/tests_yaml/tests/iax2/tests.yaml Wed Nov 24 11:17:35 2010
@@ -1,0 +1,3 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+    - test: 'basic-call'

Propchange: asterisk/team/pabelanger/tests_yaml/tests/iax2/tests.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/pabelanger/tests_yaml/tests/iax2/tests.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/pabelanger/tests_yaml/tests/iax2/tests.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/pabelanger/tests_yaml/tests/manager/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/tests_yaml/tests/manager/tests.yaml?view=auto&rev=936
==============================================================================
--- asterisk/team/pabelanger/tests_yaml/tests/manager/tests.yaml (added)
+++ asterisk/team/pabelanger/tests_yaml/tests/manager/tests.yaml Wed Nov 24 11:17:35 2010
@@ -1,0 +1,5 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+    - test: 'login'
+    - test: 'action-events-response'
+    - test: 'response-time'

Propchange: asterisk/team/pabelanger/tests_yaml/tests/manager/tests.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/pabelanger/tests_yaml/tests/manager/tests.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/pabelanger/tests_yaml/tests/manager/tests.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/pabelanger/tests_yaml/tests/pbx/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/tests_yaml/tests/pbx/tests.yaml?view=auto&rev=936
==============================================================================
--- asterisk/team/pabelanger/tests_yaml/tests/pbx/tests.yaml (added)
+++ asterisk/team/pabelanger/tests_yaml/tests/pbx/tests.yaml Wed Nov 24 11:17:35 2010
@@ -1,0 +1,5 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+    - test: 'call-files'
+    # Temporarily disabled while failures are debugged
+    #- test: 'call-files2'

Propchange: asterisk/team/pabelanger/tests_yaml/tests/pbx/tests.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/pabelanger/tests_yaml/tests/pbx/tests.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/pabelanger/tests_yaml/tests/pbx/tests.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/pabelanger/tests_yaml/tests/queues/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/tests_yaml/tests/queues/tests.yaml?view=auto&rev=936
==============================================================================
--- asterisk/team/pabelanger/tests_yaml/tests/queues/tests.yaml (added)
+++ asterisk/team/pabelanger/tests_yaml/tests/queues/tests.yaml Wed Nov 24 11:17:35 2010
@@ -1,0 +1,9 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+    - test: 'queue_baseline'
+    - test: 'position_priority_maxlen'
+    - test: 'macro_gosub_test'
+    # Temporarily disabled while failures are debugged
+    #- test: 'ringinuse_and_pause'
+    # Temporarily disabled while failures are debugged
+    #- test: 'wrapup_time'

Propchange: asterisk/team/pabelanger/tests_yaml/tests/queues/tests.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/pabelanger/tests_yaml/tests/queues/tests.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/pabelanger/tests_yaml/tests/queues/tests.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/pabelanger/tests_yaml/tests/sip/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/tests_yaml/tests/sip/tests.yaml?view=auto&rev=936
==============================================================================
--- asterisk/team/pabelanger/tests_yaml/tests/sip/tests.yaml (added)
+++ asterisk/team/pabelanger/tests_yaml/tests/sip/tests.yaml Wed Nov 24 11:17:35 2010
@@ -1,0 +1,3 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+    - test: 'handle_response_refer'

Propchange: asterisk/team/pabelanger/tests_yaml/tests/sip/tests.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/pabelanger/tests_yaml/tests/sip/tests.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/pabelanger/tests_yaml/tests/sip/tests.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: asterisk/team/pabelanger/tests_yaml/tests/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/tests_yaml/tests/tests.yaml?view=diff&rev=936&r1=935&r2=936
==============================================================================
--- asterisk/team/pabelanger/tests_yaml/tests/tests.yaml (original)
+++ asterisk/team/pabelanger/tests_yaml/tests/tests.yaml Wed Nov 24 11:17:35 2010
@@ -1,24 +1,11 @@
 # Enter tests here in the order they should be considered for execution:
 tests:
     - test: 'example'
-    - test: 'manager/login'
-    - test: 'manager/action-events-response'
-    - test: 'manager/response-time'
+    - dir: 'manager'
     - test: 'rfc2833_dtmf_detect'
     - test: 'sip_channel_params'
-    - test: 'iax2/basic-call'
-    - test: 'cdr/console_dial_sip_answer'
-    - test: 'cdr/console_dial_sip_busy'
-    - test: 'cdr/console_dial_sip_congestion'
-    - test: 'cdr/console_dial_sip_transfer'
-    - test: 'cdr/console_fork_after_busy_forward'
-    - test: 'cdr/console_fork_before_dial'
-    - test: 'cdr/cdr_unanswered_yes'
-    - test: 'cdr/cdr_userfield'
-    - test: 'cdr/nocdr'
-    - test: 'cdr/app_queue'
-    - test: 'cdr/blind-transfer-accountcode'
-    - test: 'cdr/originate-cdr-disposition'
+    - dir: 'iax2'
+    - dir: 'cdr'
     - test: 'directed_pickup'
     - test: 'func_srv'
     - test: 'sip_outbound_address'
@@ -30,7 +17,7 @@
     # Temporarily disabled while failures are debugged
     #- test: 'sip_one_legged_transfer_v6'
     - test: 'sip_register'
-    - test: 'sip/handle_response_refer'
+    - dir: 'sip'
     - test: 'udptl'
     - test: 'udptl_v6'
     # Temporarily disabled while failures are debugged
@@ -43,34 +30,8 @@
     - test: 'callparking_retrieval'
     - test: 'mixmonitor'
     - test: 'mixmonitor_audiohook_inherit'
-    - test: 'chanspy/chanspy_barge'
-    - test: 'queues/queue_baseline'
-    - test: 'queues/position_priority_maxlen'
-    - test: 'queues/macro_gosub_test'
-    # Temporarily disabled while failures are debugged
-    #- test: 'queues/ringinuse_and_pause'
-    # Temporarily disabled while failures are debugged
-    #- test: 'queues/wrapup_time'
-    - test: 'fastagi/connect'
-    - test: 'fastagi/channel-status'
-    - test: 'fastagi/hangup'
-    - test: 'fastagi/stream-file'
-    - test: 'fastagi/control-stream-file'
-    - test: 'fastagi/database'
-    - test: 'fastagi/execute'
-    - test: 'fastagi/get-data'
-    - test: 'fastagi/record-file'
-    - test: 'fastagi/say-alpha'
-    - test: 'fastagi/say-date'
-    - test: 'fastagi/say-datetime'
-    - test: 'fastagi/say-time'
-    - test: 'fastagi/say-digits'
-    - test: 'fastagi/say-number'
-    - test: 'fastagi/say-phonetic'
-    # Requires patch to StarPy.
-    #- test: 'fastagi/wait-for-digit'
-    - test: 'pbx/call-files'
-    # Temporarily disabled while failures are debugged
-    #- test: 'pbx/call-files2'
-    - test: 'fax/local_channel_t38_queryoption'
-
+    - dir: 'chanspy'
+    - dir: 'queues'
+    - dir: 'fastagi'
+    - dir: 'pbx'
+    - dir: 'fax'




More information about the svn-commits mailing list