From 5736cca9f60df291d1e6dfd86960c64811df1843 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 31 Aug 2026 05:01:53 +0200 Subject: [PATCH] Break a machine with a unit that does not exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- test/integration/mesh.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/integration/mesh.test.ts b/test/integration/mesh.test.ts index d3dddc8..90205e9 100644 --- a/test/integration/mesh.test.ts +++ b/test/integration/mesh.test.ts @@ -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");