From 42727d7edb237fea54bc49340ae7eb335f6a9fe9 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 13 Nov 2026 03:41:54 +0000 Subject: tests: check the canaries' modification times and new neighbours The canary manifest records modification times, so changing a canary's time shows, as rsync does to a hard-linked file it takes for unchanged. And entries beside the target directories whose names start like the canaries' count as canaries, so a file created next to one shows, too. --- tests/lib.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'tests/lib.sh') diff --git a/tests/lib.sh b/tests/lib.sh index 4f62890..a8f2594 100644 --- a/tests/lib.sh +++ b/tests/lib.sh @@ -52,13 +52,17 @@ gc() { # Canaries are files outside the target directories, which populate must # never change, whatever the target directories contain. Some scenarios # point links at them. The manifest lists every entry with its type, mode, -# and link target, and every file with its checksum. +# modification time, and link target, and every file with its checksum. +# Entries beside the target directories whose names start like the +# canaries' count as well, so files created next to them show. canary_manifest() { + set -- /var/krops-outside $( + find /var/krops -mindepth 1 -maxdepth 1 \ + \( -name 'canary*' -o -name 'sibling*' \) 2>/dev/null + ) { - find /var/krops/canary /var/krops/sibling /var/krops-outside \ - -printf '%y %m %p -> %l\n' - find /var/krops/canary /var/krops/sibling /var/krops-outside \ - -type f -exec sha256sum {} + + find "$@" -printf '%y %m %T@ %p -> %l\n' + find "$@" -type f -exec sha256sum {} + } 2>&1 | sort } -- cgit v1.3.1