[asterisk-commits] tests/pbx/autohints: Add test for autohints support. (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Apr 11 20:29:11 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

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(-)

Approvals:
  Mark Michelson: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



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: merged
Gerrit-Change-Id: Ibf64f7b798ca43e2c0726f8e6665b713372f6413
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-commits mailing list