diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2017-03-31 22:13:50 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2017-04-01 00:45:18 +0200 |
| commit | 892d9089a88abaa2ef1127f16308d03f4f08a4ce (patch) | |
| tree | f6ea39e959f3d40e38f741be75d7d160c15e446d /gnu/tests/ssh.scm | |
| parent | 9af7ecd9591b4eff41389291bbc586dcf09e2665 (diff) | |
tests: Introduce 'simple-operating-system' and use it.
* gnu/tests.scm (%simple-os): New macro.
(simple-operating-system): New macro.
* gnu/tests/base.scm (%simple-os): Define using 'simple-operating-system'.
(%mcron-os): Use 'simple-operating-system'.
* gnu/tests/mail.scm (%opensmtpd-os): Likewise.
* gnu/tests/messaging.scm (%base-os, os-with-service): Remove.
(run-xmpp-test): Use 'simple-operating-system'.
* gnu/tests/networking.scm (%inetd-os): Likewise.
* gnu/tests/ssh.scm (%base-os, os-with-service): Remove.
(run-ssh-test): Use 'simple-operating-system'.
* gnu/tests/web.scm (%nginx-os): Likewise.
Diffstat (limited to 'gnu/tests/ssh.scm')
| -rw-r--r-- | gnu/tests/ssh.scm | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/gnu/tests/ssh.scm b/gnu/tests/ssh.scm index c1582c47374..02931e982a0 100644 --- a/gnu/tests/ssh.scm +++ b/gnu/tests/ssh.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org> | 3 | ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org> |
| 4 | ;;; | 4 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| @@ -20,12 +20,8 @@ | |||
| 20 | (define-module (gnu tests ssh) | 20 | (define-module (gnu tests ssh) |
| 21 | #:use-module (gnu tests) | 21 | #:use-module (gnu tests) |
| 22 | #:use-module (gnu system) | 22 | #:use-module (gnu system) |
| 23 | #:use-module (gnu system grub) | ||
| 24 | #:use-module (gnu system file-systems) | ||
| 25 | #:use-module (gnu system shadow) | ||
| 26 | #:use-module (gnu system vm) | 23 | #:use-module (gnu system vm) |
| 27 | #:use-module (gnu services) | 24 | #:use-module (gnu services) |
| 28 | #:use-module (gnu services base) | ||
| 29 | #:use-module (gnu services ssh) | 25 | #:use-module (gnu services ssh) |
| 30 | #:use-module (gnu services networking) | 26 | #:use-module (gnu services networking) |
| 31 | #:use-module (gnu packages ssh) | 27 | #:use-module (gnu packages ssh) |
| @@ -35,26 +31,6 @@ | |||
| 35 | #:export (%test-openssh | 31 | #:export (%test-openssh |
| 36 | %test-dropbear)) | 32 | %test-dropbear)) |
| 37 | 33 | ||
| 38 | (define %base-os | ||
| 39 | (operating-system | ||
| 40 | (host-name "komputilo") | ||
| 41 | (timezone "Europe/Berlin") | ||
| 42 | (locale "en_US.UTF-8") | ||
| 43 | |||
| 44 | (bootloader (grub-configuration (device "/dev/sdX"))) | ||
| 45 | (file-systems %base-file-systems) | ||
| 46 | (firmware '()) | ||
| 47 | (users %base-user-accounts) | ||
| 48 | (services (cons (dhcp-client-service) | ||
| 49 | %base-services)))) | ||
| 50 | |||
| 51 | (define (os-with-service service) | ||
| 52 | "Return a test operating system that runs SERVICE." | ||
| 53 | (operating-system | ||
| 54 | (inherit %base-os) | ||
| 55 | (services (cons service | ||
| 56 | (operating-system-user-services %base-os))))) | ||
| 57 | |||
| 58 | (define* (run-ssh-test name ssh-service pid-file #:key (sftp? #f)) | 34 | (define* (run-ssh-test name ssh-service pid-file #:key (sftp? #f)) |
| 59 | "Run a test of an OS running SSH-SERVICE, which writes its PID to PID-FILE. | 35 | "Run a test of an OS running SSH-SERVICE, which writes its PID to PID-FILE. |
| 60 | SSH-SERVICE must be configured to listen on port 22 and to allow for root and | 36 | SSH-SERVICE must be configured to listen on port 22 and to allow for root and |
| @@ -62,7 +38,9 @@ empty-password logins. | |||
| 62 | 38 | ||
| 63 | When SFTP? is true, run an SFTP server test." | 39 | When SFTP? is true, run an SFTP server test." |
| 64 | (mlet* %store-monad ((os -> (marionette-operating-system | 40 | (mlet* %store-monad ((os -> (marionette-operating-system |
| 65 | (os-with-service ssh-service) | 41 | (simple-operating-system |
| 42 | (dhcp-client-service) | ||
| 43 | ssh-service) | ||
| 66 | #:imported-modules '((gnu services herd) | 44 | #:imported-modules '((gnu services herd) |
| 67 | (guix combinators)))) | 45 | (guix combinators)))) |
| 68 | (command (system-qemu-image/shared-store-script | 46 | (command (system-qemu-image/shared-store-script |
