Commit Graph
3 Commits
Author SHA1 Message Date
Martin Vogel d826374577 test-infra(vm): remove embedded SSH key, pin host identity and installer
The Windows-VM bootstrap embedded a personal SSH public key and the
drivers connected with StrictHostKeyChecking=no. Key material and host
identity are now strictly operator-supplied and live outside the
repository (~/.claude/cbm-vm/, never committed):

- windows-bootstrap.ps1 takes the operator's public key as a mandatory
  -SshPublicKeyPath argument (validated single Ed25519 line) and prints
  the VM host-key fingerprint to pin. Generating your own key is
  documented in the script and README:
  ssh-keygen -t ed25519 -N "" -C <label> -f ~/.claude/cbm-vm/id_ed25519
- win.sh and provision-windows.sh verify the pinned
  CBM_VM_HOST_KEY_SHA256 fingerprint before every connection
  (StrictHostKeyChecking=yes against a keyscanned known_hosts, Ed25519
  only, IdentitiesOnly), validate branch names before remote
  interpolation, and fail remote pipelines loudly (set -e -o pipefail).
- The MSYS2 installer download is pinned to a versioned release URL with
  SHA-256 verification instead of an unpinned latest.
- win.sh gains a sync subcommand mirroring the uncommitted worktree onto
  the VM; its manifest logic is guarded by
  tests/test_vm_worktree_manifest.sh, wired into scripts/test.sh.
  guards now runs the maintained PowerShell driver against a clean
  product build; smoke-install drives vm-smoke.sh.
- run.sh drops the stale duplicate windows-vm/mac-vm legs (the former
  carried its own unpinned ssh path) in favor of the vm/ drivers.

The previously committed public key has been rotated off the VM and is
no longer authorized anywhere.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-07-19 23:21:53 +02:00
Martin Vogel 343582aa93 test-infra(vm): script-driven Windows VM leg for the local 3-OS gate
The Windows VM becomes a first-class, reproducible local-CI leg driven
entirely over the local ssh link by maintained scripts:

- provision-windows.sh: idempotent host-side provisioner — msys2 base,
  CLANGARM64 (native, fast) + CLANG64 (CI arch) toolchains, repo
  clone/update, full build, smoke check. One command recovers a fresh VM
  or a lost disk.
- win.sh: daily driver — status/update/build/test/guards/smoke-install/
  sh/push-file/asan-build. smoke-install runs the managed-install E2E
  with stderr visible, the class the CI smoke probe structurally hides.
- windows-bootstrap.ps1: reduced to the one-time in-VM door-opener
  (OpenSSH + host key + GitHub-runner default-owner policy mirror), with
  the ISO delivery trick documented; toolchain work moved to the
  host-side provisioner. The previous winget path does not work over ssh
  and clipboard/shared folders do not exist on Windows-ARM guests.
- README.md: full lifecycle — VM creation, clone-before-drivers rollback
  point, SPICE guest tools, bootstrap, provisioning, daily loop, and the
  honest limits (no ASan on aarch64-windows; ASan also faults under
  x64-on-ARM emulation, so Windows sanitizer coverage stays on CI).

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-07-19 14:14:11 +02:00
Martin Vogel 37956940da feat(test-infra): opt-in windows-vm and mac-vm legs
Two failure classes stay invisible to the container legs: kernel-real
Windows ACL/token/owner semantics (Wine only compile-checks) and the
GitHub-runner macOS environment (a developer Mac differs in temp
ancestry, ACLs, and policies - runner-only failures never reproduce
locally). Add real-VM legs for both, strictly opt-in: run.sh detects
the tooling and the named VM and prints setup guidance with a distinct
exit code when absent - explicitly requested legs are never silently
skipped.

windows-vm: UTM + CrystalFetch (both free), driven over ssh; the
in-VM bootstrap (vm/windows-bootstrap.ps1) installs the CLANG64
toolchain, enables sshd, and mirrors the runner's
NoDefaultAdminOwner=0 policy so freshly created objects are owned by
BUILTIN\Administrators - the exact class the daemon's owner gates must
survive.

mac-vm: Cirrus Labs' runner-equivalent image via tart (free OSS),
booted headless, worktree synced over key-based ssh, scripts/test.sh
executed in the runner-class environment.

vm/README.md documents both setups end to end.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-07-18 18:46:02 +02:00