[Asterisk-code-review] apps/control playback: Add test 'remote uri' for playing bac... (testsuite[master])

Matt Jordan asteriskteam at digium.com
Sun Feb 28 19:13:28 CST 2016


Matt Jordan has uploaded a new change for review.

  https://gerrit.asterisk.org/2318

Change subject: apps/control_playback: Add test 'remote_uri' for playing back remote media
......................................................................

apps/control_playback: Add test 'remote_uri' for playing back remote media

This patch adds a test that uses ControlPlayback to play back a remote media
resource. The test verifies that the media is played, and that the application
specific dialplan variables are set with the expected values.

ASTERISK-25654

Change-Id: I673ee6c4426a94da44562f3c3c67bc61402474c5
---
A tests/apps/control_playback/remote_uri/configs/ast1/extensions.conf
A tests/apps/control_playback/remote_uri/test-config.yaml
M tests/apps/control_playback/tests.yaml
3 files changed, 81 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/18/2318/1

diff --git a/tests/apps/control_playback/remote_uri/configs/ast1/extensions.conf b/tests/apps/control_playback/remote_uri/configs/ast1/extensions.conf
new file mode 100644
index 0000000..b57a711
--- /dev/null
+++ b/tests/apps/control_playback/remote_uri/configs/ast1/extensions.conf
@@ -0,0 +1,8 @@
+[default]
+
+exten => test,1,NoOp()
+	same => n,Answer()
+	same => n,ControlPlayback(http://localhost:8090/talking.wav)
+	same => n,ExecIf($[${CPLAYBACKOFFSET}=-1]?UserEvent(Offset,result:offset_pass)
+	same => n,ExecIf($[${CPLAYBACKSTATUS}=SUCCESS]?UserEvent(Status,result:status_pass)
+	same => n,Hangup()
diff --git a/tests/apps/control_playback/remote_uri/test-config.yaml b/tests/apps/control_playback/remote_uri/test-config.yaml
new file mode 100644
index 0000000..3c47bf3
--- /dev/null
+++ b/tests/apps/control_playback/remote_uri/test-config.yaml
@@ -0,0 +1,72 @@
+testinfo:
+    summary: 'Test ControlPlayback of a remote media resource'
+    description: |
+      'This tests playing back a remote media resource using the
+       ControlPlayback application.'
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'test_case.SimpleTestCase'
+    modules:
+        -
+            config-section: ami-config
+            typename: 'ami.AMIEventModule'
+        -
+            config-section: http-server
+            typename: 'http_static_server.HTTPStaticServer'
+
+test-object-config:
+    spawn-after-hangup: True
+    expected_events: 0
+    test-iterations:
+        -
+            channel: 'Local/test at default'
+            application: 'Echo'
+
+http-server:
+    port: 8090
+    root-directory: 'contrib/sounds'
+
+ami-config:
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'Offset'
+        requirements:
+            match:
+                Result: 'offset_pass'
+        count: '1'
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'Status'
+        requirements:
+            match:
+                Result: 'status_pass'
+        count: '1'
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'TestEvent'
+                State: 'PLAYBACK'
+                Message: 'http://localhost:8090/talking.wav'
+        count: '1'
+
+properties:
+    minversion: '14.0.0'
+    tags:
+      - playback
+      - apps
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - buildoption: 'TEST_FRAMEWORK'
+        - asterisk : 'app_userevent'
+        - asterisk : 'app_controlplayback'
+        - asterisk : 'res_http_media_cache'
diff --git a/tests/apps/control_playback/tests.yaml b/tests/apps/control_playback/tests.yaml
index 481b1d9..5f50065 100644
--- a/tests/apps/control_playback/tests.yaml
+++ b/tests/apps/control_playback/tests.yaml
@@ -6,3 +6,4 @@
     - test: 'control_restart'
     - test: 'control_reverse'
     - test: 'control_stop'
+    - test: 'remote_uri'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I673ee6c4426a94da44562f3c3c67bc61402474c5
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