[asterisk-commits] tests/rest api/asterisk/config/dynamic: Add a test for push ... (testsuite[master])
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jul 17 09:24:01 CDT 2015
Matt Jordan has submitted this change and it was merged.
Change subject: tests/rest_api/asterisk/config/dynamic: Add a test for push config creation
......................................................................
tests/rest_api/asterisk/config/dynamic: Add a test for push config creation
This patch adds a test that covers push creation of a dynamic, aka,
'sorcery', configuration object. The test covers both off-nominal and
nominal scenarios, including:
- Off-nominal requests with bad path parameters
- Off-nominal requests with an invalid body
- Off-nominal requests that attempt to create a dynamic object
that is not supported by the machine configuration
- Nominal creation of an object
ASTERISK-25238
Change-Id: I728ea8b73d52ee766afde343228c17b57e2c527c
---
A tests/rest_api/asterisk/config/dynamic/create/configs/ast1/sorcery.conf
A tests/rest_api/asterisk/config/dynamic/create/test-config.yaml
A tests/rest_api/asterisk/config/dynamic/tests.yaml
A tests/rest_api/asterisk/config/tests.yaml
M tests/rest_api/asterisk/tests.yaml
M tests/rest_api/tests.yaml
6 files changed, 101 insertions(+), 0 deletions(-)
Approvals:
Matt Jordan: Looks good to me, approved; Verified
Joshua Colp: Looks good to me, but someone else must approve
diff --git a/tests/rest_api/asterisk/config/dynamic/create/configs/ast1/sorcery.conf b/tests/rest_api/asterisk/config/dynamic/create/configs/ast1/sorcery.conf
new file mode 100644
index 0000000..8b341df
--- /dev/null
+++ b/tests/rest_api/asterisk/config/dynamic/create/configs/ast1/sorcery.conf
@@ -0,0 +1,2 @@
+[res_pjsip]
+endpoint=memory,ps_endpoints
diff --git a/tests/rest_api/asterisk/config/dynamic/create/test-config.yaml b/tests/rest_api/asterisk/config/dynamic/create/test-config.yaml
new file mode 100644
index 0000000..de3978c
--- /dev/null
+++ b/tests/rest_api/asterisk/config/dynamic/create/test-config.yaml
@@ -0,0 +1,91 @@
+testinfo:
+ summary: 'Test creation of a dynamic configuration object'
+ description: |
+ 'This test covers creating a dynamic config object using ARI.
+ This includes both off-nominal and nominal scenarios, specifically:
+ - Off-nominal requests with bad path parameters
+ - Off-nominal requests with an invalid body
+ - Off-nominal requests that attempt to create a dynamic object
+ that is not supported by the configuration
+ - Nominal creation of an object'
+
+properties:
+ minversion: '13.5.0'
+ dependencies:
+ - python: autobahn.websocket
+ - python: requests
+ - python: twisted
+ - python: starpy
+ - asterisk: res_ari_asterisk
+ - asterisk: res_pjsip
+ - asterisk: res_sorcery_memory
+ tags:
+ - ARI
+ - pjsip
+
+test-modules:
+ test-object:
+ config-section: test-config
+ typename: ari.AriBaseTestObject
+ modules:
+ -
+ config-section: pluggable-config
+ typename: pluggable_modules.EventActionModule
+
+
+test-config:
+ apps: testsuite
+
+
+pluggable-config:
+ -
+ ari-start:
+ ari-requests:
+ -
+ method: 'put'
+ uri: 'asterisk/BAD/dynamic/res_pjsip/endpoint/alice'
+ body: { 'fields': [ { 'attribute': 'allow', 'value': '!all,ulaw,alaw' },
+ { 'attribute': 'context', 'value': 'local' } ] }
+ expect: 404
+ -
+ method: 'put'
+ uri: 'asterisk/config/BAD/res_pjsip/endpoint/alice'
+ body: { 'fields': [ { 'attribute': 'allow', 'value': '!all,ulaw,alaw' },
+ { 'attribute': 'context', 'value': 'local' } ] }
+ expect: 404
+ -
+ method: 'put'
+ uri: 'asterisk/config/dynamic/BAD/endpoint/alice'
+ body: { 'fields': [ { 'attribute': 'allow', 'value': '!all,ulaw,alaw' },
+ { 'attribute': 'context', 'value': 'local' } ] }
+ expect: 404
+ -
+ method: 'put'
+ uri: 'asterisk/config/dynamic/res_pjsip/BAD/alice'
+ body: { 'fields': [ { 'attribute': 'allow', 'value': '!all,ulaw,alaw' },
+ { 'attribute': 'context', 'value': 'local' } ] }
+ expect: 404
+ -
+ method: 'put'
+ uri: 'asterisk/config/dynamic/res_pjsip/endpoint/alice'
+ body: { 'fields': [ { 'attribute': 'allow', 'value': 'BLECH' },
+ { 'attribute': 'context', 'value': 'local' } ] }
+ expect: 400
+ -
+ method: 'put'
+ uri: 'asterisk/config/dynamic/res_pjsip/auth/alice'
+ body: { 'fields': [ { 'attribute': 'username', 'value': 'alice' },
+ { 'attribute': 'password', 'value': 'alice' } ] }
+ expect: 403
+ -
+ method: 'put'
+ uri: 'asterisk/config/dynamic/res_pjsip/endpoint/alice'
+ body: { 'fields': [ { 'attribute': 'allow', 'value': '!all,ulaw,alaw' },
+ { 'attribute': 'context', 'value': 'local' } ] }
+ expect: 200
+ -
+ method: 'get'
+ uri: 'asterisk/config/dynamic/res_pjsip/endpoint/alice'
+ expect: 200
+ stop_test:
+
diff --git a/tests/rest_api/asterisk/config/dynamic/tests.yaml b/tests/rest_api/asterisk/config/dynamic/tests.yaml
new file mode 100644
index 0000000..c338803
--- /dev/null
+++ b/tests/rest_api/asterisk/config/dynamic/tests.yaml
@@ -0,0 +1,3 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+ - test: 'create'
diff --git a/tests/rest_api/asterisk/config/tests.yaml b/tests/rest_api/asterisk/config/tests.yaml
new file mode 100644
index 0000000..3c58e3a
--- /dev/null
+++ b/tests/rest_api/asterisk/config/tests.yaml
@@ -0,0 +1,3 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+ - dir: 'dynamic'
diff --git a/tests/rest_api/asterisk/tests.yaml b/tests/rest_api/asterisk/tests.yaml
index dc82f36..4bd5f73 100644
--- a/tests/rest_api/asterisk/tests.yaml
+++ b/tests/rest_api/asterisk/tests.yaml
@@ -1,2 +1,3 @@
tests:
- dir: 'modules'
+ - dir: 'config'
diff --git a/tests/rest_api/tests.yaml b/tests/rest_api/tests.yaml
index ac9303c..2d1b461 100644
--- a/tests/rest_api/tests.yaml
+++ b/tests/rest_api/tests.yaml
@@ -3,6 +3,7 @@
- test: 'continue'
- test: 'authentication'
- test: 'CORS'
+ - dir: 'asterisk'
- dir: 'applications'
- dir: 'asterisk'
- dir: 'bridges'
--
To view, visit https://gerrit.asterisk.org/843
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I728ea8b73d52ee766afde343228c17b57e2c527c
Gerrit-PatchSet: 3
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
More information about the asterisk-commits
mailing list