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

Mark Michelson asteriskteam at digium.com
Tue Aug 4 10:31:41 CDT 2015


Mark Michelson has submitted this change and it was merged.

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/configs/ast1/logger.conf
A tests/rest_api/asterisk/logging/get_logging/test-config.yaml
M tests/rest_api/asterisk/logging/tests.yaml
4 files changed, 73 insertions(+), 0 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, approved; Verified
  Joshua Colp: Looks good to me, but someone else must approve



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/configs/ast1/logger.conf b/tests/rest_api/asterisk/logging/get_logging/configs/ast1/logger.conf
new file mode 100644
index 0000000..d4724b6
--- /dev/null
+++ b/tests/rest_api/asterisk/logging/get_logging/configs/ast1/logger.conf
@@ -0,0 +1,4 @@
+[logfiles]
+
+messages => notice,warning,error
+full => notice,warning,error,debug,verbose,dtmf,fax
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..a7d73af
--- /dev/null
+++ b/tests/rest_api/asterisk/logging/get_logging/test-config.yaml
@@ -0,0 +1,62 @@
+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",
+                                  "type": "File",
+                                  "status": "Enabled",
+                                  "configuration": "DEBUG NOTICE WARNING ERROR VERBOSE DTMF FAX "
+                                }
+                            -
+                                {
+                                  "channel": ".*/ast1/var/log/asterisk/messages",
+                                  "type": "File",
+                                  "status": "Enabled",
+                                  "configuration": "NOTICE WARNING ERROR "
+                                }
+                    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
index 7cc938a..7fec8b9 100644
--- a/tests/rest_api/asterisk/logging/tests.yaml
+++ b/tests/rest_api/asterisk/logging/tests.yaml
@@ -1,2 +1,3 @@
 tests:
+    - test: 'get_logging'
     - test: 'rotate_log'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I351ba706123bb524d4d7894ed8414f2e8f34a718
Gerrit-PatchSet: 3
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-code-review mailing list