From b367cd7f59fa8fba40e2bebf4954360fcab68e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Mon, 11 Aug 2025 12:29:09 +0000 Subject: [PATCH] fix: tests: freebsd: proper reload of recent sshd --- tests/functional/tests.d/900-strict-checking.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functional/tests.d/900-strict-checking.sh b/tests/functional/tests.d/900-strict-checking.sh index 6ff3ed5..d9fce2c 100644 --- a/tests/functional/tests.d/900-strict-checking.sh +++ b/tests/functional/tests.d/900-strict-checking.sh @@ -24,8 +24,8 @@ testsuite_strict_checking() # 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\"" + # FreeBSD: -a includes our process tree, otherwise this shadows sshd. it'll kill our current session so don't check for a return code + run change_host_keys $r0 "\"find /etc/ssh/ -type f -name 'ssh_host_*' -delete; ssh-keygen -A; test -e /bin/freebsd-version && pkill -HUP -a -f sshd: || pkill -HUP sshd\"" # set bastion ssh_client config to StrictHostKeyChecking yes sshclientconfigchg 's=StrictHostKeyChecking.*=StrictHostKeyChecking\\\\x20yes=g'