[Asterisk-code-review] apps/dial/privacy/screening: Add a screening test that conne... (testsuite[master])

Matt Jordan asteriskteam at digium.com
Sat Sep 3 15:59:52 CDT 2016


Matt Jordan has uploaded a new change for review.

  https://gerrit.asterisk.org/3817

Change subject: apps/dial/privacy/screening: Add a screening test that connects the call
......................................................................

apps/dial/privacy/screening: Add a screening test that connects the call

This patch adds a test for the screening (p) option for the Dial application.
Upon receiving the call attempt, the callee selects the option to
connect the call. The test verifies that the call is bridged between the
two parties, along with whether important sound prompts were played to
both parties.

ASTERISK-25691

Change-Id: I79689404aafa59463f86dee71e681e7dd3b0ae65
---
A tests/apps/dial/privacy/screening/connect-call/test-config.yaml
A tests/apps/dial/privacy/screening/tests.yaml
M tests/apps/dial/privacy/tests.yaml
3 files changed, 170 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/17/3817/1

diff --git a/tests/apps/dial/privacy/screening/connect-call/test-config.yaml b/tests/apps/dial/privacy/screening/connect-call/test-config.yaml
new file mode 100644
index 0000000..c1f130f
--- /dev/null
+++ b/tests/apps/dial/privacy/screening/connect-call/test-config.yaml
@@ -0,0 +1,166 @@
+testinfo:
+    summary: 'Test Screening where the call is connected'
+    description: |
+        'This test covers the screening option (p) where the called
+        party chooses to connect the call. The test verifies some
+        basic properties of the Screening mode, including the recording
+        of the name of the caller, along with the resulting DIALSTATUS.'
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: apptest.AppTest
+    modules:
+        -
+            config-section: asterisk-config
+            typename: pluggable_modules.AsteriskConfigModule
+
+asterisk-config:
+    -
+        src: 'tests/apps/dial/privacy/configs/extensions.conf'
+        dst: 'extensions.conf'
+
+test-object-config:
+  app: 'Dial'
+  scenarios:
+    -
+      channels:
+        -
+          channel-id: 'Test-User'
+          channel-name: 'Local/test_screening at default'
+          context: 'default'
+          exten: 'wait'
+          start-on-create: True
+          events:
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'Newexten'
+                  Context: 'default'
+                  Extension: 'wait'
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'TestEvent'
+                  State: 'PLAYBACK'
+                  Message: 'beep'
+              actions:
+                -
+                  action-type: 'stream-audio-with-dtmf'
+                  sound-file: 'agent-loginok'
+                  dtmf: '#'
+                  dtmf-delay: 4
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'TestEvent'
+                  State: 'PLAYBACK'
+                  Message: 'vm-dialout'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'Dial out commencing and announced'
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'BridgeEnter'
+                  Channel: 'Local/test_screening at default-00000000;2'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'Bridge of test_screening half occurred'
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'UserEvent'
+                  UserEvent: 'DialStatus'
+                  Result: 'ANSWER'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'DIALSTATUS is ANSWER'
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'Hangup'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'Channel test_screening hungup'
+        -
+          # This channel is dialed; as a result, we don't control
+          # it when it goes into an application. Instead, channel
+          # variables set in the dialplan will inform apptest that
+          # it can be controlled
+          channel-id: 'Farend'
+          channel-name: 'Local/farend at default'
+          testuniqueid: 'farend'
+          events:
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'TestEvent'
+                  State: 'PLAYBACK'
+                  Message: 'priv-callerintros/5551234.*'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'Calling party name played to called party'
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'TestEvent'
+                  State: 'PLAYBACK'
+                  Message: 'screen-callee-options'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'Options played to far end'
+                -
+                  action-type: 'send-dtmf'
+                  delay: 1
+                  dtmf: '1'
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'BridgeEnter'
+                  Channel: 'Local/farend at default-00000001;1'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'Bridge of farend half occurred'
+                -
+                  action-type: 'hangup'
+                  delay: 3
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'Hangup'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'Channel farend hungup'
+
+
+properties:
+    minversion: '13.12.0'
+    tags:
+      - apps
+      - dial
+    dependencies:
+      - buildoption: 'TEST_FRAMEWORK'
+      - python : 'twisted'
+      - python : 'starpy'
+      - asterisk : 'app_senddtmf'
+      - asterisk : 'app_dial'
+
diff --git a/tests/apps/dial/privacy/screening/tests.yaml b/tests/apps/dial/privacy/screening/tests.yaml
new file mode 100644
index 0000000..3c66c7a
--- /dev/null
+++ b/tests/apps/dial/privacy/screening/tests.yaml
@@ -0,0 +1,3 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+    - test: 'connect-call'
diff --git a/tests/apps/dial/privacy/tests.yaml b/tests/apps/dial/privacy/tests.yaml
index f70df47..dcd1ba9 100644
--- a/tests/apps/dial/privacy/tests.yaml
+++ b/tests/apps/dial/privacy/tests.yaml
@@ -1,4 +1,4 @@
 # Enter tests here in the order they should be considered for execution:
 tests:
     - dir: 'privacy'
-
+    - dir: 'screening'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I79689404aafa59463f86dee71e681e7dd3b0ae65
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list