[Asterisk-code-review] app_sendtext: Add test for ReceiveText (testsuite[19])
Friendly Automation
asteriskteam at digium.com
Wed Jan 5 12:18:12 CST 2022
Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/testsuite/+/17817 )
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(-)
Approvals:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
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/+/17817
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: testsuite
Gerrit-Branch: 19
Gerrit-Change-Id: Ic65424b85d1bb2ff4cedb062ee7f23295377d1cc
Gerrit-Change-Number: 17817
Gerrit-PatchSet: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220105/d1e8f346/attachment.html>
More information about the asterisk-code-review
mailing list