Nowadays, systemd will auto-remove files from /tmp after 10 days. If
you want to run a testcase for more than that duration (e.g.
SOAK_DURATION=14d) then the test will fail after the .out file is
deleted:
xfs/286 _check_xfs_filesystem: filesystem on /dev/sda4 is inconsistent (r)
(see /var/tmp/fstests/xfs/286.full for details)
sed: can't read /tmp/2098.out: No such file or directory
- output mismatch (see /var/tmp/fstests/xfs/286.out.bad)
mv: cannot stat '/tmp/2098.out': No such file or directory
diff: /var/tmp/fstests/xfs/286.out.bad: No such file or directory
This happens because systemd-tmpfiles garbage collects any file in /tmp
that becomes older than 10 days:
$ cat /usr/lib/tmpfiles.d/tmp.conf
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
# See tmpfiles.d(5) for details.
# Clear tmp directories separately, to make them easier to override
q /tmp 1777 root root 10d
q /var/tmp 1777 root root 30d
This is now the default in Debian 13 (D12 never deleted anything) which
is why I didn't notice this until I upgraded a couple of weeks ago.
Most people aren't going to be running a single testcase for more than
10 days so I'll go with the least invasive solution that I can think of.
Allow system administrators or fstests runners to set TMPDIR to a
directory that won't get purged, and make fstests follow that. Fix up
generic/002 so that it doesn't use $tmp for paths on the test
filesystem.
Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Zorro Lang <zlang@kernel.org>