[Asterisk-code-review] tests/pbx/autohints: Add test for autohints support. (testsuite[master])

Joshua Colp asteriskteam at digium.com
Sun Apr 10 10:05:09 CDT 2016


Joshua Colp has uploaded a new change for review.

  https://gerrit.asterisk.org/2565

Change subject: tests/pbx/autohints: Add test for autohints support.
......................................................................

tests/pbx/autohints: Add test for autohints support.

This adds a test which uses custom device states to test
that when autohints are enabled a hint is created as a result
of a device state change.

ASTERISK-25881

Change-Id: Ibf64f7b798ca43e2c0726f8e6665b713372f6413
---
A tests/pbx/autohints/configs/ast1/extensions.conf
A tests/pbx/autohints/test-config.yaml
M tests/pbx/tests.yaml
3 files changed, 48 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/65/2565/1

diff --git a/tests/pbx/autohints/configs/ast1/extensions.conf b/tests/pbx/autohints/configs/ast1/extensions.conf
new file mode 100644
index 0000000..4c9d272
--- /dev/null
+++ b/tests/pbx/autohints/configs/ast1/extensions.conf
@@ -0,0 +1,2 @@
+[hints]
+autohints=yes
diff --git a/tests/pbx/autohints/test-config.yaml b/tests/pbx/autohints/test-config.yaml
new file mode 100644
index 0000000..94f8d2f
--- /dev/null
+++ b/tests/pbx/autohints/test-config.yaml
@@ -0,0 +1,45 @@
+testinfo:
+    summary: 'Test PBX autohints support'
+    description: |
+        Tests the PBX autohints support by using a custom device state to
+        trigger the creation of a hint. Once the hint is created we should
+        then receive an event about it.
+
+properties:
+    minversion: '14.0.0'
+
+test-modules:
+    test-object:
+        config-section: object-config
+        typename: 'test_case.TestCaseModule'
+    modules:
+        -
+            config-section: 'ami-config'
+            typename: 'pluggable_modules.EventActionModule'
+
+object-config:
+    reactor-timeout: 15
+    connect-ami: True
+
+ami-config:
+    -
+        ami-start:
+        ami-actions:
+            action:
+                Action: 'SetVar'
+                Variable: 'DEVICE_STATE(Custom:alice)'
+                Value: 'INUSE'
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'ExtensionStatus'
+                    Exten: 'alice'
+                    Context: 'hints'
+            requirements:
+                match:
+                    Hint: 'Custom:alice'
+                    Status: '1'
+                    StatusText: 'InUse'
+            count: 1
+        stop_test:
diff --git a/tests/pbx/tests.yaml b/tests/pbx/tests.yaml
index cb81af9..4e4c97f 100644
--- a/tests/pbx/tests.yaml
+++ b/tests/pbx/tests.yaml
@@ -1,6 +1,7 @@
 # Enter tests here in the order they should be considered for execution:
 tests:
     - dir: 'accountcode'
+    - test: 'autohints'
     - test: 'call_file_retries_archive'
     - test: 'call_file_retries_alwaysdelete'
     - test: 'call_file_retries_fail'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf64f7b798ca43e2c0726f8e6665b713372f6413
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list