From 892d9089a88abaa2ef1127f16308d03f4f08a4ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 31 Mar 2017 22:13:50 +0200 Subject: 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. --- gnu/tests.scm | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) (limited to 'gnu/tests.scm') diff --git a/gnu/tests.scm b/gnu/tests.scm index 8abe6c608b..e84d1ebb20 100644 --- a/gnu/tests.scm +++ b/gnu/tests.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2016 Ludovic Courtès +;;; Copyright © 2016, 2017 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,7 +21,11 @@ #:use-module (guix utils) #:use-module (guix records) #:use-module (gnu system) + #:use-module (gnu system grub) + #:use-module (gnu system file-systems) + #:use-module (gnu system shadow) #:use-module (gnu services) + #:use-module (gnu services base) #:use-module (gnu services shepherd) #:use-module ((gnu packages) #:select (scheme-modules)) #:use-module (srfi srfi-1) @@ -37,6 +41,8 @@ marionette-operating-system define-os-with-source + simple-operating-system + system-test system-test? system-test-name @@ -188,6 +194,41 @@ the system under test." (use-modules modules ...) (operating-system fields ...))))))) + +;;; +;;; Simple operating systems. +;;; + +(define %simple-os + (operating-system + (host-name "komputilo") + (timezone "Europe/Berlin") + (locale "en_US.UTF-8") + + (bootloader (grub-configuration (device "/dev/sdX"))) + (file-systems (cons (file-system + (device "my-root") + (title 'label) + (mount-point "/") + (type "ext4")) + %base-file-systems)) + (firmware '()) + + (users (cons (user-account + (name "alice") + (comment "Bob's sister") + (group "users") + (supplementary-groups '("wheel" "audio" "video")) + (home-directory "/home/alice")) + %base-user-accounts)))) + +(define-syntax-rule (simple-operating-system user-services ...) + "Return an operating system that includes USER-SERVICES in addition to +%BASE-SERVICES." + (operating-system (inherit %simple-os) + (services (cons* user-services ... %base-services)))) + + ;;; ;;; Tests. -- cgit v1.2.3