[Asterisk-code-review] app_assert: Add tests for Assert application (testsuite[master])
N A
asteriskteam at digium.com
Wed Dec 15 08:05:56 CST 2021
N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/testsuite/+/17659 )
Change subject: app_assert: Add tests for Assert application
......................................................................
app_assert: Add tests for Assert application
Ensures Assert application functions correctly.
ASTERISK-29701
Change-Id: I564bca2c4143eef7d7097b33810a0316140e364c
---
A tests/apps/assert/configs/ast1/extensions.conf
A tests/apps/assert/test-config.yaml
M tests/apps/tests.yaml
3 files changed, 75 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/59/17659/1
diff --git a/tests/apps/assert/configs/ast1/extensions.conf b/tests/apps/assert/configs/ast1/extensions.conf
new file mode 100644
index 0000000..5e6d7b1
--- /dev/null
+++ b/tests/apps/assert/configs/ast1/extensions.conf
@@ -0,0 +1,15 @@
+
+[default]
+exten => s,1,Answer()
+ same => n,Assert($[${EPOCH}!=$[${EPOCH}-2]])
+ same => n,UserEvent(AssertSuccess,Result: Pass)
+ same => n,Assert($[${EPOCH}=$[${EPOCH}-2]],d)
+ same => n,UserEvent(AssertSuccess,Result: Pass) ; assert fails, but doesn't crash the call
+ same => n,Assert($[${EPOCH}=$[${EPOCH}-2]]) ; goodbye
+ same => n,UserEvent(AssertFail,Result: Fail)
+ same => n,Hangup()
+
+[nothing]
+exten => 0,1,Answer()
+ same => n,Wait(10)
+ same => n,Hangup()
diff --git a/tests/apps/assert/test-config.yaml b/tests/apps/assert/test-config.yaml
new file mode 100644
index 0000000..ff19fe8
--- /dev/null
+++ b/tests/apps/assert/test-config.yaml
@@ -0,0 +1,59 @@
+testinfo:
+ summary: 'Ensure that app_assert functions correctly.'
+ description: |
+ 'This tests the Assert application to make sure
+ that it functions correctly.'
+
+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: 'AssertSuccess'
+ requirements:
+ match:
+ Result: 'Pass'
+ count: 2
+ stop_test:
+
+properties:
+ tags:
+ - dial
+ - funcs
+ dependencies:
+ - python: 'twisted'
+ - python: 'starpy'
+ - asterisk: 'app_dial'
+ - asterisk: 'app_userevent'
+ - asterisk: 'app_originate'
+ - asterisk: 'app_assert'
+ - asterisk: 'pbx_config'
diff --git a/tests/apps/tests.yaml b/tests/apps/tests.yaml
index 4f15191..22127b8 100644
--- a/tests/apps/tests.yaml
+++ b/tests/apps/tests.yaml
@@ -27,3 +27,4 @@
- test: 'waitdigit'
- dir: 'sendtext'
- test: 'mf'
+ - test: 'assert'
--
To view, visit https://gerrit.asterisk.org/c/testsuite/+/17659
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Change-Id: I564bca2c4143eef7d7097b33810a0316140e364c
Gerrit-Change-Number: 17659
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/20211215/652fe9c8/attachment-0001.html>
More information about the asterisk-code-review
mailing list