[asterisk-commits] Test/ARI: test for getting all module information (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 10 21:47:05 CDT 2015


Matt Jordan has submitted this change and it was merged.

Change subject: Test/ARI: test for getting all module information
......................................................................


Test/ARI: test for getting all module information

Test that returns a list of all modules that are to be
loaded based on the modules.conf configuration. The test
checks the response body of the modules, 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 list of all loaded modules

ASTERISK-25173
Reported By: Matt Jordan

Change-Id: Ic16508cf03548a55ffa0339b94d432c7d8f660c1
---
A tests/rest_api/asterisk/modules/get_modules/configs/ast1/extensions.conf
A tests/rest_api/asterisk/modules/get_modules/configs/ast1/modules.conf
A tests/rest_api/asterisk/modules/get_modules/test-config.yaml
A tests/rest_api/asterisk/modules/tests.yaml
A tests/rest_api/asterisk/tests.yaml
M tests/rest_api/tests.yaml
6 files changed, 282 insertions(+), 0 deletions(-)

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



diff --git a/tests/rest_api/asterisk/modules/get_modules/configs/ast1/extensions.conf b/tests/rest_api/asterisk/modules/get_modules/configs/ast1/extensions.conf
new file mode 100644
index 0000000..484f40a
--- /dev/null
+++ b/tests/rest_api/asterisk/modules/get_modules/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_modules/configs/ast1/modules.conf b/tests/rest_api/asterisk/modules/get_modules/configs/ast1/modules.conf
new file mode 100644
index 0000000..9fa73ca
--- /dev/null
+++ b/tests/rest_api/asterisk/modules/get_modules/configs/ast1/modules.conf
@@ -0,0 +1,26 @@
+[modules]
+autoload=no
+
+load => app_echo.so
+load => app_stasis.so
+load => res_ari_applications.so
+load => res_ari_asterisk.so
+load => res_ari_bridges.so
+load => res_ari_channels.so
+load => res_ari_device_states.so
+load => res_ari_endpoints.so
+load => res_ari_events.so
+load => res_ari_mailboxes.so
+load => res_ari_model.so
+load => res_ari_playbacks.so
+load => res_ari_recordings.so
+load => res_ari.so
+load => res_ari_sounds.so
+load => res_http_websocket.so
+load => res_stasis_answer.so
+load => res_stasis_device_state.so
+load => res_stasis_playback.so
+load => res_stasis_recording.so
+load => res_stasis_snoop.so
+load => res_stasis.so
+load => pbx_config.so
diff --git a/tests/rest_api/asterisk/modules/get_modules/test-config.yaml b/tests/rest_api/asterisk/modules/get_modules/test-config.yaml
new file mode 100644
index 0000000..6c3d6ac
--- /dev/null
+++ b/tests/rest_api/asterisk/modules/get_modules/test-config.yaml
@@ -0,0 +1,245 @@
+testinfo:
+    summary: 'Test for getting the list of modules using ARI'
+    description: |
+        Test that returns a list of all modules that are to be
+        loaded based on the modules.conf configuration. The test
+        checks the response body of the modules, 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'
+                    response_body:
+                        match:
+                            -
+                                {
+                                  "name": "app_echo.so",
+                                  "description": "Simple Echo Application",
+                                  "use_count": 1,
+                                  "status": "Running",
+                                  "support_level": "core",
+                                }
+                            -
+                                {
+                                  "name": "app_stasis.so",
+                                  "description": "Stasis dialplan application",
+                                  "use_count": 1,
+                                  "status": "Running",
+                                  "support_level": "core"
+                                }
+                            -
+                                {
+                                  "name": "pbx_config.so",
+                                  "description": "Text Extension Configuration",
+                                  "use_count": 0,
+                                  "status": "Running",
+                                  "support_level": "core"
+                                }
+                            -
+                                {
+                                  "name": "res_ari.so",
+                                  "description": "Asterisk RESTful Interface",
+                                  "use_count": 10,
+                                  "status": "Running",
+                                  "support_level": "core"
+                                }
+                            -
+                                {
+                                  "name": "res_ari_applications.so",
+                                  "description": "RESTful API module - Stasis application resources",
+                                  "use_count": 0,
+                                  "status": "Running",
+                                  "support_level": "core"
+                                }
+                            -
+                                {
+                                  "name": "res_ari_asterisk.so",
+                                  "description": "RESTful API module - Asterisk resources",
+                                  "use_count": 0,
+                                  "status": "Running",
+                                  "support_level": "core"
+                                }
+                            -
+                                {
+                                  "name": "res_ari_bridges.so",
+                                  "description": "RESTful API module - Bridge resources",
+                                  "use_count": 0,
+                                  "status": "Running",
+                                  "support_level": "core"
+                                }
+                            -
+                                {
+                                  "name": "res_ari_channels.so",
+                                  "description": "RESTful API module - Channel resources",
+                                  "use_count": 0,
+                                  "status": "Running",
+                                  "support_level": "core"
+                                }
+                            -
+                                {
+                                  "name": "res_ari_device_states.so",
+                                  "description": "RESTful API module - Device state resources",
+                                  "use_count": 0,
+                                  "status": "Running",
+                                  "support_level": "core"
+                                }
+                            -
+                                {
+                                  "name": "res_ari_endpoints.so",
+                                  "description": "RESTful API module - Endpoint resources",
+                                  "use_count": 0,
+                                  "status": "Running",
+                                  "support_level": "core"
+                                }
+                            -
+                                {
+                                  "name": "res_ari_events.so",
+                                  "description": "RESTful API module - WebSocket resource",
+                                  "use_count": 0,
+                                  "status": "Running",
+                                  "support_level": "core"
+                                }
+                            -
+                                {
+                                  "name": "res_ari_model.so",
+                                  "description": "ARI Model validators",
+                                  "use_count": 0,
+                                  "status": "Running",
+                                  "support_level": "core"
+                                }
+                            -
+                                {
+                                  "name": "res_ari_playbacks.so",
+                                  "description": "RESTful API module - Playback control resources",
+                                  "use_count": 0,
+                                  "status": "Running",
+                                  "support_level": "core"
+                                }
+                            -
+                                {
+                                  "name": "res_ari_recordings.so",
+                                  "description": "RESTful API module - Recording resources",
+                                  "use_count": 0,
+                                  "status": "Running",
+                                  "support_level": "core"
+                                }
+                            -
+                                {
+                                  "name": "res_ari_sounds.so",
+                                  "description": "RESTful API module - Sound resources",
+                                  "use_count": 0,
+                                  "status": "Running",
+                                  "support_level": "core"
+                                }
+                            -
+                                {
+                                  "name": "res_http_websocket.so",
+                                  "description": "HTTP WebSocket Support",
+                                  "use_count": 2,
+                                  "status": "Running",
+                                  "support_level": "extended"
+                                }
+                            -
+                                {
+                                  "name": "res_stasis.so",
+                                  "description": "Stasis application support",
+                                  "use_count": 13,
+                                  "status": "Running",
+                                  "support_level": "core"
+                                }
+                            -
+                                {
+                                  "name": "res_stasis_answer.so",
+                                  "description": "Stasis application answer support",
+                                  "use_count": 0,
+                                  "status": "Running",
+                                  "support_level": "core"
+                                }
+                            -
+                                {
+                                  "name": "res_stasis_device_state.so",
+                                  "description": "Stasis application device state support",
+                                  "use_count": 0,
+                                  "status": "Running",
+                                  "support_level": "core"
+                                }
+                            -
+                                {
+                                  "name": "res_stasis_playback.so",
+                                  "description": "Stasis application playback support",
+                                  "use_count": 0,
+                                  "status": "Running",
+                                  "support_level": "core"
+                                }
+                            -
+                                {
+                                  "name": "res_stasis_recording.so",
+                                  "description": "Stasis application recording support",
+                                  "use_count": 0,
+                                  "status": "Running",
+                                  "support_level": "core"
+                                }
+                            -
+                                {
+                                  "name": "res_stasis_snoop.so",
+                                  "description": "Stasis application snoop support",
+                                  "use_count": 0,
+                                  "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
+        - python : starpy
+        - asterisk: app_echo
+        - asterisk: app_stasis
+        - asterisk: pbx_config
+        - asterisk: res_ari
+        - asterisk: res_ari_applications
+        - asterisk: res_ari_asterisk
+        - asterisk: res_ari_bridges
+        - asterisk: res_ari_channels
+        - asterisk: res_ari_device_states
+        - asterisk: res_ari_endpoints
+        - asterisk: res_ari_events
+        - asterisk: res_ari_model
+        - asterisk: res_ari_playbacks
+        - asterisk: res_ari_recordings
+        - asterisk: res_ari_sounds
+        - asterisk: res_http_websocket
+        - asterisk: res_stasis
+        - asterisk: res_stasis_answer
+        - asterisk: res_stasis_device_state
+        - asterisk: res_stasis_playback
+        - asterisk: res_stasis_recording
+        - asterisk: res_stasis_snoop
+    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..6b76744
--- /dev/null
+++ b/tests/rest_api/asterisk/modules/tests.yaml
@@ -0,0 +1,2 @@
+tests:
+    - test: 'get_modules'
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/838
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic16508cf03548a55ffa0339b94d432c7d8f660c1
Gerrit-PatchSet: 3
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Scott Emidy <jemidy at digium.com>
Gerrit-Reviewer: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell 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