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

Friendly Automation asteriskteam at digium.com
Mon Jun 3 08:12:44 CDT 2019


Friendly Automation has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/testsuite/+/11178 )

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
A tests/rest_api/channels/rtp_statistics/tests.yaml
M tests/rest_api/channels/tests.yaml
4 files changed, 133 insertions(+), 0 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit



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..dc32a76
--- /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: 1
+            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/rtp_statistics/tests.yaml b/tests/rest_api/channels/rtp_statistics/tests.yaml
new file mode 100644
index 0000000..073e19f
--- /dev/null
+++ b/tests/rest_api/channels/rtp_statistics/tests.yaml
@@ -0,0 +1,3 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+    - test: 'basic'
diff --git a/tests/rest_api/channels/tests.yaml b/tests/rest_api/channels/tests.yaml
index 6ed8d28..090788e 100644
--- a/tests/rest_api/channels/tests.yaml
+++ b/tests/rest_api/channels/tests.yaml
@@ -15,3 +15,4 @@
     - dir: 'hold'
     - test: 'originate_duplicate_id'
     - test: 'create_duplicate_id'
+    - dir: 'rtp_statistics'
\ No newline at end of file

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

Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Change-Id: Ie41127219a4fccc183f9374fbcb768835a7d2bb2
Gerrit-Change-Number: 11178
Gerrit-PatchSet: 8
Gerrit-Owner: sungtae kim <pchero21 at gmail.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: sungtae kim <pchero21 at gmail.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190603/4d9c2405/attachment-0001.html>


More information about the asterisk-code-review mailing list