[Asterisk-code-review] Test/ARI: Test for getting a single module (testsuite[master])

Scott Emidy asteriskteam at digium.com
Thu Jul 9 16:47:34 CDT 2015


Scott Emidy has uploaded a new change for review.

  https://gerrit.asterisk.org/863

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
A tests/rest_api/asterisk/modules/tests.yaml
A tests/rest_api/asterisk/tests.yaml
M tests/rest_api/tests.yaml
5 files changed, 66 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/63/863/1

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
new file mode 100644
index 0000000..9802d5d
--- /dev/null
+++ b/tests/rest_api/asterisk/modules/tests.yaml
@@ -0,0 +1,2 @@
+tests:
+    - test: 'get_module'
diff --git a/tests/rest_api/asterisk/tests.yaml b/tests/rest_api/asterisk/tests.yaml
new file mode 100644
index 0000000..dc82f36
--- /dev/null
+++ b/tests/rest_api/asterisk/tests.yaml
@@ -0,0 +1,2 @@
+tests:
+    - dir: 'modules'
diff --git a/tests/rest_api/tests.yaml b/tests/rest_api/tests.yaml
index 1e540c5..ac9303c 100644
--- a/tests/rest_api/tests.yaml
+++ b/tests/rest_api/tests.yaml
@@ -4,6 +4,7 @@
     - test: 'authentication'
     - test: 'CORS'
     - dir:  'applications'
+    - dir:  'asterisk'
     - dir:  'bridges'
     - dir:  'channels'
     - dir:  'recording'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3dd06fccddac0086879360f9569172662a897af1
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Scott Emidy <jemidy at digium.com>



More information about the asterisk-code-review mailing list