[Asterisk-code-review] manager: add test for file outside config directory (testsuite[20])
Michael Bradeen
asteriskteam at digium.com
Fri Dec 9 10:17:28 CST 2022
Michael Bradeen has uploaded this change for review. ( https://gerrit.asterisk.org/c/testsuite/+/19689 )
Change subject: manager: add test for file outside config directory
......................................................................
manager: add test for file outside config directory
Add negative test that looks for correct error on read of
file outside AST_CONFIG_DIR
ASTERISK-30176
Change-Id: I49d0daf31043bcb7483b0003619e0bc5568141f9
---
A tests/manager/config/restricted/test-config.yaml
M tests/manager/config/tests.yaml
2 files changed, 82 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/89/19689/1
diff --git a/tests/manager/config/restricted/test-config.yaml b/tests/manager/config/restricted/test-config.yaml
new file mode 100644
index 0000000..f37e1a9
--- /dev/null
+++ b/tests/manager/config/restricted/test-config.yaml
@@ -0,0 +1,67 @@
+testinfo:
+ summary: 'Test Manager GetConfig and UpdateConfig Basic Ops'
+ description: |
+ 'Test Manager GetConfig and UpdateConfig Basic Ops'
+properties:
+ dependencies:
+ - python : 'twisted'
+ - python : 'starpy'
+ tags:
+ - manager
+ - AMI
+
+test-modules:
+ add-test-to-search-path: 'True'
+ add-relative-to-search-path: ['..']
+ test-object:
+ config-section: object-config
+ typename: 'ManagerConfigTest.ManagerConfigTest'
+
+ast-config-options:
+ live_dangerously: 'no'
+
+object-config:
+ reactor-timeout: 15
+ ami-config:
+ - ### Create a new config file outside the asterisk config directory
+ message:
+ Action: 'GetConfig'
+ Filename: '/tmp/test.conf'
+ expected:
+ Response: 'Error'
+ Message: 'File requires escalated priveledges'
+ - ### Update a config file outside the asterisk config directory
+ message:
+ Action: 'UpdateConfig'
+ SrcFilename: '/tmp/test.conf'
+ DstFilename: '/tmp/test.conf'
+
+ Action-000000: 'NewCat'
+ Cat-000000: 'Cat1'
+ expected:
+ Response: 'Error'
+ Message: 'File requires escalated priveledges'
+ - ### Update from a config file outside the asterisk config directory
+ message:
+ Action: 'UpdateConfig'
+ SrcFilename: '/tmp/test.conf'
+ DstFilename: 'test.conf'
+
+ Action-000000: 'NewCat'
+ Cat-000000: 'Cat1'
+ expected:
+ Response: 'Error'
+ Message: 'File requires escalated priveledges'
+ - ### Update to a config file outside the asterisk config directory
+ message:
+ Action: 'UpdateConfig'
+ SrcFilename: 'test.conf'
+ DstFilename: '/tmp/test.conf'
+
+ Action-000000: 'NewCat'
+ Cat-000000: 'Cat1'
+ expected:
+ Response: 'Error'
+ Message: 'File requires escalated priveledges'
+
+
diff --git a/tests/manager/config/tests.yaml b/tests/manager/config/tests.yaml
index 9ddadda..45cacc8 100644
--- a/tests/manager/config/tests.yaml
+++ b/tests/manager/config/tests.yaml
@@ -2,4 +2,5 @@
tests:
- test: 'basic'
- test: 'advanced'
+ - test: 'restricted'
- test: 'no_preserve_effective_context'
--
To view, visit https://gerrit.asterisk.org/c/testsuite/+/19689
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: testsuite
Gerrit-Branch: 20
Gerrit-Change-Id: I49d0daf31043bcb7483b0003619e0bc5568141f9
Gerrit-Change-Number: 19689
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Bradeen <mbradeen at sangoma.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221209/cd7bd78c/attachment-0001.html>
More information about the asterisk-code-review
mailing list