Support globstar for recursion
This commit is contained in:
@@ -37,7 +37,8 @@ class TestFileAssertionUtils(ut_utils.BaseTestCase):
|
||||
file_assertions.assert_path_glob(
|
||||
self._assert, 'test/0', file_details)
|
||||
self.run_on_unit.assert_called_once_with(
|
||||
'test/0', 'stat -c "%n %U %G %a" *')
|
||||
'test/0', 'bash -c "shopt -s -q globstar;'
|
||||
' stat -c "%n %U %G %a" *"')
|
||||
|
||||
def test_single_path(self):
|
||||
self.run_on_unit.return_value = {
|
||||
|
||||
@@ -20,7 +20,9 @@ import zaza.model as model
|
||||
def assert_path_glob(test_case, unit, file_details, paths=[]):
|
||||
"""Verify all files in a given directory."""
|
||||
result = model.run_on_unit(
|
||||
unit, 'stat -c "%n %U %G %a" {}'.format(file_details['path']))
|
||||
unit, 'bash -c "'
|
||||
'shopt -s -q globstar; '
|
||||
'stat -c "%n %U %G %a" {}"'.format(file_details['path']))
|
||||
files = result['Stdout']
|
||||
for file in files.splitlines():
|
||||
file, owner, group, mode = file.split()
|
||||
|
||||
Reference in New Issue
Block a user