mirror of
https://github.com/morluto/rea.git
synced 2026-11-07 07:16:13 +00:00
* feat(native): admit raw binaries with caller-supplied architecture and entry * fix(native): honor raw-binary preparation and entry identity * fix(ghidra): stream raw snapshot attestation with cancellation * fix(native): preserve and validate raw lifecycle entries --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { openBinaryInputSchema } from "./sessionLifecycleInputs.js";
|
|
|
|
describe("open_binary raw-binary input contract", () => {
|
|
it("accepts header detection without architecture", () => {
|
|
expect(
|
|
openBinaryInputSchema.safeParse({ path: "/tmp/fixture.bin" }).success,
|
|
).toBe(true);
|
|
expect(
|
|
openBinaryInputSchema.safeParse({
|
|
path: "/tmp/legacy.com",
|
|
format: "dos-com",
|
|
}).success,
|
|
).toBe(true);
|
|
});
|
|
it("accepts raw-binary with architecture and entry", () => {
|
|
expect(
|
|
openBinaryInputSchema.safeParse({
|
|
path: "/tmp/ecu.bin",
|
|
format: "raw-binary",
|
|
architecture: "arm",
|
|
entry_point: "0x8000000",
|
|
}).success,
|
|
).toBe(true);
|
|
});
|
|
it("rejects raw-binary without architecture or entry", () => {
|
|
const parsed = openBinaryInputSchema.safeParse({
|
|
path: "/tmp/ecu.bin",
|
|
format: "raw-binary",
|
|
});
|
|
expect(parsed.success).toBe(false);
|
|
expect(
|
|
openBinaryInputSchema.safeParse({
|
|
path: "/tmp/ecu.bin",
|
|
format: "raw-binary",
|
|
architecture: "arm",
|
|
}).success,
|
|
).toBe(false);
|
|
});
|
|
it("rejects architecture without format=raw-binary", () => {
|
|
expect(
|
|
openBinaryInputSchema.safeParse({
|
|
path: "/tmp/ecu.bin",
|
|
architecture: "arm",
|
|
entry_point: "0x8000000",
|
|
}).success,
|
|
).toBe(false);
|
|
});
|
|
});
|