<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/1431/">https://reviewboard.asterisk.org/r/1431/</a>
     </td>
    </tr>
   </table>
   <br />








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On September 12th, 2011, 3:20 p.m., <b>Paul Belanger</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<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/1431/diff/1/?file=20561#file20561line194" style="color: black; font-weight: bold; text-decoration: underline;">/asterisk/trunk/runtests.py</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

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

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

   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">def __archive_ast_logs(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">194</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                        <span class="n">shutil</span><span class="o">.</span><span class="n">copytree</span><span class="p">(</span><span class="n">ast_dir</span><span class="p">,</span> <span class="n">dest_dir</span><span class="p">)</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">How about a symlink?  Seems like a waste to copy it.</pre>
 </blockquote>



 <p>On September 12th, 2011, 3:34 p.m., <b>mjordan</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">You wouldn&#39;t want a symbolic link, as the thing that you link to is apparently being deleted by the test harness.  We&#39;d have a dangling link otherwise.  If we aren&#39;t deleting the Asterisk logs between runs, then yes, a symbolic link would suffice here.</pre>
 </blockquote>





 <p>On September 12th, 2011, 3:49 p.m., <b>Paul Belanger</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Well, we actually delete the testsuite directory and runtests.py before the /tmp/asterisk-testsuite folder, so symlinking is not an issue.  We also have bamboo copy the files into the artifact directory before we at to this point too.</pre>
 </blockquote>





 <p>On September 12th, 2011, 4:31 p.m., <b>mjordan</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I&#39;m confused.

Either we have the original Asterisk logs, or we don&#39;t.  If we have the original Asterisk logs, then creating symbolic links is all find and good, but is merely a &#39;nice to have&#39;.  I was under the impression that we had no way to get the Asterisk logs after a test run.  If that&#39;s not the case, then this is a nice to have, but not needed, patch to debug the voicemail tests that have been bouncing.

If we don&#39;t have the Asterisk logs, e.g., everything in the /tmp/asterisk-testsuite/ directory is deleted, then symbolic links would be no bueno, and we need to copy the files.  Whether or not the place the test copies them to is later manipulated by bamboo in someway (moving them yet again, etc.) is superfluous from the test&#39;s perspective - currently, our place for putting log results is in the .logs\ directory.
</pre>
 </blockquote>





 <p>On September 12th, 2011, 4:38 p.m., <b>mjordan</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">er, that should be .\logs\ directory, but I think you know what I meant :-)</pre>
 </blockquote>





 <p>On September 12th, 2011, 5:01 p.m., <b>Paul Belanger</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Let me explain how bamboo works, this should clear up some issues.

Bamboo start
-&gt; remote agent runs build-asterisk.sh
--&gt; checkout asterisk
---&gt; compile / install / samples for asterisk
---&gt; checkout testsuite
----&gt; make addons / install asttest
----&gt; runtests.py
----&gt; cp xml results
---&gt; uninstall asterisk
--&gt; generate coverage
-&gt; bamboo copies artifacts
-&gt; bamboo deletes everything

At the point of &#39;bamboo copies artifacts&#39; is where we look into testsuite/logs/ folder to get the information.   So, we can get the symlink information, I&#39;m actually not sure if this will work, because for whatever reason bamboo will not copy files into an artifact folder if they exist out side the sandbox instance it creates.  And becuase /tmp/asterisk-testsuite exists outside of the sandbox instance, we cannot directly access this.

So, copying is an issue, however for local development boxes, because we are just eating up HDD space.  Like I said, I don&#39;t even know if a symlink will work.
</pre>
 </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I&#39;m pretty sure symbolic links won&#39;t work, since the things that they point to would be destroyed by the &#39;bamboo deletes everything&#39; step.  If you have a link to something that doesn&#39;t exist, you won&#39;t be able to read the contents :-)

I think we can copy the files as bamboo doesn&#39;t actually do the file manipulation; the tests themselves do.  Since the tests are already manipulating files within their own directories (by creating python log files in the .\logs\ directories) and manipulating files in the /tmp/ directories, they should have write permissions to both locations.  So the test should be able to copy things between the locations prior to the runtests.py script completing.

As far as HDD space goes, that is a concern, but probably something outside of this patch.  We should have an archival policy that prevents the test system machines from running out of disk space, and that&#39;s more of a systems management issue.</pre>
<br />




<p>- mjordan</p>


<br />
<p>On September 12th, 2011, 1:42 p.m., mjordan 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 and Paul Belanger.</div>
<div>By mjordan.</div>


<p style="color: grey;"><i>Updated Sept. 12, 2011, 1:42 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 TestSuite will now archive the Asterisk logs if a test run fails.  All logs are copied to the local ./logs directory, using the same relative test path used for the /tmp/asterisk-testsuite/ directory.

Note that since the top level script does not have knowledge of the number of instances of Asterisk created by a test, all Asterisk (ast1, etc.) directories created by the test are archived.</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;">local machine.  Induced a test failure, tested multiple runs to ensure that archiving occurs even if directories were previously copied.</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/runtests.py <span style="color: grey">(2190)</span></li>

 <li>/asterisk/trunk/lib/python/asterisk/asterisk.py <span style="color: grey">(2188)</span></li>

</ul>

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




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








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