From 77ab1e2336aaec38b8b07a7770f947d5b9be2c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Tue, 2 Jul 2024 10:13:03 +0000 Subject: [PATCH] fix: tests: Ubuntu 24.04 adjustments --- tests/functional/tests.d/900-strict-checking.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/functional/tests.d/900-strict-checking.sh b/tests/functional/tests.d/900-strict-checking.sh index a8c4e4e68..4b2421801 100644 --- a/tests/functional/tests.d/900-strict-checking.sh +++ b/tests/functional/tests.d/900-strict-checking.sh @@ -29,8 +29,10 @@ testsuite_strict_checking() retvalshouldbe 255 contain "Permanently added" - # change the remote hostkeys - success change_host_keys $r0 "\"find /etc/ssh/ -type f -name 'ssh_host_*' -delete; ssh-keygen -A\"" + # change the remote hostkeys, also send HUP to force sshd to take the change into account (Ubuntu 24+ at least), + # don't check return value as we'll kill our own session with pkill, as a collateral damage. + # uname -s: under FreeBSD, this interrupts the tests otherwise. + run change_host_keys $r0 "\"find /etc/ssh/ -type f -name 'ssh_host_*' -delete; ssh-keygen -A; test \$(uname -s) = Linux && pkill -HUP sshd\"" # set bastion ssh_client config to StrictHostKeyChecking yes sshclientconfigchg 's=StrictHostKeyChecking.*=StrictHostKeyChecking\\\\x20yes=g'