]> git.proxmox.com Git - mirror_zfs.git/commit - .github/workflows/build-dependencies.txt
ZTS: switch to rsync for directory diffs
authorAleksa Sarai <cyphar@cyphar.com>
Tue, 1 Mar 2022 18:05:32 +0000 (05:05 +1100)
committerGitHub <noreply@github.com>
Tue, 1 Mar 2022 18:05:32 +0000 (10:05 -0800)
commit669683c4cbcd9c20258ce6641c6c777f29aeb94d
tree909474b14dbdfe47a345f9b2ad8bb02a3189b369
parent19229e5f1ee3b7ff4709e63f64c559518f2fd82e
ZTS: switch to rsync for directory diffs

While "diff -r" is the most straightforward way of comparing directory
trees for differences, it has two major issues:

 * File metadata is not compared, which means that subtle bugs may be
   missed even if a test is written that exercises the buggy behaviour.
 * diff(1) doesn't know how to compare special files -- it assumes they
   are always different, which means that a test using diff(1) on
   special files will always fail (resulting in such tests not being
   added).

rsync can be used in a very similar manner to diff (with the -ni flags),
but has the additional benefit of being able to detect and resolve many
more differences between directory trees. In addition, rsync has a
standard set of features and flags while diffs feature set depends on
whether you're using GNU or BSD binutils.

Note that for several of the test cases we expect that file timestamps
will not match. For example, the ctime for a file creation or modify
event is stored in the intent log but not the mtime. Thus when replaying
the log the correct ctime is set but the current mtime is used. This is
the expected behavior, so to prevent these tests from failing, there's a
replay_directory_diff function which ignores those kinds of changes.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Closes #12588
16 files changed:
.github/workflows/build-dependencies.txt
tests/zfs-tests/include/commands.cfg
tests/zfs-tests/include/libtest.shlib
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_010_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_009_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_errata4.ksh
tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_005_pos.ksh
tests/zfs-tests/tests/functional/redacted_send/redacted_incrementals.ksh
tests/zfs-tests/tests/functional/redacted_send/redacted_largeblocks.ksh
tests/zfs-tests/tests/functional/rsend/recv_dedup.ksh
tests/zfs-tests/tests/functional/rsend/rsend.kshlib
tests/zfs-tests/tests/functional/slog/slog_replay_fs_001.ksh
tests/zfs-tests/tests/functional/slog/slog_replay_fs_002.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_002_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_006_pos.ksh