[asterisk-commits] Test/ARI: Test for getting a single module (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 14 11:23:03 CDT 2015


Matt Jordan has submitted this change and it was merged.

Change subject: Test/ARI: Test for getting a single module
......................................................................


Test/ARI: Test for getting a single module

Test that returns a single requested module that is to be
autoloaded based on the modules.conf configuration. The test
checks the response body of the module, so that it matches
that of the expected response body specified within the yaml
configuration. It also checks to make sure that a '200 OK' was
received back as a response from the request.

* Receives a single loaded module

ASTERISK-25173

Change-Id: I3dd06fccddac0086879360f9569172662a897af1
---
A tests/rest_api/asterisk/modules/get_module/configs/ast1/extensions.conf
A tests/rest_api/asterisk/modules/get_module/test-config.yaml
M tests/rest_api/asterisk/modules/tests.yaml
3 files changed, 62 insertions(+), 0 deletions(-)

Approvals:
  Matt Jordan: Looks good to me, approved; Verified
  Ashley Sanders: Looks good to me, but someone else must approve



diff --git a/tests/rest_api/asterisk/modules/get_module/configs/ast1/extensions.conf b/tests/rest_api/asterisk/modules/get_module/configs/ast1/extensions.conf
new file mode 100644
index 0000000..484f40a
--- /dev/null
+++ b/tests/rest_api/asterisk/modules/get_module/configs/ast1/extensions.conf
@@ -0,0 +1,6 @@
+[default]
+
+exten => s,1,NoOp()
+    same => n,Answer()
+    same => n,Stasis(testsuite)
+    same => n,Hangup()
diff --git a/tests/rest_api/asterisk/modules/get_module/test-config.yaml b/tests/rest_api/asterisk/modules/get_module/test-config.yaml
new file mode 100644
index 0000000..bd40292
--- /dev/null
+++ b/tests/rest_api/asterisk/modules/get_module/test-config.yaml
@@ -0,0 +1,55 @@
+testinfo:
+    summary: 'Test for getting a single module using ARI'
+    description: |
+        Test that returns a single requested module that is to be
+        autoloaded based on the modules.conf configuration. The test
+        checks the response body of the module, so that it matches
+        that of the expected response body specified within the yaml
+        configuration. It also checks to make sure that a '200 OK' was
+        received back as a response from the request.
+
+test-modules:
+    test-object:
+        typename: ari.AriTestObject
+    modules:
+        -   config-section: ari-config
+            typename: ari.WebSocketEventModule
+
+ari-config:
+    apps: testsuite
+    events:
+        -   conditions:
+                match:
+                    type: StasisStart
+                    application: testsuite
+                    args: []
+            count: 1
+            requests:
+                -
+                    method: 'get'
+                    uri: 'asterisk/modules/app_echo.so'
+                    response_body:
+                        match:
+                            {
+                                "name": "app_echo.so",
+                                "description": "Simple Echo Application",
+                                "use_count": 1,
+                                "status": "Running",
+                                "support_level": "core"
+                            }
+                    expect: 200
+                -
+                    method: 'delete'
+                    uri: 'channels/{channel.id}'
+
+properties:
+    minversion: '13.5.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - asterisk: app_echo
+        - asterisk: res_ari_asterisk
+        - asterisk: res_ari_channels
+    tags:
+        - ARI
diff --git a/tests/rest_api/asterisk/modules/tests.yaml b/tests/rest_api/asterisk/modules/tests.yaml
index 6b76744..49e365b 100644
--- a/tests/rest_api/asterisk/modules/tests.yaml
+++ b/tests/rest_api/asterisk/modules/tests.yaml
@@ -1,2 +1,3 @@
 tests:
     - test: 'get_modules'
+    - test: 'get_module'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3dd06fccddac0086879360f9569172662a897af1
Gerrit-PatchSet: 2
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Scott Emidy <jemidy at digium.com>
Gerrit-Reviewer: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Scott Emidy <jemidy at digium.com>



More information about the asterisk-commits mailing list