[asterisk-dev] questions about setup of testsuite, docs and python troubles

Joshua C. Colp jcolp at sangoma.com
Thu Sep 29 07:00:59 CDT 2022


On Thu, Sep 29, 2022 at 8:57 AM Henning Westerholt <hw at gilawa.com> wrote:

> Hello,
>
>
>
> is there a current documentation about setup the asterisk unit tests? This
> documentation seems to be outdated:
>
>
> https://wiki.asterisk.org/wiki/display/AST/Installing+the+Asterisk+Test+Suite
>
>
>
> I also followed some blog posts from on asterisk.org, but they also did
> not help as they seem to be outdated as well.
>
>
>
> The docs specify that the unit test framework is still using python2.
>
> But according to the contrib/scripts/install_prereq its already switched
> to python3, which is also indicated in the runtest.py command.
>
>
>
> Unfortunately, the starpy fails for python3:
>
>
>
>     </testcase>
>
>     <testcase classname="rtp.strict_rtp" name="strict_rtp_yes" time="0.62">
>
>       <failure>Running tests/rtp/strict_rtp/strict_rtp_yes ...
>
> […]
>
> data=None, variable={}, async=False, channelid=None,
>
> ^
>
> SyntaxError: invalid syntax
>
> </failure>
>
>
>
> Apparently async is a reserved keyword now on python 3.7. The used
> distribution is Debian Buster, so nothing bleeding edge.
>
> I found a (one year old) pull-request at
> https://github.com/asterisk/starpy/pull/46/files that aparently fixes
> that bug.
>
>
>
> There is also another issue related to starpy:
>
>
>
> [Sep 28 16:28:00] ERROR[28954]: asterisk.test_case:607 _ami_connect:
> Exception raised in ami_connect:
>
> [..]
>
> File
> "/usr/local/lib/python3.7/dist-packages/starpy-1.0.3-py3.7.egg/starpy/manager.py",
> line 729, in inner
>
> return func(*args, **kwargs)
>
> TypeError: originate() got an unexpected keyword argument 'nowait'
>
> Test tests/apps/control_playback/nominal failed
>
>
>
> I am a bit confused if this is the maintained way to use this framework.
>
>
>
> After spending one day on that I found by chance this post:
> https://wiki.asterisk.org/wiki/display/AST/Using+Python3
>
> This seems to depend on a starpy version 1.1, which is not visible at all
> in the actual github its located.
>
>
>
> Is this the appropriate way of running this framework now?
>
> 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.
>

This is the appropriate way to run the framework, and I've updated the
"Using Python3" page and also the "Installing the Asterisk Test Suite"
page. Sorry for the trouble, the dust is still settling on the huge move to
Python 3.

-- 
Joshua C. Colp
Asterisk Project Lead
Sangoma Technologies
Check us out at www.sangoma.com and www.asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20220929/9c19dc12/attachment-0001.html>


More information about the asterisk-dev mailing list