mirror of
https://github.com/morluto/rea.git
synced 2026-11-02 21:06:04 +00:00
Settle absent and zombie candidates before retaining baseline or token-read failures. Preserve fail-closed behavior for live and unknown generations, and stop retrying exited candidates. Bind Linux effective UID to stat-bracketed status reads only for unreadable-token candidates, preserving partial identity facts and avoiding full-table UID enrichment.
22 lines
695 B
TypeScript
22 lines
695 B
TypeScript
import { expect, it } from "vitest";
|
|
|
|
import { parseLinuxProcessEffectiveUid } from "./LinuxProcessStatus.js";
|
|
|
|
it("parses the effective UID from the single native status Uid row", () => {
|
|
expect(
|
|
parseLinuxProcessEffectiveUid(
|
|
"Name:\tworker\nUid:\t1000\t1001\t1002\t1003\nGid:\t20\t20\t20\t20\n",
|
|
),
|
|
).toBe(1001);
|
|
});
|
|
|
|
it.each([
|
|
"Name:\tworker\n",
|
|
"Uid:\t1000\t1001\t1002\n",
|
|
"Uid:\t1000\t1001\t1002\t1003\nUid:\t1000\t1001\t1002\t1003\n",
|
|
"Uid:\t1000\t-1\t1002\t1003\n",
|
|
"Uid:\t1000\t9007199254740992\t1002\t1003\n",
|
|
])("does not infer an effective UID from malformed status: %s", (status) => {
|
|
expect(parseLinuxProcessEffectiveUid(status)).toBeUndefined();
|
|
});
|