diff --git a/unit_tests/utilities/test_zaza_utilities_file_assertions.py b/unit_tests/utilities/test_zaza_utilities_file_assertions.py index f0eba1c..b40276c 100644 --- a/unit_tests/utilities/test_zaza_utilities_file_assertions.py +++ b/unit_tests/utilities/test_zaza_utilities_file_assertions.py @@ -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 = { diff --git a/zaza/utilities/file_assertions.py b/zaza/utilities/file_assertions.py index 08375c1..470fcd2 100644 --- a/zaza/utilities/file_assertions.py +++ b/zaza/utilities/file_assertions.py @@ -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()