[Asterisk-code-review] tests/remote-test: Add a sample remote test (testsuite[master])
Matt Jordan
asteriskteam at digium.com
Sat Oct 24 09:17:50 CDT 2015
Matt Jordan has uploaded a new change for review.
https://gerrit.asterisk.org/1522
Change subject: tests/remote-test: Add a sample remote test
......................................................................
tests/remote-test: Add a sample remote test
This patch adds a test that only executes if the Test Suite is in 'remote'
mode. It will attempt to connect to a remote Asterisk instance, and spawn a
Local channel at s at default. If the channel is answered, the test will pass.
This test is provided merely as an example of how to write a remote test.
Change-Id: I857c5f20d4c260be73697062506f63cb3533c3a8
---
A tests/remote-test/test-config.yaml
M tests/tests.yaml
2 files changed, 60 insertions(+), 1 deletion(-)
git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/22/1522/1
diff --git a/tests/remote-test/test-config.yaml b/tests/remote-test/test-config.yaml
new file mode 100644
index 0000000..26169b5
--- /dev/null
+++ b/tests/remote-test/test-config.yaml
@@ -0,0 +1,59 @@
+testinfo:
+ summary: 'A remote test demo'
+ description: |
+ This test is simply a demonstration of a remote Asterisk test. Rather
+ than spawn a local instance of Asterisk, it will attempt to connect
+ back to some Asterisk instance running on a remote system.
+
+ You will need to configure the global test-config.yaml file for this
+ test to function properly. In addition to providing credentials for the
+ SSH connection, an AMI connection should be configured for the remote
+ Asterisk instance.
+
+ The test spawns a Local channel at s at default. So long as the channel
+ is created and answered, the test will pass.
+
+test-modules:
+ test-object:
+ config-section: test-config
+ typename: test_case.TestCaseModule
+ modules:
+ -
+ config-section: originator-config
+ typename: 'pluggable_modules.Originator'
+ -
+ config-section: hangup-monitor
+ typename: 'pluggable_modules.HangupMonitor'
+ -
+ config-section: ami-config
+ typename: 'ami.AMIEventModule'
+
+test-config:
+ connect-ami: True
+
+originator-config:
+ trigger: 'ami_connect'
+ id: '0'
+ channel: 'Local/s at default'
+ application: 'Echo'
+ async: True
+
+hangup-monitor:
+ ids: ['0']
+
+ami-config:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'Hangup'
+ requirements:
+ match:
+ Channel: 'Local/s at default-.*'
+ count: '>1'
+
+properties:
+ dependencies:
+ - python : 'twisted'
+ - python : 'starpy'
+ - custom : 'remote'
diff --git a/tests/tests.yaml b/tests/tests.yaml
index 1a92254..a94bc94 100644
--- a/tests/tests.yaml
+++ b/tests/tests.yaml
@@ -34,4 +34,4 @@
- dir: 'realtime'
- dir: 'http_server'
- dir: 'sorcery'
-
+ - test: 'remote-test'
--
To view, visit https://gerrit.asterisk.org/1522
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I857c5f20d4c260be73697062506f63cb3533c3a8
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