Improve test harness code introduced during sidecar migration

Merged
HE
3mo ago
+607-772

Follow up improvement effort to improve code introduce in https://github.com/sysprog21/elfuse/pull/256

Mainly focusing on improving the test harness makefile, and refactoring the helper functions.


Summary by cubic

Modernizes the test harness by generating check lanes with canned make rules, centralizing shared helpers, and adding header dependency tracking for guest tests. This reduces duplication, fixes rebuild correctness, and removes stale sidecar references.

  • Refactors

    • Generate check and sanitizer lanes via canned recipes in mk/tests.mk (shared scratch setup, absock leak check, banners preserved; single '+' run line so make -n expands the lane).
    • Track shared header deps for cross-compiled guest tests via CROSS_TEST_CFLAGS (-MMD/-MP; driver injects -MQ for the -o target).
    • Consolidate helpers into tests/test-util.h and tests/host-test-util.h (dirfd file I/O, dir scans, UNIX socket helpers with cleanup on failure, host pass/fail summary; unify openat2 ABI via linux-openat2.h); update tests to use them.
    • Fold the no-sysroot variant into test-sysroot-outside-names via a mode arg; remove tests/test-nosysroot-literal-names.c.
    • Remove stale sidecar mentions from docs and test headers; clarify resolver behavior (clamp '..' only at guest root; case-insensitive sysroot may store escaped leaves).
  • Bug Fixes

    • Bounds-check the stored-name probe reply and zero the buffer; accept SMB/NFS attr layouts; mirror the check in host-only lanes.