aboutsummaryrefslogtreecommitdiff
path: root/tests/system.scm
blob: 9416b950e6ab2bc9918eb163dd00f944ebeeb27e (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (test-system)
  #:use-module (gnu)
  #:use-module ((gnu services) #:select (service-value))
  #:use-module (guix store)
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-64))

;; Test the (gnu system) module.

(define %root-fs
  (file-system
    (device (file-system-label "my-root"))
    (mount-point "/")
    (type "ext4")))

(define %os
  (operating-system
    (host-name "komputilo")
    (timezone "Europe/Berlin")
    (locale "en_US.utf8")
    (bootloader (bootloader-configuration
                 (bootloader grub-bootloader)
                 (target "/dev/sdX")))
    (file-systems (cons %root-fs %base-file-systems))

    (users %base-user-accounts)))

(define %luks-device
  (mapped-device
   (source "/dev/foo") (target "my-luks-device")
   (type luks-device-mapping)))

(define %os-with-mapped-device
  (operating-system
    (host-name "komputilo")
    (timezone "Europe/Berlin")
    (locale "en_US.utf8")
    (bootloader (bootloader-configuration
                 (bootloader grub-bootloader)
                 (target "/dev/sdX")))
    (mapped-devices (list %luks-device))
    (file-systems (cons (file-system
                          (inherit %root-fs)
                          (dependencies (list %luks-device)))
                        %base-file-systems))
    (users %base-user-accounts)))


(test-begin "system")

(test-assert "operating-system-store-file-system"
  ;; %BASE-FILE-SYSTEMS defines a bind-mount for /gnu/store, but this
  ;; shouldn't be a problem.
  (eq? %root-fs
       (operating-system-store-file-system %os)))

(test-assert "operating-system-store-file-system, prefix"
  (let* ((gnu (file-system
                (device "foobar")
                (mount-point (dirname (%store-prefix)))
                (type "ext5")))
         (os  (operating-system
                (inherit %os)
                (file-systems (cons* gnu %root-fs
                                     %base-file-systems)))))
    (eq? gnu (operating-system-store-file-system os))))

(test-assert "operating-system-store-file-system, store"
  (let* ((gnu (file-system
                (device "foobar")
                (mount-point (%store-prefix))
                (type "ext5")))
         (os  (operating-system
                (inherit %os)
                (file-systems (cons* gnu %root-fs
                                     %base-file-systems)))))
    (eq? gnu (operating-system-store-file-system os))))

(test-equal "operating-system-user-mapped-devices"
  '()
  (operating-system-user-mapped-devices %os-with-mapped-device))

(test-equal "operating-system-boot-mapped-devices"
  (list %luks-device)
  (operating-system-boot-mapped-devices %os-with-mapped-device))

(test-equal "operating-system-boot-mapped-devices, implicit dependency"
  (list %luks-device)

  ;; Here we expect the implicit dependency between "/" and
  ;; "/dev/mapper/my-luks-device" to be found, in spite of the lack of a
  ;; 'dependencies' field in the root file system.
  (operating-system-boot-mapped-devices
   (operating-system
     (inherit %os-with-mapped-device)
     (file-systems (cons (file-system
                           (device "/dev/mapper/my-luks-device")
                           (mount-point "/")
                           (type "ext4"))
                         %base-file-systems)))))

(test-equal "non-boot-file-system-service"
  '()

  ;; Make sure that mapped devices with at least one needed-for-boot user are
  ;; handled exclusively from the initrd.  See <https://bugs.gnu.org/31889>.
  (append-map file-system-dependencies
              (service-value
               ((@@ (gnu system) non-boot-file-system-service)
                (operating-system
                  (inherit %os-with-mapped-device)
                  (file-systems
                   (list (file-system
                           (mount-point "/foo/bar")
                           (device "qux:baz")
                           (type "none")
                           (dependencies (list %luks-device)))
                         (file-system
                           (device (file-system-label "my-root"))
                           (mount-point "/")
                           (type "ext4")
                           (dependencies (list %luks-device))))))))))

(test-end)
0'>2020-05-07gnu: android-libutils: Fix build failure....* gnu/packages/android.scm (android-libutils)[arguments]: Add phase 'augment-CPLUS_INCLUDE_PATH'. [native-inputs]: Distinguish GCC-5. Marius Bakke 2020-03-04Merge branch 'master' into core-updatesMarius Bakke 2020-02-27gnu: git-repo: Really disable self update....* gnu/packages/android.scm (git-repo)[phases]{do-not-self-update}: Rename phase from 'do-not-clone-this-source. Rework the patching done to prevent repo from self updating. {set-executable-paths}: Do not patch the reference to GnuPG, as it is only necessary for the self update mechanism, which is disabled. [inputs]: Remove gnupg. Maxim Cournoyer 2020-02-27gnu: git-repo: Update to 2.4.1....* gnu/packages/android.scm (git-repo): Update to 2.4.1. Maxim Cournoyer 2020-02-24gnu: git-repo: Update to 2.3....* gnu/packages/android.scm (git-repo): Update to 2.3. [arguments]: Remove the #:python argument. git-repo v2.x is now compatible with Python 3. [phases]{configure-git}: New phase. {set-executable-paths}: Adapt the substitution rule for the GIT command. {check}: Use the "run_tests" script to launch tests. [native-inputs]: Replace python2-nose by python-test. Maxim Cournoyer 2020-01-15gnu: util-linux: Move libraries to separate output....Fixes <https://bugs.gnu.org/37732>. Reported by Diego Nicola Barbato <dnbarbato@posteo.de>. * gnu/packages/linux.scm (util-linux)[outputs]: Add "lib". [arguments]: Update #:configure-flags and the "move-static-libraries" phase accordingly. Add phases "patch-build-scripts" and "adjust-pkg-config-files". (e2fsprogs, psm, mtd-utils, f2fs-tools, f2fs-tools-1.7, eudev, xfsprogs)[inputs]: Change to the "lib" output of UTIL-LINUX. (btrfs-progs)[inputs]: Remove duplicate UTIL-LINUX inputs and change to use the "lib" output. * gnu/packages/admin.scm (pam-mount)[inputs]: Add UTIL-LINUX:LIB. (testdisk)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/android.scm (abootimg)[inputs]: Likewise. * gnu/packages/audio.scm (jack-1)[propagated-inputs]: Likewise. * gnu/packages/bootloaders.scm (syslinux, vboot-utils)[inputs]: Likewise. * gnu/packages/chez.scm (chez-scheme)[inputs]: Likewise. * gnu/packages/cryptsetup.scm (cryptsetup, cryptsetup-static)[inputs]: Likewise. * gnu/packages/databases.scm (postgresql, 4store)[inputs]: Likewise. * gnu/packages/disk.scm (ndctl, gptfdisk, fdisk, gparted, rmlint, volume-key)[inputs]: Likewise. (parted)[inputs]: Likewise. [native-inputs]: Add UTIL-LINUX. * gnu/packages/efi.scm (sbsigntools)[inputs]: Add UTIL-LINUX:LIB. * gnu/packages/engineering.scm (lib3mf)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/enlightenment.scm (efl)[propagated-inputs]: Likewise. * gnu/packages/file-systems.scm (glusterfs, jfsutils, zfs)[inputs]: Likewise. * gnu/packages/firmware.scm (ovmf)[inputs]: Likewise. * gnu/packages/fontutils.scm (fontconfig)[propagated-inputs]: Likewise. * gnu/packages/freedesktop.scm (localed)[inputs]: Likewise. * gnu/packages/glib.scm (glib, appstream-glib)[propagated-inputs]: Likewise. * gnu/packages/gnome.scm (tracker, gnome-terminal)[inputs]: Likewise. * gnu/packages/jupyter.scm (xeus)[inputs]: Likewise. * gnu/packages/kde.scm (kpmcore)[inputs]: Likewise. * gnu/packages/kodi.scm (crossguid)[inputs]: Likewise. * gnu/packages/lighting.scm (ola)[inputs]: Likewise. * gnu/packages/music.scm (libgig)[inputs]: Likewise. * gnu/packages/nfs.scm (nfs-utils)[inputs]: Likewise. * gnu/packages/opencog.scm (opencog)[inputs]: Likewise. * gnu/packages/package-management.scm (msitools)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/password-utils.scm (pwsafe)[inputs]: Likewise. * gnu/packages/telephony.scm (pjproject)[propagated-inputs]: Likewise. * gnu/packages/rdf.scm (rasqal)[inputs]: Likewise. * gnu/packages/search.scm (xapian)[inputs]: Likewise. * gnu/packages/sssd.scm (sssd)[native-inputs]: Likewise. * gnu/packages/storage.scm (ceph)[inputs]: Add UTIL-LINUX:LIB. * gnu/packages/task-management.scm (taskwarrior)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/virtualization.scm (libvirt, xen)[inputs]: Likewise. * gnu/packages/xorg.scm (libsm)[inputs]: Likewise. Marius Bakke 2019-12-02gnu: android-libselinux: Avoid top-level references to 'libsellinux'....* gnu/packages/android.scm (android-libselinux)[synopsis] [description, license]: Remove references to 'libsellinux'. Ludovic Courtès 2019-11-03gnu: android-udev-rules: Use GIT-FILE-NAME....* gnu/packages/android.scm (android-udev-rules)[source]: Use GIT-FILE-NAME. Tobias Geerinckx-Rice 2019-11-03gnu: android-udev-rules: Update to 20191103....* gnu/packages/android.scm (android-udev-rules): Update to 20191103. Tobias Geerinckx-Rice 2019-10-20gnu: Remove more GCC < 7 workarounds....* gnu/packages/abiword.scm (abiword)[arguments]: Do not pass "-std=c++11" to the GCC command line. * gnu/packages/aidc.scm (zbar)[arguments]: Likewise. * gnu/packages/android.scm (android-libbase, android-libcutils, android-libziparchive, fastboot)[arguments]: Likewise. * gnu/packages/audio.scm (azr3, guitarix, suil)[arguments]: Likewise. * gnu/packages/bioinformatics.scm (bless)[arguments]: Likewise. * gnu/packages/bittorrent.scm (libtorrent-rasterbar)[arguments]: Likewise. * gnu/packages/code.scm (rtags)[arguments]: Likewise. * gnu/packages/coq.scm (coq-gappa)[arguments]: Likewise. * gnu/packages/emulators.scm (dolphin-emu)[arguments]: Likewise. * gnu/packages/engineering.scm (xyce-serial, xyce-parallel)[arguments]: Likewise. * gnu/packages/gnupg.scm (pinentry-qt)[arguments]: Likewise. * gnu/packages/gobby.scm (libnet6, obby)[arguments]: Likewise. * gnu/packages/graph.scm (python-faiss)[arguments]: Likewise. * gnu/packages/graphics.scm (povray)[arguments]: Likewise. * gnu/packages/image-processing.scm (opencv, itk-snap)[arguments]: Likewise. * gnu/packages/image.scm (freeimage)[arguments]: Likewise. * gnu/packages/kodi.scm (crossguid)[arguments]: Likewise. * gnu/packages/music.scm (amsynth, qmidiarp, qmidiroute, seq24)[arguments]: Likewise. * gnu/packages/pdf.scm (python-poppler-qt5)[arguments]: Likewise. * gnu/packages/sagemath.scm (lcalc)[arguments]: Likewise. * gnu/packages/video.scm (vlc, mlt, v4l-utils)[arguments]: Likewise. Marius Bakke 2019-09-24Merge branch 'master' into core-updatesLudovic Courtès 2019-09-20gnu: enjarify: Adjust native-inputs....* gnu/packages/android (enjarify)[native-inputs]: Use openjdk instead of openjdk:jdk. Vagrant Cascadian 2019-09-19gnu: Add enjarify....* gnu/packages/android (enjarify): New variable. * gnu/packages/diffoscope (diffoscope)[native-inputs]: Add enjarify. [arguments]: add enjarify to add-known-tools phase. * gnu/packages/patches/enjarify-setup-py.patch: New file. * gnu/local.mk: Add enjarify-setup-py.patch. Vagrant Cascadian 2019-09-19gnu: android-libutils: Build with GCC 5....* gnu/packages/android.scm (android-libutils)[native-inputs]: Add gcc-5. Ricardo Wurmus 2019-06-27Merge branch 'master' into core-updatesLudovic Courtès 2019-06-25gnu: android-googletest: Downgrade to 1.8.0....This is a follow-up to commit 3b39f09fd99cd07543b904d11ea9b3463c38ecb7. * gnu/packages/android.scm (android-googletest): Downgrade to 1.8.0. [version]: Overwrite field. [source]: Likewise. Ricardo Wurmus 2019-06-15gnu: adb: Build against OpenSSL 1.0....* gnu/packages/android.scm (adb)[inputs]: Change OPENSSL to OPENSSL-1.0. Marius Bakke