<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/1604/">https://reviewboard.asterisk.org/r/1604/</a>
     </td>
    </tr>
   </table>
   <br />









<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://reviewboard.asterisk.org/r/1604/diff/2/?file=22027#file22027line100" style="color: black; font-weight: bold; text-decoration: underline;">/asterisk/trunk/runtests.py</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">def run(self):</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">99</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="n">dest_file</span><span class="o">.</span><span class="n">close</span><span class="p">()</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I would propose to add a:

os.move(&#39;./core&#39;, dest_dir + &#39;/core&#39;)

as well.

Right now you can get backtraces for stale core files.</pre>
</div>
<br />



<p>- wdoekes</p>


<br />
<p>On November 30th, 2011, 4:03 p.m., wdoekes wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers.</div>
<div>By wdoekes.</div>


<p style="color: grey;"><i>Updated Nov. 30, 2011, 4:03 p.m.</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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 &quot;OSError occurred while copying ...&quot; &lt;-- wrong, should be &quot;while hardlinking&quot;
- if a destination file exists (backtrace.txt doesn&#39;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&#39;t add exception handlers around the makedirs() and open() in __archive_core_dump. If you&#39;re not able to create directories and log files, you probably shouldn&#39;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&#39;t see this as a problem.)</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">--- 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: &#39;3&#39; 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 &quot;asterisk&quot; -ex &quot;bt full&quot; -ex &quot;thread apply all bt&quot; --batch -c core &gt; ./backtrace.txt
-
-warning: Can&#39;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 &quot;info sharedlibrary&quot; command to see the complete listing.
-Do you need &quot;set solib-search-path&quot; or &quot;set sysroot&quot;?
-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
 &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
-&lt;testsuite errors=&quot;0&quot; failures=&quot;1&quot; name=&quot;AsteriskTestSuite&quot; tests=&quot;1&quot; time=&quot;11.17&quot;&gt;
-  &lt;testcase name=&quot;tests/channels/SIP/sip_reg_domain_acl&quot; time=&quot;11.17&quot;&gt;
+&lt;testsuite errors=&quot;0&quot; failures=&quot;1&quot; name=&quot;AsteriskTestSuite&quot; tests=&quot;1&quot; time=&quot;11.20&quot;&gt;
+  &lt;testcase name=&quot;tests/channels/SIP/sip_reg_domain_acl&quot; time=&quot;11.20&quot;&gt;
     &lt;failure&gt;
-      Running [&#39;tests/channels/SIP/sip_reg_domain_acl/run-test&#39;] ...Parsing /tmp/asterisk-testsuite/channels/SIP/sip_reg_domain_acl/ast8/etc/asterisk/extconfig.conf
+      Running [&#39;tests/channels/SIP/sip_reg_domain_acl/run-test&#39;] ...
+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
</pre>
  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/asterisk/trunk/cleanup-test-remnants.sh <span style="color: grey">(2817)</span></li>

 <li>/asterisk/trunk/runtests.py <span style="color: grey">(2817)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/1604/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>