Validate Bun launch arguments in SSH framing fixture

This commit is contained in:
m4air
2026-09-28 04:46:45 -07:00
parent 817e076df4
commit 8d9089821a
@@ -8,7 +8,7 @@ vi.mock('electron', () => ({
// This fixture exercises SSH framing; runtime installation has separate integration coverage.
vi.mock('./ssh-relay-bun-runtime', () => ({
ensureRemoteRelayBunRuntime: vi.fn(async () => process.execPath)
ensureRemoteRelayBunRuntime: vi.fn(async () => `${process.env.ORCA_SYSTEM_SSH_PATH}-runtime`)
}))
import { SshConnection } from './ssh-connection'
@@ -180,6 +180,17 @@ describe('system SSH transport integration', () => {
process.env.HOME = remoteHome
process.env.ORCA_RELAY_PATH = relayRoot
process.env.ORCA_SYSTEM_SSH_PATH = writeFakeSsh(tempDir)
// Validate the owned-runtime prefix before handing the framing fixture to Node.
const runtime = `${process.env.ORCA_SYSTEM_SSH_PATH}-runtime`
writeFileSync(
runtime,
`#!/bin/sh
[ "$1" = '--no-env-file' ] && [ "$2" = '--config=/dev/null' ] && [ "$3" = '--no-install' ] || exit 64
shift 3
exec '${process.execPath.replaceAll("'", "'\"'\"'")}' "$@"
`
)
chmodSync(runtime, 0o755)
process.env.ORCA_SSH_FORCE_SYSTEM_TRANSPORT = '1'
})