[asterisk-commits] tests/rest api/bridges: Add a test for video (testsuite[master])
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Nov 16 18:43:12 CST 2016
Anonymous Coward #1000019 has submitted this change and it was merged. ( https://gerrit.asterisk.org/4437 )
Change subject: tests/rest_api/bridges: Add a test for video
......................................................................
tests/rest_api/bridges: Add a test for video
This patch adds a test for manipulating the source of video via ARI in a
multi-party bridge. It:
- Create a bridge
- Spawns three channels and puts them in the bridge
- Sets the video source to the third channel
- Once we receive notification of the video source update, change the
video source to the second channel
- Once we recieve notification of that video source update, remove the
video source
- Clean everything up and verify all the important events
ASTERISK-26595
Change-Id: I8195bf9377482e6c09c6a526c7268e7d95d1ae10
---
M tests/rest_api/bridges/tests.yaml
A tests/rest_api/bridges/video/configs/ast1/extensions.conf
A tests/rest_api/bridges/video/test-config.yaml
3 files changed, 234 insertions(+), 0 deletions(-)
Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
Anonymous Coward #1000019: Verified
Matt Jordan: Looks good to me, approved
Joshua Colp: Looks good to me, but someone else must approve
diff --git a/tests/rest_api/bridges/tests.yaml b/tests/rest_api/bridges/tests.yaml
index e6feebc..791faad 100644
--- a/tests/rest_api/bridges/tests.yaml
+++ b/tests/rest_api/bridges/tests.yaml
@@ -11,3 +11,4 @@
- test: 'id_propagate'
- test: 'no_id_propagate'
- dir: 'playback'
+ - test: 'video'
diff --git a/tests/rest_api/bridges/video/configs/ast1/extensions.conf b/tests/rest_api/bridges/video/configs/ast1/extensions.conf
new file mode 100644
index 0000000..8c93e56
--- /dev/null
+++ b/tests/rest_api/bridges/video/configs/ast1/extensions.conf
@@ -0,0 +1,10 @@
+[default]
+
+exten => echo,1,NoOp()
+ same => n,Answer()
+ same => n,Echo()
+
+exten => s,1,NoOp()
+ same => n,Answer()
+ same => n,Stasis(testsuite)
+ same => n,Hangup()
diff --git a/tests/rest_api/bridges/video/test-config.yaml b/tests/rest_api/bridges/video/test-config.yaml
new file mode 100644
index 0000000..57bd009
--- /dev/null
+++ b/tests/rest_api/bridges/video/test-config.yaml
@@ -0,0 +1,223 @@
+
+testinfo:
+ summary: 'Test manipulation of video source in a multi-party bridge'
+ description: |
+ * Originate three channels and put them in a mixing bridge
+ * Set the video source to the third channel
+ * Once we know that the source of video is the third channel, switch
+ to the second channel
+ * Once we know that the source is the second channel, remove the video
+ source
+ * Validate all the events
+
+properties:
+ minversion: '13.13.0'
+ dependencies:
+ - python : autobahn.websocket
+ - python : requests
+ - python : twisted
+ - python : starpy
+ - asterisk : res_ari_channels
+ - asterisk : app_echo
+ tags:
+ - ARI
+
+test-modules:
+ test-object:
+ config-section: test-object-config
+ typename: ari.AriOriginateTestObject
+ modules:
+ - config-section: pluggable-config
+ typename: pluggable_modules.EventActionModule
+
+test-object-config:
+ # using default origination:
+ # endpoint: Local/s at default
+ # channelId: testsuite-default-id
+ # app: testsuite
+ stop-on-end: True
+
+pluggable-config:
+ -
+ ari-events:
+ match:
+ type: StasisStart
+ application: testsuite
+ channel:
+ id: 'testsuite-default-id$'
+ count: 1
+ ari-requests:
+ -
+ method: 'post'
+ uri: 'bridges'
+ params:
+ bridgeId: 'VideoBridge'
+ # note: creating bridge does not result in another event
+ -
+ # note: an explicit subscription to the bridge is required to catch BridgeDestroyed later
+ method: 'post'
+ uri: 'applications/testsuite/subscription'
+ params:
+ eventSource: 'bridge:VideoBridge'
+ -
+ method: 'post'
+ uri: 'channels'
+ params:
+ endpoint: 'Local/echo at default'
+ channelId: 'MyFirstChannel'
+ app: 'testsuite'
+ -
+ method: 'post'
+ uri: 'channels'
+ params:
+ endpoint: 'Local/echo at default'
+ channelId: 'MySecondChannel'
+ app: 'testsuite'
+ -
+ method: 'post'
+ uri: 'channels'
+ params:
+ endpoint: 'Local/echo at default'
+ channelId: 'MyThirdChannel'
+ app: 'testsuite'
+ -
+ ari-events:
+ match:
+ type: StasisStart
+ application: testsuite
+ channel:
+ id: 'MyFirstChannel$'
+ count: 1
+ ari-requests:
+ method: 'post'
+ uri: 'bridges/VideoBridge/addChannel'
+ params:
+ channel: 'MyFirstChannel'
+ -
+ ari-events:
+ match:
+ type: StasisStart
+ application: testsuite
+ channel:
+ id: 'MySecondChannel$'
+ count: 1
+ ari-requests:
+ method: 'post'
+ uri: 'bridges/VideoBridge/addChannel'
+ params:
+ channel: 'MySecondChannel'
+ -
+ ari-events:
+ match:
+ type: StasisStart
+ application: testsuite
+ channel:
+ id: 'MyThirdChannel$'
+ count: 1
+ ari-requests:
+ method: 'post'
+ uri: 'bridges/VideoBridge/addChannel'
+ params:
+ channel: 'MyThirdChannel'
+ -
+ ari-events:
+ match:
+ type: ChannelEnteredBridge
+ application: testsuite
+ channel:
+ id: 'MyFirstChannel$'
+ count: 1
+ -
+ ari-events:
+ match:
+ type: ChannelEnteredBridge
+ application: testsuite
+ channel:
+ id: 'MySecondChannel$'
+ count: 1
+ -
+ ari-events:
+ match:
+ type: ChannelEnteredBridge
+ application: testsuite
+ channel:
+ id: 'MyThirdChannel$'
+ count: 1
+ ari-requests:
+ method: 'post'
+ uri: 'bridges/VideoBridge/videoSource/MyThirdChannel'
+ -
+ ari-events:
+ match:
+ type: BridgeVideoSourceChanged
+ application: testsuite
+ bridge:
+ id: 'VideoBridge$'
+ video_mode: 'single'
+ video_source_id: 'MyThirdChannel$'
+ count: 1
+ ari-requests:
+ method: 'post'
+ uri: 'bridges/VideoBridge/videoSource/MySecondChannel'
+ -
+ ari-events:
+ match:
+ type: BridgeVideoSourceChanged
+ application: testsuite
+ bridge:
+ id: 'VideoBridge$'
+ video_mode: 'single'
+ video_source_id: 'MySecondChannel$'
+ old_video_source_id: 'MyThirdChannel$'
+ count: 1
+ ari-requests:
+ method: 'delete'
+ uri: 'bridges/VideoBridge/videoSource'
+ ari-requests:
+ method: 'delete'
+ uri: 'channels/MyThirdChannel'
+ -
+ ari-events:
+ match:
+ type: ChannelLeftBridge
+ application: testsuite
+ channel:
+ id: 'MyThirdChannel$'
+ count: 1
+ ari-requests:
+ method: 'delete'
+ uri: 'channels/MySecondChannel'
+ -
+ ari-events:
+ match:
+ type: ChannelLeftBridge
+ application: testsuite
+ channel:
+ id: 'MySecondChannel$'
+ count: 1
+ ari-requests:
+ method: 'delete'
+ uri: 'channels/MyFirstChannel'
+ -
+ ari-events:
+ match:
+ type: ChannelLeftBridge
+ application: testsuite
+ channel:
+ id: 'MyFirstChannel$'
+ count: 1
+ ari-requests:
+ method: 'delete'
+ uri: 'bridges/VideoBridge'
+ -
+ ari-events:
+ match:
+ type: BridgeDestroyed
+ application: testsuite
+ bridge:
+ id: 'VideoBridge$'
+ count: 1
+ ari-requests:
+ # delete the first stasis channel to end the test
+ method: 'delete'
+ uri: 'channels/testsuite-default-id'
--
To view, visit https://gerrit.asterisk.org/4437
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8195bf9377482e6c09c6a526c7268e7d95d1ae10
Gerrit-PatchSet: 2
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: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
More information about the asterisk-commits
mailing list