[Asterisk-code-review] testsuite: Added testcase for channels/{channelId}/rtp_statistics (...testsuite[13])

sungtae kim asteriskteam at digium.com
Wed May 1 17:21:30 CDT 2019


sungtae kim has uploaded this change for review. ( https://gerrit.asterisk.org/c/testsuite/+/11329


Change subject: testsuite: Added testcase for channels/{channelId}/rtp_statistics
......................................................................

testsuite: Added testcase for channels/{channelId}/rtp_statistics

Added basic testcase for rtp_statistics.

ASTERISK-28320

Change-Id: Ie41127219a4fccc183f9374fbcb768835a7d2bb2
---
A tests/rest_api/channels/rtp_statistics/basic/configs/ast1/extensions.conf
A tests/rest_api/channels/rtp_statistics/basic/test-config.yaml
M tests/rest_api/channels/tests.yaml
3 files changed, 130 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/29/11329/1

diff --git a/tests/rest_api/channels/rtp_statistics/basic/configs/ast1/extensions.conf b/tests/rest_api/channels/rtp_statistics/basic/configs/ast1/extensions.conf
new file mode 100644
index 0000000..59c7f03
--- /dev/null
+++ b/tests/rest_api/channels/rtp_statistics/basic/configs/ast1/extensions.conf
@@ -0,0 +1,6 @@
+[default]
+
+exten => s,1,NoOp()
+	same => n,Answer()
+	same => n,Echo()
+	same => n,Hangup()
diff --git a/tests/rest_api/channels/rtp_statistics/basic/test-config.yaml b/tests/rest_api/channels/rtp_statistics/basic/test-config.yaml
new file mode 100644
index 0000000..2032c76
--- /dev/null
+++ b/tests/rest_api/channels/rtp_statistics/basic/test-config.yaml
@@ -0,0 +1,123 @@
+
+testinfo:
+    summary: 'Test rtp_statistics'
+    description: |
+        'This attempts to test basic functionality of
+        /ari/channels/{channelId}/rtp_statistics ARI.
+        * Originate a channel
+        * Playback an audio file
+        * Get rtp statistics
+        * Pause it
+        * Unpause it
+        * Rewind it
+        * Delete the playback
+        * Delete the channel
+        * Validate all the events'
+
+properties:
+    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: ari-config
+            typename: ari.WebSocketEventModule
+        -
+            config-section: ari-test-stopper
+            typename: pluggable_modules.EventActionModule
+
+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: 'ChannelStateChange'
+            count: '>1'
+        -
+            conditions:
+                match:
+                    type: StasisStart
+                    application: testsuite
+                    channel:
+                        id: 'testsuite-default-id$'
+            count: 1
+            requests:
+                method: 'post'
+                uri: 'channels/testsuite-default-id/play/MyPlaybackId'
+                params:
+                    media: 'sound:silence/5'
+        -
+            conditions:
+                match:
+                    type: PlaybackStarted
+                    application: testsuite
+                    playback:
+                        id: 'MyPlaybackId'
+                        target_uri: 'channel:testsuite-default-id$'
+            count: 2
+            requests:
+                -
+                    instance: 1
+                    delay: 1
+                    method: 'get'
+                    uri: 'channels/testsuite-default-id/rtp_statistics'
+                    response_body:
+                        match:
+                            {
+                                "channel_uniqueid": "testsuite-default-id"
+                            }
+        -
+            conditions:
+                match:
+                    type: PlaybackFinished
+                    application: testsuite
+                    playback:
+                        target_uri: 'channel:testsuite-default-id$'
+            count: 1
+            requests:
+                # playback is already deleted
+                method: 'delete'
+                uri: 'channels/testsuite-default-id'
+        -
+            conditions:
+                match:
+                    type: ChannelHangupRequest
+                    application: testsuite
+                    channel:
+                        id: 'testsuite-default-id$'
+            count: 1
+
+        -
+            conditions:
+                match:
+                    type: StasisEnd
+                    application: testsuite
+                    channel:
+                        id: 'testsuite-default-id$'
+            count: 1
+
diff --git a/tests/rest_api/channels/tests.yaml b/tests/rest_api/channels/tests.yaml
index 81bba31..b25d1dd 100644
--- a/tests/rest_api/channels/tests.yaml
+++ b/tests/rest_api/channels/tests.yaml
@@ -13,3 +13,4 @@
     - test: 'originate_to_dialplan'
     - dir: 'hold'
     - test: 'originate_duplicate_id'
+    - test: 'rtp_statistics'

-- 
To view, visit https://gerrit.asterisk.org/c/testsuite/+/11329
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: 13
Gerrit-Change-Id: Ie41127219a4fccc183f9374fbcb768835a7d2bb2
Gerrit-Change-Number: 11329
Gerrit-PatchSet: 1
Gerrit-Owner: sungtae kim <pchero21 at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190501/b26ae947/attachment-0001.html>


More information about the asterisk-code-review mailing list