[Asterisk-code-review] app_sendtext: Add test for ReceiveText (testsuite[master])

N A asteriskteam at digium.com
Sat Dec 4 08:37:05 CST 2021


N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/testsuite/+/17592 )


Change subject: app_sendtext: Add test for ReceiveText
......................................................................

app_sendtext: Add test for ReceiveText

Adds test for new ReceiveText application.

ASTERISK-29759

Change-Id: Ic65424b85d1bb2ff4cedb062ee7f23295377d1cc
---
A tests/apps/sendtext/receive/configs/ast1/extensions.conf
A tests/apps/sendtext/receive/test-config.yaml
M tests/apps/sendtext/tests.yaml
3 files changed, 94 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/92/17592/1

diff --git a/tests/apps/sendtext/receive/configs/ast1/extensions.conf b/tests/apps/sendtext/receive/configs/ast1/extensions.conf
new file mode 100644
index 0000000..135779d
--- /dev/null
+++ b/tests/apps/sendtext/receive/configs/ast1/extensions.conf
@@ -0,0 +1,33 @@
+[default]
+exten => s,1,Answer()
+	same => n,Originate(Local/1 at send-text,exten,receive-text,1,1,,a)
+	same => n,Originate(Local/2 at send-text,exten,receive-text,2,1,,a)
+	same => n,Wait(8)
+	same => n,Hangup()
+
+[nothing]
+exten => 0,1,Answer()
+	same => n,Wait(8)
+	same => n,Hangup()
+
+[send-text]
+exten => 1,1,Answer(0.5)
+	same => n,SendText(Hello world)
+	same => n,Hangup()
+exten => 2,1,Answer(0.5)
+	same => n,SendText(Something)
+	same => n,Hangup()
+
+[receive-text]
+exten => 1,1,Answer()
+	same => n,ReceiveText(3)
+	same => n,GotoIf($["${RECEIVETEXTMESSAGE}"="Hello world"]?success,1:fail,1)
+exten => 2,1,Answer()
+	same => n,ReceiveText(3)
+	same => n,GotoIf($["${RECEIVETEXTMESSAGE}"="Something"]?success,1:fail,1)
+exten => success,1,Answer(1)
+	same => n,UserEvent(ReceiveTextSuccess,Result: Pass)
+	same => n,Hangup()
+exten => fail,1,Answer(1)
+	same => n,UserEvent(ReceiveTextSuccess,Result: Fail ${RECEIVETEXTSTATUS},Reason: ${RECEIVETEXTMESSAGE})
+	same => n,Hangup()
diff --git a/tests/apps/sendtext/receive/test-config.yaml b/tests/apps/sendtext/receive/test-config.yaml
new file mode 100644
index 0000000..beb5efa
--- /dev/null
+++ b/tests/apps/sendtext/receive/test-config.yaml
@@ -0,0 +1,60 @@
+testinfo:
+    summary: 'Ensure that Originate work as intended.'
+    description: |
+        'This tests multiple Originate scenarios with
+        Caller ID and variables on each channel to
+        ensure that they are set properly.'
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'test_case.TestCaseModule'
+    modules:
+        -
+            config-section: caller-originator
+            typename: 'pluggable_modules.Originator'
+        -
+            config-section: hangup-monitor
+            typename: 'pluggable_modules.HangupMonitor'
+        -
+            config-section: ami-config
+            typename: 'pluggable_modules.EventActionModule'
+
+test-object-config:
+    connect-ami: True
+
+caller-originator:
+    channel: 'Local/s at default'
+    context: 'nothing'
+    exten: '0'
+    priority: '1'
+    trigger: 'ami_connect'
+
+hangup-monitor:
+    ids: '0'
+
+ami-config:
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'UserEvent'
+                    UserEvent: 'ReceiveTextSuccess'
+            requirements:
+                match:
+                    Result: 'Pass'
+            count: 2
+        stop_test:
+
+properties:
+    tags:
+        - dial
+        - apps
+    dependencies:
+        - python: 'twisted'
+        - python: 'starpy'
+        - asterisk: 'app_dial'
+        - asterisk: 'app_userevent'
+        - asterisk: 'app_originate'
+        - asterisk: 'app_sendtext'
+        - asterisk: 'pbx_config'
diff --git a/tests/apps/sendtext/tests.yaml b/tests/apps/sendtext/tests.yaml
index 83dfbe4..9b9d8a2 100644
--- a/tests/apps/sendtext/tests.yaml
+++ b/tests/apps/sendtext/tests.yaml
@@ -2,3 +2,4 @@
 tests:
     - test: 'basic'
     - test: 'enhanced'
+    - test: 'receive'

-- 
To view, visit https://gerrit.asterisk.org/c/testsuite/+/17592
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Change-Id: Ic65424b85d1bb2ff4cedb062ee7f23295377d1cc
Gerrit-Change-Number: 17592
Gerrit-PatchSet: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20211204/4c0ce29f/attachment.html>


More information about the asterisk-code-review mailing list