test(nasiko): isolate malformed lock fixture

This commit is contained in:
haelyra
2026-08-25 13:52:19 -04:00
parent e10c4bb5bf
commit d6d0c4e696
2 changed files with 8 additions and 2 deletions

View File

@@ -40,7 +40,7 @@ Commit `5aa66021` moved ambient-override checks into isolated child processes an
## GREEN
- Focused installer, lifecycle, packaging, release-workflow, manifest, OpenCode, Antigravity, and uninstall tests passed.
- Full repository suite: 3,986 passed, 0 failed.
- Full repository suite: 3,987 passed, 0 failed.
- `npm audit --audit-level=low`: 0 vulnerabilities.
- Supply-chain IOC scan: 207 files inspected, no findings.
- Both release workflow YAML files parsed successfully.

View File

@@ -143,7 +143,13 @@ async function main() {
assert.strictEqual(fs.existsSync(lockPath), true);
releaseLock();
assert.strictEqual(fs.existsSync(lockPath), false);
} finally { fs.rmSync(installRoot, { recursive: true, force: true }); }
}],
['refuses to recover malformed lifecycle-lock ownership', () => {
const { acquireLifecycleLock } = require('../../scripts/lib/nasiko-release');
const installRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'ecc-nasiko-malformed-lock-'));
const lockPath = path.join(installRoot, '.ecc-nasiko-lifecycle.lock');
try {
fs.writeFileSync(lockPath, '{"pid":"unknown"}\n', { mode: 0o600 });
assert.throws(
() => acquireLifecycleLock(installRoot, fs, { isProcessAlive: () => false }),