2026-03-26 14:03:08 +00:00
# Clawdie-ISO Testing Guide
**Version:** v0.9.0
**Date:** 26.mar.2026
**Tested On:** FreeBSD 15.0-RELEASE amd64
**Test Platform:** bhyve (KVM)
---
## Overview
This guide covers testing the Clawdie-ISO installer end-to-end. Testing happens in two levels:
2026-04-08 18:24:48 +00:00
1. **Module Integration Test** — Verify all 8 core shell modules work together (5 min, offline)
2026-03-26 14:03:08 +00:00
2. **Full Bhyve Boot Test** — Boot ISO in VM, run bsdinstall + firstboot (20– 25 min, interactive)
2026-04-01 19:39:46 +00:00
Before running bhyve tests, run the read-only host preflight:
```bash
./scripts/preflight-host.sh
```
2026-04-02 05:44:56 +00:00
If the host uses an isolated bhyve bridge, confirm the test VM runs on `bhyve0`
(`10.99.0.0/24` ) rather than `warden0` to avoid cross-traffic with Clawdie jails.
2026-04-01 21:23:09 +00:00
After the bhyve boot test completes, validate the installed system with the
fresh-install checklist in the Clawdie-AI repo:
`/home/clawdie/clawdie-ai/docs/FRESH-INSTALL-CHECKLIST.md`
2026-03-26 14:03:08 +00:00
---
## Level 1: Module Integration Test
2026-04-08 18:24:48 +00:00
Quick validation that the core shell modules execute in sequence with proper state handoff.
Excludes zfs/ssh/desktop/npm-globals (validated in full firstboot flow).
2026-03-26 14:03:08 +00:00
### Run the test
```bash
cd /home/clawdie/clawdie-iso
sh firstboot/integration-test.sh
```
### Expected output
```
╔════════════════════════════════════════════════════════════════╗
2026-05-12 20:07:07 +02:00
║ Clawdie Shell Integration Test ║
2026-04-08 18:24:48 +00:00
║ 8-module sequential execution (cloud/VM scenario) ║
2026-03-26 14:03:08 +00:00
╚════════════════════════════════════════════════════════════════╝
2026-04-08 18:24:48 +00:00
[1/8] shell-env.sh → Identity + .env
2026-03-26 14:03:08 +00:00
✓ .env created (65 variables)
2026-04-08 18:24:48 +00:00
[2/8] shell-pkg.sh → Repos (online + offline USB)
2026-03-26 14:03:08 +00:00
✓ FreeBSD repo configured
✓ USB repo configured
2026-04-08 18:24:48 +00:00
[3/8] shell-gpu.sh → GPU detection (Intel)
2026-03-26 14:03:08 +00:00
✓ GPU detection: intel
✓ rc.conf updated
2026-04-08 18:24:48 +00:00
[4/8] shell-nvidia.sh → NVIDIA driver (skipped for Intel)
2026-03-26 14:03:08 +00:00
✓ NVIDIA module: skipped (correct for Intel GPU)
2026-04-08 18:24:48 +00:00
[5/8] shell-system.sh → Hostname, timezone, services
2026-03-26 14:03:08 +00:00
✓ Hostname configured
✓ Profile environment setup
2026-04-08 18:24:48 +00:00
[6/8] shell-pf.sh → PF firewall + jail NAT
⚠ PF: skipped (expected in test env)
✓ PF module: loaded
[7/8] shell-tailscale.sh → Tailscale remote access
✓ Tailscale: skipped (FEATURE_TAILSCALE=NO)
[8/8] shell-deploy.sh → Clawdie-AI deployment
2026-03-26 14:03:08 +00:00
✓ Clawdie-AI deployed
✓ node_modules installed
╔════════════════════════════════════════════════════════════════╗
║ Integration Test Complete ║
2026-04-08 18:24:48 +00:00
║ ✓ All 8 modules executed with state handoff
2026-03-26 14:03:08 +00:00
╚════════════════════════════════════════════════════════════════╝
```
### What this tests
- ✅ Environment variable export between modules
- ✅ File creation (rc.conf, .env, repos)
- ✅ Error handling (functions return non-zero on failure)
- ✅ Logging to progress file
- ✅ No undefined function calls
**If test passes:** Ready for bhyve testing.
2026-04-14 19:04:41 +00:00
**If test fails:** Check `tmp/clawdie-int-*/var/log/integration.log` for errors.
2026-03-26 14:03:08 +00:00
---
## Level 2: Full Bhyve Boot Test
Complete end-to-end installation and configuration in a virtual machine.
### Prerequisites
```bash
# Check bhyve is available
which bhyve
kldstat | grep vmm
# Check disk space
df -h /
2026-04-04 09:49:01 +00:00
# Optional: allow guest internet (writes /etc/pf.bhyve.conf and reloads PF)
sudo ./scripts/bhyve-pf-allow.sh
2026-03-26 14:03:08 +00:00
```
2026-04-04 09:49:01 +00:00
Required checks should succeed. You need:
2026-05-12 20:07:07 +02:00
2026-03-26 14:03:08 +00:00
- bhyve binary
- vmm kernel module loaded
- 30GB free disk (25GB ISO + 50GB VM disk)
- Network interface
2026-04-04 09:49:01 +00:00
If you want guest internet access, run the PF helper once before the test.
Note: the bhyve test must run on bare metal or a host with nested VT-x enabled.
Running bhyve inside a VM commonly freezes the host.
2026-03-26 14:03:08 +00:00
### Run the test
```bash
# This will create a bhyve VM and boot the ISO
2026-03-30 12:43:55 +00:00
cd /home/clawdie/clawdie-iso
feat(firstboot): resume/reset flags, checkpoint guards + move bhyve scripts
firstboot.sh:
- Set SHELL_{GPU,NVIDIA,PKG,ENV,DEPLOY}_TEST=1 before sourcing modules
(prevents double-execution on source — same bug fixed in integration-test)
- Add --resume: run_step() skips steps already recorded in progress file
- Add --reset: clears progress file, starts over from scratch
- Add --help
- Wizard tracked as checkpoint so --resume skips re-prompting the user
- run_step() helper: guard → run → mark done in one call
scripts/bhyve-test.sh (was tmp/bhyve-test-setup.sh):
- Moved to tracked scripts/ directory (tmp/ is gitignored)
- Timeout 300→1800s (full install is 20–25 min, not 5)
scripts/run-bhyve-test.sh (was tmp/run-bhyve-test.sh):
- Moved to scripts/, log output redirected to logs/ (also gitignored)
BUILD.md, TESTING.md, IMPLEMENTATION-PLAN.md:
- Update all bhyve script references to scripts/bhyve-test.sh
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 13:00:24 +00:00
sudo ./scripts/bhyve-test.sh
2026-03-26 14:03:08 +00:00
```
### Boot sequence
The script will:
1. **Create VM** — bhyve VM named `clawdie-test` with 2 CPUs, 2GB RAM
2. **Boot ISO** — Load clawdie-iso-baremetal-26.mar.2026.img as CDROM
3. **FreeBSD Installer** — bsdinstall drops to interactive prompt
4. **Disk partitioning** — Default options (ZFS root)
5. **Reboot** — After install, reboots into HDD
6. **First boot** — rc.d/clawdie-firstboot triggers firstboot.sh
2026-04-02 15:18:50 +00:00
7. **Firstboot wizard** — Prompts for assistant name, domain, timezone, local LLM runtime (Ollama vs llama-cpp), and Forgejo web UI toggle (non-interactive in this test, uses defaults)
2026-03-26 14:03:08 +00:00
8. **Module execution** — GPU detection → deployment → service startup
### Timeline
2026-05-12 20:07:07 +02:00
| Phase | Duration | What happens |
| ---------------- | -------------- | ----------------------------------- |
| bsdinstall | 5– 10 min | Disk layout, base system, reboot |
| First boot | 3– 5 min | rc.d startup sequence |
| Firstboot wizard | 2– 3 min | bsddialog prompts (or auto answers) |
| GPU detection | < 1 min | pciconf → rc . conf update |
| Package setup | 2– 3 min | Repo config + cache seeding |
| Clawdie deploy | 5– 10 min | Extract tarball + just install |
| **Total** | ** ~20– 25 min** | System ready for login |
2026-03-26 14:03:08 +00:00
### What to verify
After boot completes, check the VM console for:
#### ✅ GPU detection
2026-05-12 20:07:07 +02:00
2026-03-26 14:03:08 +00:00
```
[gpu] Detected GPU vendor: intel
[gpu] Matched driver: i915kms
[gpu] Wrote kld_list=i915kms to /etc/rc.conf
```
#### ✅ Package configuration
2026-05-12 20:07:07 +02:00
2026-03-26 14:03:08 +00:00
```
[pkg] System ABI: FreeBSD:15:amd64
[pkg] Wrote /etc/pkg/repos/FreeBSD.conf with branch=latest
[pkg] Wrote /etc/pkg/repos/Clawdie-USB.conf pointing to /usr/local/share/clawdie-iso/packages
```
#### ✅ Environment generation
2026-05-12 20:07:07 +02:00
2026-03-26 14:03:08 +00:00
```
[env] Wrote .env with 45 configuration lines
[env] .env validation passed (45 lines)
```
#### ✅ System configuration
2026-05-12 20:07:07 +02:00
2026-03-26 14:03:08 +00:00
```
[system] Updated rc.conf
[system] Set hostname to clawdie.local (or provided domain)
[system] Enabled services: dbus, hald, seatd, lightdm
```
#### ✅ Clawdie deployment
2026-05-12 20:07:07 +02:00
2026-03-26 14:03:08 +00:00
```
[deploy] Extracting /usr/local/share/clawdie-iso/clawdie-ai.tar.gz
[deploy] Tarball extracted to /home/clawdie/clawdie-ai
2026-04-14 18:53:06 +00:00
[deploy] Running installer...
[deploy] Installer completed successfully
2026-03-26 14:03:08 +00:00
[deploy] ✓ Jails active: 4 jails
[deploy] ✓ clawdie service configured in rc.conf
[deploy] Clawdie-AI deployment complete
```
2026-04-02 10:35:05 +00:00
#### ✅ Forgejo (optional)
2026-05-12 20:07:07 +02:00
2026-04-02 10:35:05 +00:00
When Forgejo is enabled, verify the service and port:
```
sudo bastille cmd ${AGENT_NAME}-git service forgejo onestatus
sockstat -4l | grep ':3000'
```
2026-04-02 10:45:25 +00:00
#### ✅ Git jail storage (always)
2026-05-12 20:07:07 +02:00
2026-04-02 10:45:25 +00:00
```
sudo bastille cmd ${AGENT_NAME}-git ls -la /srv/git
```
#### ✅ Forgejo UI reachability (optional)
2026-05-12 20:07:07 +02:00
2026-04-02 10:45:25 +00:00
```
fetch -o - http://git.${AGENT_NAME}.home.arpa:3000 | head -n 5
```
2026-04-02 15:18:50 +00:00
#### ✅ llama-cpp models (optional)
2026-05-12 20:07:07 +02:00
2026-04-02 15:18:50 +00:00
If llama-cpp was selected and a USB model pack is present:
```
sudo bastille cmd llamacpp ls -la /var/db/llm-models
```
2026-03-26 14:03:08 +00:00
#### ✅ Desktop ready
2026-05-12 20:07:07 +02:00
2026-03-26 14:03:08 +00:00
```
Login prompt appears (Lumina greeter via lightdm)
User: clawdie (password auto-generated, shown in .env)
```
### Stopping the VM
Once testing is complete:
```bash
# From another terminal, destroy the VM
bhyvectl --vm=clawdie-test --destroy
```
Or press `Ctrl-C` in the bhyve console (may not work cleanly; destroy is cleaner).
---
## Troubleshooting
### VM won't boot
**Symptom:** Freezes at bhyve boot prompt
**Cause:** Usually missing or corrupted ISO
**Fix:**
2026-05-12 20:07:07 +02:00
2026-03-26 14:03:08 +00:00
```bash
# Verify ISO
2026-04-05 14:19:32 +00:00
file /home/clawdie/clawdie-iso/tmp/output/clawdie-iso-baremetal-*.img
2026-03-26 14:03:08 +00:00
# Should show: DOS/MBR boot sector
# Check size
2026-04-05 14:19:32 +00:00
ls -lh /home/clawdie/clawdie-iso/tmp/output/clawdie-iso-baremetal-*.img
2026-03-26 14:03:08 +00:00
# Should be ~25G
# Rebuild if needed
cd /home/clawdie/clawdie-iso
sudo ./build.sh --skip-fetch
```
### bsdinstall hangs
**Symptom:** Installer stops responding after disk selection
**Cause:** bhyve disk I/O issue (rare)
**Fix:**
2026-05-12 20:07:07 +02:00
2026-03-26 14:03:08 +00:00
```bash
# Destroy and retry
bhyvectl --vm=clawdie-test --destroy
2026-03-30 12:43:55 +00:00
cd /home/clawdie/clawdie-iso
feat(firstboot): resume/reset flags, checkpoint guards + move bhyve scripts
firstboot.sh:
- Set SHELL_{GPU,NVIDIA,PKG,ENV,DEPLOY}_TEST=1 before sourcing modules
(prevents double-execution on source — same bug fixed in integration-test)
- Add --resume: run_step() skips steps already recorded in progress file
- Add --reset: clears progress file, starts over from scratch
- Add --help
- Wizard tracked as checkpoint so --resume skips re-prompting the user
- run_step() helper: guard → run → mark done in one call
scripts/bhyve-test.sh (was tmp/bhyve-test-setup.sh):
- Moved to tracked scripts/ directory (tmp/ is gitignored)
- Timeout 300→1800s (full install is 20–25 min, not 5)
scripts/run-bhyve-test.sh (was tmp/run-bhyve-test.sh):
- Moved to scripts/, log output redirected to logs/ (also gitignored)
BUILD.md, TESTING.md, IMPLEMENTATION-PLAN.md:
- Update all bhyve script references to scripts/bhyve-test.sh
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 13:00:24 +00:00
sudo ./scripts/bhyve-test.sh
2026-03-26 14:03:08 +00:00
```
### Firstboot doesn't trigger
**Symptom:** System boots to login prompt, no installation started
**Cause:** rc.d service not enabled or firstboot payload missing
**Verify:**
2026-05-12 20:07:07 +02:00
2026-03-26 14:03:08 +00:00
```bash
# In VM console (login as root if possible)
grep clawdie_firstboot /etc/rc.conf
ls -la /usr/local/share/clawdie-iso/firstboot/
service clawdie-firstboot status
```
### Module errors in logs
**Symptom:** One of the [gpu], [pkg], [env], [deploy] stages fails
**Debug:**
2026-05-12 20:07:07 +02:00
2026-03-26 14:03:08 +00:00
```bash
# SSH into VM (if network working)
ssh root@< vm-ip >
# Check logs
tail -f /var/log/clawdie-firstboot.log
# Check progress
cat /var/log/clawdie-firstboot.progress
```
---
## Test Results Checklist
Before marking test as passed, verify:
- [ ] bsdinstall completed without errors
- [ ] System rebooted from HDD (not USB)
- [ ] rc.d/clawdie-firstboot triggered on first boot
- [ ] GPU detection ran and set correct kld_list
- [ ] Package repos configured
- [ ] .env file created with secrets
- [ ] Hostname and timezone set
2026-04-14 18:53:06 +00:00
- [ ] Clawdie-AI extracted and just install ran
2026-03-26 14:03:08 +00:00
- [ ] At least one jail is running
- [ ] Lumina desktop login appears
- [ ] No critical errors in /var/log/clawdie-firstboot.log
---
## Next Steps
**If all tests pass:**
2026-05-12 20:07:07 +02:00
2026-04-05 14:19:32 +00:00
- Publish ISO from `tmp/output/` (do not commit build artifacts)
2026-03-26 14:03:08 +00:00
- Test on real hardware (Intel, AMD, NVIDIA systems)
- Begin Phase 3 (clawdie-admin.sh UI)
**If tests fail:**
2026-05-12 20:07:07 +02:00
2026-03-26 14:03:08 +00:00
- Check logs in VM: `/var/log/clawdie-firstboot.log`
- Review SHELL-MODULES.md for module details
- Fix issue in shell module
- Rebuild ISO: `sudo ./build.sh --skip-fetch`
- Retry test
---
## CI/CD Integration
For automated testing in CI pipeline:
```bash
#!/bin/sh
# ci-test-installer.sh
# 1. Module integration test (fast, no root)
sh firstboot/integration-test.sh || exit 1
# 2. Build ISO
sudo ./build.sh --skip-fetch || exit 1
# 3. Boot in bhyve (requires interactive console capture)
# [Not yet automated — manual testing or expect script needed]
echo "✓ Installer tests passed"
```
---
## See Also
- [IMPLEMENTATION-PLAN.md ](IMPLEMENTATION-PLAN.md ) — Task status
- [SHELL-MODULES.md ](SHELL-MODULES.md ) — Module documentation
- [BUILD.md ](BUILD.md ) — Building the ISO