[asterisk-dev] Test framework (changed topic)

Terry Wilson twilson at digium.com
Wed Mar 18 19:06:24 CDT 2009


> I think we could discuss this till we're all blue in the face.
>
> It seems that developing an architecture for something always goes  
> round
> in circles.
>
> So,  why don't we just start by writing one test for one function.
>
> Something simple to start with.
>
> So, like lets start with sending manager commands and getting an
> expected response.

I have written a tool that will asynchronously connect to multiple  
machines at once and run a set of pretests, tests, and posttests over  
either SSH or Manager and looks for the appropriate return value of  
the SSH command or Response from the Manager interface.  It can also  
listen for specific manager events, etc.

You can set up commands to be executed over SSH (to download, install,  
configure, and start Asterisk for instance) as pretests, then listen  
for manager events, test for existence of files, run asterisk -rx  
commands, or whatever) and then do any cleanup in posttests.

Pretests and posttests run sequentially (per server), and tests run  
asynchronously (so you can listen for multiple manager events  
simultaneously, for instance).

There is currently both a simple Tk and curses based interface that  
shows the output of all of the commands for each server and also a  
list of tests that are running/passed/failed, etc.

Everything is controlled by a YAML config file.  It is still pretty  
rough, but I've used it to install Skype for Asterisk on 10 servers,  
set up asterisk on them, and listen for registration events over  
manager.  I could probably clean it up and make it available if people  
were interested.  It is in that "I had an itch and scratched it"  
state, so there isn't much documentation, etc.  But, I did write it to  
make adding new frontends, and protocols fairly trivial.  Everything  
is written in Python and uses the Twisted framework.

Terry



More information about the asterisk-dev mailing list