Testing, for people and agents

The source code is not public yet. This page is the testing guide for people and agents who have it; the public repository holds only these pages.

1. What you need

Linux x86-64 with go, zig (0.16 used), cc, python3 (3.11 used), node (24 used; the Chrome tests need a global WebSocket), git, e2fsprogs, squashfs-tools, and google-chrome for browser tests.

Not in the repository:

2. Check before you trust a result

for t in go zig cc python3 node git mke2fs e2fsck debugfs dumpe2fs mksquashfs google-chrome; do
  command -v $t >/dev/null || echo "MISSING tool: $t"; done
for f in vendor/toolchain/machin vendor/riscv-tests/env/p/link.ld build/linux/Image \
  build/linux/initramfs.cpio build/linux/busybox.stripped build/linux/dropbearmulti build/linux/LICENSE.dropbear; do
  [ -e $f ] || echo "MISSING file: $f"; done

SKIPPED is not a pass. Without build/linux/, several tests print SKIPPED and exit 0, and quick.sh can still say it passed. A result counts only if the exit status is 0, the success line below is present, and the output has no SKIPPED. quick.sh keeps each test's output in build/quick/*.out: search those too. The two node tests/linux-*.mjs tests do not skip; without the binaries they fail.

3. Build

./build.sh wasm     # native and wasm
./build.sh web      # the same, plus the site in build/web/

Build output matters: if a build fails, later tests run the previous binaries.

4. Quick checks first

timeout 30 tests/quick.sh
grep -l SKIPPED build/quick/*.out     # must print nothing

Success: quick checks passed: N runs on sosie sosie-ref wasm-mfl wasm-c.

5. Feature tests

Run one command at a time under a limit, as timeout --kill-after=2 28 COMMAND. Each fit that on the development machine (about 1 to 25 s); a slower one may need longer, and a time-out is “no result”, not a pass or a failure. Run browser and two-machine tests alone.

Device, bare metal, native

CommandSuccess line containsCovers
tests/machine/blk.pydisk tests passedboth disk slots, hostile requests
tests/machine/net.pynetwork card tests passednetwork card with an echoing host

Browser logic, Node only

CommandSuccess line containsCovers
node tests/disk-cache.mjsdisk cache tests passedcache against a model
node tests/disk-pin.mjsdisk pin tests passedkept copies and updates
node tests/disk-save.mjssave-now tests passedSave now, made-up guest and clock

Linux, native and Node

CommandSuccess line containsCovers
tests/linux/disk.pylinux disk tests passed: rw failing crashext4: reboot, failing disk, kill
tests/linux/disk.py --wasmlinux disk tests passed: rw failingsame through the browser cache
tests/linux/layers.pylayer tests passed: keep brokenall of / kept; safe mode; broken disks
tests/linux/layers.py keep --wasmlayer tests passed: keep (wasm)
tests/linux/net.pytwo machines passedping, 256 KiB over TCP, real-time waits
python3 -u tests/linux/ssh.py loginssh between two machines passed: loginlocked as shipped, refusals, login
python3 -u tests/linux/ssh.py sessionssh between two machines passed: sessioninteractive shell, scp

Headless Chrome (after ./build.sh web)

CommandSuccess line containsCovers
python3 tests/browser.py chrome --page=linux-selftest.htmlchrome linux-selftest.html: okboot, workload, Ctrl-C
python3 tests/browser.py chrome "--page=disk-selftest.html?kills=2"0 failuresIndexedDB, kills, failed saves
node tests/linux-page.mjs killui test passedbrowser killed during writes
node tests/linux-page.mjs reloadui test passedpage reloaded during writes
node tests/linux-page.mjs savenowui test passedSave now, with a control
node tests/linux-page.mjs layersui test passedsafe mode, damaged chunk
node tests/linux-page.mjs updateui test passeda real site update
node tests/linux-tabs.mjstabs test passedtwo tabs: ping, file, SSH

Outputs worth knowing: linux-page.mjs prints “0 times” for the parts you did not ask for. tests/linux/ssh.py takes login or session, one per run.

Not part of the quick route

tests/run.sh is the full suite and takes many minutes. tests/browser.py without --page runs several pages, in Chrome and Firefox: always name both a browser and a page.

6. After a failure or a time-out

A killed test can leave processes behind. Stop only this checkout's (the brackets stop the pattern matching the shell that runs it):

pkill -f "[u]ser-data-dir=$PWD/build/profile-"
pkill -f "[w]asm/run.mjs build/sosie-mfl.wasm"

The second also stops such emulators started from other checkouts. If a linux-page.mjs run was interrupted while it had replaced site files, run ./build.sh web again before testing further.

7. Testing by hand

./build.sh web
python3 -m http.server -d build/web --bind 127.0.0.1 8000

Open http://127.0.0.1:8000/linux.html. Use 127.0.0.1, localhost or HTTPS: Web Locks and hashing are not available to a page served over plain HTTP from another address.

DoExpect
Boot with Keep changes“Changes to / are kept on your saved disk”
echo hi > /etc/mine, press Save now, wait for “saved”, reload, Boot, cat /etc/minehi
Open the same page in a second tab and BootRefused: the saved disk is in use
Open ?safe=1, Boot, cat /etc/mineNo such file; “Changes are NOT being saved”
Power off, Delete saved disk, Boot, cat /etc/mineNo such file
The two-tab SSH steps on Network and SSHA shell on sosie2

8. Rules for an agent reporting results