test(pcap): run the missing-path refusal only where captures are admitted (#2510)
On hosts without an enforceable native bound (macOS), the provider refuses inspect_pcap_capture with capability_unavailable before it touches the path, which the unsupported-boundary test in the same file pins. The missing-path test expected invalid_request on every host, so it always failed on macOS while Linux and Windows CI stayed green. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1f7f808c4f
commit
1991542e59
|
|
@ -87,17 +87,22 @@ it.runIf(hasNativeBound)(
|
|||
},
|
||||
);
|
||||
|
||||
it("rejects a path that is not a readable file", async () => {
|
||||
const result = await providerOver().execute({
|
||||
operation: "inspect_pcap_capture",
|
||||
input: { path: "/nonexistent/definitely-missing.pcap" },
|
||||
});
|
||||
expect(result.ok).toBe(false);
|
||||
if (result.ok) return;
|
||||
expect(projectAnalysisError(result.error)).toMatchObject({
|
||||
code: "invalid_request",
|
||||
});
|
||||
});
|
||||
// Hosts without a native bound refuse before touching the path; that order
|
||||
// is pinned by the unsupported-boundary test below.
|
||||
it.runIf(hasNativeBound)(
|
||||
"rejects a path that is not a readable file",
|
||||
async () => {
|
||||
const result = await providerOver().execute({
|
||||
operation: "inspect_pcap_capture",
|
||||
input: { path: "/nonexistent/definitely-missing.pcap" },
|
||||
});
|
||||
expect(result.ok).toBe(false);
|
||||
if (result.ok) return;
|
||||
expect(projectAnalysisError(result.error)).toMatchObject({
|
||||
code: "invalid_request",
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
it("reports a missing binary as a capability gap", async () => {
|
||||
const provider = new PcapProvider({
|
||||
|
|
|
|||
Loading…
Reference in New Issue