Author: mjordan Date: Thu Aug 14 15:26:58 2014 New Revision: 5448 URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=5448 Log: (rest_api/bridges|rest_api/channels)/playback: Add reverse/foward tests
This patch adds four tests for the rest_api/{bridges|channels}/playback tests: (1) Test reversing a playback on a channel. This puts a local channel half into Stasis, and then plays back a sound on it (tt-monkeys). Upon starting the sound, the playback gets reversed using /control?operation=reverse and a TestEvent gets released that signifies a reversal has occurred. (2) Test forwarding a playback on a channel. This does the same thing as Test 1 except that it uses the /control?operation=forward ARI command to forward the playback, and looks for a FastForward TestEvent. (3) Test reversing a playback on a bridge. This does the same thing as Test 1 except that a channel gets put into a bridge, and the bridge instead is the one that starts the playback. (4) Test forwarding a playback on a bridge. This does the same thing as Test 3 except that it uses the /control?operation=forward command on the bridge. Review: https://reviewboard.asterisk.org/r/3842/ ASTERISK-24092 #close patches: playback.diff uploaded by cwolfe (License 6609) Added: asterisk/trunk/tests/rest_api/bridges/playback/forward/ asterisk/trunk/tests/rest_api/bridges/playback/forward/configs/ asterisk/trunk/tests/rest_api/bridges/playback/forward/configs/ast1/ asterisk/trunk/tests/rest_api/bridges/playback/forward/configs/ast1/extensions.conf (with props) asterisk/trunk/tests/rest_api/bridges/playback/forward/test-config.yaml (with props) asterisk/trunk/tests/rest_api/bridges/playback/reverse/ asterisk/trunk/tests/rest_api/bridges/playback/reverse/configs/ asterisk/trunk/tests/rest_api/bridges/playback/reverse/configs/ast1/ asterisk/trunk/tests/rest_api/bridges/playback/reverse/configs/ast1/extensions.conf (with props) asterisk/trunk/tests/rest_api/bridges/playback/reverse/test-config.yaml (with props) asterisk/trunk/tests/rest_api/channels/playback/forward/ asterisk/trunk/tests/rest_api/channels/playback/forward/configs/ asterisk/trunk/tests/rest_api/channels/playback/forward/configs/ast1/ asterisk/trunk/tests/rest_api/channels/playback/forward/configs/ast1/extensions.conf (with props) asterisk/trunk/tests/rest_api/channels/playback/forward/test-config.yaml (with props) asterisk/trunk/tests/rest_api/channels/playback/reverse/ asterisk/trunk/tests/rest_api/channels/playback/reverse/configs/ asterisk/trunk/tests/rest_api/channels/playback/reverse/configs/ast1/ asterisk/trunk/tests/rest_api/channels/playback/reverse/configs/ast1/extensions.conf (with props) asterisk/trunk/tests/rest_api/channels/playback/reverse/test-config.yaml (with props) Modified: asterisk/trunk/tests/rest_api/bridges/playback/tests.yaml asterisk/trunk/tests/rest_api/channels/playback/tests.yaml Added: asterisk/trunk/tests/rest_api/bridges/playback/forward/configs/ast1/extensions.conf URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/playback/forward/configs/ast1/extensions.conf?view=auto&rev=5448 ============================================================================== --- asterisk/trunk/tests/rest_api/bridges/playback/forward/configs/ast1/extensions.conf (added) +++ asterisk/trunk/tests/rest_api/bridges/playback/forward/configs/ast1/extensions.conf Thu Aug 14 15:26:58 2014 @@ -1,0 +1,5 @@ +[default] +exten => s,1,NoOp() + same => n,Answer() + same => n,Echo() + same => n,Hangup() Propchange: asterisk/trunk/tests/rest_api/bridges/playback/forward/configs/ast1/extensions.conf ------------------------------------------------------------------------------ svn:eol-style = native Propchange: asterisk/trunk/tests/rest_api/bridges/playback/forward/configs/ast1/extensions.conf ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Propchange: asterisk/trunk/tests/rest_api/bridges/playback/forward/configs/ast1/extensions.conf ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: asterisk/trunk/tests/rest_api/bridges/playback/forward/test-config.yaml URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/playback/forward/test-config.yaml?view=auto&rev=5448 ============================================================================== --- asterisk/trunk/tests/rest_api/bridges/playback/forward/test-config.yaml (added) +++ asterisk/trunk/tests/rest_api/bridges/playback/forward/test-config.yaml Thu Aug 14 15:26:58 2014 @@ -1,0 +1,124 @@ +testinfo: + summary: Tests that the forward ARI playback command on bridges works as intended + description: | + This test puts a local channel half into Stasis, and the other into the Echo + application. The channel that enters Stasis then gets put into a bridge. + Starts an ARI playback of tt-monkeys on the bridge, and as soon as the playback + starts, fast forwards the playback. Test passes if a playback FastForward + TestEvent gets received. + +test-modules: + add-test-to-search-path: True + test-object: + config-section: test-object-config + typename: ari.AriOriginateTestObject + modules: + - config-section: ari-config + typename: ari.WebSocketEventModule + - + config-section: ami-config + typename: ami.AMIEventModule + +apps: testsuite + +test-object-config: + test-iterations: + - + endpoint: 'Local/s@default' + channelId: 'theChannel' + app: 'testsuite' + + +ari-config: + events: + - + conditions: + match: + type: StasisStart + application: testsuite + channel: + id: 'theChannel' + count: 1 + requests: + - + method: 'post' + uri: 'bridges/theBridge' + - + method: 'post' + uri: 'bridges/theBridge/addChannel' + params: + channel: 'theChannel' + - + conditions: + match: + type: ChannelEnteredBridge + application: testsuite + bridge: + id: 'theBridge' + channel: + id: 'theChannel' + requests: + - + method: 'post' + uri: 'bridges/theBridge/play/monkeys' + params: + media: 'sound:tt-monkeys' + - + conditions: + match: + type: PlaybackStarted + application: testsuite + playback: + id: 'monkeys' + target_uri: 'bridge:theBridge$' + media_uri: 'sound:tt-monkeys' + count: 1 + requests: + - + method: 'post' + uri: 'playbacks/monkeys/control?operation=forward' + - + delay: 3 + method: 'delete' + uri: 'playbacks/monkeys' + - + conditions: + match: + type: PlaybackFinished + application: testsuite + playback: + id: 'monkeys' + target_uri: 'bridge:theBridge$' + media_uri: 'sound:tt-monkeys' + count: 1 + requests: + - + method: 'delete' + uri: 'bridges/theBridge' + - + method: 'delete' + uri: 'channels/theChannel' + +ami-config: + - + type: 'headermatch' + id: '0' + conditions: + match: + Event: 'TestEvent' + State: 'PLAYBACK' + Control: 'FastForward' + SkipMs: '3000' + +properties: + minversion: '12.0.0' + dependencies: + - python : autobahn.websocket + - python : requests + - python : twisted + - python : starpy + - asterisk : res_ari_channels + - asterisk : res_ari_bridges + - asterisk : res_ari_playbacks + tags: + - ARI Propchange: asterisk/trunk/tests/rest_api/bridges/playback/forward/test-config.yaml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: asterisk/trunk/tests/rest_api/bridges/playback/forward/test-config.yaml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Propchange: asterisk/trunk/tests/rest_api/bridges/playback/forward/test-config.yaml ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: asterisk/trunk/tests/rest_api/bridges/playback/reverse/configs/ast1/extensions.conf URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/playback/reverse/configs/ast1/extensions.conf?view=auto&rev=5448 ============================================================================== --- asterisk/trunk/tests/rest_api/bridges/playback/reverse/configs/ast1/extensions.conf (added) +++ asterisk/trunk/tests/rest_api/bridges/playback/reverse/configs/ast1/extensions.conf Thu Aug 14 15:26:58 2014 @@ -1,0 +1,5 @@ +[default] +exten => s,1,NoOp() + same => n,Answer() + same => n,Echo() + same => n,Hangup() Propchange: asterisk/trunk/tests/rest_api/bridges/playback/reverse/configs/ast1/extensions.conf ------------------------------------------------------------------------------ svn:eol-style = native Propchange: asterisk/trunk/tests/rest_api/bridges/playback/reverse/configs/ast1/extensions.conf ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Propchange: asterisk/trunk/tests/rest_api/bridges/playback/reverse/configs/ast1/extensions.conf ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: asterisk/trunk/tests/rest_api/bridges/playback/reverse/test-config.yaml URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/playback/reverse/test-config.yaml?view=auto&rev=5448 ============================================================================== --- asterisk/trunk/tests/rest_api/bridges/playback/reverse/test-config.yaml (added) +++ asterisk/trunk/tests/rest_api/bridges/playback/reverse/test-config.yaml Thu Aug 14 15:26:58 2014 @@ -1,0 +1,124 @@ +testinfo: + summary: Tests that the reverse ARI playback command on bridges works as intended + description: | + This test puts a local channel half into Stasis, and the other into the Echo + application. The channel that enters Stasis then gets put into a bridge. + Starts an ARI playback of tt-monkeys on the bridge, and as soon as the playback + starts, reverses the playback. Test passes if a playback Reverse TestEvent gets + received. + +test-modules: + add-test-to-search-path: True + test-object: + config-section: test-object-config + typename: ari.AriOriginateTestObject + modules: + - config-section: ari-config + typename: ari.WebSocketEventModule + - + config-section: ami-config + typename: ami.AMIEventModule + +apps: testsuite + +test-object-config: + test-iterations: + - + endpoint: 'Local/s@default' + channelId: 'theChannel' + app: 'testsuite' + + +ari-config: + events: + - + conditions: + match: + type: StasisStart + application: testsuite + channel: + id: 'theChannel' + count: 1 + requests: + - + method: 'post' + uri: 'bridges/theBridge' + - + method: 'post' + uri: 'bridges/theBridge/addChannel' + params: + channel: 'theChannel' + - + conditions: + match: + type: ChannelEnteredBridge + application: testsuite + bridge: + id: 'theBridge' + channel: + id: 'theChannel' + requests: + - + method: 'post' + uri: 'bridges/theBridge/play/monkeys' + params: + media: 'sound:tt-monkeys' + - + conditions: + match: + type: PlaybackStarted + application: testsuite + playback: + id: 'monkeys' + target_uri: 'bridge:theBridge$' + media_uri: 'sound:tt-monkeys' + count: 1 + requests: + - + method: 'post' + uri: 'playbacks/monkeys/control?operation=reverse' + - + delay: 3 + method: 'delete' + uri: 'playbacks/monkeys' + - + conditions: + match: + type: PlaybackFinished + application: testsuite + playback: + id: 'monkeys' + target_uri: 'bridge:theBridge$' + media_uri: 'sound:tt-monkeys' + count: 1 + requests: + - + method: 'delete' + uri: 'bridges/theBridge' + - + method: 'delete' + uri: 'channels/theChannel' + +ami-config: + - + type: 'headermatch' + id: '0' + conditions: + match: + Event: 'TestEvent' + State: 'PLAYBACK' + Control: 'Rewind' + SkipMs: '3000' + +properties: + minversion: '12.0.0' + dependencies: + - python : autobahn.websocket + - python : requests + - python : twisted + - python : starpy + - asterisk : res_ari_channels + - asterisk: res_ari_bridges + - asterisk: res_ari_playbacks + tags: + - ARI Propchange: asterisk/trunk/tests/rest_api/bridges/playback/reverse/test-config.yaml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: asterisk/trunk/tests/rest_api/bridges/playback/reverse/test-config.yaml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Propchange: asterisk/trunk/tests/rest_api/bridges/playback/reverse/test-config.yaml ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: asterisk/trunk/tests/rest_api/bridges/playback/tests.yaml URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/playback/tests.yaml?view=diff&rev=5448&r1=5447&r2=5448 ============================================================================== --- asterisk/trunk/tests/rest_api/bridges/playback/tests.yaml (original) +++ asterisk/trunk/tests/rest_api/bridges/playback/tests.yaml Thu Aug 14 15:26:58 2014 @@ -1,3 +1,5 @@ tests: - test: 'basic' - test: 'tones' + - test: 'forward' + - test: 'reverse' Added: asterisk/trunk/tests/rest_api/channels/playback/forward/configs/ast1/extensions.conf URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/channels/playback/forward/configs/ast1/extensions.conf?view=auto&rev=5448 ============================================================================== --- asterisk/trunk/tests/rest_api/channels/playback/forward/configs/ast1/extensions.conf (added) +++ asterisk/trunk/tests/rest_api/channels/playback/forward/configs/ast1/extensions.conf Thu Aug 14 15:26:58 2014 @@ -1,0 +1,5 @@ +[default] +exten => s,1,NoOp() + same => n,Answer() + same => n,Echo() + same => n,Hangup() Propchange: asterisk/trunk/tests/rest_api/channels/playback/forward/configs/ast1/extensions.conf ------------------------------------------------------------------------------ svn:eol-style = native Propchange: asterisk/trunk/tests/rest_api/channels/playback/forward/configs/ast1/extensions.conf ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Propchange: asterisk/trunk/tests/rest_api/channels/playback/forward/configs/ast1/extensions.conf ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: asterisk/trunk/tests/rest_api/channels/playback/forward/test-config.yaml URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/channels/playback/forward/test-config.yaml?view=auto&rev=5448 ============================================================================== --- asterisk/trunk/tests/rest_api/channels/playback/forward/test-config.yaml (added) +++ asterisk/trunk/tests/rest_api/channels/playback/forward/test-config.yaml Thu Aug 14 15:26:58 2014 @@ -1,0 +1,101 @@ +testinfo: + summary: Tests that the forward ARI playback command works on channels as intended + description: | + This test puts a local channel half into Stasis, and the other into the Echo + application. Starts an ARI playback of tt-monkeys on a channel, and as soon + as the playback starts, fastforwards the playback. Test passes if a playback + FastForward TestEvent gets received. + +test-modules: + add-test-to-search-path: True + test-object: + config-section: test-object-config + typename: ari.AriOriginateTestObject + modules: + - config-section: ari-config + typename: ari.WebSocketEventModule + - + config-section: ami-config + typename: ami.AMIEventModule + +apps: testsuite + +test-object-config: + test-iterations: + - + endpoint: 'Local/s@default' + channelId: 'theChannel' + app: 'testsuite' + + +ari-config: + events: + - + conditions: + match: + type: StasisStart + application: testsuite + channel: + id: 'theChannel' + count: 1 + requests: + - + method: 'post' + uri: 'channels/theChannel/play/monkeys' + params: + media: 'sound:tt-monkeys' + - + conditions: + match: + type: PlaybackStarted + application: testsuite + playback: + id: 'monkeys' + target_uri: 'channel:theChannel$' + media_uri: 'sound:tt-monkeys' + count: 1 + requests: + - + method: 'post' + uri: 'playbacks/monkeys/control?operation=forward' + - + delay: 3 + method: 'delete' + uri: 'playbacks/monkeys' + - + conditions: + match: + type: PlaybackFinished + application: testsuite + playback: + id: 'monkeys' + target_uri: 'channel:theChannel$' + media_uri: 'sound:tt-monkeys' + count: 1 + requests: + - + method: 'delete' + uri: 'channels/theChannel' + +ami-config: + - + type: 'headermatch' + id: '0' + conditions: + match: + Event: 'TestEvent' + State: 'PLAYBACK' + Control: 'FastForward' + SkipMs: '3000' + +properties: + minversion: '12.0.0' + dependencies: + - python : autobahn.websocket + - python : requests + - python : twisted + - python : starpy + - asterisk : res_ari_channels + - asterisk : res_ari_playbacks + tags: + - ARI Propchange: asterisk/trunk/tests/rest_api/channels/playback/forward/test-config.yaml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: asterisk/trunk/tests/rest_api/channels/playback/forward/test-config.yaml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Propchange: asterisk/trunk/tests/rest_api/channels/playback/forward/test-config.yaml ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: asterisk/trunk/tests/rest_api/channels/playback/reverse/configs/ast1/extensions.conf URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/channels/playback/reverse/configs/ast1/extensions.conf?view=auto&rev=5448 ============================================================================== --- asterisk/trunk/tests/rest_api/channels/playback/reverse/configs/ast1/extensions.conf (added) +++ asterisk/trunk/tests/rest_api/channels/playback/reverse/configs/ast1/extensions.conf Thu Aug 14 15:26:58 2014 @@ -1,0 +1,5 @@ +[default] +exten => s,1,NoOp() + same => n,Answer() + same => n,Echo() + same => n,Hangup() Propchange: asterisk/trunk/tests/rest_api/channels/playback/reverse/configs/ast1/extensions.conf ------------------------------------------------------------------------------ svn:eol-style = native Propchange: asterisk/trunk/tests/rest_api/channels/playback/reverse/configs/ast1/extensions.conf ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Propchange: asterisk/trunk/tests/rest_api/channels/playback/reverse/configs/ast1/extensions.conf ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: asterisk/trunk/tests/rest_api/channels/playback/reverse/test-config.yaml URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/channels/playback/reverse/test-config.yaml?view=auto&rev=5448 ============================================================================== --- asterisk/trunk/tests/rest_api/channels/playback/reverse/test-config.yaml (added) +++ asterisk/trunk/tests/rest_api/channels/playback/reverse/test-config.yaml Thu Aug 14 15:26:58 2014 @@ -1,0 +1,101 @@ +testinfo: + summary: Tests that the reverse ARI playback command works on channels as intended + description: | + This test puts a local channel half into Stasis, and the other into the Echo + application. Starts an ARI playback of tt-monkeys on the channel, and as soon + as the playback starts, reverses the playback. Test passes if a playback + Reverse TestEvent gets received. + +test-modules: + add-test-to-search-path: True + test-object: + config-section: test-object-config + typename: ari.AriOriginateTestObject + modules: + - config-section: ari-config + typename: ari.WebSocketEventModule + - + config-section: ami-config + typename: ami.AMIEventModule + +apps: testsuite + +test-object-config: + test-iterations: + - + endpoint: 'Local/s@default' + channelId: 'theChannel' + app: 'testsuite' + + +ari-config: + events: + - + conditions: + match: + type: StasisStart + application: testsuite + channel: + id: 'theChannel' + count: 1 + requests: + - + method: 'post' + uri: 'channels/theChannel/play/monkeys' + params: + media: 'sound:tt-monkeys' + - + conditions: + match: + type: PlaybackStarted + application: testsuite + playback: + id: 'monkeys' + target_uri: 'channel:theChannel$' + media_uri: 'sound:tt-monkeys' + count: 1 + requests: + - + method: 'post' + uri: 'playbacks/monkeys/control?operation=reverse' + - + delay: 3 + method: 'delete' + uri: 'playbacks/monkeys' + - + conditions: + match: + type: PlaybackFinished + application: testsuite + playback: + id: 'monkeys' + target_uri: 'channel:theChannel$' + media_uri: 'sound:tt-monkeys' + count: 1 + requests: + - + method: 'delete' + uri: 'channels/theChannel' + +ami-config: + - + type: 'headermatch' + id: '0' + conditions: + match: + Event: 'TestEvent' + State: 'PLAYBACK' + Control: 'Rewind' + SkipMs: '3000' + +properties: + minversion: '12.0.0' + dependencies: + - python : autobahn.websocket + - python : requests + - python : twisted + - python : starpy + - asterisk : res_ari_channels + - asterisk : res_ari_playbacks + tags: + - ARI Propchange: asterisk/trunk/tests/rest_api/channels/playback/reverse/test-config.yaml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: asterisk/trunk/tests/rest_api/channels/playback/reverse/test-config.yaml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Propchange: asterisk/trunk/tests/rest_api/channels/playback/reverse/test-config.yaml ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: asterisk/trunk/tests/rest_api/channels/playback/tests.yaml URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/channels/playback/tests.yaml?view=diff&rev=5448&r1=5447&r2=5448 ============================================================================== --- asterisk/trunk/tests/rest_api/channels/playback/tests.yaml (original) +++ asterisk/trunk/tests/rest_api/channels/playback/tests.yaml Thu Aug 14 15:26:58 2014 @@ -4,3 +4,5 @@ - test: 'to_channel_in_bridge' - test: 'tones' - test: 'tones_w_tonezone' + - test: 'forward' + - test: 'reverse' -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- svn-commits mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/svn-commits