[PATCH 2/3] tests/vm/freebsd: Reload the sshd configuration

Ilya Leoshkevich posted 3 patches 10 months ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Thomas Huth <thuth@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, "Alex Bennée" <alex.bennee@linaro.org>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>, Ed Maste <emaste@freebsd.org>, Li-Wen Hsu <lwhsu@freebsd.org>, Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>
There is a newer version of this series
[PATCH 2/3] tests/vm/freebsd: Reload the sshd configuration
Posted by Ilya Leoshkevich 10 months ago
After console_sshd_config(), the SSH server needs to be nudged to pick
up the new configs. The scripts for the other BSD flavors already do
this with a reboot, but a simple reload is sufficient.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
 tests/vm/freebsd | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/vm/freebsd b/tests/vm/freebsd
index b581bd17fb7..9971bc1f2b2 100755
--- a/tests/vm/freebsd
+++ b/tests/vm/freebsd
@@ -108,6 +108,8 @@ class FreeBSDVM(basevm.BaseVM):
         prompt = "root@freebsd:~ #"
         self.console_ssh_init(prompt, "root", self._config["root_pass"])
         self.console_sshd_config(prompt)
+        self.console_wait(prompt)
+        self.console_send("service sshd reload\n")
 
         # setup virtio-blk #1 (tarfile)
         self.console_wait(prompt)
-- 
2.43.0
Re: [PATCH 2/3] tests/vm/freebsd: Reload the sshd configuration
Posted by Thomas Huth 10 months ago
On 25/01/2024 20.48, Ilya Leoshkevich wrote:
> After console_sshd_config(), the SSH server needs to be nudged to pick
> up the new configs. The scripts for the other BSD flavors already do
> this with a reboot, but a simple reload is sufficient.
> 
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> ---
>   tests/vm/freebsd | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/tests/vm/freebsd b/tests/vm/freebsd
> index b581bd17fb7..9971bc1f2b2 100755
> --- a/tests/vm/freebsd
> +++ b/tests/vm/freebsd
> @@ -108,6 +108,8 @@ class FreeBSDVM(basevm.BaseVM):
>           prompt = "root@freebsd:~ #"
>           self.console_ssh_init(prompt, "root", self._config["root_pass"])
>           self.console_sshd_config(prompt)
> +        self.console_wait(prompt)
> +        self.console_send("service sshd reload\n")

Could be simplified to:

	self.console_wait_send(prompt, "service sshd reload\n")

  Thomas