[asterisk-dev] [Code Review] make testsuite runtests a bit less warny

wdoekes reviewboard at asterisk.org
Wed Nov 30 16:03:24 CST 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1604/
-----------------------------------------------------------

Review request for Asterisk Developers.


Summary
-------

The test suite can throw off new users by being a bit verbose with errors/warnings that are not really problems:

- EXDEV error when hardlinking causes "OSError occurred while copying ..." <-- wrong, should be "while hardlinking"
- if a destination file exists (backtrace.txt doesn't get its own astN-dir in the logs) you get a warning/failure

Further, there were a couple of minor eye sores:

- very verbose exception handling which extracts values for printing purposes only: use str(exception) instead
- shell=True in subprocess call to gdb
- no redirect of stderr in call to gdb
- missing LF in self.stdout addition

This patch addresses this so I can get back to the task at hand, which was to create a test.

(Note that I didn't add exception handlers around the makedirs() and open() in __archive_core_dump. If you're not able to create directories and log files, you probably shouldn't be running any tests at all. And, backtrace.txt in logs is now always overwritten, even if extracting a core dump were to fail. I don't see this as a problem.)


Diffs
-----

  /asterisk/trunk/cleanup-test-remnants.sh 2817 
  /asterisk/trunk/runtests.py 2817 

Diff: https://reviewboard.asterisk.org/r/1604/diff


Testing
-------

--- before.txt	2011-11-30 22:55:28.084665732 +0100
+++ after.txt	2011-11-30 22:56:10.776877432 +0100
@@ -9,24 +9,14 @@
 Parsing /tmp/asterisk-testsuite/channels/SIP/sip_reg_domain_acl/ast8/etc/asterisk/logger.general.conf.inc
 Parsing /tmp/asterisk-testsuite/channels/SIP/sip_reg_domain_acl/ast8/etc/asterisk/logger.logfiles.conf.inc
 [Nov 30 22:55:10] WARNING[9310]: asterisk.TestCase:217 __reactor_timeout: Reactor timeout: '3' seconds
-OSError occurred while copying /tmp/asterisk-testsuite/channels/SIP/sip_reg_domain_acl/ast8/var/log/asterisk ([18]: Invalid cross-device link)
-Attempting copy
 Core dump detected; an Asterisk instance must have crashed
-Running gdb -se "asterisk" -ex "bt full" -ex "thread apply all bt" --batch -c core > ./backtrace.txt
-
-warning: Can't read pathname for load map: Input/output error.
-
-warning: Could not load shared library symbols for 190 libraries, e.g. /tmp/asterisk-testsuite/fastagi/control-stream-file/ast1/usr/lib/asterisk/modules/pbx_lua.so.
-Use the "info sharedlibrary" command to see the complete listing.
-Do you need "set solib-search-path" or "set sysroot"?
-OSError occurred while copying backtrace.txt ([17]: File exists)
-Attempting copy
-Exception occurred while archiving backtrace from ` to .: /
+Running gdb -se asterisk -ex bt full -ex thread apply all bt --batch -c core
 <?xml version="1.0" encoding="utf-8"?>
-<testsuite errors="0" failures="1" name="AsteriskTestSuite" tests="1" time="11.17">
-  <testcase name="tests/channels/SIP/sip_reg_domain_acl" time="11.17">
+<testsuite errors="0" failures="1" name="AsteriskTestSuite" tests="1" time="11.20">
+  <testcase name="tests/channels/SIP/sip_reg_domain_acl" time="11.20">
     <failure>
-      Running ['tests/channels/SIP/sip_reg_domain_acl/run-test'] ...Parsing /tmp/asterisk-testsuite/channels/SIP/sip_reg_domain_acl/ast8/etc/asterisk/extconfig.conf
+      Running ['tests/channels/SIP/sip_reg_domain_acl/run-test'] ...
+Parsing /tmp/asterisk-testsuite/channels/SIP/sip_reg_domain_acl/ast8/etc/asterisk/extconfig.conf
 Parsing /tmp/asterisk-testsuite/channels/SIP/sip_reg_domain_acl/ast8/etc/asterisk/logger.conf
 Parsing /tmp/asterisk-testsuite/channels/SIP/sip_reg_domain_acl/ast8/etc/asterisk/logger.general.conf.inc
 Parsing /tmp/asterisk-testsuite/channels/SIP/sip_reg_domain_acl/ast8/etc/asterisk/logger.logfiles.conf.inc


Thanks,

wdoekes

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20111130/68b11499/attachment-0001.htm>


More information about the asterisk-dev mailing list