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

Joshua Colp asteriskteam at digium.com
Mon Aug 3 08:49:33 CDT 2015


Joshua Colp has submitted this change and it was merged.

Change subject: Test/ARI: Nominal test for rotating a log channel.
......................................................................


Test/ARI: Nominal test for rotating a log channel.

This test verifies that a log channel is successfully rotated through
ARI.

* Nominal log rotation test

ASTERISK-25252

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

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



diff --git a/tests/rest_api/asterisk/logging/rotate_log/configs/ast1/extensions.conf b/tests/rest_api/asterisk/logging/rotate_log/configs/ast1/extensions.conf
new file mode 100644
index 0000000..484f40a
--- /dev/null
+++ b/tests/rest_api/asterisk/logging/rotate_log/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/rotate_log/test-config.yaml b/tests/rest_api/asterisk/logging/rotate_log/test-config.yaml
new file mode 100644
index 0000000..b0c1c9a
--- /dev/null
+++ b/tests/rest_api/asterisk/logging/rotate_log/test-config.yaml
@@ -0,0 +1,53 @@
+testinfo:
+    summary: 'Test for rotating logs using ARI'
+    description: |
+        Test that rotates a log channel. A '200 OK' should be
+        the response, and the test should verify that the log
+        channel was rotated successfully.
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: ari.AriTestObject
+    modules:
+        -
+            config-section: ari-config
+            typename: pluggable_modules.EventActionModule
+
+ari-config:
+    -
+        ari-events:
+            match:
+                type: StasisStart
+                application: testsuite
+            count: 1
+        ari-requests:
+            -
+                method: 'put'
+                uri: 'asterisk/logging/messages.txt/rotate'
+                expect: 204
+            -
+                method: 'delete'
+                uri: 'channels/{channel.id}'
+    -
+        ari-events:
+            match:
+                type: StasisEnd
+                application: testsuite
+            count: 1
+        validate-log:
+            logfile: 'messages.txt.0'
+            pass-if-present: True
+        stop_test:
+
+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..7cc938a
--- /dev/null
+++ b/tests/rest_api/asterisk/logging/tests.yaml
@@ -0,0 +1,2 @@
+tests:
+    - test: 'rotate_log'
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/1024
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I657e7780ac9784727f1e2fd514688230ee404e9f
Gerrit-PatchSet: 3
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-code-review mailing list