diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-14 03:55:53 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-14 03:55:53 +0300 |
| commit | c77af1892ff121736ecb103b32d504d6f1b31805 (patch) | |
| tree | f3012dfa1720ddbb5c2e789c3544fe0915f9c426 /tests | |
| parent | 21c1f8cf856affb875b5ab4302225a63f4563bdd (diff) | |
fix: clean up idle ssh bridges and back off flapping connections (#4083)
* fix: clean up idle ssh bridges and back off flapping connections
* chore: keep ssh liveness smoke tooling local
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/client_mode.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/client_mode.rs b/tests/client_mode.rs index 8f326484..d3205e5a 100644 --- a/tests/client_mode.rs +++ b/tests/client_mode.rs @@ -889,9 +889,10 @@ fn federated_client_starts_without_local_and_survives_its_restart() { std::os::unix::fs::symlink(env!("CARGO_BIN_EXE_herdr"), bin.join("herdr")).unwrap(); let quote = |path: &std::path::Path| format!("'{}'", path.display().to_string().replace('\'', "'\\''")); + let ssh_commands = base.join("ssh-commands"); fs::write(bin.join("ssh"), format!( - "#!/bin/sh\nexport HOME={} XDG_CONFIG_HOME={} XDG_RUNTIME_DIR={} HERDR_SOCKET_PATH={}\nunset HERDR_CLIENT_SOCKET_PATH HERDR_SESSION\nfor arg do last=\"$arg\"; done\nexec /bin/sh -c \"$last\"\n", - quote(&base.join("home")), quote(&remote_config), quote(&remote_runtime), quote(&remote_api), + "#!/bin/sh\nexport HOME={} XDG_CONFIG_HOME={} XDG_RUNTIME_DIR={} HERDR_SOCKET_PATH={}\nunset HERDR_CLIENT_SOCKET_PATH HERDR_SESSION\nfor arg do last=\"$arg\"; done\nprintf '%s\\n' \"$last\" >> {}\nexec /bin/sh -c \"$last\"\n", + quote(&base.join("home")), quote(&remote_config), quote(&remote_runtime), quote(&remote_api), quote(&ssh_commands), )).unwrap(); fs::set_permissions(bin.join("ssh"), fs::Permissions::from_mode(0o700)).unwrap(); let path = format!( @@ -914,6 +915,12 @@ fn federated_client_starts_without_local_and_survives_its_restart() { "remote must be usable before Local exists: {}", read_output(&output) ); + assert!( + fs::read_to_string(&ssh_commands) + .unwrap() + .contains("remote-client-bridge --idle-timeout-v1"), + "saved machine discovery must opt into the advertised bridge idle timeout" + ); let mut local = spawn_server(&config_home, &runtime_dir, &api_socket, &client_socket); wait_for_socket(&api_socket, Duration::from_secs(10)); |
