[Asterisk-code-review] apps/waitdigit: Add test for filtered DTMF wait. (testsuite[master])

Corey Farrell asteriskteam at digium.com
Wed Jul 12 18:20:29 CDT 2017


Corey Farrell has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/08/6008/1

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: newchange
Gerrit-Change-Id: I4c16b6ba02b12be3d62c37afa731f6874f2dc5ed
Gerrit-Change-Number: 6008
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170712/122d705d/attachment.html>


More information about the asterisk-code-review mailing list