Skip to content

fix(tests): resolve ewfexport via PATH and install it in CI - #8

Draft
h4x0r wants to merge 1 commit into
mainfrom
fix/oracle-path-resolution
Draft

fix(tests): resolve ewfexport via PATH and install it in CI#8
h4x0r wants to merge 1 commit into
mainfrom
fix/oracle-path-resolution

Conversation

@h4x0r

@h4x0r h4x0r commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

The defect

Same defect class as the qemu-img differentials, found while sweeping the fleet for hardcoded oracle paths. Two compounding problems:

  1. The oracle was pinned to /usr/local/bin/ewfexport — a path matching only an Intel-Homebrew or hand-built install. It happens to exist on the dev machine, which is why this was never noticed.
  2. ci.yml never installed libewf, so the differential resolved nothing and returned early on every CI run across all three matrix legs.

Net effect: EwfReader has never been cross-validated against ewfexport in CI. The job reported 3 passed while doing no work.

The fix

  • PATH first (covering any install location), known absolute prefixes as fallback for a stripped PATH, EWFEXPORT_BIN override.
  • Debian's ewf-tools installed on the Linux leg (it ships /usr/bin/ewfexport). The macOS and Windows legs skip cleanly, as no oracle is available there.

ewfexport has no --version flag and exits non-zero on -h, so the usability probe accepts any completed spawn rather than requiring success — still stronger than a bare exists() check, which would accept a non-executable file.

Does the differential actually pass once the oracle is present?

Yes. Run on Linux (rust:1-slim-bookworm + apt ewf-tools, giving /usr/bin/ewfexport):

Control Result
A — real ewfexport from apt ✅ 3 passed, 0.74s
B — EWFEXPORT_BIN=/bin/true (resolves, exits 0, produces nothing) 3 FAILED

Control B is the positive control: the tests must fail when the oracle produces no output, which proves the body genuinely runs the oracle and consumes its result.

Also verified on macOS against an unlinked Homebrew libewf under /opt/homebrew/Cellar/libewf/20140816/bin/ewfexport — a location in neither PATH nor any candidate directory, reachable only via EWFEXPORT_BIN. That is precisely why the override exists.

EwfReader agrees with ewfexport byte-for-byte across exfat1.E01, imageformat_mmls_1.E01 and nps-2010-emails.E01. No reader defect was hiding behind the skip.

On the missing RED commit

A test-plumbing change admits no honest failing test — a unit test asserting "the resolver does not hardcode one directory" would be tautological. The verification is the control matrix above, not a fabricated RED.

Gates

cargo build · cargo test --workspace · cargo clippy --all-targets -- -D warnings · cargo fmt --check — all green.

🤖 Generated with Claude Code

Same defect class as the qemu-img differentials, found while sweeping the
fleet for hardcoded oracle paths. Two problems compounded:

1. The oracle was pinned to `/usr/local/bin/ewfexport`, which matches
   only an Intel-Homebrew or hand-built install. It happens to exist on
   the dev machine, which is why this was never noticed.

2. ci.yml never installed libewf, so the differential resolved nothing
   and returned early on every CI run across all three matrix legs --
   reporting "3 passed" while validating nothing.

Fix both: resolve through PATH first (covering any install location),
falling back to the known absolute prefixes for a stripped PATH, with an
EWFEXPORT_BIN override; and install Debian's ewf-tools on the Linux leg.
The macOS and Windows legs skip cleanly, as no oracle is available there.

ewfexport has no `--version` flag and exits non-zero on `-h`, so the
usability probe accepts any completed spawn rather than requiring
success -- still stronger than a bare exists() check, which would accept
a non-executable file.

Verified on Linux (rust:1-slim-bookworm + apt ewf-tools, giving
/usr/bin/ewfexport):

  A  real ewfexport   -> 3 passed  (0.74s -- real work)
  B  EWFEXPORT_BIN=/bin/true -> 3 FAILED (proves the body runs the
                                          oracle and consumes its output)

Also verified on macOS against an unlinked Homebrew libewf under
/opt/homebrew/Cellar -- a location in neither PATH nor any candidate
directory, reached only via EWFEXPORT_BIN, which is why the override
exists. EwfReader agrees with ewfexport byte-for-byte across exfat1,
imageformat_mmls_1 and nps-2010-emails -- no reader defect behind the
skip.

No RED commit: a test-plumbing change admits no honest failing test. The
verification is the control matrix above.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@h4x0r
h4x0r force-pushed the fix/oracle-path-resolution branch from f97913a to cc89408 Compare August 6, 2026 00:11
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