update
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
# Test Case: Future Compression Algorithm Rejection
|
||||
|
||||
**Test ID**: TC115-unsupported-algorithm
|
||||
**Category**: Error Handling
|
||||
**Priority**: High
|
||||
|
||||
## Objective
|
||||
|
||||
Verify mount-time `EOPNOTSUPP` for a legal compressed image whose
|
||||
`available_compr_algs` field additionally advertises unknown bit `0x8000`.
|
||||
|
||||
## Fixture Qualification
|
||||
|
||||
```sh
|
||||
work=$(mktemp -d /tmp/repo22-tc115.XXXXXX)
|
||||
tests/prepare_error_fixtures.sh "$work/fixtures"
|
||||
od -An -tx2 -j 1106 -N 2 "$work/fixtures/future-algorithm.erofs"
|
||||
python3 tests/erofs_fixture.py inspect \
|
||||
"$work/fixtures/future-algorithm.erofs"
|
||||
grep '^future-algorithm ' "$work/fixtures/fixture-evidence.txt"
|
||||
wc -c "$work/fixtures/valid-lz4.erofs" \
|
||||
"$work/fixtures/future-algorithm.erofs"
|
||||
sha256 -q "$work/fixtures/future-algorithm.erofs"
|
||||
```
|
||||
|
||||
The mutator requires `EROFS_FEATURE_INCOMPAT_COMPR_CFGS`, asserts the old
|
||||
16-bit field at absolute byte 1106, sets only future bit `0x8000`, recomputes
|
||||
CRC32C, and preserves provider length.
|
||||
|
||||
## FreeBSD Procedure
|
||||
|
||||
```sh
|
||||
mkdir "$work/mnt"
|
||||
unit=$(mdconfig -a -t vnode -f "$work/fixtures/future-algorithm.erofs")
|
||||
set +e
|
||||
mount -t erofs -o ro "/dev/$unit" "$work/mnt" \
|
||||
>"$work/mount.out" 2>"$work/mount.err"
|
||||
status=$?
|
||||
set -e
|
||||
test "$status" -ne 0
|
||||
set +e
|
||||
truss -o "$work/mount.truss" mount -t erofs -o ro "/dev/$unit" \
|
||||
"$work/mnt" >/dev/null 2>&1
|
||||
set -e
|
||||
grep -E 'nmount.*ERR#45' "$work/mount.truss"
|
||||
! mount -p | awk -v path="$work/mnt" '$2 == path { found=1 }
|
||||
END { exit found ? 0 : 1 }'
|
||||
mdconfig -d -u "${unit#md}"
|
||||
```
|
||||
|
||||
## Expected Results
|
||||
|
||||
Mount returns errno 45 (`EOPNOTSUPP`), not checksum or media-size failure. No
|
||||
mount or md consumer remains.
|
||||
Reference in New Issue
Block a user