]> git.ipfire.org Git - thirdparty/rsync.git/commit
testsuite: generate predictable fixture files instead of reading /etc, /bin, /
authorAndrew Tridgell <andrew@tridgell.net>
Fri, 22 May 2026 04:41:17 +0000 (14:41 +1000)
committerAndrew Tridgell <andrew@tridgell.net>
Fri, 22 May 2026 05:15:22 +0000 (15:15 +1000)
commit1d8f47cc711cd2dbee6aef6c14299b693f341b90
treeaa059a38e917bf93a255fdf79b7336d104509a44
parent743d715d43871a09b17c906b9e158cd0ee7216e4
testsuite: generate predictable fixture files instead of reading /etc, /bin, /

The Python rewrite of the suite carried over the shell habit of
populating the test tree by capturing "ls -l /etc" / "ls -l /bin"
(falling back to "ls /"): hands_setup() built etc-ltr-list / bin-lt-list
that way, and longdir_test.py did the same for its leaf files. That ties
the fixtures to the host filesystem layout -- those directories are
absent or unreadable on Android/Termux and other minimal environments,
where "ls /" fails outright -- and the captured content was never
reproducible from run to run.

Add a deterministic make_text_file() helper to rsyncfns.py and use it for
hands_setup()'s two fixture files and longdir's leaf files. The names
etc-ltr-list / bin-lt-list are unchanged (chmod, chmod-temp-dir and
alt-dest reference them by name); only the content source changes, so the
fixtures are now self-contained and identical on every platform. This
also drops longdir_test.py's date(1) and ls(1) subprocess calls.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
testsuite/longdir_test.py
testsuite/rsyncfns.py