mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Update tests to reflect behavior changes
This commit is contained in:
parent
58f5fde03c
commit
f59506d4cc
2 changed files with 2 additions and 23 deletions
|
@ -168,24 +168,3 @@ class RootsTest(TestCase, AdaptedConfigurationTestCaseMixin, LoaderModuleMockMix
|
|||
finally:
|
||||
if self.test_symlink_list_file_roots:
|
||||
self.opts['file_roots'] = orig_file_roots
|
||||
|
||||
|
||||
class RootsLimitTraversalTest(TestCase, AdaptedConfigurationTestCaseMixin):
|
||||
|
||||
def test_limit_traversal(self):
|
||||
'''
|
||||
1) Set up a deep directory structure
|
||||
2) Enable the configuration option 'fileserver_limit_traversal'
|
||||
3) Ensure that we can find SLS files in a directory so long as there is
|
||||
an SLS file in a directory above.
|
||||
4) Ensure that we cannot find an SLS file in a directory that does not
|
||||
have an SLS file in a directory above.
|
||||
|
||||
'''
|
||||
file_client_opts = self.get_temp_config('master')
|
||||
file_client_opts['fileserver_limit_traversal'] = True
|
||||
|
||||
ret = salt.fileclient.Client(file_client_opts).list_states('base')
|
||||
self.assertIn('test_deep.test', ret)
|
||||
self.assertIn('test_deep.a.test', ret)
|
||||
self.assertNotIn('test_deep.b.2.test', ret)
|
||||
|
|
|
@ -314,7 +314,7 @@ class PillarTestCase(TestCase):
|
|||
'extension_modules': '',
|
||||
}
|
||||
pillar = salt.pillar.Pillar(opts, {}, 'mocked-minion', 'base', pillarenv='dev')
|
||||
self.assertEqual(pillar.opts['file_roots'],
|
||||
self.assertEqual(pillar.opts['pillar_roots'],
|
||||
{'base': ['/srv/pillar/base'], 'dev': ['/srv/pillar/__env__']})
|
||||
|
||||
def test_ignored_dynamic_pillarenv(self):
|
||||
|
@ -329,7 +329,7 @@ class PillarTestCase(TestCase):
|
|||
'extension_modules': '',
|
||||
}
|
||||
pillar = salt.pillar.Pillar(opts, {}, 'mocked-minion', 'base', pillarenv='base')
|
||||
self.assertEqual(pillar.opts['file_roots'], {'base': ['/srv/pillar/base']})
|
||||
self.assertEqual(pillar.opts['pillar_roots'], {'base': ['/srv/pillar/base']})
|
||||
|
||||
def test_malformed_pillar_sls(self):
|
||||
with patch('salt.pillar.compile_template') as compile_template:
|
||||
|
|
Loading…
Add table
Reference in a new issue