fix(landlock-run): enforce probe CLI contract

This commit is contained in:
Tianyi Cui
2026-07-20 12:25:36 +08:00
parent 733a90e708
commit 801289adf2
2 changed files with 13 additions and 8 deletions

View File

@@ -53,9 +53,15 @@ const run = (args, options = {}) => spawnSync(launcher, args, { encoding: 'utf8'
assert.equal(danglingPath.status, LAUNCHER_FAILURE_EXIT);
assert.match(danglingPath.stderr, /--ro requires a path/);
const probeWithExtras = run(['--probe', '--ro', '/']);
assert.equal(probeWithExtras.status, LAUNCHER_FAILURE_EXIT);
assert.match(probeWithExtras.stderr, /--probe takes no other arguments/);
for (const args of [
['--probe', '--ro', '/'],
['--probe', '--'],
['--probe', '--probe'],
]) {
const probeWithExtras = run(args);
assert.equal(probeWithExtras.status, LAUNCHER_FAILURE_EXIT);
assert.match(probeWithExtras.stderr, /--probe takes no other arguments/);
}
}
// --- probe: the functional availability signal ---