summary refs log tree commit diff
path: root/gnu/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-05-22 20:12:27 +0200
committerLudovic Courtès <ludo@gnu.org>2022-05-22 21:56:40 +0200
commitd2b3400f79ffaed3357650307376ab69a7ec3b1b (patch)
tree1b531c135fea77d60de3df5408be1500d6a720c9 /gnu/tests
parent52aceda4fd61970db118f23d316784ea8df244e8 (diff)
downloadguix-d2b3400f79ffaed3357650307376ab69a7ec3b1b.tar.gz
services: openssh: Listen on both IPv4 and IPv6.
Fixes <https://issues.guix.gnu.org/55335>.
Reported by Christopher Baines <mail@cbaines.net>.

* gnu/services/ssh.scm (openssh-shepherd-service)[inetd-style?]: New variable.
<start>: Use it.  When using 'make-inetd-constructor', pass a list of
endpoints as is possible with the Shepherd 0.9.1.
<stop>: Adjust accordingly.
* gnu/tests/ssh.scm (run-ssh-test)["wait for port 22"]: Rename to...
["wait for port 22, IPv4"]: ... this.
["wait for port 22, IPv6"]: New test.
Diffstat (limited to 'gnu/tests')
-rw-r--r--gnu/tests/ssh.scm12
1 files changed, 11 insertions, 1 deletions
diff --git a/gnu/tests/ssh.scm b/gnu/tests/ssh.scm
index e3dd601603..3f550db5ea 100644
--- a/gnu/tests/ssh.scm
+++ b/gnu/tests/ssh.scm
@@ -136,9 +136,19 @@ root with an empty password."
                     (= pid (wait-for-file #$pid-file marionette))
                     pid)))
 
-            (test-assert "wait for port 22"
+            (test-assert "wait for port 22, IPv4"
               (wait-for-tcp-port 22 marionette))
 
+            (test-assert "wait for port 22, IPv6"
+              ;; Make sure it's also available as IPv6.
+              ;; See <https://issues.guix.gnu.org/55335>.
+              (wait-for-tcp-port 22 marionette
+                                 #:address
+                                 `(make-socket-address
+                                   AF_INET6
+                                   (inet-pton AF_INET6 "::1")
+                                   22)))
+
             ;; Connect to the guest over SSH.  Make sure we can run a shell
             ;; command there.
             (test-equal "shell command"