[asterisk-commits] sgriepentrog: branch sgriepentrog/testsuite-valgrind r4396 - in /asterisk/tea...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 3 20:09:05 CST 2013


Author: sgriepentrog
Date: Tue Dec  3 20:09:03 2013
New Revision: 4396

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4396
Log:
improved valgrind option handling

Modified:
    asterisk/team/sgriepentrog/testsuite-valgrind/configs/valgrind.supp
    asterisk/team/sgriepentrog/testsuite-valgrind/lib/python/asterisk/TestCase.py
    asterisk/team/sgriepentrog/testsuite-valgrind/lib/python/asterisk/TestConfig.py
    asterisk/team/sgriepentrog/testsuite-valgrind/lib/python/asterisk/asterisk.py
    asterisk/team/sgriepentrog/testsuite-valgrind/runtests.py
    asterisk/team/sgriepentrog/testsuite-valgrind/tests/pbx/tests.yaml

Modified: asterisk/team/sgriepentrog/testsuite-valgrind/configs/valgrind.supp
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/sgriepentrog/testsuite-valgrind/configs/valgrind.supp?view=diff&rev=4396&r1=4395&r2=4396
==============================================================================
--- asterisk/team/sgriepentrog/testsuite-valgrind/configs/valgrind.supp (original)
+++ asterisk/team/sgriepentrog/testsuite-valgrind/configs/valgrind.supp Tue Dec  3 20:09:03 2013
@@ -5,26 +5,26 @@
 {
    dlclose-1
    Memcheck:Addr1
-   fun:...
+   ...
    fun:dlclose
    fun:load_dynamic_module
-   fun:...
+   ...
 }
 {
    dlclose-2
    Memcheck:Addr2
-   fun:...
+   ...
    fun:dlclose
    fun:load_dynamic_module
-   fun:...
+   ...
 }
 {
    dlclose-4
    Memcheck:Addr4
-   fun:...
+   ...
    fun:dlclose
    fun:load_dynamic_module
-   fun:...
+   ...
 }
 
 {
@@ -132,3 +132,19 @@
    ...
 }
 
+{
+   overlap-memcpy-ilbc
+   Memcheck:Overlap
+   fun:memcpy
+   fun:Decode
+   fun:iLBC_decode
+   ...
+}
+
+{
+   overlap-memcpy-ilbc2
+   Memcheck:Overlap
+   fun:memcpy
+   fun:iLBC_encode
+   ...
+}

Modified: asterisk/team/sgriepentrog/testsuite-valgrind/lib/python/asterisk/TestCase.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/sgriepentrog/testsuite-valgrind/lib/python/asterisk/TestCase.py?view=diff&rev=4396&r1=4395&r2=4396
==============================================================================
--- asterisk/team/sgriepentrog/testsuite-valgrind/lib/python/asterisk/TestCase.py (original)
+++ asterisk/team/sgriepentrog/testsuite-valgrind/lib/python/asterisk/TestCase.py Tue Dec  3 20:09:03 2013
@@ -130,19 +130,26 @@
 
         logger.info("Executing " + self.test_name)
 
-        if None != self.test_config.valgrind:
+        if self.test_config.valgrind:
             self.valgrind = self.test_config.valgrind
         elif os.getenv("VALGRIND") == "true":
             self.valgrind = True
-        if True == self.valgrind:
+        if self.valgrind:
             self.reactor_timeout *= 5
             logger.info("Adjusting reactor timeout to %d for valgrind" % self.reactor_timeout)
             if os.getenv("VALGRINDGENSUPP") == "true":
                 self.valgrind_gensupp = True
-            if os.getenv("VALGRINDLEAK"):
+
+            if self.test_config.valgrind_leak:
+                self.valgrind_leak = self.test_config.valgrind_leak
+            elif os.getenv("VALGRINDLEAK"):
                 self.valgrind_leak = os.getenv("VALGRINDLEAK");
-            if os.getenv("VALGRINDUNDEF"):
+
+            if self.test_config.valgrind_undef:
+                self.valgrind_undef = self.test_config.valgrind_undef
+            elif os.getenv("VALGRINDUNDEF"):
                 self.valgrind_undef = os.getenv("VALGRINDUNDEF");
+
             if TestSuiteUtils.which('valgrind') is None:
                 logger.error("VALGRIND IS NOT INSTALLED - running test without it")
                 self.valgrind = False

Modified: asterisk/team/sgriepentrog/testsuite-valgrind/lib/python/asterisk/TestConfig.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/sgriepentrog/testsuite-valgrind/lib/python/asterisk/TestConfig.py?view=diff&rev=4396&r1=4395&r2=4396
==============================================================================
--- asterisk/team/sgriepentrog/testsuite-valgrind/lib/python/asterisk/TestConfig.py (original)
+++ asterisk/team/sgriepentrog/testsuite-valgrind/lib/python/asterisk/TestConfig.py Tue Dec  3 20:09:03 2013
@@ -253,6 +253,8 @@
         self.test_configuration = "(none)"
         self.condition_definitions = []
         self.valgrind = None
+        self.valgrind_leak = None
+        self.valgrind_undef = None
         self.global_test_config = global_test_config
         self.__parse_config()
 
@@ -341,14 +343,29 @@
                 print "ERROR: '%s' is not a valid Asterisk version" % \
                     properties["forced-version"]
         if "valgrind" in properties:
-            try:
-                if properties["valgrind"].upper().strip() == "YES":
-                    self.valgrind = True
-                if properties["valgrind"].upper().strip() == "NO":
-                    self.valgrind = False
-            except:
+            if properties["valgrind"].upper().strip() == "YES":
+                self.valgrind = True
+            elif properties["valgrind"].upper().strip() == "NO":
+                self.valgrind = False
+            else:
                 print "ERROR: '%s' is not a valid value for valgrind" %\
                         properties["valgrind"]
+
+        if "valgrind-leak" in properties:
+            leak = properties["valgrind-leak"].lower().strip()
+            if leak in ['yes', 'no', 'summary', 'full']:
+                    self.valgrind_leak = leak
+            else:
+                print "ERROR: '%s' is not a valid value for valgrind-leak" %\
+                        properties["valgrind-leak"]
+
+        if "valgrind-undef" in properties:
+            undef = properties["valgrind-undef"].lower().strip()
+            if undef in ['yes', 'no']:
+                    self.valgrind_undef = undef
+            else:
+                print "ERROR: '%s' is not a valid value for valgrind-undef" %\
+                        properties["valgrind-undef"]
 
     def __parse_config(self):
         test_config = "%s/test-config.yaml" % self.test_name
@@ -473,3 +490,5 @@
 
         # all tags matched successfully
         return self.can_run
+
+# vim: set ts=8 sw=4 sts=4 et ai tw=79:

Modified: asterisk/team/sgriepentrog/testsuite-valgrind/lib/python/asterisk/asterisk.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/sgriepentrog/testsuite-valgrind/lib/python/asterisk/asterisk.py?view=diff&rev=4396&r1=4395&r2=4396
==============================================================================
--- asterisk/team/sgriepentrog/testsuite-valgrind/lib/python/asterisk/asterisk.py (original)
+++ asterisk/team/sgriepentrog/testsuite-valgrind/lib/python/asterisk/asterisk.py Tue Dec  3 20:09:03 2013
@@ -308,6 +308,8 @@
             "-f", "-g", "-q", "-m", "-n",
             "-C", "%s" % os.path.join(self.astetcdir, "asterisk.conf")
         ]
+
+        os.environ["ASTETCDIR"] = self.astetcdir
 
         if self.valgrind:
             self.valgrind_log_filename = os.path.join(self.base, "valgrind.txt")

Modified: asterisk/team/sgriepentrog/testsuite-valgrind/runtests.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/sgriepentrog/testsuite-valgrind/runtests.py?view=diff&rev=4396&r1=4395&r2=4396
==============================================================================
--- asterisk/team/sgriepentrog/testsuite-valgrind/runtests.py (original)
+++ asterisk/team/sgriepentrog/testsuite-valgrind/runtests.py Tue Dec  3 20:09:03 2013
@@ -199,13 +199,17 @@
         count_error_kinds = {}
         code = {}
         supp = []
+        ignore_leaks = False
 
         try:
             error_list = xmldoc.getElementsByTagName('error')
             count_errors_found = len(error_list)
 
+
             def getText(nodelist):
                 text = []
+                if not isinstance(nodelist, list):
+                    return getText(nodelist.childNodes)
                 for node in nodelist:
                     if node.nodeType == node.ELEMENT_NODE:
                         text.append(getText(node.childNodes))
@@ -244,12 +248,19 @@
                 else:
                     arrange_frames_by_code(tree[codefile], frames[1:], error)
 
+            args = xmldoc.getElementsByTagName('args')[0]
+            vargv = args.getElementsByTagName('vargv')[0]
+            valgrind_args = vargv.getElementsByTagName('arg')
+            for arg in valgrind_args:
+                if '--leak-check=no' in getText(arg):
+                    ignore_leaks = True
+
             for error in error_list:
                 kind = getText(error.getElementsByTagName('kind'))
                 what = getText(error.getElementsByTagName('what'))
 
                 if kind == "Leak_DefinitelyLost":
-                    if os.environ["VALGRINDLEAK"].lower() == "no":
+                    if ignore_leaks:
                         count_errors_ignored += 1
                         count_errors_found -= 1
                         continue
@@ -294,7 +305,6 @@
             for text, branch in tree.items():
                 msg = '  ' * depth + text
                 self.stdout += msg + "\n"
-                print msg
                 if len(branch):
                     dump_code_errors(branch, depth+1)
 

Modified: asterisk/team/sgriepentrog/testsuite-valgrind/tests/pbx/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/sgriepentrog/testsuite-valgrind/tests/pbx/tests.yaml?view=diff&rev=4396&r1=4395&r2=4396
==============================================================================
--- asterisk/team/sgriepentrog/testsuite-valgrind/tests/pbx/tests.yaml (original)
+++ asterisk/team/sgriepentrog/testsuite-valgrind/tests/pbx/tests.yaml Tue Dec  3 20:09:03 2013
@@ -4,6 +4,9 @@
     - test: 'call-files'
     - test: 'callerid_match'
     - test: 'dialplan_reload'
+    - test: 'dialplan_stress'
+    - test: 'datus_reload'
+    - test: 'datus_call'
     - test: 'pbx_lua_goto'
     - test: 'pbx_lua_background'
     # this test currently doesn't work due to a bug (ASTERISK-18230)




More information about the asterisk-commits mailing list