No subject


Sun Jul 19 19:54:31 CDT 2009


Review: https://reviewboard.asterisk.org/r/638/


Added:
    asterisk/trunk/tests/queues/
    asterisk/trunk/tests/queues/macro_gosub_test/
    asterisk/trunk/tests/queues/macro_gosub_test/configs/
    asterisk/trunk/tests/queues/macro_gosub_test/configs/extensions.conf   (with props)
    asterisk/trunk/tests/queues/macro_gosub_test/configs/queues.conf   (with props)
    asterisk/trunk/tests/queues/macro_gosub_test/run-test   (with props)
    asterisk/trunk/tests/queues/macro_gosub_test/test-config.yaml   (with props)
    asterisk/trunk/tests/queues/macro_gosub_test/test.lua   (with props)
    asterisk/trunk/tests/queues/position_priority_maxlen/
    asterisk/trunk/tests/queues/position_priority_maxlen/configs/
    asterisk/trunk/tests/queues/position_priority_maxlen/configs/extensions.conf   (with props)
    asterisk/trunk/tests/queues/position_priority_maxlen/configs/queues.conf   (with props)
    asterisk/trunk/tests/queues/position_priority_maxlen/run-test   (with props)
    asterisk/trunk/tests/queues/position_priority_maxlen/test-config.yaml   (with props)
    asterisk/trunk/tests/queues/position_priority_maxlen/test.lua   (with props)
    asterisk/trunk/tests/queues/queue_baseline/
    asterisk/trunk/tests/queues/queue_baseline/configs/
    asterisk/trunk/tests/queues/queue_baseline/configs/extensions.conf   (with props)
    asterisk/trunk/tests/queues/queue_baseline/configs/queues.conf   (with props)
    asterisk/trunk/tests/queues/queue_baseline/run-test   (with props)
    asterisk/trunk/tests/queues/queue_baseline/test-config.yaml   (with props)
    asterisk/trunk/tests/queues/queue_baseline/test.lua   (with props)
    asterisk/trunk/tests/queues/ringinuse_and_pause/
    asterisk/trunk/tests/queues/ringinuse_and_pause/configs/
    asterisk/trunk/tests/queues/ringinuse_and_pause/configs/extensions.conf   (with props)
    asterisk/trunk/tests/queues/ringinuse_and_pause/configs/queues.conf   (with props)
    asterisk/trunk/tests/queues/ringinuse_and_pause/configs/sip.conf   (with props)
    asterisk/trunk/tests/queues/ringinuse_and_pause/run-test   (with props)
    asterisk/trunk/tests/queues/ringinuse_and_pause/sipp/
    asterisk/trunk/tests/queues/ringinuse_and_pause/sipp/uas.xml   (with props)
    asterisk/trunk/tests/queues/ringinuse_and_pause/test-config.yaml   (with props)
    asterisk/trunk/tests/queues/ringinuse_and_pause/test.lua   (with props)
    asterisk/trunk/tests/queues/wrapup_time/
    asterisk/trunk/tests/queues/wrapup_time/configs/
    asterisk/trunk/tests/queues/wrapup_time/configs/ast1/
    asterisk/trunk/tests/queues/wrapup_time/configs/ast1/queues.conf   (with props)
    asterisk/trunk/tests/queues/wrapup_time/configs/ast2/
    asterisk/trunk/tests/queues/wrapup_time/configs/ast2/queues.conf   (with props)
    asterisk/trunk/tests/queues/wrapup_time/configs/extensions.conf   (with props)
    asterisk/trunk/tests/queues/wrapup_time/run-test   (with props)
    asterisk/trunk/tests/queues/wrapup_time/test-config.yaml   (with props)
    asterisk/trunk/tests/queues/wrapup_time/test.lua   (with props)
Modified:
    asterisk/trunk/tests/tests.yaml

Added: asterisk/trunk/tests/queues/macro_gosub_test/configs/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/macro_gosub_test/configs/extensions.conf?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/macro_gosub_test/configs/extensions.conf (added)
+++ asterisk/trunk/tests/queues/macro_gosub_test/configs/extensions.conf Fri Jun  4 13:52:44 2010
@@ -1,0 +1,27 @@
+[test_context]
+
+exten => answerer,1,Answer
+exten => answerer,n,Wait(2)
+exten => answerer,n,Hangup
+
+exten => test1,1,Queue(test_queue)
+exten => test1,n,Hangup
+
+exten => test2,1,Queue(test_queue,,,,,,secondarymacro,secondarygosub)
+exten => test2,n,Hangup
+
+[macro-primarymacro]
+exten => s,1,Set(MACROVAR=primarymacro)
+exten => s,n,MacroExit
+
+[macro-secondarymacro]
+exten => s,1,Set(MACROVAR=secondarymacro)
+exten => s,n,MacroExit
+
+[primarygosub]
+exten => s,1,Set(GOSUBVAR=primarygosub)
+exten => s,n,Return
+
+[secondarygosub]
+exten => s,1,Set(GOSUBVAR=secondarygosub)
+exten => s,n,Return

Propchange: asterisk/trunk/tests/queues/macro_gosub_test/configs/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/queues/macro_gosub_test/configs/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/queues/macro_gosub_test/configs/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/queues/macro_gosub_test/configs/queues.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/macro_gosub_test/configs/queues.conf?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/macro_gosub_test/configs/queues.conf (added)
+++ asterisk/trunk/tests/queues/macro_gosub_test/configs/queues.conf Fri Jun  4 13:52:44 2010
@@ -1,0 +1,4 @@
+[test_queue]
+membermacro=primarymacro
+membergosub=primarygosub
+member => Local/answerer at test_context/n

Propchange: asterisk/trunk/tests/queues/macro_gosub_test/configs/queues.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/queues/macro_gosub_test/configs/queues.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/queues/macro_gosub_test/configs/queues.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/queues/macro_gosub_test/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/macro_gosub_test/run-test?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/macro_gosub_test/run-test (added)
+++ asterisk/trunk/tests/queues/macro_gosub_test/run-test Fri Jun  4 13:52:44 2010
@@ -1,0 +1,3 @@
+#!/bin/bash -e
+
+asttest -a / -s tests/queues/macro_gosub_test

Propchange: asterisk/trunk/tests/queues/macro_gosub_test/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/queues/macro_gosub_test/run-test
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/queues/macro_gosub_test/run-test
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/queues/macro_gosub_test/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/queues/macro_gosub_test/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/macro_gosub_test/test-config.yaml?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/macro_gosub_test/test-config.yaml (added)
+++ asterisk/trunk/tests/queues/macro_gosub_test/test-config.yaml Fri Jun  4 13:52:44 2010
@@ -1,0 +1,13 @@
+testinfo:
+    summary:     'Test Macro and Gosub execution upon answer of Queue calls'
+    description: |
+        'This test runs two calls through a queue. The queue is configured to run
+        a particular macro and gosub when a member answers. For the first call, we
+        ensure that the configured membermacro and membergosub are executed. In the
+        second call, we give overriding parameters to the Queue() application and
+        ensure that those are run instead.'
+
+properties:
+    minversion: '1.6.0'
+    dependencies:
+        - app: 'asttest'

Propchange: asterisk/trunk/tests/queues/macro_gosub_test/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/queues/macro_gosub_test/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/queues/macro_gosub_test/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/queues/macro_gosub_test/test.lua
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/macro_gosub_test/test.lua?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/macro_gosub_test/test.lua (added)
+++ asterisk/trunk/tests/queues/macro_gosub_test/test.lua Fri Jun  4 13:52:44 2010
@@ -1,0 +1,121 @@
+function manager_setup(a)
+	local m,err = a:manager_connect()
+	if not m then
+		fail("error connecting to asterisk: " .. err)
+	end
+
+	local login = ast.manager.action.login()
+	if not login then
+		fail("Failed to create manager login action")
+	end
+
+	local 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
+	return m
+end
+
+booted = nil
+function boot_event(event)
+	booted = true
+end
+
+function wait_until_booted(man)
+	man:register_event("FullyBooted", boot_event)
+	while not booted do
+		local res, err = man:wait_event()
+		if not res then
+			fail("Failure while waiting for FullyBooted event: " .. err)
+		end
+		man:process_events()
+	end
+	man:unregister_event("FullyBooted", boot_event)
+end
+
+function primary(event)
+	if event["Variable"] == "MACROVAR" then
+		if event["Value"] == "primarymacro" then
+			passmacro = true
+		end
+	end
+	if event["Variable"] == "GOSUBVAR" then
+		if event["Value"] == "primarygosub" then
+			passgosub = true
+		end
+	end
+end
+
+function secondary(event)
+	if event["Variable"] == "MACROVAR" then
+		if event["Value"] == "secondarymacro" then
+			passmacro = true
+		end
+	end
+	if event["Variable"] == "GOSUBVAR" then
+		if event["Value"] == "secondarygosub" then
+			passgosub = true
+		end
+	end
+end
+
+function test_call(exten, man, handler)
+	passmacro = false
+	passgosub = false
+	local orig = ast.manager.action:new("Originate")
+	man:register_event("VarSet", handler)
+	orig["Channel"] = "Local/" .. exten .."@test_context/n"
+	orig["Application"] = "Wait"
+	orig["Data"] = "3"
+
+	local res,err = man(orig)
+	if not res then
+		fail("Error originating call: " .. err)
+	end
+
+	if res["Response"] ~= "Success" then
+		fail("Failure response from Originate: " .. res["Message"])
+	end
+
+	--When the originate returns, we know that the member
+	--has answered the call, but we can't guarantee that
+	--the macro or gosub has actually run, so sleep for a
+	--sec for safety's sake
+	posix.sleep(1)
+	res, err = man:pump_messages()
+	if not res then
+		fail("Error pumping messages: " .. err)
+	end
+
+	man:process_events()
+	man:unregister_event("VarSet", handler)
+
+	if not passmacro then
+		fail("Did not get expected macro variable set")
+	end
+
+	if not passgosub then
+		fail("Did not get expected gosub variable set")
+	end
+end
+
+instance = ast.new()
+instance:load_config("configs/extensions.conf")
+instance:load_config("configs/queues.conf")
+instance:generate_manager_conf()
+instance:spawn()
+
+man = manager_setup(instance)
+
+wait_until_booted(man)
+
+test_call("test1", man, primary)
+test_call("test2", man, secondary)
+
+logoff = ast.manager.action.logoff()
+man(logoff)
+instance:term_or_kill()

Propchange: asterisk/trunk/tests/queues/macro_gosub_test/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/queues/macro_gosub_test/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/queues/macro_gosub_test/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/queues/position_priority_maxlen/configs/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/position_priority_maxlen/configs/extensions.conf?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/position_priority_maxlen/configs/extensions.conf (added)
+++ asterisk/trunk/tests/queues/position_priority_maxlen/configs/extensions.conf Fri Jun  4 13:52:44 2010
@@ -1,0 +1,5 @@
+[test_context]
+
+exten => test,1,Answer
+exten => test,n,Queue(test_queue,,,,,,,,,${QUEUE_POS})
+exten => test,n,Hangup

Propchange: asterisk/trunk/tests/queues/position_priority_maxlen/configs/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/queues/position_priority_maxlen/configs/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/queues/position_priority_maxlen/configs/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/queues/position_priority_maxlen/configs/queues.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/position_priority_maxlen/configs/queues.conf?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/position_priority_maxlen/configs/queues.conf (added)
+++ asterisk/trunk/tests/queues/position_priority_maxlen/configs/queues.conf Fri Jun  4 13:52:44 2010
@@ -1,0 +1,4 @@
+[test_queue]
+eventwhencalled=yes
+joinempty=yes
+maxlen=11

Propchange: asterisk/trunk/tests/queues/position_priority_maxlen/configs/queues.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/queues/position_priority_maxlen/configs/queues.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/queues/position_priority_maxlen/configs/queues.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/queues/position_priority_maxlen/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/position_priority_maxlen/run-test?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/position_priority_maxlen/run-test (added)
+++ asterisk/trunk/tests/queues/position_priority_maxlen/run-test Fri Jun  4 13:52:44 2010
@@ -1,0 +1,3 @@
+#!/bin/bash -e
+
+asttest -a / -s tests/queues/position_priority_maxlen

Propchange: asterisk/trunk/tests/queues/position_priority_maxlen/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/queues/position_priority_maxlen/run-test
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/queues/position_priority_maxlen/run-test
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/queues/position_priority_maxlen/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/queues/position_priority_maxlen/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/position_priority_maxlen/test-config.yaml?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/position_priority_maxlen/test-config.yaml (added)
+++ asterisk/trunk/tests/queues/position_priority_maxlen/test-config.yaml Fri Jun  4 13:52:44 2010
@@ -1,0 +1,14 @@
+testinfo:
+    summary:     'Ensure queue callers are entered into the proper position in the queue.'
+    description: |
+        "This test enters several callers into a queue, assigning various priorities and
+        positions to the callers. As each caller enters, we inspect the 'Join' manager event
+        to ensure that the caller has entered the queue in the position we expect."
+
+properties:
+    minversion: 'trunk'
+    dependencies:
+        - app : 'bash'
+        - app : 'sipp'
+        - app : 'asttest'
+

Propchange: asterisk/trunk/tests/queues/position_priority_maxlen/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/queues/position_priority_maxlen/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/queues/position_priority_maxlen/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/queues/position_priority_maxlen/test.lua
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/position_priority_maxlen/test.lua?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/position_priority_maxlen/test.lua (added)
+++ asterisk/trunk/tests/queues/position_priority_maxlen/test.lua Fri Jun  4 13:52:44 2010
@@ -1,0 +1,110 @@
+function manager_setup(a)
+	local m, err = a:manager_connect()
+	if not m then
+		fail("error connecting to asterisk: " .. err)
+	end
+
+	login = ast.manager.action.login()
+	if not login then
+		fail("Couldn't create login?")
+	end
+
+	local r, err = 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
+	return m
+end
+
+function setup_ast_instance()
+	local instance = ast.new()
+	instance:load_config("configs/extensions.conf")
+	instance:load_config("configs/queues.conf")
+	instance:generate_manager_conf()
+	instance:spawn()
+	return instance
+end
+
+booted = nil
+function boot_event(event)
+	booted = true
+end
+
+function wait_until_booted(man)
+	man:register_event("FullyBooted", boot_event)
+	while not booted do
+		local res, err = man:wait_event()
+		if not res then
+			fail("Failure while waiting for FullyBooted event: " .. err)
+		end
+		man:process_events()
+	end
+	man:unregister_event("FullyBooted", boot_event)
+end
+
+function join_event(event)
+	actual_position = tonumber(event["Position"])
+end
+
+function test_call(priority, position, expected_position)
+	local prio_string = ""
+	local pos_string = ""
+	local comma = ""
+	actual_position = nil
+	man:register_event("Join", join_event)
+	local orig = ast.manager.action:new("Originate")
+	orig["Channel"] = "Local/test at test_context/n"
+	orig["Application"] = "Wait"
+	orig["Data"] = "100"
+	if priority then
+		prio_string = "QUEUE_PRIO=" .. priority
+	end
+	if position then
+		pos_string = "QUEUE_POS=" .. position
+	end
+	if position and priority then
+		comma = ","
+	end
+	orig["Variable"] = pos_string .. comma .. prio_string
+	local res, err = man(orig)
+	if not res then
+		fail("Failed to send originate: " .. err)
+	end
+
+	if res["Response"] ~= "Success" then
+		fail("Originate response is an error: " .. res["Message"])
+	end
+	posix.sleep(1)
+	res, err = man:pump_messages()
+	if not res then
+		fail("Error pumping messages: " .. err)
+	end
+	man:process_events()
+	man:unregister_event("Join", join_event)
+	if actual_position ~= expected_position then
+		fail("Expected caller to enter at position " .. tostring(expected_position) .. " but entered at " .. tostring(actual_position))
+	end
+end
+
+instance = setup_ast_instance()
+man = manager_setup(instance)
+wait_until_booted(man)
+test_call(nil, nil, 1) --1
+test_call(nil, nil, 2) --1,2
+test_call(1, nil, 1)   --3,1,2
+test_call(1, nil, 2)   --3,4,1,2
+test_call(2, nil, 1)   --5,3,4,1,2
+test_call(nil, 5, 5)   --5,3,4,1,6,2
+test_call(nil, 200, 7) --5,3,4,1,6,2,7
+test_call(nil, 1, 4)   --5,3,4,8,1,6,2,7
+test_call(8, 3, 1)     --9,5,3,4,8,1,6,2,7
+test_call(1, 7, 5)     --9,5,3,4,10,8,1,6,2,7
+test_call(1, 4, 4)     --9,5,3,11,4,10,8,1,6,2,7
+test_call(2, 5, nil)   --Can't enter due to maxlen
+logoff = ast.manager.action.logoff()
+man(logoff)
+instance:term_or_kill()

Propchange: asterisk/trunk/tests/queues/position_priority_maxlen/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/queues/position_priority_maxlen/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/queues/position_priority_maxlen/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/queues/queue_baseline/configs/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/queue_baseline/configs/extensions.conf?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/queue_baseline/configs/extensions.conf (added)
+++ asterisk/trunk/tests/queues/queue_baseline/configs/extensions.conf Fri Jun  4 13:52:44 2010
@@ -1,0 +1,12 @@
+[test_context]
+
+exten => test,1,Answer
+exten => test,n,Wait(1)
+exten => test,n,Hangup
+
+exten => queue,1,Queue(test_queue)
+exten => queue,n,Hangup
+
+exten => member,1,Answer
+exten => member,n,Wait(2)
+exten => member,n,Hangup

Propchange: asterisk/trunk/tests/queues/queue_baseline/configs/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/queues/queue_baseline/configs/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/queues/queue_baseline/configs/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/queues/queue_baseline/configs/queues.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/queue_baseline/configs/queues.conf?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/queue_baseline/configs/queues.conf (added)
+++ asterisk/trunk/tests/queues/queue_baseline/configs/queues.conf Fri Jun  4 13:52:44 2010
@@ -1,0 +1,5 @@
+[general]
+
+[test_queue]
+eventwhencalled = yes
+member => Local/member at test_context

Propchange: asterisk/trunk/tests/queues/queue_baseline/configs/queues.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/queues/queue_baseline/configs/queues.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/queues/queue_baseline/configs/queues.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/queues/queue_baseline/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/queue_baseline/run-test?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/queue_baseline/run-test (added)
+++ asterisk/trunk/tests/queues/queue_baseline/run-test Fri Jun  4 13:52:44 2010
@@ -1,0 +1,3 @@
+#!/bin/bash -e
+
+asttest -a / -s tests/queues/queue_baseline

Propchange: asterisk/trunk/tests/queues/queue_baseline/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/queues/queue_baseline/run-test
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/queues/queue_baseline/run-test
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/queues/queue_baseline/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/queues/queue_baseline/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/queue_baseline/test-config.yaml?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/queue_baseline/test-config.yaml (added)
+++ asterisk/trunk/tests/queues/queue_baseline/test-config.yaml Fri Jun  4 13:52:44 2010
@@ -1,0 +1,11 @@
+testinfo:
+    summary:     'Get a baseline for Queue operations'
+    description: |
+        'This test runs a single call to a single queue that has a single
+        member in it. We monitor the manager events for five specific events
+        that let us know that the call went through the queue as expected.'
+
+properties:
+    minversion: '1.4'
+    dependencies:
+        - app: 'asttest'

Propchange: asterisk/trunk/tests/queues/queue_baseline/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/queues/queue_baseline/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/queues/queue_baseline/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/queues/queue_baseline/test.lua
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/queue_baseline/test.lua?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/queue_baseline/test.lua (added)
+++ asterisk/trunk/tests/queues/queue_baseline/test.lua Fri Jun  4 13:52:44 2010
@@ -1,0 +1,113 @@
+function manager_setup(a)
+	local m,err = a:manager_connect()
+	if not m then
+		fail("error connecting to asterisk: " .. err)
+	end
+
+	login = ast.manager.action.login()
+	if not login then
+		fail("Couldn't create login?")
+	end
+
+	local 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
+	return m
+end
+
+booted = nil
+function boot_event(event)
+	booted = true
+end
+
+function wait_until_booted(man)
+	man:register_event("FullyBooted", boot_event)
+	while not booted do
+		local res, err = man:wait_event()
+		if not res then
+			fail("Failure while waiting for FullyBooted event: " .. err)
+		end
+		man:process_events()
+	end
+	man:unregister_event("FullyBooted", boot_event)
+end
+
+join = nil
+function join_event(event)
+	join = 1
+end
+
+called = nil
+function called_event(event)
+	called = 1
+end
+
+connect = nil
+function connect_event(event)
+	connect = 1
+end
+
+leave = nil
+function leave_event(event)
+	leave = 1
+end
+
+complete = nil
+function complete_event(event)
+	complete = 1
+end
+
+function do_call(man)
+	local orig = ast.manager.action:new("Originate")
+	orig["Channel"] = "Local/test at test_context"
+	orig["Exten"] = "queue"
+	orig["Context"] = "test_context"
+	orig["Priority"] = "1"
+	man:register_event("Join", join_event)
+	man:register_event("AgentCalled", called_event)
+	man:register_event("AgentConnect", connect_event)
+	man:register_event("Leave", leave_event)
+	man:register_event("AgentComplete", complete_event)
+	local res, err = man(orig)
+	if not res then
+		fail("Error originating call: " .. err)
+	end
+	if res["Response"] ~= "Success" then
+		fail("Response failure for Originate: " .. res["Message"])
+	end
+	posix.sleep(2)
+	res, err = man:pump_messages()
+	if not res then
+		fail("Error pumping messages: " .. err)
+	end
+	man:process_events()
+	man:unregister_event("Join", join_event)
+	man:unregister_event("AgentCalled", called_event)
+	man:unregister_event("AgentConnect", connect_event)
+	man:unregister_event("Leave", leave_event)
+	man:unregister_event("AgentComplete", complete_event)
+end
+
+instance = ast.new()
+instance:load_config("configs/extensions.conf")
+instance:load_config("configs/queues.conf")
+instance:generate_manager_conf()
+instance:spawn()
+
+man = manager_setup(instance)
+
+wait_until_booted(man)
+
+do_call(man)
+logoff = ast.manager.action.logoff()
+man(logoff)
+instance:term_or_kill()
+
+if not join or not called or not connect or not leave or not complete then
+	fail ("Failed to capture one of our expected events")
+end

Propchange: asterisk/trunk/tests/queues/queue_baseline/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/queues/queue_baseline/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/queues/queue_baseline/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/queues/ringinuse_and_pause/configs/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/ringinuse_and_pause/configs/extensions.conf?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/ringinuse_and_pause/configs/extensions.conf (added)
+++ asterisk/trunk/tests/queues/ringinuse_and_pause/configs/extensions.conf Fri Jun  4 13:52:44 2010
@@ -1,0 +1,7 @@
+[test_context]
+
+exten => queue1,1,Queue(test_queue1,n,,,3)
+exten => queue1,n,Hangup
+
+exten => queue2,1,Queue(test_queue2,n,,,3)
+exten => queue2,n,Hangup

Propchange: asterisk/trunk/tests/queues/ringinuse_and_pause/configs/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/queues/ringinuse_and_pause/configs/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/queues/ringinuse_and_pause/configs/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/queues/ringinuse_and_pause/configs/queues.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/ringinuse_and_pause/configs/queues.conf?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/ringinuse_and_pause/configs/queues.conf (added)
+++ asterisk/trunk/tests/queues/ringinuse_and_pause/configs/queues.conf Fri Jun  4 13:52:44 2010
@@ -1,0 +1,15 @@
+[test_queue1]
+eventwhencalled=yes
+ringinuse=no
+autopause=yes
+timeout=1
+retry=1
+member=SIP/member
+
+[test_queue2]
+eventwhencalled=yes
+ringinuse=yes
+autopause=yes
+timeout=1
+retry=1
+member=SIP/member

Propchange: asterisk/trunk/tests/queues/ringinuse_and_pause/configs/queues.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/queues/ringinuse_and_pause/configs/queues.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/queues/ringinuse_and_pause/configs/queues.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/queues/ringinuse_and_pause/configs/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/ringinuse_and_pause/configs/sip.conf?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/ringinuse_and_pause/configs/sip.conf (added)
+++ asterisk/trunk/tests/queues/ringinuse_and_pause/configs/sip.conf Fri Jun  4 13:52:44 2010
@@ -1,0 +1,11 @@
+[general]
+udpbindaddr=127.0.0.1:5060
+canreinvite=no
+videosupport=yes
+
+[member]
+type = friend
+host = 127.0.0.1
+port = 5061
+context = test_context
+call-limit=3

Propchange: asterisk/trunk/tests/queues/ringinuse_and_pause/configs/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/queues/ringinuse_and_pause/configs/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/queues/ringinuse_and_pause/configs/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/queues/ringinuse_and_pause/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/ringinuse_and_pause/run-test?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/ringinuse_and_pause/run-test (added)
+++ asterisk/trunk/tests/queues/ringinuse_and_pause/run-test Fri Jun  4 13:52:44 2010
@@ -1,0 +1,3 @@
+#!/bin/bash -e
+
+asttest -a / -s tests/queues/ringinuse_and_pause

Propchange: asterisk/trunk/tests/queues/ringinuse_and_pause/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/queues/ringinuse_and_pause/run-test
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/queues/ringinuse_and_pause/run-test
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/queues/ringinuse_and_pause/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/queues/ringinuse_and_pause/sipp/uas.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/queues/ringinuse_and_pause/sipp/uas.xml?view=auto&rev=344
==============================================================================
--- asterisk/trunk/tests/queues/ringinuse_and_pause/sipp/uas.xml (added)
+++ asterisk/trunk/tests/queues/ringinuse_and_pause/sipp/uas.xml Fri Jun  4 13:52:44 2010
@@ -1,0 +1,115 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<!-- This program is free software; you can redistribute it and/or      -->
+<!-- modify it under the terms of the GNU General Public License as     -->
+<!-- published by the Free Software Foundation; either version 2 of the -->
+<!-- License, or (at your option) any later version.                    -->
+<!--                                                                    -->
+<!-- This program is distributed in the hope that it will be useful,    -->
+<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of     -->
+<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      -->
+<!-- GNU General Public License for more details.                       -->
+<!--                                                                    -->
+<!-- You should have received a copy of the GNU General Public License  -->
+<!-- along with this program; if not, write to the                      -->
+<!-- Free Software Foundation, Inc.,                                    -->
+<!-- 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA             -->
+<!--                                                                    -->
+<!--                 Sipp default 'uas' scenario.                       -->
+<!--                                                                    -->
+
+<scenario name="Basic UAS responder">
+  <!-- By adding rrs="true" (Record Route Sets), the route sets         -->
+  <!-- are saved and used for following messages sent. Useful to test   -->
+  <!-- against stateful SIP proxies/B2BUAs.                             -->
+  <recv request="INVITE" crlf="true">
+  </recv>
+
+  <!-- The '[last_*]' keyword is replaced automatically by the          -->
+  <!-- specified header if it was present in the last message received  -->
+  <!-- (except if it was a retransmission). If the header was not       -->
+  <!-- present or if no message has been received, the '[last_*]'       -->
+  <!-- keyword is discarded, and all bytes until the end of the line    -->
+  <!-- are also discarded.                                              -->
+  <!--                                                                  -->
+  <!-- If the specified header was present several times in the         -->
+  <!-- message, all occurences are concatenated (CRLF seperated)        -->
+  <!-- to be used in place of the '[last_*]' keyword.                   -->
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 180 Ringing
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Type: application/sdp
+      Content-Length: [len]
+
+      v=0
+      o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
+      s=-

[... 661 lines stripped ...]



More information about the asterisk-commits mailing list