[Asterisk-code-review] app_sendtext: Add test for ReceiveText (testsuite[18])
N A
asteriskteam at digium.com
Wed Jan 5 06:35:30 CST 2022
N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/testsuite/+/17816 )
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, 95 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/16/17816/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..03f8d58
--- /dev/null
+++ b/tests/apps/sendtext/receive/configs/ast1/extensions.conf
@@ -0,0 +1,35 @@
+
+[default]
+exten => s,1,Answer()
+ same => n,Set(GLOBAL(sendtext1)=Hello world)
+ same => n,Set(GLOBAL(sendtext2)=Something cool.)
+ same => n,Set(GLOBAL(sendtext3)=Hi, Joe! What's for lunch?)
+ same => n,Set(GLOBAL(sendtext4)=http://example.com)
+ same => n,Set(GLOBAL(sendtext5)={"city": "Anytown", "state": "USA"})
+ same => n,Set(i=0)
+ same => n,While($[${INC(i)}<=5])
+ same => n,Originate(Local/${i}@send-text,exten,receive-text,${i},1,,a)
+ same => n,EndWhile()
+ same => n,Hangup()
+
+[nothing]
+exten => 0,1,Answer()
+ same => n,Wait(8)
+ same => n,Hangup()
+
+[send-text]
+exten => _X!,1,Answer(0.5)
+ same => n,SendText(${sendtext${EXTEN}})
+ same => n,Wait(2) ; needed so ReceiveText has time to finish.
+ same => n,Hangup()
+
+[receive-text]
+exten => _X!,1,Answer()
+ same => n,ReceiveText(3)
+ same => n,GotoIf($["${RECEIVETEXTMESSAGE}"="${sendtext${EXTEN}}"]?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..d6ed9e6
--- /dev/null
+++ b/tests/apps/sendtext/receive/test-config.yaml
@@ -0,0 +1,59 @@
+testinfo:
+ summary: 'Ensure that ReceiveText functions correctly.'
+ description: |
+ 'This tests the ReceiveText application to ensure
+ that it works correctly as the inverse to SendText.'
+
+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: 5
+ 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/+/17816
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: testsuite
Gerrit-Branch: 18
Gerrit-Change-Id: Ic65424b85d1bb2ff4cedb062ee7f23295377d1cc
Gerrit-Change-Number: 17816
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/20220105/7e776fb1/attachment.html>
More information about the asterisk-code-review
mailing list