Break a machine with a unit that does not exist

A file in a missing directory is not impossible: the host creates the parents,
which is correct and meant the first version of this test broke nothing at all
— and then reported that the board could not name a failure that never
happened. A unit that does not exist fails immediately and in the host's own
words, which is also what the board is being asked to show.
This commit is contained in:
2026-08-31 05:01:53 +02:00
parent eb0c8a6d98
commit 5736cca9f6
+6 -2
View File
@@ -1140,9 +1140,13 @@ test("the board names the machine that is not doing what it was told", {
assert.ok(up, `the board does not answer:\n${said.out}`);
// Something a person opened it for: give a machine a declaration it cannot apply.
//
// A unit that does not exist, because the host says so immediately and in its own words. A file
// in a missing directory is not impossible — the host creates the parents, which is correct and
// made the first version of this test break nothing at all.
await must("anchor", `printf %s '{"module":"impossible","version":"1",` +
`"resources":[{"id":"nowhere","type":"file","path":"/does/not/exist/at/all/file",` +
`"content":"x","mode":"0644"}]}' > /tmp/impossible.json`);
`"resources":[{"id":"nowhere","type":"service","unit":"nothing-like-this.service",` +
`"state":"running"}]}' > /tmp/impossible.json`);
await must("anchor", `docker cp /tmp/impossible.json mesh-control:/impossible.json`);
await mesh("module add /impossible.json");
await mesh("assign laptop impossible");