Skip to content

Commit 8c45f26

Browse files
committed
tests/internals/storage_vdir_import.py: Set mtime for directories
This fixes test failures with recent versions of buildbox-casd, see commit 85f0578f ("common: Support capturing directory mtime and mode").
1 parent 0da729d commit 8c45f26

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/internals/storage_vdir_import.py

+6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ def generate_import_root(rootdir, filelist):
7676
(dirnames, filename) = os.path.split(path)
7777
os.makedirs(os.path.join(rootdir, dirnames), exist_ok=True)
7878
os.symlink(content, os.path.join(rootdir, path))
79+
# Set deterministic mtime for all directories
80+
for (dirpath, _, _) in os.walk(rootdir):
81+
_set_file_mtime(dirpath, MTIME)
7982

8083

8184
def generate_random_root(rootno, directory):
@@ -116,6 +119,9 @@ def generate_random_root(rootno, directory):
116119
relative_link = os.path.relpath(symlink_destination, start=location)
117120
os.symlink(relative_link, target)
118121
things.append(os.path.join(location, thingname))
122+
# Set deterministic mtime for all directories
123+
for (dirpath, _, _) in os.walk(rootdir):
124+
_set_file_mtime(dirpath, MTIME)
119125

120126

121127
def file_contents(path):

0 commit comments

Comments
 (0)