From 808b9e850491c7b1d867a5f1f4d5ee6f61f345d4 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 28 Mar 2022 14:03:45 +0200 Subject: services: openssh: Start as an inetd service. * gnu/services/ssh.scm (openssh-shepherd-service): Use 'make-inetd-constructor' when it is defined. ()[max-connections]: New field. * gnu/tests/ssh.scm (run-ssh-test)["sshd PID"]: Adjust to cope with PID-FILE being #f. * gnu/tests/ssh.scm (%test-openssh): Pass #f as the 'pid-file' argument. * doc/guix.texi (Networking Services): Document 'max-connections'. --- gnu/tests/ssh.scm | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'gnu/tests') diff --git a/gnu/tests/ssh.scm b/gnu/tests/ssh.scm index 791ff7b73f..e3dd601603 100644 --- a/gnu/tests/ssh.scm +++ b/gnu/tests/ssh.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès +;;; Copyright © 2016-2022 Ludovic Courtès ;;; Copyright © 2017, 2018 Clément Lassieur ;;; Copyright © 2017 Marius Bakke ;;; @@ -120,19 +120,21 @@ root with an empty password." marionette)) ;; Check sshd's PID file. - (test-equal "sshd PID" - (wait-for-file #$pid-file marionette) - (marionette-eval - '(begin - (use-modules (gnu services herd) - (srfi srfi-1)) - - (live-service-running - (find (lambda (live) - (memq 'ssh-daemon - (live-service-provision live))) - (current-services)))) - marionette)) + (test-assert "sshd PID" + (let ((pid (marionette-eval + '(begin + (use-modules (gnu services herd) + (srfi srfi-1)) + + (live-service-running + (find (lambda (live) + (memq 'ssh-daemon + (live-service-provision live))) + (current-services)))) + marionette))) + (if #$pid-file + (= pid (wait-for-file #$pid-file marionette)) + pid))) (test-assert "wait for port 22" (wait-for-tcp-port 22 marionette)) @@ -222,7 +224,7 @@ root with an empty password." (openssh-configuration (permit-root-login #t) (allow-empty-passwords? #t))) - "/var/run/sshd.pid" + #f ;inetd-style, no PID file #:sftp? #t)))) (define %test-dropbear -- cgit 1.4.1