diff --git a/tests/apps/mixmonitor_loop/configs/ast1/extensions.conf b/tests/apps/mixmonitor_loop/configs/ast1/extensions.conf new file mode 100755 index 000000000..7a75ad0dc --- /dev/null +++ b/tests/apps/mixmonitor_loop/configs/ast1/extensions.conf @@ -0,0 +1,20 @@ +[default] +exten => s,1,Answer() + same => n,Set(i=0) + same => n,While($[${INC(i)}<1100]) ; more than the default # of file descriptors per process + same => n,MixMonitor(test.wav) + same => n,EndWhile() + same => n,While($[${INC(i)}<2200]) + same => n,MixMonitor(test2.wav,r(test2-rx.wav)t(test2-tx.wav)) + same => n,EndWhile() + same => n,StopMixMonitor() + same => n,MixMonitor(test3.wav) + same => n,Wait(0.1) + same => n,StopMixMonitor() + same => n,ExecIf(${STAT(e,${AST_CONFIG(asterisk.conf,directories,astspooldir}/monitor/test3.wav)}?UserEvent(MixMonitorSuccess,Result: Pass):UserEvent(MixMonitorSuccess,Result: Fail)) + same => n,Hangup() + +[nothing] +exten => 0,1,Answer() + same => n,Wait(8) + same => n,Hangup() diff --git a/tests/apps/mixmonitor_loop/test-config.yaml b/tests/apps/mixmonitor_loop/test-config.yaml new file mode 100755 index 000000000..5cc251567 --- /dev/null +++ b/tests/apps/mixmonitor_loop/test-config.yaml @@ -0,0 +1,60 @@ +testinfo: + summary: 'Ensure that MixMonitor called in a loop acts sanely.' + description: | + 'This tests calling MixMonitor in a loop to ensure that + duplicate recordings do not get opened, consuming all + available file descriptor resources.' + +test-modules: + test-object: + config-section: test-object-config + typename: 'test_case.TestCaseModule' + modules: + - + config-section: caller-originator + typename: 'pluggable_modules.Originator' + - + config-section: hangup-monitor + typename: 'pluggable_modules.HangupMonitor' + - + config-section: ami-config + typename: 'pluggable_modules.EventActionModule' + +test-object-config: + connect-ami: True + +caller-originator: + channel: 'Local/s@default' + context: 'nothing' + exten: '0' + priority: '1' + trigger: 'ami_connect' + +hangup-monitor: + ids: '0' + +ami-config: + - + ami-events: + conditions: + match: + Event: 'UserEvent' + UserEvent: 'MixMonitorSuccess' + requirements: + match: + Result: 'Pass' + count: 1 + stop_test: + +properties: + tags: + - dial + - apps + dependencies: + - python: 'twisted' + - python: 'starpy' + - asterisk: 'app_dial' + - asterisk: 'app_userevent' + - asterisk: 'app_originate' + - asterisk: 'app_mixmonitor' + - asterisk: 'pbx_config' diff --git a/tests/apps/tests.yaml b/tests/apps/tests.yaml index fc1a0d7dd..2b04c4ad5 100644 --- a/tests/apps/tests.yaml +++ b/tests/apps/tests.yaml @@ -15,6 +15,7 @@ tests: - test: 'mixmonitor_rxtx' - test: 'mixmonitor_audiohook_inherit' - test: 'mixmonitor_func' + - test: 'mixmonitor_loop' - dir: 'control_playback' - dir: 'playback' - test: 'say_interrupt'