[asterisk-commits] mnicholson: branch mnicholson/asttest r244689 - /team/mnicholson/asttest/astt...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 4 09:38:48 CST 2010


Author: mnicholson
Date: Thu Feb  4 09:38:45 2010
New Revision: 244689

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=244689
Log:
Added astlib_manager self test.

Added:
    team/mnicholson/asttest/asttest/self-tests/astlib_manager/
    team/mnicholson/asttest/asttest/self-tests/astlib_manager/test.lua   (with props)

Added: team/mnicholson/asttest/asttest/self-tests/astlib_manager/test.lua
URL: http://svnview.digium.com/svn/asterisk/team/mnicholson/asttest/asttest/self-tests/astlib_manager/test.lua?view=auto&rev=244689
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/astlib_manager/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/astlib_manager/test.lua Thu Feb  4 09:38:45 2010
@@ -1,0 +1,37 @@
+-- test spawning and connecting to asterisk
+
+a = ast.new()
+a:generate_manager_conf()
+
+a:spawn()
+
+posix.sleep(1)
+
+m, err = a:manager_connect()
+if not m then
+	fail("error connecting to asterisk: " .. err)
+end
+
+login = ast.manager.action:new("login")
+login["Username"] = "asttest"
+login["Secret"] = "asttest"
+
+logoff = ast.manager.action:new("logoff")
+
+r = m(login)
+if not r then
+	fail("error logging in to the manager: " .. err)
+end
+
+if r["Response"] ~= "Success" then
+	fail("error authenticating: " .. r["Message"])
+end
+
+r = m(logoff)
+
+status, err = a:term()
+if not status then
+	fail("error terminating asterisk: " .. err)
+end
+print("asterisk exited with status: " .. status)
+

Propchange: team/mnicholson/asttest/asttest/self-tests/astlib_manager/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/astlib_manager/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/astlib_manager/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the asterisk-commits mailing list