[asterisk-commits] Test/ARI: Test for loading an already loaded module/invalid ... (testsuite[master])

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


Matt Jordan has submitted this change and it was merged.

Change subject: Test/ARI: Test for loading an already loaded module/invalid configuration
......................................................................


Test/ARI: Test for loading an already loaded module/invalid configuration

Test that attempts to load an already loaded module, and also
attempts to load a module that has invalid configuration.
The already loaded module and the module with the invalid
configuration will both receive a '409 Conflict' as the
response from the requests.

* receives 409 for loading an already loaded module
* receives 409 for invalid configuration for a module attempting to load

ASTERISK-25173

Change-Id: Ia8aa389a0e4a814fb8043c594624914c9159e1d4
---
A tests/rest_api/asterisk/modules/load_already_loaded_module/configs/ast1/extensions.conf
A tests/rest_api/asterisk/modules/load_already_loaded_module/configs/ast1/modules.conf
A tests/rest_api/asterisk/modules/load_already_loaded_module/configs/ast1/res_parking.conf
A tests/rest_api/asterisk/modules/load_already_loaded_module/test-config.yaml
M tests/rest_api/asterisk/modules/tests.yaml
5 files changed, 70 insertions(+), 0 deletions(-)

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



diff --git a/tests/rest_api/asterisk/modules/load_already_loaded_module/configs/ast1/extensions.conf b/tests/rest_api/asterisk/modules/load_already_loaded_module/configs/ast1/extensions.conf
new file mode 100644
index 0000000..00d0563
--- /dev/null
+++ b/tests/rest_api/asterisk/modules/load_already_loaded_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/load_already_loaded_module/configs/ast1/modules.conf b/tests/rest_api/asterisk/modules/load_already_loaded_module/configs/ast1/modules.conf
new file mode 100644
index 0000000..8be9f4b
--- /dev/null
+++ b/tests/rest_api/asterisk/modules/load_already_loaded_module/configs/ast1/modules.conf
@@ -0,0 +1,7 @@
+[modules]
+
+autoload=yes
+
+load => app_playback.so
+noload => res_parking.so
+
diff --git a/tests/rest_api/asterisk/modules/load_already_loaded_module/configs/ast1/res_parking.conf b/tests/rest_api/asterisk/modules/load_already_loaded_module/configs/ast1/res_parking.conf
new file mode 100644
index 0000000..dddf996
--- /dev/null
+++ b/tests/rest_api/asterisk/modules/load_already_loaded_module/configs/ast1/res_parking.conf
@@ -0,0 +1,3 @@
+[testing]
+
+parkpos=jfkdslahfjkdlhjfkldsa
diff --git a/tests/rest_api/asterisk/modules/load_already_loaded_module/test-config.yaml b/tests/rest_api/asterisk/modules/load_already_loaded_module/test-config.yaml
new file mode 100644
index 0000000..0b59a81
--- /dev/null
+++ b/tests/rest_api/asterisk/modules/load_already_loaded_module/test-config.yaml
@@ -0,0 +1,52 @@
+testinfo:
+    summary: 'Test for loading an already loaded module using ARI'
+    description: |
+        Test that attempts to load an already loaded module, and also
+        attempts to load a module that has invalid configuration.
+        The already loaded module and the module with the invalid
+        configuration will both receive a '409 Conflict' as the
+        response from the requests.
+
+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 to check that module is already loaded
+                -
+                    method: 'post'
+                    uri: 'asterisk/modules/app_playback.so'
+                    expect: 409
+                # Test to check for invalid configuration in res_parking.conf
+                -
+                    method: 'post'
+                    uri: 'asterisk/modules/res_parking.so'
+                    expect: 409
+                -
+                    method: 'delete'
+                    uri: 'channels/{channel.id}'
+
+properties:
+    minversion: '13.5.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - asterisk: app_playback
+        - asterisk: res_parking
+        - 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 54b30ac..8887f27 100644
--- a/tests/rest_api/asterisk/modules/tests.yaml
+++ b/tests/rest_api/asterisk/modules/tests.yaml
@@ -9,3 +9,4 @@
     - test: 'reload_unloaded_module'
     - test: 'reload_module'
     - test: 'load_unknown_module'
+    - test: 'load_already_loaded_module'

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

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



More information about the asterisk-commits mailing list