[Asterisk-code-review] Test/ARI: Nominal test for getting log channel information. (testsuite[master])

Benjamin Keith Ford asteriskteam at digium.com
Fri Jul 31 12:58:52 CDT 2015


Benjamin Keith Ford has uploaded a new change for review.

  https://gerrit.asterisk.org/1025

Change subject: Test/ARI: Nominal test for getting log channel information.
......................................................................

Test/ARI: Nominal test for getting log channel information.

This test verifies that getting log channel information through ARI
returns the correct response code and body.

* Nominal get log test

ASTERISK-25252

Change-Id: I351ba706123bb524d4d7894ed8414f2e8f34a718
---
A tests/rest_api/asterisk/logging/get_logging/configs/ast1/extensions.conf
A tests/rest_api/asterisk/logging/get_logging/test-config.yaml
A tests/rest_api/asterisk/logging/tests.yaml
M tests/rest_api/asterisk/tests.yaml
4 files changed, 78 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/25/1025/1

diff --git a/tests/rest_api/asterisk/logging/get_logging/configs/ast1/extensions.conf b/tests/rest_api/asterisk/logging/get_logging/configs/ast1/extensions.conf
new file mode 100644
index 0000000..484f40a
--- /dev/null
+++ b/tests/rest_api/asterisk/logging/get_logging/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/logging/get_logging/test-config.yaml b/tests/rest_api/asterisk/logging/get_logging/test-config.yaml
new file mode 100644
index 0000000..731fea0
--- /dev/null
+++ b/tests/rest_api/asterisk/logging/get_logging/test-config.yaml
@@ -0,0 +1,69 @@
+testinfo:
+    summary: 'Test for getting the list of logs using ARI'
+    description: |
+        Test that returns a list of all log channels that are
+        configured for the testsuite. A '200 OK' should be
+        the response to the request, and the response body should
+        include the log channels and their levels.
+
+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/logging'
+                    response_body:
+                        match:
+                            -
+                                {
+                                  "channel": ".*/ast1/var/log/asterisk/full.txt",
+                                  "type": "File",
+                                  "status": "Enabled",
+                                  "configuration": "DEBUG ---EVENT--- NOTICE WARNING ERROR VERBOSE DTMF CC FAX SECURITY "
+                                }
+                            -
+                                {
+                                  "channel": ".*/ast1/var/log/asterisk/messages.txt",
+                                  "type": "File",
+                                  "status": "Enabled",
+                                  "configuration": "NOTICE WARNING ERROR VERBOSE DTMF "
+                                }
+                            -
+                                {
+                                  "channel": "",
+                                  "type": "Console",
+                                  "status": "Enabled",
+                                  "configuration": "VERBOSE "
+                                }
+                    expect: 200
+                -
+                    method: 'delete'
+                    uri: 'channels/{channel.id}'
+
+properties:
+    minversion: '13.6.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/logging/tests.yaml b/tests/rest_api/asterisk/logging/tests.yaml
new file mode 100644
index 0000000..43b1826
--- /dev/null
+++ b/tests/rest_api/asterisk/logging/tests.yaml
@@ -0,0 +1,2 @@
+tests:
+    - test: 'get_logging'
diff --git a/tests/rest_api/asterisk/tests.yaml b/tests/rest_api/asterisk/tests.yaml
index 4bd5f73..09d2c9c 100644
--- a/tests/rest_api/asterisk/tests.yaml
+++ b/tests/rest_api/asterisk/tests.yaml
@@ -1,3 +1,4 @@
 tests:
+    - dir: 'logging'
     - dir: 'modules'
     - dir: 'config'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I351ba706123bb524d4d7894ed8414f2e8f34a718
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