[asterisk-commits] rest api/channels/playback/lists: Add a test for the 'forwar... (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 18 17:41:12 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: rest_api/channels/playback/lists: Add a test for the 'forward' operation
......................................................................


rest_api/channels/playback/lists: Add a test for the 'forward' operation

This patch adds a test that covers the 'forward' operation on a media
playlist. It verifies that using 'forward' will move the playback of
a media file forward on any media file in a playlist.

ASTERISK-26022

Change-Id: I0343b7a3be5e8e648b2a2b9146c3bd4a345f06f5
---
A tests/rest_api/channels/playback/lists/forward/test-config.yaml
M tests/rest_api/channels/playback/lists/tests.yaml
2 files changed, 146 insertions(+), 0 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, approved
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/tests/rest_api/channels/playback/lists/forward/test-config.yaml b/tests/rest_api/channels/playback/lists/forward/test-config.yaml
new file mode 100644
index 0000000..6feb7d5
--- /dev/null
+++ b/tests/rest_api/channels/playback/lists/forward/test-config.yaml
@@ -0,0 +1,145 @@
+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:
+    test-object:
+        config-section: test-object-config
+        typename: ari.AriOriginateTestObject
+    modules:
+        -
+            config-section: ari-config
+            typename: ari.WebSocketEventModule
+        -
+            config-section: ari-test-stopper
+            typename: pluggable_modules.EventActionModule
+        -
+            config-section: asterisk-config
+            typename: pluggable_modules.AsteriskConfigModule
+        -
+            config-section: ami-config
+            typename: ami.AMIEventModule
+
+asterisk-config:
+    -
+        src: 'tests/rest_api/channels/playback/lists/configs/extensions.conf'
+        dst: 'extensions.conf'
+
+test-object-config:
+    stop-on-end: False
+
+ari-test-stopper:
+    -
+        ari-events:
+            match:
+                type: ChannelDestroyed
+                application: testsuite
+                channel:
+                    id: 'testsuite-default-id$'
+        stop_test:
+
+ari-config:
+    apps: testsuite
+    events:
+        -
+            conditions:
+                match:
+                    type: StasisStart
+                    application: testsuite
+                    channel:
+                        id: 'testsuite-default-id$'
+            count: 1
+            requests:
+                -
+                    method: 'post'
+                    uri: 'channels/testsuite-default-id/play/list'
+                    params:
+                       media: 'sound:tt-monkeys,sound:tt-weasels'
+        -
+            conditions:
+                match:
+                    type: PlaybackStarted
+                    application: testsuite
+                    playback:
+                        id: 'list'
+                        target_uri: 'channel:testsuite-default-id$'
+                        media_uri: 'sound:tt-monkeys'
+            count: 1
+            requests:
+                -
+                    method: 'post'
+                    uri: 'playbacks/list/control?operation=forward'
+                -
+                    delay: 1
+                    method: 'post'
+                    uri: 'playbacks/list/control?operation=forward'
+        -
+            conditions:
+                match:
+                    type: PlaybackContinuing
+                    application: testsuite
+                    playback:
+                        id: 'list'
+                        target_uri: 'channel:testsuite-default-id$'
+                        media_uri: 'sound:tt-monkeys'
+        -
+            conditions:
+                match:
+                    type: PlaybackStarted
+                    application: testsuite
+                    playback:
+                        id: 'list'
+                        target_uri: 'channel:testsuite-default-id$'
+                        media_uri: 'sound:tt-weasels'
+            count: 1
+            requests:
+                -
+                    method: 'post'
+                    uri: 'playbacks/list/control?operation=forward'
+                -
+                    delay: 2
+                    method: 'delete'
+                    uri: 'playbacks/list'
+        -
+            conditions:
+                match:
+                    type: PlaybackFinished
+                    application: testsuite
+                    playback:
+                        id: 'list'
+                        target_uri: 'channel:testsuite-default-id$'
+                        media_uri: 'sound:tt-weasels'
+            count: 1
+            requests:
+                -
+                    method: 'delete'
+                    uri: 'channels/testsuite-default-id'
+
+ami-config:
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'TestEvent'
+                State: 'PLAYBACK'
+                Control: 'FastForward'
+                SkipMs: '3000'
+        count: 3
+
+properties:
+    buildoption: 'TEST_FRAMEWORK'
+    minversion: '14.0.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - python : starpy
+        - asterisk : res_ari_channels
+        - asterisk : res_ari_playbacks
+    tags:
+        - ARI
diff --git a/tests/rest_api/channels/playback/lists/tests.yaml b/tests/rest_api/channels/playback/lists/tests.yaml
index 9e4b026..e4a2518 100644
--- a/tests/rest_api/channels/playback/lists/tests.yaml
+++ b/tests/rest_api/channels/playback/lists/tests.yaml
@@ -1,4 +1,5 @@
 tests:
     - test: 'basic'
+    - test: 'forward'
 
 

-- 
To view, visit https://gerrit.asterisk.org/2847
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0343b7a3be5e8e648b2a2b9146c3bd4a345f06f5
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-commits mailing list