[asterisk-commits] apps/waitdigit: Add test for filtered DTMF wait. (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 26 05:58:40 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/6008 )

Change subject: apps/waitdigit: Add test for filtered DTMF wait.
......................................................................

apps/waitdigit: Add test for filtered DTMF wait.

Test all results of the WaitDigit dialplan app.

ASTERISK-27129 #close

Change-Id: I4c16b6ba02b12be3d62c37afa731f6874f2dc5ed
---
M tests/apps/tests.yaml
A tests/apps/waitdigit/configs/ast1/extensions.conf
A tests/apps/waitdigit/test-config.yaml
3 files changed, 71 insertions(+), 0 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/tests/apps/tests.yaml b/tests/apps/tests.yaml
index 3b94a91..5c79751 100644
--- a/tests/apps/tests.yaml
+++ b/tests/apps/tests.yaml
@@ -23,3 +23,4 @@
     - dir: 'disa'
     - dir: 'authenticate'
     - dir: 'statsd'
+    - test: 'waitdigit'
diff --git a/tests/apps/waitdigit/configs/ast1/extensions.conf b/tests/apps/waitdigit/configs/ast1/extensions.conf
new file mode 100644
index 0000000..1ddf420
--- /dev/null
+++ b/tests/apps/waitdigit/configs/ast1/extensions.conf
@@ -0,0 +1,28 @@
+[default]
+
+exten => test,1,NoOp()
+same => n,Answer()
+
+same => n,WaitDigit(5000ms,123)
+same => n,Noop(${WAITDIGITSTATUS}${WAITDIGITRESULT})
+same => n,ExecIf($[${WAITDIGITSTATUS}${WAITDIGITRESULT}=DTMF2]?UserEvent(Test1,result:pass))
+
+same => n,WaitDigit(invalid,123)
+same => n,ExecIf($[${WAITDIGITSTATUS}=ERROR]?UserEvent(Test2,result:pass))
+
+same => n,WaitDigit(100ms,123)
+same => n,ExecIf($[${WAITDIGITSTATUS}=TIMEOUT]?UserEvent(Test3,result:pass))
+
+same => n,WaitDigit(5s,123)
+exten => h,1,ExecIf($[${WAITDIGITSTATUS}=CANCEL]?UserEvent(Test4,result:pass))
+
+
+[caller]
+exten => test,1,NoOp()
+same => n,Answer()
+same => n,Wait(0.5)
+; 5 is not among the accepted digits so it will be ignored.
+same => n,SendDTMF(5)
+same => n,SendDTMF(2)
+same => n,Wait(0.5)
+same => n,Hangup()
diff --git a/tests/apps/waitdigit/test-config.yaml b/tests/apps/waitdigit/test-config.yaml
new file mode 100644
index 0000000..160c8b4
--- /dev/null
+++ b/tests/apps/waitdigit/test-config.yaml
@@ -0,0 +1,42 @@
+testinfo:
+    summary: 'Test WaitDigit'
+    description: |
+      'Basic testing of WaitDigit.'
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'test_case.SimpleTestCase'
+    modules:
+        -
+            config-section: ami-config
+            typename: 'ami.AMIEventModule'
+
+test-object-config:
+    spawn-after-hangup: True
+    expected_events: 4
+    test-iterations:
+        -
+            channel: 'Local/test at default'
+            context: 'caller'
+            exten: 'test'
+            priority: 1
+
+ami-config:
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'UserEvent'
+        requirements:
+            match:
+                Result: 'pass'
+        count: '4'
+
+properties:
+    minversion: '15.0.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - asterisk : 'app_userevent'
+        - asterisk : 'app_senddtmf'

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

Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I4c16b6ba02b12be3d62c37afa731f6874f2dc5ed
Gerrit-Change-Number: 6008
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20170726/c1eca5bd/attachment-0001.html>


More information about the asterisk-commits mailing list