test code v1
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
# Test Case: Primary Plus One mkfs Blob Provider
|
||||
|
||||
**Test ID**: TC099-multidev-2devices
|
||||
**Category**: Multi-Device
|
||||
**Priority**: Critical
|
||||
|
||||
## Objective
|
||||
|
||||
Verify the common two-provider layout emitted directly by erofs-utils 1.8.6,
|
||||
including statfs aggregation and fail-closed omission of the blob provider.
|
||||
|
||||
## Positive procedure
|
||||
|
||||
```sh
|
||||
I=/root/repo22-g6/images
|
||||
S=/root/repo22-g6/sources/chunk
|
||||
mkdir -p /mnt/g6
|
||||
kldload /root/repo22-g6/erofs.ko
|
||||
mdconfig -a -t vnode -f "$I/mkfs-blob-primary.erofs" -u 90
|
||||
mdconfig -a -t vnode -f "$I/mkfs-blob-slot1.blob" -u 91
|
||||
mount -t erofs -o ro -o device.1=/dev/md91 /dev/md90 /mnt/g6
|
||||
mount -p | grep '/mnt/g6'
|
||||
df -k /mnt/g6
|
||||
sha256 "$S/tc006.bin" /mnt/g6/tc006.bin
|
||||
cmp "$S/tc006.bin" /mnt/g6/tc006.bin
|
||||
dd if="$S/tc006.bin" of=/tmp/tc099.src bs=1 skip=28672 count=8192 2>/dev/null
|
||||
dd if=/mnt/g6/tc006.bin of=/tmp/tc099.mnt bs=1 skip=28672 count=8192 2>/dev/null
|
||||
cmp /tmp/tc099.src /tmp/tc099.mnt
|
||||
```
|
||||
|
||||
The manifest reports primary blocks 1 and slot blocks 224, so `df -k` must
|
||||
report 900 one-kilobyte blocks. Metadata comes from md90; all file bytes come
|
||||
from md91.
|
||||
|
||||
Unmount and detach both providers before the negative step.
|
||||
|
||||
## Missing blob option
|
||||
|
||||
```sh
|
||||
umount /mnt/g6
|
||||
mdconfig -d -u 91
|
||||
mdconfig -d -u 90
|
||||
mdconfig -a -t vnode -f "$I/mkfs-blob-primary.erofs" -u 90
|
||||
truss -f -o /tmp/tc099-enxio.truss mount -t erofs -o ro \
|
||||
/dev/md90 /mnt/g6
|
||||
tail -20 /tmp/tc099-enxio.truss
|
||||
```
|
||||
|
||||
Mount must return exactly `ENXIO`: the 4096-byte split primary is shorter than
|
||||
the declared flatdev range.
|
||||
|
||||
## Cleanup and zero-state check
|
||||
|
||||
```sh
|
||||
mdconfig -d -u 90
|
||||
kldunload erofs
|
||||
rm -f /tmp/tc099.src /tmp/tc099.mnt
|
||||
mount -p | awk '$3 == "erofs" { print }'
|
||||
mdconfig -l
|
||||
kldstat -n erofs 2>/dev/null || true
|
||||
sysctl -n kern.geom.conftxt | grep -E 'md9[01]|erofs' || true
|
||||
```
|
||||
|
||||
All four final outputs must be empty.
|
||||
Reference in New Issue
Block a user