aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib.sh
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-13 03:41:54 +0000
committertv <tv@krebsco.de>2026-11-13 03:41:54 +0000
commit42727d7edb237fea54bc49340ae7eb335f6a9fe9 (patch)
treee55342c8f72cf5328b2bf5fb41c1a3625e19bd9a /tests/lib.sh
parente90426e9abf1370851cd24557ae7ac897cdef297 (diff)
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.
Diffstat (limited to 'tests/lib.sh')
-rw-r--r--tests/lib.sh14
1 files changed, 9 insertions, 5 deletions
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
}