Skip to content

Add an integration test suite using the file tape backend - #611

Open
matejk wants to merge 9 commits into
LinearTapeFileSystem:mainfrom
matejk:tests/integration-suite
Open

matejk wants to merge 9 commits into
LinearTapeFileSystem:mainfrom
matejk:tests/integration-suite

Conversation

@matejk

@matejk matejk commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

LTFS has no automated tests. This PR adds a shell-based integration test suite (17 tests) that mounts a volume of the file tape backend from the build tree, so it needs neither an installation nor tape hardware. It runs with make check and with ctest.

  • Tests (tests/t/): mount and unmount, data round trips, truncate, rename and rename flags, directories, xattrs, symlinks, large directories, tar round trip, inode stability across remounts, FUSE request sizes, direct_io, readdirplus, writes larger than the tape block (silent data corruption on ARM64? #591), overwrite with truncation, timestamps, listing during writes.
  • Harness (tests/lib/harness.sh): formats, mounts and unmounts; a test fails when the daemon exits with an error or when the volume had to be repaired after an unmount.
  • Build: tests/Makefile.am for autotools; the CMake build registers the scripts with ctest.
  • CI: test.yml runs the suite with autotools.
  • arch_open passes the permission argument to open(2); the same commit is in Fix file permissions passed to open(2) by the POSIX arch_open #612.

The tests need Linux with /dev/fuse and are skipped elsewhere; tests/run-in-docker.sh runs them in a container.

Verified on Ubuntu: FUSE 2, 16 pass and 12-readdirplus is skipped; with the FUSE 3 port (#603, #657), 17 pass. The macOS CMake build skips all tests.

@matejk
matejk force-pushed the tests/integration-suite branch 3 times, most recently from 453f49f to d5f14f3 Compare June 12, 2026 12:38
@matejk
matejk force-pushed the tests/integration-suite branch from d5f14f3 to 2618ac3 Compare June 17, 2026 20:35
@matejk
matejk force-pushed the tests/integration-suite branch from 2618ac3 to 5b98311 Compare July 3, 2026 22:01
@amissael95
amissael95 requested a review from Piloalucard July 27, 2026 18:18
@matejk
matejk force-pushed the tests/integration-suite branch from 5b98311 to 8944923 Compare August 17, 2026 20:10
@matejk
matejk changed the base branch from main to release/v2.4.9.0 August 17, 2026 20:10
@matejk
matejk changed the base branch from release/v2.4.9.0 to main August 17, 2026 20:11
@matejk
matejk force-pushed the tests/integration-suite branch 3 times, most recently from 4334285 to cc20b62 Compare August 17, 2026 20:28
@matejk
matejk changed the base branch from main to release/v2.4.9.1 October 13, 2026 07:01
@matejk
matejk force-pushed the tests/integration-suite branch from cc20b62 to dd0d588 Compare October 13, 2026 07:16
@matejk

matejk commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

Retargeted to release/v2.4.9.1 to go in together with #606 and #612. Two new commits fix checks that could not fail (t/11 mmap, t/09 error codes, t/05 xattr removal), report interrupted tests as failed, and make the cleanup more robust; t/12 skips on FUSE 2 builds. Result: 13 pass and 1 skip on FUSE 2, 14/14 on FUSE 3 with #603.

@matejk

matejk commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

Pushed two commits:

  • New regression tests:
    • t/14: overwriting a file by redirection or cp must truncate it, and appending must keep the old data, also after a remount.
    • t/15: touch must store the given date or the current time, and an atime-only or mtime-only update must keep the other time, also after a remount. The partial updates go through new fsops_helper atime and mtime commands (utimensat() with UTIME_OMIT), because some touch implementations pass both times. This part runs on FUSE 3 builds only: libfuse 2 drops such updates because LTFS does not set flag_utime_omit_ok.
    • t/16: listing a directory with 1000 entries while 300 files are written must finish within 120 s.
  • CI runs the suite once for FUSE 3 and once for FUSE 2 (--with-fuse2). Until Add libfuse 3 support with libfuse 2 fallback #603 is merged, both jobs build FUSE 2.
  • The README section on running the suite is now part of this PR.

On Ubuntu 26.04 with FUSE 2, 16 tests pass and t/12 is skipped. On the current head of #603, t/14 to t/16 fail: they cover three FUSE 3 defects found there (O_TRUNC ignored on open, UTIME_NOW and UTIME_OMIT stored as times, and a deadlock between readdirplus and flush).

@matejk
matejk force-pushed the tests/integration-suite branch from ac84759 to 34094e8 Compare November 10, 2026 16:31
@matejk
matejk changed the base branch from release/v2.4.9.1 to main November 10, 2026 16:31
matejk added a commit to matejk/ltfs that referenced this pull request Nov 10, 2026
The share flag was passed as the mode, so the file backend created 0200
files that a non-root user could not reopen.
Shell tests under make check and ctest; skipped without /dev/fuse.
tests/run-in-docker.sh runs them in a container on non-Linux hosts.
run-in-docker.sh also works from a release tarball without git.
Also limits a test to 300 s under ctest and includes time.h in the helper.
CI installs fuse3, so the tests cannot be skipped for a missing fusermount.
@matejk
matejk force-pushed the tests/integration-suite branch from 34094e8 to 13cd20f Compare November 26, 2026 08:12
@matejk

matejk commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on main (41b843f) and pushed two commits:

  • The harness fails a test when the daemon exits with a non-zero status at unmount, or when ltfsck or the next mount had to repair the volume. ltfsck exits 1 and reports a consistent volume in both cases, so the previous check could not tell them apart. ctest limits a test to 300 s.
  • The README documents ctest. The CI jobs are named by configuration, because both build FUSE 2 until Add libfuse 3 support with libfuse 2 fallback #603 is merged, and they install fuse3.

Results on Ubuntu: 16 pass and 12-readdirplus is skipped on FUSE 2, with CMake and with autotools; 17 pass on FUSE 3 with #657.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant