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

Benjamin Keith Ford asteriskteam at digium.com
Wed Jul 15 10:53:38 CDT 2015


Benjamin Keith Ford has uploaded a new change for review.

  https://gerrit.asterisk.org/898

Change subject: Test/ARI: Test for unloading a module.
......................................................................

Test/ARI: Test for unloading a module.

Test that unloads a module. A '204 No Content' should be the response
to the request, followed by a '404 Not Found' reponse to a GET request
on the same module.

* Test ARI module unloading

ASTERISK-25173

Change-Id: I0518e22ff776be3e24f4d029d1ce345fb3c46f1a
---
M tests/rest_api/asterisk/modules/tests.yaml
A tests/rest_api/asterisk/modules/unload_module/configs/ast1/extensions.conf
A tests/rest_api/asterisk/modules/unload_module/configs/ast1/modules.conf
A tests/rest_api/asterisk/modules/unload_module/test-config.yaml
4 files changed, 60 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/98/898/1

diff --git a/tests/rest_api/asterisk/modules/tests.yaml b/tests/rest_api/asterisk/modules/tests.yaml
index b7fcd0e..d156f24 100644
--- a/tests/rest_api/asterisk/modules/tests.yaml
+++ b/tests/rest_api/asterisk/modules/tests.yaml
@@ -2,3 +2,4 @@
     - test: 'get_modules'
     - test: 'get_module'
     - test: 'get_unknown_module'
+    - test: 'unload_module'
diff --git a/tests/rest_api/asterisk/modules/unload_module/configs/ast1/extensions.conf b/tests/rest_api/asterisk/modules/unload_module/configs/ast1/extensions.conf
new file mode 100644
index 0000000..aa88cf3
--- /dev/null
+++ b/tests/rest_api/asterisk/modules/unload_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/unload_module/configs/ast1/modules.conf b/tests/rest_api/asterisk/modules/unload_module/configs/ast1/modules.conf
new file mode 100644
index 0000000..e5af2ee
--- /dev/null
+++ b/tests/rest_api/asterisk/modules/unload_module/configs/ast1/modules.conf
@@ -0,0 +1,5 @@
+[modules]
+
+autoload=yes
+
+load=app_confbridge.so
diff --git a/tests/rest_api/asterisk/modules/unload_module/test-config.yaml b/tests/rest_api/asterisk/modules/unload_module/test-config.yaml
new file mode 100644
index 0000000..3cae214
--- /dev/null
+++ b/tests/rest_api/asterisk/modules/unload_module/test-config.yaml
@@ -0,0 +1,48 @@
+testinfo:
+    summary: 'Test for loading a module using ARI'
+    description: |
+        Test that unloads a module. A '204 No Content' should
+        be the response to the request. Then, a GET request is
+        made that should return a '404 Not Found' to ensure the
+        module was unloaded.
+
+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: 'delete'
+                    uri: 'asterisk/modules/app_confbridge.so'
+                    expect: 204
+                -
+                    method: 'get'
+                    uri: 'asterisk/modules/app_confbridge.so'
+                    expect: 404
+                -
+                    method: 'delete'
+                    uri: 'channels/{channel.id}'
+
+properties:
+    minversion: '13.5.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - asterisk: app_confbridge
+        - asterisk: res_ari_asterisk
+        - asterisk: res_ari_channels
+    tags:
+        - ARI

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0518e22ff776be3e24f4d029d1ce345fb3c46f1a
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>



More information about the asterisk-code-review mailing list