test code v1
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
# Test Case: Concurrent Mount Operations
|
||||
|
||||
**Test ID**: TC007-concurrent-mount
|
||||
|
||||
## Objective
|
||||
|
||||
Verify two simultaneous mounts of the same deterministic EROFS image through
|
||||
independent md providers, including source-exact reads from both mounts.
|
||||
|
||||
## Fixture
|
||||
|
||||
Use `images/compact.erofs` and `source/compact/testfile.txt` from the G1
|
||||
fixture set. Follow `tests/G1-MANUAL-SETUP.md`.
|
||||
|
||||
## Procedure
|
||||
|
||||
```sh
|
||||
image=/tmp/repo22-g1/images/compact.erofs
|
||||
source=/tmp/repo22-g1/source/compact/testfile.txt
|
||||
mnt1=/mnt/repo22-g1-007a
|
||||
mnt2=/mnt/repo22-g1-007b
|
||||
md1=$(mdconfig -a -t vnode -f "$image")
|
||||
md2=$(mdconfig -a -t vnode -f "$image")
|
||||
mkdir -p "$mnt1" "$mnt2"
|
||||
set +e
|
||||
mount -t erofs -o ro "/dev/$md1" "$mnt1" & p1=$!
|
||||
mount -t erofs -o ro "/dev/$md2" "$mnt2" & p2=$!
|
||||
wait "$p1"; rc1=$?
|
||||
wait "$p2"; rc2=$?
|
||||
set -e
|
||||
printf 'mount_rc=%d,%d providers=%s,%s\n' "$rc1" "$rc2" "$md1" "$md2"
|
||||
test "$rc1" -eq 0 -a "$rc2" -eq 0
|
||||
cmp "$source" "$mnt1/testfile.txt"
|
||||
cmp "$source" "$mnt2/testfile.txt"
|
||||
cmp "$mnt1/testfile.txt" "$mnt2/testfile.txt"
|
||||
sha256 "$source" "$mnt1/testfile.txt" "$mnt2/testfile.txt"
|
||||
umount "$mnt1"
|
||||
umount "$mnt2"
|
||||
mdconfig -d -u "${md1#md}"
|
||||
mdconfig -d -u "${md2#md}"
|
||||
rmdir "$mnt1" "$mnt2"
|
||||
```
|
||||
|
||||
## Expected Results
|
||||
|
||||
- Both independently waited mount processes return zero.
|
||||
- All three comparisons and SHA256 values match.
|
||||
- No panic, trap, EROFS diagnostic, mount, or md provider remains.
|
||||
Reference in New Issue
Block a user