fix(ssh): verify mux readiness before reusing socket

Use ssh -O check in the first-use mux lock flow so commands only reuse a multiplexed socket after the control master is actually ready.
This commit is contained in:
Andras Bacsai committed 2026-05-22 18:22:22 +02:00
1 parent 5c67766f41
commit a13fb3cf00
2 files changed
+27 -14

No files matched your search

+4 -4
View File
@@ -71,8 +71,8 @@ it('adds native openssh multiplexing options to ssh commands', function () {
->toContain("-o ControlPath=/var/www/html/storage/app/ssh/mux/mux_{$server->uuid}")
->toContain("/var/www/html/storage/app/ssh/mux/mux_{$server->uuid}.lock")
->toContain('-o ControlPersist=3600')
->not->toContain('ssh -fN')
->not->toContain('-O check');
->toContain('-O check')
->not->toContain('ssh -fN');
Process::assertNothingRan();
});
@@ -105,8 +105,8 @@ it('adds native openssh multiplexing options to scp commands', function () {
->toContain("-o ControlPath=/var/www/html/storage/app/ssh/mux/mux_{$server->uuid}")
->toContain("/var/www/html/storage/app/ssh/mux/mux_{$server->uuid}.lock")
->toContain('-o ControlPersist=3600')
->not->toContain('ssh -fN')
->not->toContain('-O check');
->toContain('-O check')
->not->toContain('ssh -fN');
Process::assertNothingRan();
});