[asterisk-commits] Test/ARI: Test for unloading an invalid module/already in us... (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jul 19 09:28:10 CDT 2015


Matt Jordan has submitted this change and it was merged.

Change subject: Test/ARI: Test for unloading an invalid module/already in use module
......................................................................


Test/ARI: Test for unloading an invalid module/already in use module

Test that unloads an invalid module and a dependent module
that is already in use. The test checks that a '404 Not Found'
is received for an invalid module name, and a '409 Conflict'
is recieved for a dependency module that is already in use.

* Receives 404 for invalid module name
* Receives 409 for module that is already in use

ASTERISK-25173

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

Approvals:
  Matt Jordan: Looks good to me, approved; Verified



diff --git a/tests/rest_api/asterisk/modules/tests.yaml b/tests/rest_api/asterisk/modules/tests.yaml
index 5522df2..0fe1616 100644
--- a/tests/rest_api/asterisk/modules/tests.yaml
+++ b/tests/rest_api/asterisk/modules/tests.yaml
@@ -4,3 +4,4 @@
     - test: 'get_unknown_module'
     - test: 'load_module'
     - test: 'unload_module'
+    - test: 'unload_already_unloaded_module'
diff --git a/tests/rest_api/asterisk/modules/unload_already_unloaded_module/configs/ast1/extensions.conf b/tests/rest_api/asterisk/modules/unload_already_unloaded_module/configs/ast1/extensions.conf
new file mode 100644
index 0000000..00d0563
--- /dev/null
+++ b/tests/rest_api/asterisk/modules/unload_already_unloaded_module/configs/ast1/extensions.conf
@@ -0,0 +1,7 @@
+[default]
+
+exten => s,1,NoOp()
+    same => n,Answer()
+    same => n,Stasis(testsuite)
+    same => n,Hangup()
+
diff --git a/tests/rest_api/asterisk/modules/unload_already_unloaded_module/test-config.yaml b/tests/rest_api/asterisk/modules/unload_already_unloaded_module/test-config.yaml
new file mode 100644
index 0000000..766756d
--- /dev/null
+++ b/tests/rest_api/asterisk/modules/unload_already_unloaded_module/test-config.yaml
@@ -0,0 +1,50 @@
+testinfo:
+    summary: 'Test for unloading an invalid module using ARI'
+    description: |
+        Test that unloads an invalid module and a dependent module
+        that is already in use. The test checks that a '404 Not Found'
+        is received for an invalid module name, and a '409 Conflict'
+        is recieved for a dependency module that is already in use.
+
+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:
+                # Test that checks for invalid module name
+                -
+                    method: 'delete'
+                    uri: 'asterisk/modules/blah.so'
+                    expect: 404
+                # Test that checks for dependency module that is in use
+                -
+                    method: 'delete'
+                    uri: 'asterisk/modules/res_stasis.so'
+                    expect: 409
+                -
+                    method: 'delete'
+                    uri: 'channels/{channel.id}'
+
+properties:
+    minversion: '13.5.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - asterisk: res_stasis
+        - asterisk: res_ari_asterisk
+        - asterisk: res_ari_channels
+    tags:
+        - ARI

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I96e0fce6deb09dd265df4fa67e4e82eff04b1378
Gerrit-PatchSet: 4
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-commits mailing list