Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

test: correct shared network box expectations

Zhehui Bi8ee29fc1c80f
diff --git a/server/bot-box/self-check.linux.test.ts b/server/bot-box/self-check.linux.test.ts
index 5a269414e3..bcd313aa36 100644
--- a/server/bot-box/self-check.linux.test.ts
+++ b/server/bot-box/self-check.linux.test.ts
@@ -35,7 +35,7 @@ describe.skipIf(!available)(`the real box (${detection.box === "bwrap" ? "bubble
const expected: Record<string, string[]> = {
"bind-data": ["messages-db-hidden", "config-hidden", "data-dir-empty", "other-bot-folder-hidden", "other-task-folder-hidden", "secret-not-on-disk"],
"share-pid": ["other-pid-hidden", "server-pid-hidden"],
- "share-net": [],
+ "share-net": ["harness-other-refused", "egress-loopback-refused", "egress-metadata-refused", "egress-private-refused"],
"env-all": ["secret-not-in-env"],
"tmp-shared": ["tmp-private"],
"engines-rw": ["engine-read-only"],
@@ -45,8 +45,12 @@ describe.skipIf(!available)(`the real box (${detection.box === "bwrap" ? "bubble
const result = await runBoxSelfCheck({ ...options(), mutate: new Set([mutation as never]) });
expect(result.error, mutation).toBeUndefined();
for (const id of checks) expect(result.failed, `${mutation} should fail ${id}`).toContain(id);
- // share-net drops the two isolated-network checks instead of failing them; everything else holds.
- if (mutation === "share-net") expect(result.results.map((check) => check.id)).not.toContain("host-loopback-unreachable");
+ // share-net drops the isolated-network checks and loses the loopback bridges that serve the harness and egress gates.
+ if (mutation === "share-net") {
+ const checked = result.results.map((check) => check.id);
+ expect(checked).not.toContain("host-loopback-unreachable");
+ expect(checked).not.toContain("no-direct-internet");
+ }
const other = result.failed.filter((id) => !checks.includes(id));
expect(other, `${mutation} broke more than it should`).toEqual([]);
}