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:
co-authored by
Claude Opus 5.5
parent
1f7f808c4f
commit
1991542e59
@@ -87,17 +87,22 @@ it.runIf(hasNativeBound)(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
it("rejects a path that is not a readable file", async () => {
|
// Hosts without a native bound refuse before touching the path; that order
|
||||||
const result = await providerOver().execute({
|
// is pinned by the unsupported-boundary test below.
|
||||||
operation: "inspect_pcap_capture",
|
it.runIf(hasNativeBound)(
|
||||||
input: { path: "/nonexistent/definitely-missing.pcap" },
|
"rejects a path that is not a readable file",
|
||||||
});
|
async () => {
|
||||||
expect(result.ok).toBe(false);
|
const result = await providerOver().execute({
|
||||||
if (result.ok) return;
|
operation: "inspect_pcap_capture",
|
||||||
expect(projectAnalysisError(result.error)).toMatchObject({
|
input: { path: "/nonexistent/definitely-missing.pcap" },
|
||||||
code: "invalid_request",
|
});
|
||||||
});
|
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 () => {
|
it("reports a missing binary as a capability gap", async () => {
|
||||||
const provider = new PcapProvider({
|
const provider = new PcapProvider({
|
||||||
|
|||||||
Reference in New Issue
Block a user