[Asterisk-code-review] Test/ARI: Offnominal get module test (testsuite[master])

Matt Jordan asteriskteam at digium.com
Tue Jul 14 19:14:04 CDT 2015


Matt Jordan has submitted this change and it was merged.

Change subject: Test/ARI: Offnominal get module test
......................................................................


Test/ARI: Offnominal get module test

Test that checks when someone tries to get a module that is
noloaded in the modules.conf configuration, and when someone
has entered in an invalid module name. The test also checks
to make sure that a '404 Not Found' was received back as the
response from the requests.

* Receives 404 for noloaded module that doesn't exist
* Receives 404 for module name that doesn't exist

ASTERISK-25173

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

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



diff --git a/tests/rest_api/asterisk/modules/get_unknown_module/configs/ast1/extensions.conf b/tests/rest_api/asterisk/modules/get_unknown_module/configs/ast1/extensions.conf
new file mode 100644
index 0000000..484f40a
--- /dev/null
+++ b/tests/rest_api/asterisk/modules/get_unknown_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_unknown_module/test-config.yaml b/tests/rest_api/asterisk/modules/get_unknown_module/test-config.yaml
new file mode 100644
index 0000000..26df275
--- /dev/null
+++ b/tests/rest_api/asterisk/modules/get_unknown_module/test-config.yaml
@@ -0,0 +1,56 @@
+testinfo:
+    summary: 'Offnominal get_module test that receives invalid modules using ARI'
+    description: |
+        Test that checks when someone tries to get a module that is
+        noloaded in the modules.conf configuration, and when someone
+        has entered in an invalid module name. The test also checks
+        to make sure that a '404 Not Found' was received back as the
+        response from the requests.
+
+        * Receives 404 for noloaded module that doesn't exist
+        * Receives 404 for module name that doesn't exist
+
+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:
+                # chan_oss.so is noloaded in the default testsuite modules.conf
+                # test to check that the noloaded module doesn't exist
+                -
+                    method: 'get'
+                    uri: 'asterisk/modules/chan_oss.so'
+                    expect: 404
+                # test to check that module name doesn't exist
+                -
+                    method: 'get'
+                    uri: 'asterisk/modules/blah.so'
+                    expect: 404
+                -
+                    method: 'delete'
+                    uri: 'channels/{channel.id}'
+
+properties:
+    minversion: '13.5.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - python : starpy
+        - 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 49e365b..b7fcd0e 100644
--- a/tests/rest_api/asterisk/modules/tests.yaml
+++ b/tests/rest_api/asterisk/modules/tests.yaml
@@ -1,3 +1,4 @@
 tests:
     - test: 'get_modules'
     - test: 'get_module'
+    - test: 'get_unknown_module'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1a480191025ac7931945e06c06a7b6c6fc3df133
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Scott Emidy <jemidy at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list