<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.E-MailFormatvorlage17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hello,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-GB">is there a current documentation about setup the asterisk unit tests? This documentation seems to be outdated:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><a href="https://wiki.asterisk.org/wiki/display/AST/Installing+the+Asterisk+Test+Suite">https://wiki.asterisk.org/wiki/display/AST/Installing+the+Asterisk+Test+Suite</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">I also followed some blog posts from on asterisk.org, but they also did not help as they seem to be outdated as well.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">The docs specify that the unit test framework is still using python2.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">But according to the contrib/scripts/install_prereq its already switched to python3, which is also indicated in the runtest.py command.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Unfortunately, the starpy fails for python3:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"> </testcase><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"> <testcase classname="rtp.strict_rtp" name="strict_rtp_yes" time="0.62"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"> <failure>Running tests/rtp/strict_rtp/strict_rtp_yes ...<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">[…]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">data=None, variable={}, async=False, channelid=None,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">^<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">SyntaxError: invalid syntax<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"></failure><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Apparently async is a reserved keyword now on python 3.7. The used distribution is Debian Buster, so nothing bleeding edge.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">I found a (one year old) pull-request at <a href="https://github.com/asterisk/starpy/pull/46/files">
https://github.com/asterisk/starpy/pull/46/files</a> that aparently fixes that bug.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">There is also another issue related to starpy:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">[Sep 28 16:28:00] ERROR[28954]: asterisk.test_case:607 _ami_connect: Exception raised in ami_connect:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">[..]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">File "/usr/local/lib/python3.7/dist-packages/starpy-1.0.3-py3.7.egg/starpy/manager.py", line 729, in inner<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">return func(*args, **kwargs)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">TypeError: originate() got an unexpected keyword argument 'nowait'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Test tests/apps/control_playback/nominal failed<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">I am a bit confused if this is the maintained way to use this framework.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">After spending one day on that I found by chance this post:
<a href="https://wiki.asterisk.org/wiki/display/AST/Using+Python3">https://wiki.asterisk.org/wiki/display/AST/Using+Python3</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">This seems to depend on a starpy version 1.1, which is not visible at all in the actual github its located.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Is this the appropriate way of running this framework now?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">If yes, it would be great to add a note or link it at the generic test suite documentation above, to save other people time to figure all this stuff out.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Henning<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-- <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Henning Westerholt – </span><a href="https://skalatan.de/blog/"><span lang="EN-GB" style="color:#0563C1">https://skalatan.de/blog/</span></a><span lang="EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Kamailio services – </span><a href="https://gilawa.com/"><span lang="EN-GB" style="color:#0563C1">https://gilawa.com</span></a><span lang="EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
</div>
</body>
</html>