[Asterisk-code-review] rest api/channels/playback/lists: Add a test for the 'revers... (testsuite[master])

Matt Jordan asteriskteam at digium.com
Mon May 16 10:45:43 CDT 2016


Matt Jordan has uploaded a new change for review.

  https://gerrit.asterisk.org/2848

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

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

This patch adds a test for the 'reverse' operation. It verifies that the
'reverse' operation will execute on any media file in the playlist and
rewind the sound file.

ASTERISK-26022

Change-Id: Ic2fa858682c4ccc6eadcd725e74d91a215486e9f
---
A tests/rest_api/channels/playback/lists/reverse/test-config.yaml
M tests/rest_api/channels/playback/lists/tests.yaml
2 files changed, 144 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/48/2848/1

diff --git a/tests/rest_api/channels/playback/lists/reverse/test-config.yaml b/tests/rest_api/channels/playback/lists/reverse/test-config.yaml
new file mode 100644
index 0000000..c4bc6c2
--- /dev/null
+++ b/tests/rest_api/channels/playback/lists/reverse/test-config.yaml
@@ -0,0 +1,143 @@
+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:
+                -
+                    delay: 1
+                    method: 'post'
+                    uri: 'playbacks/list/control?operation=reverse'
+        -
+            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:
+                -
+                    delay: 1
+                    method: 'post'
+                    uri: 'playbacks/list/control?operation=reverse'
+                -
+                    delay: 3
+                    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: 'Rewind'
+                SkipMs: '3000'
+        count: 2
+
+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 e4a2518..858b701 100644
--- a/tests/rest_api/channels/playback/lists/tests.yaml
+++ b/tests/rest_api/channels/playback/lists/tests.yaml
@@ -1,5 +1,4 @@
 tests:
     - test: 'basic'
     - test: 'forward'
-
-
+    - test: 'reverse'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic2fa858682c4ccc6eadcd725e74d91a215486e9f
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list