test code v1

This commit is contained in:
2026-08-13 10:44:59 +02:00
commit f3b1165f19
301 changed files with 37885 additions and 0 deletions
+62
View File
@@ -0,0 +1,62 @@
# Test Case: Sequential Throughput
**Test ID**: TC128-sequential-throughput
**Category**: Boundary & Stress
**Priority**: Medium
**Regression**: None
## Objective
Record reproducible sequential-read metrics for the exact 256 MiB fixture
under QEMU TCG while gating PASS only on complete and correct reads.
## Preconditions
- Complete `G7-MANUAL-SETUP.md` and record the QEMU TCG configuration.
- Do not apply fixed MB/s thresholds across hosts.
## Manual Steps
```sh
G7=/root/repo22-g7
FIX=$G7/fixtures
SRC=$FIX/sources/workloads/sequential/sequential.bin
IMAGE=$FIX/images/workloads.erofs
MNT=/mnt/repo22-g7-tc128
E=$G7/evidence/TC128
mkdir -p "$MNT" "$E"
test "$(stat -f %z "$SRC")" -eq 268435456
unit=$(mdconfig -a -t vnode -f "$IMAGE")
mount -t erofs -o ro "/dev/$unit" "$MNT"
TARGET=$MNT/sequential/sequential.bin
source_hash=$(sha256 -q "$SRC")
target_hash=$(sha256 -q "$TARGET")
printf 'bytes=268435456\nsource=%s\ntarget=%s\n' \
"$source_hash" "$target_hash" | tee "$E/hashes.txt"
test "$source_hash" = "$target_hash"
cmp "$SRC" "$TARGET"
: > "$E/runs.tsv"
run=1
while [ "$run" -le 3 ]; do
/usr/bin/time -p dd if="$TARGET" of=/dev/null bs=1m \
> "$E/run-$run.log" 2>&1
rc=$?
printf '%s\t%s\n' "$run" "$rc" >> "$E/runs.tsv"
cat "$E/run-$run.log"
test "$rc" -eq 0 || exit 1
run=$((run + 1))
done
cat "$E/runs.tsv"
test "$(awk '$2 != 0 { bad++ } END { print bad + 0 }' "$E/runs.tsv")" -eq 0
umount "$MNT"
mdconfig -d -u "${unit#md}"
test -z "$(mount -p | awk -v m="$MNT" '$2 == m { print }')"
test -z "$(mdconfig -l | tr ' ' '\n' | grep -x "$unit")"
```
## PASS Gate
- Mounted size is exactly 268435456; SHA256 and full `cmp` match the source.
- All three `dd` reads transfer the full file and exit 0.
- Bytes/second and real/user/sys times are reported as TCG metrics only.
- No fixed speed gate, panic, hang, or cleanup leak occurs.