[svn-commits] mnicholson: branch mnicholson/asttest r250759 - /team/mnicholson/asttest/astt...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Mar 4 14:23:39 CST 2010


Author: mnicholson
Date: Thu Mar  4 14:23:35 2010
New Revision: 250759

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=250759
Log:
Updated the README file a bit

Modified:
    team/mnicholson/asttest/asttest/README

Modified: team/mnicholson/asttest/asttest/README
URL: http://svnview.digium.com/svn/asterisk/team/mnicholson/asttest/asttest/README?view=diff&rev=250759&r1=250758&r2=250759
==============================================================================
--- team/mnicholson/asttest/asttest/README (original)
+++ team/mnicholson/asttest/asttest/README Thu Mar  4 14:23:35 2010
@@ -2,24 +2,15 @@
 ==============
 
 Asttest is a framework for doing automated testing of asterisk.  It can be used 
-to test asterisk channels, asterisk applications, asterisk cdr, the manager 
-interface, asterisk dialplans, and other parts of asterisk.
-
-Asttest Structure
-=================
-
-Asttest is broken up into two main parts:  the asttest test driver and the 
-res_asttest asterisk module.  The test driver controls the execution of tests 
-and collects the results.  The res_asttest asterisk module provides access to 
-internal asterisk APIs and can emulate a channel driver if necessary.
+to spawn asterisk and other processes, interact with the manager interface, and 
+other related testing tasks.
 
 Writing Tests
 =============
 
 The structure of a test will be different depending on what is being tested.  
-All tests require a test.lua file in the given test directory and most tests 
-will also include one or res_asttest test scripts.  The directory layout for 
-tests is as follows:
+All tests require a test.lua file in the given test directory.  The directory 
+layout for tests is as follows:
 
 main_test_dir/
    test1/
@@ -35,29 +26,46 @@
 manager interface, parse log files, etc.  Test.lua is also responsible for 
 notifiying asttest of the test result.
 
-res_asttest
-===========
+When running in single test mode (the -s flag, see below) the directory 
+structure is as follows:
 
-The res_asttest module can be used for tests that need access to the internals 
-of asterisk.  This module can execute tests via the manager interface.  The 
-tests have the ability to create asterisk channels and access internal asterisk 
-API calls.  Tests executed via the RunTest manager action should have the 
-folloing function signature:
+test1/
+   test.lua
 
-tests.test_name(args)
+When a test is run, the working directory will be changed to the test directory 
+and all paths in the test will be intrepreted relative to that directory.
 
-Res_asttest also has the ability to terminate calls from the Dial applcation.  
-For example:
+Running Tests
+=============
 
-; dial res_asttest
-exten s,1,Dial(asttest/test_name)
+Asttest can be run in two modes. It can be used to execute a directory full of 
+tests, or it can execute a single test.  Documentation for the various options 
+asttest accepts can be found by passing the -h flag to asttest.
 
-This will execute the given test name using the following fuction call:
+To execute a directory full of tests, pass asttest the path to the directory.
 
-tests.test_name(channel, data)
+asttest my-test-dir/
 
-The test can then read and write data to and from the channel and initiate 
-transfers and other events.
+To execute a single test (useful for interfacing with run-tests.py), pass 
+asstest the -s flag specifiying the directory the desired test is in.
+
+asttest -s my-test-dir/my-test
+
+When executing in single test mode, asttest will send all output to stdout and 
+will return non-zero on error.
+
+Using asttest with run-tests.py
+===============================
+
+To use asttest with run-tests.py, a script similar to the following can be 
+used.
+
+#!/bin/bash -e
+asttest -a / -s tests/my-test
+
+The -a option indicates the location of the asterisk installation to use for 
+the test and the -s option turns on single test mode and indicates the 
+directory the test is located in.
 
 
 vim: set fo=tqwal:




More information about the svn-commits mailing list