# repo22 手工测试报告

- 执行日期：2026-08-08（UTC）
- 执行时段：2026-08-08T11:08Z 至 2026-08-08T11:14:44Z
- 工作区：`/work`
- 测试对象：`/work/repo-community/repo22`
- ABI 提交：`f2caaae2890a910d0f11547d9ff5f7cf92c062a2`
- 提交时间：`2026-08-08T11:12:36Z`
- 提交主题：`repo22: align core on-disk structures`
- 执行方式：手工 SSH/SCP、手工模块命令；未使用测试 wrapper 或 CI；未修改源码；未 commit/push
- 总体结论：**FAIL / BLOCKED**

## 结果摘要

| 项目 | 结果 | 证据 |
|---|---|---|
| SSH 与 guest 环境 | PASS | FreeBSD 15.0-RELEASE-p8 amd64，root，securelevel -1，所需系统工具存在 |
| 等待 repo22 ABI 提交 | PASS | `f2caaae28` 出现后 repo22 scoped 工作树干净 |
| 宿主构建 repo22 `erofs.ko` | PASS | 构建退出 0，产物 45088 字节 |
| SCP 到 guest | PASS | 宿主/guest SHA-256 均为 `f119bb2c902bf6e221b532b1c8e7668caaa5c744c46b4eac8f9f105cd7494e9f` |
| guest `kldload` | **FAIL** | 返回 1；dmesg：`link_elf_obj: symbol bcmp undefined` |
| guest `kldstat`（加载后） | BLOCKED | `kldload` 未成功，不能出现已加载模块 |
| guest `kldunload` | BLOCKED | 模块从未加载，不能执行有效卸载验证 |
| 制作/复制 plain 镜像 | NOT RUN | 按“任何步骤失败立即停止”要求，在模块加载失败后停止 |
| TC001-mount-basic | BLOCKED / NOT RUN | 前置条件“EROFS 模块已加载”不满足 |
| TC009-statfs-basic | BLOCKED / NOT RUN | 仅在 TC001 通过后执行；TC001 未执行 |

## 1. 初始 SSH 验证

首次按题目给出的普通 SSH 方式验证，端口可达，但 guest 不接受宿主默认公钥。

实际命令：

```sh
ssh -o BatchMode=yes -o StrictHostKeyChecking=accept-new \
  -o ConnectTimeout=8 -p 9222 root@127.0.0.1 \
  'echo "== identity =="; id; echo "== uname =="; uname -a'
```

实际输出：

```text
Warning: Permanently added '[127.0.0.1]:9222' (ED25519) to the list of known hosts.
root@127.0.0.1: Permission denied (publickey,keyboard-interactive).
```

检查现有 VM 基线文档后，确认该 guest 使用固定测试密码和
`keyboard-interactive,password`。宿主没有 `sshpass`，因此创建了仅用于 SSH/SCP
认证的临时 `/tmp/repo22-ssh-askpass.sh`；它不是测试 wrapper，未写入仓库。

实际命令：

```sh
cat > /tmp/repo22-ssh-askpass.sh <<'EOF'
#!/bin/sh
printf '%s\n' '<固定测试密码>'
EOF
chmod 700 /tmp/repo22-ssh-askpass.sh
```

随后所有 SSH/SCP 命令使用以下认证前缀和选项：

```sh
DISPLAY=:0 SSH_ASKPASS=/tmp/repo22-ssh-askpass.sh \
SSH_ASKPASS_REQUIRE=force setsid -w ssh \
  -o StrictHostKeyChecking=no \
  -o UserKnownHostsFile=/dev/null \
  -o PreferredAuthentications=keyboard-interactive,password \
  -o PubkeyAuthentication=no \
  -p 9222 root@127.0.0.1 '<guest command>'
```

## 2. Guest 环境验证

实际 guest 命令：

```sh
echo "== UTC date =="; date -u "+%Y-%m-%dT%H:%M:%SZ"
echo "== identity =="; id
echo "== uname =="; uname -a
echo "== freebsd-version =="; freebsd-version -ku 2>&1
echo "== hostname =="; hostname
echo "== architecture =="; uname -m; sysctl -n hw.machine_arch 2>&1
echo "== securelevel =="; sysctl kern.securelevel
echo "== module tools =="; command -v kldload; command -v kldstat; command -v kldunload
echo "== filesystem tools =="; command -v mdconfig; command -v mount; command -v umount; command -v sha256; command -v stat
echo "== existing erofs module/mount/md =="; kldstat | grep -i erofs || true; mount | grep -i erofs || true; mdconfig -l
echo "== temp space =="; df -h /tmp /root
```

实际输出：

```text
Warning: Permanently added '[127.0.0.1]:9222' (ED25519) to the list of known hosts.
== UTC date ==
2026-08-08T11:10:13Z
== identity ==
uid=0(root) gid=0(wheel) groups=0(wheel),5(operator)
== uname ==
FreeBSD freebsd-build 15.0-RELEASE-p8 FreeBSD 15.0-RELEASE-p8 releng/15.0-n281036-53054229dcb3 GENERIC amd64
== freebsd-version ==
15.0-RELEASE-p8
15.0-RELEASE-p8
== hostname ==
freebsd-build
== architecture ==
amd64
amd64
== securelevel ==
kern.securelevel: -1
== module tools ==
/sbin/kldload
/sbin/kldstat
/sbin/kldunload
== filesystem tools ==
/sbin/mdconfig
/sbin/mount
/sbin/umount
/sbin/sha256
/usr/bin/stat
== existing erofs module/mount/md ==
== temp space ==
Filesystem      Size    Used   Avail Capacity  Mounted on
/dev/vtbd0p2    112G     12G     91G    12%    /
/dev/vtbd0p2    112G     12G     91G    12%    /
```

结论：guest 连接及基础环境 PASS；开始时没有已加载 EROFS 模块、EROFS 挂载或 md 设备。

## 3. 等待 ABI 提交

轮询条件：HEAD 必须晚于测试开始时的 `db524d69f`，且
`git status --porcelain -- repo-community/repo22` 行数必须为 0。

实际命令：

```sh
baseline=db524d69f
for attempt in $(seq 1 40); do
  now=$(date -u '+%Y-%m-%dT%H:%M:%SZ')
  head=$(git rev-parse --short HEAD)
  subject=$(git log -1 --pretty=%s)
  dirty=$(git status --porcelain -- repo-community/repo22 | wc -l)
  printf '%s attempt=%02d HEAD=%s dirty_repo22=%s subject=%s\n' \
    "$now" "$attempt" "$head" "$dirty" "$subject"
  if [ "$head" != "$baseline" ] && [ "$dirty" -eq 0 ]; then
    echo 'READY: repo22 has a newer commit and its scoped worktree is clean'
    git log --date=iso-strict -5 --pretty=format:'%h %ad %an %s'
    echo
    exit 0
  fi
  sleep 15
done
```

实际输出：

```text
2026-08-08T11:10:33Z attempt=01 HEAD=db524d69f dirty_repo22=6 subject=repo22: record initial manual test blockers
2026-08-08T11:10:49Z attempt=02 HEAD=db524d69f dirty_repo22=6 subject=repo22: record initial manual test blockers
2026-08-08T11:11:04Z attempt=03 HEAD=db524d69f dirty_repo22=6 subject=repo22: record initial manual test blockers
2026-08-08T11:11:20Z attempt=04 HEAD=db524d69f dirty_repo22=6 subject=repo22: record initial manual test blockers
2026-08-08T11:11:35Z attempt=05 HEAD=db524d69f dirty_repo22=19 subject=repo22: record initial manual test blockers
2026-08-08T11:11:50Z attempt=06 HEAD=db524d69f dirty_repo22=19 subject=repo22: record initial manual test blockers
2026-08-08T11:12:05Z attempt=07 HEAD=db524d69f dirty_repo22=19 subject=repo22: record initial manual test blockers
2026-08-08T11:12:21Z attempt=08 HEAD=db524d69f dirty_repo22=19 subject=repo22: record initial manual test blockers
2026-08-08T11:12:36Z attempt=09 HEAD=f2caaae28 dirty_repo22=0 subject=repo22: align core on-disk structures
READY: repo22 has a newer commit and its scoped worktree is clean
f2caaae28 2026-08-08T11:12:36Z Ruicheng Pan repo22: align core on-disk structures
db524d69f 2026-08-08T10:46:37Z Ruicheng Pan repo22: record initial manual test blockers
524dcfac5 2026-08-08T10:43:55Z Ruicheng Pan repo22: harden core I/O and build path
173385f79 2026-08-08T10:09:38Z Ruicheng Pan Add repo22 based on repo21 for comprehensive validation and review
c782c1dc8 2026-06-18T20:01:35Z Ruicheng Pan 补充和完善 repo21_explain/src 中文注释
```

## 4. 宿主构建 repo22 erofs.ko

实际命令（工作目录 `/work/repo-community/repo22`）：

```sh
date -u '+%Y-%m-%dT%H:%M:%SZ'
git rev-parse HEAD
clang --version | head -1
FREEBSD_SRC=/work/dev-freebsd-releng ./build.sh
echo "build_exit=$?"
ls -l --full-time build/erofs.ko
sha256sum build/erofs.ko
```

实际输出（编译器对 FreeBSD 内核头文件产生了多组重复的 builtin redeclaration
warning；构建未使用 `-Werror`，没有编译或链接 error）：

```text
2026-08-08T11:13:13Z
f2caaae2890a910d0f11547d9ff5f7cf92c062a2
Debian clang version 19.1.7 (3+b1)
==> Building repo22 erofs.ko
[data.c、dir.c、erofs_vnops.c、inode.c、namei.c、super.c、xattr.c、lz4.c、deflate.c、zstd.c、lzma.c 编译期间重复出现以下 warning：]
warning: incompatible redeclaration of library function 'log' [-Wincompatible-library-redeclaration]
warning: incompatible redeclaration of library function 'strdup' [-Wincompatible-library-redeclaration]
warning: incompatible redeclaration of library function 'strndup' [-Wincompatible-library-redeclaration]
warning: incompatible redeclaration of library function 'free' [-Wincompatible-library-redeclaration]
warning: incompatible redeclaration of library function 'malloc' [-Wincompatible-library-redeclaration]
warning: incompatible redeclaration of library function 'realloc' [-Wincompatible-library-redeclaration]
/work/repo-community/repo22/src/lzma.c:133:19: warning: result of comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always true [-Wtautological-constant-out-of-range-compare]
/work/repo-community/repo22/src/lzma.c:135:16: warning: result of comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always true [-Wtautological-constant-out-of-range-compare]
==> SUCCESS: /work/repo-community/repo22/build/erofs.ko
build_exit=0
-rw-r--r-- 1 root root 45088 2026-08-08 11:13:16.704187568 +0000 build/erofs.ko
f119bb2c902bf6e221b532b1c8e7668caaa5c744c46b4eac8f9f105cd7494e9f  build/erofs.ko
```

说明：原始构建输出包含每个源文件的同类完整 warning 展开；本报告逐类保留了实际
warning 文本和两个非重复的 `lzma.c` warning，并保留了完整的成功、退出码、尺寸和哈希证据。

## 5. SCP 模块到 guest

实际命令（密码由临时 askpass 提供）：

```sh
DISPLAY=:0 SSH_ASKPASS=/tmp/repo22-ssh-askpass.sh \
SSH_ASKPASS_REQUIRE=force setsid -w scp -O \
  -o StrictHostKeyChecking=no \
  -o UserKnownHostsFile=/dev/null \
  -o PreferredAuthentications=keyboard-interactive,password \
  -o PubkeyAuthentication=no \
  -P 9222 build/erofs.ko root@127.0.0.1:/root/repo22-erofs.ko
echo "scp_exit=$?"
```

实际输出：

```text
Warning: Permanently added '[127.0.0.1]:9222' (ED25519) to the list of known hosts.
scp_exit=0
```

guest 校验命令：

```sh
ls -l /root/repo22-erofs.ko
sha256 /root/repo22-erofs.ko
```

实际输出：

```text
-rw-r--r--  1 root wheel 45088 Aug  8 11:13 /root/repo22-erofs.ko
SHA256 (/root/repo22-erofs.ko) = f119bb2c902bf6e221b532b1c8e7668caaa5c744c46b4eac8f9f105cd7494e9f
```

结论：复制成功且字节身份一致。

## 6. Guest 手工模块加载测试

### 6.1 加载前状态与 dmesg

实际命令：

```sh
kldstat | grep -i erofs
echo "pre_kldstat_grep_exit=$?"
dmesg | tail -30
```

实际输出：

```text
pre_kldstat_grep_exit=1
device_attach: fdc0 attach returned 6
ppc0: <Parallel port> port 0x378-0x37f irq 7 on acpi0
ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode
ppbus0: <Parallel port bus> on ppc0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
orm0: <ISA Option ROM> at iomem 0xe7800-0xeffff pnpid ORM0000 on isa0
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff pnpid PNP0900 on isa0
attimer0: <AT timer> at port 0x40 on isa0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
attimer0: non-PNP ISA device will be removed from GENERIC in FreeBSD 16.
Timecounters tick every 10.000 msec
usb_needs_explore_all: no devclass
Trying to mount root from ufs:/dev/vtbd0p2 [rw]...
WARNING: / was not properly dismounted
WARNING: /: mount pending error: blocks 0 files 32
cd0 at ata1 bus 0 scbus1 target 0 lun 0
cd0: <QEMU QEMU DVD-ROM 2.5+> Removable CD-ROM SCSI device
cd0: Serial Number QM00003
cd0: 16.700MB/s transfers (WDMA2, ATAPI 12bytes, PIO 65534bytes)
cd0: Attempt to query device size failed: NOT READY, Medium not present
intsmb0: <Intel PIIX4 SMBUS Interface> irq 9 at device 1.3 on pci0
intsmb0: intr IRQ 9 enabled revision 0
smbus0: <System Management Bus> on intsmb0
lo0: link state changed to UP
vtnet0: link state changed to UP
Security policy loaded: MAC/ntpd (mac_ntpd)
```

### 6.2 kldload

实际命令：

```sh
kldload /root/repo22-erofs.ko
echo "kldload_exit=$?"
```

实际输出：

```text
kldload: an error occurred while loading module /root/repo22-erofs.ko. Please check dmesg(8) for more details.
kldload_exit=1
```

失败后的实际 dmesg 命令：

```sh
dmesg | tail -80
```

实际输出末尾（失败相关行）：

```text
link_elf_obj: symbol bcmp undefined
linker_load_file: /root/repo22-erofs.ko - unsupported file type
```

最终复核命令：

```sh
date -u "+%Y-%m-%dT%H:%M:%SZ"
kldstat | grep -i erofs
echo "kldstat_grep_exit=$?"
mount | grep -i erofs
echo "mount_grep_exit=$?"
mdconfig -l
dmesg | grep -E "bcmp|repo22-erofs|linker_load_file" | tail -20
ls -l /root/repo22-erofs.ko
sha256 /root/repo22-erofs.ko
```

实际输出：

```text
2026-08-08T11:14:44Z
kldstat_grep_exit=1
mount_grep_exit=1
link_elf_obj: symbol bcmp undefined
linker_load_file: /root/repo22-erofs.ko - unsupported file type
-rw-r--r--  1 root wheel 45088 Aug  8 11:13 /root/repo22-erofs.ko
SHA256 (/root/repo22-erofs.ko) = f119bb2c902bf6e221b532b1c8e7668caaa5c744c46b4eac8f9f105cd7494e9f
```

结论：**模块加载 FAIL**。失败不是 SCP 损坏导致，因为宿主和 guest 哈希完全一致。
FreeBSD 内核链接器无法解析模块引用的 `bcmp` 符号。

### 6.3 kldstat 与 kldunload

- 加载后的 `kldstat` 验证：**BLOCKED**。加载操作返回 1，最终复核也确认没有 EROFS 模块。
- `kldunload erofs`：**BLOCKED / NOT RUN**。模块从未成功加载；执行卸载不能构成有效卸载测试。
- 已按“任何步骤失败立即记录并停止”要求停止，没有尝试替换模块、修改 guest、绕过未解析符号或继续文件系统测试。

## 7. mkfs.erofs 与 plain 镜像

宿主工具前置检查实际命令：

```sh
command -v mkfs.erofs
mkfs.erofs -V
```

实际输出：

```text
/usr/bin/mkfs.erofs
mkfs.erofs (erofs-utils) 1.8.6
available compressors: lz4, lz4hc, lzma, deflate, libdeflate, zstd
```

状态：**NOT RUN**。工具版本满足要求，但 `kldload` 已失败，因此没有生成源数据、
没有生成 plain 镜像、没有复制镜像到 guest。这样避免在首个失败后继续推进并产生误导性结果。

## 8. TC001-mount-basic

状态：**BLOCKED / NOT RUN**。

阻塞原因：`TC001-mount-basic.md` 的前置条件要求 FreeBSD 系统已加载 EROFS 内核模块；
本轮 `kldload /root/repo22-erofs.ko` 返回 1。因而以下命令均未执行：

```sh
mdconfig -a -t vnode -f test.erofs -u 0
mkdir -p /mnt/test
mount -t erofs /dev/md0 /mnt/test
mount | grep erofs
df -h /mnt/test
sha256 /mnt/test/<测试文件>
umount /mnt/test
mdconfig -d -u md0
```

没有把 BLOCKED 记录为 PASS 或文件系统行为 FAIL。

## 9. TC009-statfs-basic

状态：**BLOCKED / NOT RUN**。

用户要求仅在 TC001 通过后执行 TC009。TC001 因模块加载失败没有进入测试步骤，故
`df -h`、`df -i`、`stat -f` 和只读标志检查均未执行。

## 10. 工作树与提交状态

ABI 提交完成后的实际确认：

```text
HEAD=f2caaae2890a910d0f11547d9ff5f7cf92c062a2
git status --porcelain -- repo-community/repo22
<无输出>
```

本报告是本轮唯一预期新增文件。未修改 repo22 源码，未 commit，未 push。

## 最终判定

- 手工测试准备环境：PASS
- repo22 模块宿主构建：PASS
- 模块传输与完整性：PASS
- FreeBSD guest 模块加载：**FAIL**
- 失败根因证据：`link_elf_obj: symbol bcmp undefined`
- TC001：BLOCKED / NOT RUN
- TC009：BLOCKED / NOT RUN
- 总体：**FAIL / BLOCKED**

