diff --git a/src/main/ssh/ssh-system-transport.integration.test.ts b/src/main/ssh/ssh-system-transport.integration.test.ts index bf2b639207b..f411712410c 100644 --- a/src/main/ssh/ssh-system-transport.integration.test.ts +++ b/src/main/ssh/ssh-system-transport.integration.test.ts @@ -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' })