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

Henning Westerholt hw at gilawa.com
Thu Sep 29 06:57:16 CDT 2022


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.

Thanks,

Henning


--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://gilawa.com<https://gilawa.com/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20220929/bf118036/attachment.html>


More information about the asterisk-dev mailing list