[Asterisk-code-review] apps/control playback: Add test 'remote uri' for playing bac... (testsuite[master])
Anonymous Coward
asteriskteam at digium.com
Wed Mar 23 14:22:25 CDT 2016
Anonymous Coward #1000019 has submitted this change and it was merged.
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(-)
Approvals:
Anonymous Coward #1000019: Verified
Joshua Colp: Looks good to me, approved
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: merged
Gerrit-Change-Id: I673ee6c4426a94da44562f3c3c67bc61402474c5
Gerrit-PatchSet: 2
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
More information about the asterisk-code-review
mailing list