fix(tests): resolve ewfexport via PATH and install it in CI - #8
Draft
h4x0r wants to merge 1 commit into
Draft
Conversation
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
force-pushed
the
fix/oracle-path-resolution
branch
from
August 6, 2026 00:11
f97913a to
cc89408
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The defect
Same defect class as the qemu-img differentials, found while sweeping the fleet for hardcoded oracle paths. Two compounding problems:
/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.ci.ymlnever installed libewf, so the differential resolved nothing and returned early on every CI run across all three matrix legs.Net effect:
EwfReaderhas never been cross-validated againstewfexportin CI. The job reported3 passedwhile doing no work.The fix
PATHfirst (covering any install location), known absolute prefixes as fallback for a strippedPATH,EWFEXPORT_BINoverride.ewf-toolsinstalled on the Linux leg (it ships/usr/bin/ewfexport). The macOS and Windows legs skip cleanly, as no oracle is available there.ewfexporthas no--versionflag and exits non-zero on-h, so the usability probe accepts any completed spawn rather than requiring success — still stronger than a bareexists()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+ aptewf-tools, giving/usr/bin/ewfexport):ewfexportfrom aptEWFEXPORT_BIN=/bin/true(resolves, exits 0, produces nothing)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 neitherPATHnor any candidate directory, reachable only viaEWFEXPORT_BIN. That is precisely why the override exists.EwfReaderagrees withewfexportbyte-for-byte acrossexfat1.E01,imageformat_mmls_1.E01andnps-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