guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[shepherd] 05/05: maint: Add Guix System test to the manifest.


From: Ludovic Courtès
Subject: [shepherd] 05/05: maint: Add Guix System test to the manifest.
Date: Fri, 21 Apr 2023 16:59:19 -0400 (EDT)

civodul pushed a commit to branch master
in repository shepherd.

commit 834bccd2f1baa60078fbaffe23b41bbd6e5e82ce
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Apr 21 22:35:55 2023 +0200

    maint: Add Guix System test to the manifest.
    
    * build-aux/manifest.scm (operating-system-with-latest-shepherd): New
    procedure.
    (system-test/base): New variable.
    (system-test->manifest-entry): New procedure.
    (system-tests): New variable.
    <top level>: Concatenate SYSTEM-TESTS to the other manifests.
---
 build-aux/manifest.scm | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)

diff --git a/build-aux/manifest.scm b/build-aux/manifest.scm
index edb1077..22a240f 100644
--- a/build-aux/manifest.scm
+++ b/build-aux/manifest.scm
@@ -19,6 +19,13 @@
 (use-modules (guix)
              (guix profiles)
              (shepherd-package)
+             (gnu system)
+             ((gnu system vm)
+              #:select (virtual-machine
+                        virtualized-operating-system))
+             (gnu services shepherd)
+             (gnu tests)
+             (gnu tests base)
              (srfi srfi-1))
 
 (define* (package->manifest-entry* package system
@@ -57,4 +64,44 @@ TARGET."
           "aarch64-linux-gnu"
           "riscv64-linux-gnu"))))
 
-(concatenate-manifests (list native-builds cross-builds))
+(define (operating-system-with-latest-shepherd os)
+  "Return @var{os}, running with the current Shepherd."
+  (operating-system
+    (inherit os)
+    (essential-services
+     (modify-services (operating-system-default-essential-services
+                       this-operating-system)
+       (shepherd-root-service-type
+        config => (shepherd-configuration
+                   (shepherd shepherd)))))))
+
+(define system-test/base
+  ;; "Base" system test running against the latest Shepherd.
+  (system-test
+   (name "system-test-base")
+   (description "Test Guix System with the latest Shepherd.")
+   (value
+    (let* ((os (marionette-operating-system
+                (operating-system-with-latest-shepherd %simple-os)
+                #:imported-modules '((gnu services herd)
+                                     (guix combinators))))
+           (vm (virtual-machine os)))
+      ;; XXX: Add call to 'virtualized-operating-system' to get the exact same
+      ;; set of services as the OS in VM.
+      (run-basic-test (virtualized-operating-system os '())
+                      #~(list #$vm)
+                      name)))))
+
+(define (system-test->manifest-entry test)
+  "Return a manifest entry for @var{test}, a system test."
+  (manifest-entry
+    (name (system-test-name test))
+    (version "0")
+    (item test)))
+
+(define system-tests
+  (manifest
+   (map system-test->manifest-entry
+        (list system-test/base))))
+
+(concatenate-manifests (list native-builds cross-builds system-tests))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]