diff options
author | Ludovic Courtès <[email protected]> | 2025-03-10 00:21:26 +0100 |
---|---|---|
committer | Ludovic Courtès <[email protected]> | 2025-03-10 00:38:05 +0100 |
commit | d0510dcd824e1b3fda62a8841e792581d7b8de8d (patch) | |
tree | 0e486c0b0f7add9ae4dd7e68c16cb347d640a001 /gnu/tests | |
parent | ac2681310878ca841a91020f4211bff4369a8f72 (diff) |
gnu: Adjust tests for ‘shepherd-system-log-service-type’.
This is a followup to 8492a3c8962664db4bd0e7475f63be0ef59db87a.
* gnu/services/virtualization.scm (%minimal-vm-syslog-config): Remove.
(%system-log-message-destination): New variable.
(%virtual-build-machine-operating-system): Use it, and modify
‘shepherd-system-log-service-type’ instead of ‘syslog-service-type’.
* gnu/tests/base.scm (%avahi-os): Likewise.
* gnu/tests/install.scm (%syslog-conf): Remove.
(operating-system-with-console-syslog): Modify
‘shepherd-system-log-service-type’ instead of ‘syslog-service-type’.
* gnu/tests/nfs.scm (%nfs-os, run-nfs-full-test): Likewise.
* gnu/tests/reconfigure.scm (run-kexec-test): Likewise.
Change-Id: I142d34ad27594a538f5b75daf087e48c690171b8
Diffstat (limited to 'gnu/tests')
-rw-r--r-- | gnu/tests/base.scm | 14 | ||||
-rw-r--r-- | gnu/tests/install.scm | 35 | ||||
-rw-r--r-- | gnu/tests/nfs.scm | 31 | ||||
-rw-r--r-- | gnu/tests/reconfigure.scm | 15 |
4 files changed, 44 insertions, 51 deletions
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index d9e30e9b1d..223a27be1f 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -984,14 +984,12 @@ non-ASCII names from /tmp.") (inherit config) (debug-level 3) (log-file "/dev/console"))) - (syslog-service-type config - => - (syslog-configuration - (inherit config) - (config-file - (plain-file - "syslog.conf" - "*.* /dev/console\n"))))))))) + (shepherd-system-log-service-type + config + => + (system-log-configuration + (inherit config) + (message-destination #~(const '("/dev/console")))))))))) (define (run-nss-mdns-test) ;; Test resolution of '.local' names via libc. Start the marionette service diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index b799a6752e..a837637b18 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2016-2023 Ludovic Courtès <[email protected]> +;;; Copyright © 2016-2023, 2025 Ludovic Courtès <[email protected]> ;;; Copyright © 2017, 2019, 2021 Tobias Geerinckx-Rice <[email protected]> ;;; Copyright © 2020 Mathieu Othacehe <[email protected]> ;;; Copyright © 2020 Danny Milosavljevic <[email protected]> @@ -52,6 +52,7 @@ #:use-module (gnu packages xorg) #:use-module (gnu services desktop) #:use-module (gnu services networking) + #:use-module (gnu services shepherd) #:use-module (gnu services xorg) #:use-module (guix store) #:use-module (guix monads) @@ -1783,27 +1784,25 @@ build (current-guix) and then store a couple of full system images.") ;;; Installation through the graphical interface. ;;; -(define %syslog-conf - ;; Syslog configuration that dumps to /dev/console, so we can see the - ;; installer's messages during the test. - (computed-file "syslog.conf" - #~(begin - (copy-file #$%default-syslog.conf #$output) - (chmod #$output #o644) - (let ((port (open-file #$output "a"))) - (display "\n*.info /dev/console\n" port) - #t)))) - (define (operating-system-with-console-syslog os) "Return OS with a syslog service that writes to /dev/console." (operating-system (inherit os) - (services (modify-services (operating-system-user-services os) - (syslog-service-type config - => - (syslog-configuration - (inherit config) - (config-file %syslog-conf))))))) + (services + (modify-services (operating-system-user-services os) + (shepherd-system-log-service-type + config + => + (system-log-configuration + (inherit config) + (message-destination + #~(lambda (message) + (let ((destinations ((default-message-destination-procedure) + message))) + (if (<= (system-log-message-priority message) + (system-log-priority info)) + (cons "/dev/console" destinations) + destinations)))))))))) (define %root-password "foo") diff --git a/gnu/tests/nfs.scm b/gnu/tests/nfs.scm index 0d9972e0e9..c08f7186a2 100644 --- a/gnu/tests/nfs.scm +++ b/gnu/tests/nfs.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2016, 2017, 2020, 2021 Ludovic Courtès <[email protected]> +;;; Copyright © 2016-2017, 2020-2021, 2025 Ludovic Courtès <[email protected]> ;;; Copyright © 2016 John Darrington <[email protected]> ;;; Copyright © 2017 Mathieu Othacehe <[email protected]> ;;; Copyright © 2017 Tobias Geerinckx-Rice <[email protected]> @@ -33,6 +33,7 @@ #:use-module (gnu services base) #:use-module (gnu services nfs) #:use-module (gnu services networking) + #:use-module (gnu services shepherd) #:use-module (gnu packages admin) #:use-module (gnu packages onc-rpc) #:use-module (gnu packages nfs) @@ -170,14 +171,12 @@ (services ;; Enable debugging output. (modify-services (operating-system-user-services os) - (syslog-service-type config - => - (syslog-configuration - (inherit config) - (config-file - (plain-file - "syslog.conf" - "*.* /dev/console\n"))))))))) + (shepherd-system-log-service-type + config + => + (system-log-configuration + (inherit config) + (message-destination #~(const '("/dev/console")))))))))) (define (run-nfs-server-test) "Run a test of an OS running a service of NFS-SERVICE-TYPE." @@ -287,14 +286,12 @@ directories can be mounted.") "*(rw,insecure,no_subtree_check,\ crossmnt,fsid=root,no_root_squash,insecure,async)"))))) (modify-services (operating-system-user-services os) - (syslog-service-type config - => - (syslog-configuration - (inherit config) - (config-file - (plain-file - "syslog.conf" - "*.* /dev/console\n")))))))) + (shepherd-system-log-service-type + config + => + (system-log-configuration + (inherit config) + (message-destination #~(const '("/dev/console"))))))))) #:requirements '(nscd) #:imported-modules '((gnu services herd) (guix combinators))))) diff --git a/gnu/tests/reconfigure.scm b/gnu/tests/reconfigure.scm index a24a953e6e..77cbe16a9c 100644 --- a/gnu/tests/reconfigure.scm +++ b/gnu/tests/reconfigure.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2019 Jakob L. Kreuze <[email protected]> -;;; Copyright © 2024 Ludovic Courtès <[email protected]> +;;; Copyright © 2024-2025 Ludovic Courtès <[email protected]> ;;; ;;; This file is part of GNU Guix. ;;; @@ -190,13 +190,12 @@ Shepherd (PID 1) by unloading obsolete services and loading new services." (operating-system (inherit %simple-os) (services (modify-services %base-services - (syslog-service-type - config => (syslog-configuration - (inherit config) - (config-file - (plain-file - "syslog.conf" - "*.* /dev/console\n"))))))) + (shepherd-system-log-service-type + config + => + (system-log-configuration + (inherit config) + (message-destination #~(const '("/dev/console")))))))) #:imported-modules '((gnu services herd) (guix combinators)))) |