garage44.eu/jeroen/midas

logclone: git clone https://garage44.eu/jeroen/midas.git

.. /tests/e2e/README.md

raw

End-to-end: bot mode on a throwaway workspace

cargo build --release --target x86_64-unknown-linux-musl
tests/e2e/run.sh            # or: tests/e2e/run.sh path/to/midas

A workspace of one, on this machine, that touches nothing of the real one:

What it drives: a build lease refusing a bot; midas bot start (the flush carries the toy bot to the node, readiness is retried until it answers); status, mine and status --json showing a bot lease; midas bot mcp under client.py, an MCP client that initializes, lists and calls tools through ssh and fails on anything but JSON-RPC on stdout, and checks the owner's secret (bot.env, 0600, the container's build user) reached the bot; midas bot stop releasing the node and leaving no bot process or record; the heartbeat reporting a bot and stopping one whose lease was released at the hub; a new holder's handover clearing a bot left behind; and that the secret's value appears in no event.

Not covered, because they need root: the machine's firewall (sudo midas setup) and sudo midas bot setup itself (its file is written the way it writes it, with podman unshare chown).

Everything is named midas-e2e-* and removed on exit, the temporary directory too. The image is kept, so the next run builds in seconds; E2E_REMOVE_IMAGE=1 removes it. Where rootless podman also runs a distrobox, E2E_DISTROBOX (default arch) names it so its root is mounted back after each build and removal. A run takes about three minutes, most of it waiting for heartbeats (one a minute).