<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/19689">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span></span><br></pre><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">manager: add test for file outside config directory<br><br>Add negative test that looks for correct error on read of<br>file outside AST_CONFIG_DIR<br><br>ASTERISK-30176<br><br>Change-Id: I49d0daf31043bcb7483b0003619e0bc5568141f9<br>---<br>A tests/manager/config/restricted/test-config.yaml<br>M tests/manager/config/tests.yaml<br>2 files changed, 82 insertions(+), 0 deletions(-)<br><br></pre>
<pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/manager/config/restricted/test-config.yaml b/tests/manager/config/restricted/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..f37e1a9</span><br><span>--- /dev/null</span><br><span>+++ b/tests/manager/config/restricted/test-config.yaml</span><br><span>@@ -0,0 +1,67 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test Manager GetConfig and UpdateConfig Basic Ops'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ 'Test Manager GetConfig and UpdateConfig Basic Ops'</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - python : 'twisted'</span><br><span style="color: hsl(120, 100%, 40%);">+ - python : 'starpy'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - manager</span><br><span style="color: hsl(120, 100%, 40%);">+ - AMI</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ add-test-to-search-path: 'True'</span><br><span style="color: hsl(120, 100%, 40%);">+ add-relative-to-search-path: ['..']</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'ManagerConfigTest.ManagerConfigTest'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ast-config-options:</span><br><span style="color: hsl(120, 100%, 40%);">+ live_dangerously: 'no'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ reactor-timeout: 15</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ - ### Create a new config file outside the asterisk config directory</span><br><span style="color: hsl(120, 100%, 40%);">+ message:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'GetConfig'</span><br><span style="color: hsl(120, 100%, 40%);">+ Filename: '/tmp/test.conf'</span><br><span style="color: hsl(120, 100%, 40%);">+ expected:</span><br><span style="color: hsl(120, 100%, 40%);">+ Response: 'Error'</span><br><span style="color: hsl(120, 100%, 40%);">+ Message: 'File requires escalated priveledges'</span><br><span style="color: hsl(120, 100%, 40%);">+ - ### Update a config file outside the asterisk config directory</span><br><span style="color: hsl(120, 100%, 40%);">+ message:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'UpdateConfig'</span><br><span style="color: hsl(120, 100%, 40%);">+ SrcFilename: '/tmp/test.conf'</span><br><span style="color: hsl(120, 100%, 40%);">+ DstFilename: '/tmp/test.conf'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ Action-000000: 'NewCat'</span><br><span style="color: hsl(120, 100%, 40%);">+ Cat-000000: 'Cat1'</span><br><span style="color: hsl(120, 100%, 40%);">+ expected:</span><br><span style="color: hsl(120, 100%, 40%);">+ Response: 'Error'</span><br><span style="color: hsl(120, 100%, 40%);">+ Message: 'File requires escalated priveledges'</span><br><span style="color: hsl(120, 100%, 40%);">+ - ### Update from a config file outside the asterisk config directory</span><br><span style="color: hsl(120, 100%, 40%);">+ message:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'UpdateConfig'</span><br><span style="color: hsl(120, 100%, 40%);">+ SrcFilename: '/tmp/test.conf'</span><br><span style="color: hsl(120, 100%, 40%);">+ DstFilename: 'test.conf'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ Action-000000: 'NewCat'</span><br><span style="color: hsl(120, 100%, 40%);">+ Cat-000000: 'Cat1'</span><br><span style="color: hsl(120, 100%, 40%);">+ expected:</span><br><span style="color: hsl(120, 100%, 40%);">+ Response: 'Error'</span><br><span style="color: hsl(120, 100%, 40%);">+ Message: 'File requires escalated priveledges'</span><br><span style="color: hsl(120, 100%, 40%);">+ - ### Update to a config file outside the asterisk config directory</span><br><span style="color: hsl(120, 100%, 40%);">+ message:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'UpdateConfig'</span><br><span style="color: hsl(120, 100%, 40%);">+ SrcFilename: 'test.conf'</span><br><span style="color: hsl(120, 100%, 40%);">+ DstFilename: '/tmp/test.conf'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ Action-000000: 'NewCat'</span><br><span style="color: hsl(120, 100%, 40%);">+ Cat-000000: 'Cat1'</span><br><span style="color: hsl(120, 100%, 40%);">+ expected:</span><br><span style="color: hsl(120, 100%, 40%);">+ Response: 'Error'</span><br><span style="color: hsl(120, 100%, 40%);">+ Message: 'File requires escalated priveledges'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/manager/config/tests.yaml b/tests/manager/config/tests.yaml</span><br><span>index 9ddadda..45cacc8 100644</span><br><span>--- a/tests/manager/config/tests.yaml</span><br><span>+++ b/tests/manager/config/tests.yaml</span><br><span>@@ -2,4 +2,5 @@</span><br><span> tests:</span><br><span> - test: 'basic'</span><br><span> - test: 'advanced'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'restricted'</span><br><span> - test: 'no_preserve_effective_context'</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/19689">change 19689</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/testsuite/+/19689"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 20 </div>
<div style="display:none"> Gerrit-Change-Id: I49d0daf31043bcb7483b0003619e0bc5568141f9 </div>
<div style="display:none"> Gerrit-Change-Number: 19689 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Michael Bradeen <mbradeen@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>