Skip to content

Commit 7f5af75

Browse files
committed
test(runtime): cover Hermes CA helper guard
Signed-off-by: Ho Lim <subhoya@gmail.com>
1 parent 702a02f commit 7f5af75

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

test/corporate-ca-runtime-merge.test.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,16 @@ const OPENCLAW_END = "# Git TLS CA bundle fix (NemoClaw#2270).";
4343
const HERMES_END = "# OpenShell injects SSL_CERT_FILE/CURL_CA_BUNDLE for its L7 proxy CA.";
4444

4545
describe("corporate proxy CA runtime helper guard (#8292)", () => {
46-
it.each(["missing", "symlink"] as const)(
47-
"exits before sourcing or merging when the deployed helper is %s and fallback is unavailable",
48-
(deployedMode) => {
49-
const dir = tmpDir(`nemoclaw-corp-helper-${deployedMode}-`);
50-
const result = runCorporateCaHelperGuard(OPENCLAW_START, dir, deployedMode);
46+
it.each([
47+
{ agent: "OpenClaw", script: OPENCLAW_START, end: OPENCLAW_END, mode: "missing" as const },
48+
{ agent: "OpenClaw", script: OPENCLAW_START, end: OPENCLAW_END, mode: "symlink" as const },
49+
{ agent: "Hermes", script: HERMES_START, end: HERMES_END, mode: "missing" as const },
50+
{ agent: "Hermes", script: HERMES_START, end: HERMES_END, mode: "symlink" as const },
51+
])(
52+
"exits $agent before sourcing or merging when the deployed helper is $mode and fallback is unavailable",
53+
({ agent, script, end, mode }) => {
54+
const dir = tmpDir(`nemoclaw-${agent.toLowerCase()}-helper-${mode}-`);
55+
const result = runCorporateCaHelperGuard(script, dir, mode, end);
5156

5257
expect(result.status).not.toBe(0);
5358
expect(result.stderr).toContain("required corporate CA runtime helper is missing or unsafe");

test/helpers/corporate-ca-support.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,11 @@ export function runCorporateCaHelperGuard(
334334
scriptPath: string,
335335
dir: string,
336336
deployedMode: "missing" | "symlink",
337+
endMarker: string,
337338
): { status: number; stderr: string; mergedPath: string; secret: string } {
338339
const src = fs.readFileSync(scriptPath, "utf-8");
339340
const startMarker =
340341
'_NEMOCLAW_CORPORATE_CA_HELPER="/usr/local/lib/nemoclaw/corporate-ca-runtime.sh"';
341-
const endMarker = "# Git TLS CA bundle fix (NemoClaw#2270).";
342342
const start = src.indexOf(startMarker);
343343
const end = src.indexOf(endMarker, start);
344344
if (start === -1 || end === -1 || end <= start) {

0 commit comments

Comments
 (0)