mirror of
https://codeberg.org/guix/guix.git
synced 2026-01-25 03:55:08 -06:00
tests: Add Fedora foreign distribution test.
* gnu/tests/foreign.scm (qcow-image-with-marionette):
- Create .autorelabel file to make copied Guile work
on SELinux-enabled systems.
(resize-lvm-xfs-partition): New variable.
(run-foreign-install-test): Increase RAM for VM to 1024
as 512 is not sufficient to run Guix installation
on Fedora.
(fedora-qcow2): New variable.
(%test-fedora-install): New variable.
Change-Id: Ib247a174dfea8630d830763410391077516a8c16
Merges: #5007
This commit is contained in:
parent
c558339893
commit
59c9c36db9
1 changed files with 57 additions and 3 deletions
|
|
@ -42,7 +42,8 @@
|
||||||
#:use-module (srfi srfi-9)
|
#:use-module (srfi srfi-9)
|
||||||
#:export (%test-debian-install
|
#:export (%test-debian-install
|
||||||
%test-archlinux-install
|
%test-archlinux-install
|
||||||
%test-ubuntu-install))
|
%test-ubuntu-install
|
||||||
|
%test-fedora-install))
|
||||||
|
|
||||||
(define marionette-systemd-service
|
(define marionette-systemd-service
|
||||||
;; Definition of the marionette service for systemd.
|
;; Definition of the marionette service for systemd.
|
||||||
|
|
@ -73,7 +74,7 @@ marionette. This procedure will be called from within a VM and it should
|
||||||
resize the partition and file system, if appropriate."
|
resize the partition and file system, if appropriate."
|
||||||
(define vm
|
(define vm
|
||||||
(virtual-machine
|
(virtual-machine
|
||||||
(marionette-operating-system %simple-os)))
|
(marionette-operating-system %simple-os)))
|
||||||
|
|
||||||
(define build
|
(define build
|
||||||
(with-imported-modules (source-module-closure
|
(with-imported-modules (source-module-closure
|
||||||
|
|
@ -109,6 +110,9 @@ resize the partition and file system, if appropriate."
|
||||||
marionette))
|
marionette))
|
||||||
(error "failed to mount foreign distro image" #$device))
|
(error "failed to mount foreign distro image" #$device))
|
||||||
|
|
||||||
|
;; Make newly copied files relabeled for SELinux-enabled distributions
|
||||||
|
(marionette-eval '(system* "touch" "/mnt/.autorelabel") marionette)
|
||||||
|
|
||||||
(marionette-eval '(system* "ls" "-la" "/mnt")
|
(marionette-eval '(system* "ls" "-la" "/mnt")
|
||||||
marionette)
|
marionette)
|
||||||
(marionette-eval '(begin
|
(marionette-eval '(begin
|
||||||
|
|
@ -176,6 +180,35 @@ resize the partition and file system, if appropriate."
|
||||||
marionette))
|
marionette))
|
||||||
(error "failed to grow the file system"))))
|
(error "failed to grow the file system"))))
|
||||||
|
|
||||||
|
(define resize-lvm-xfs-partition
|
||||||
|
;; Gexp evaluating to a two-argument procedure, taking DEVICE and
|
||||||
|
;; MARIONETTE. It will grow the given device and its file system to 100 %
|
||||||
|
;; of the empty space on the image.
|
||||||
|
#~(lambda (device marionette)
|
||||||
|
|
||||||
|
(unless (zero? (marionette-eval `(begin
|
||||||
|
(system* #$(file-append lvm2 "/sbin/pvscan"))
|
||||||
|
(system* #$(file-append lvm2 "/sbin/vgscan"))
|
||||||
|
(system* #$(file-append lvm2 "/sbin/vgchange") "-a" "y")
|
||||||
|
(system* #$(file-append lvm2 "/sbin/lvscan"))
|
||||||
|
(system* #$(file-append lvm2 "/sbin/lvextend") "-l" "+100%FREE" ,device))
|
||||||
|
marionette))
|
||||||
|
`(error "failed to extend logical volume" ,device))
|
||||||
|
|
||||||
|
(unless (zero? (marionette-eval `(system* "mount" ,device "/mnt")
|
||||||
|
marionette))
|
||||||
|
`(error "failed to mount foreign distro image" ,device))
|
||||||
|
|
||||||
|
(unless (zero? (marionette-eval
|
||||||
|
`(system* #$(file-append xfsprogs "/sbin/xfs_growfs")
|
||||||
|
,device)
|
||||||
|
marionette))
|
||||||
|
(error "failed to grow the file system"))
|
||||||
|
|
||||||
|
(unless (zero? (marionette-eval '(system* "umount" "/mnt")
|
||||||
|
marionette))
|
||||||
|
(error "failed to unmount device"))))
|
||||||
|
|
||||||
(define (manifest-entry-without-grafts entry)
|
(define (manifest-entry-without-grafts entry)
|
||||||
"Return ENTRY with grafts disabled on its contents."
|
"Return ENTRY with grafts disabled on its contents."
|
||||||
(manifest-entry
|
(manifest-entry
|
||||||
|
|
@ -239,7 +272,7 @@ and file system, if appropriate."
|
||||||
(list (%store-prefix))
|
(list (%store-prefix))
|
||||||
#:image-format "qcow2"
|
#:image-format "qcow2"
|
||||||
#:rw-image? #t)
|
#:rw-image? #t)
|
||||||
"-m" "512"
|
"-m" "1024"
|
||||||
"-snapshot")))
|
"-snapshot")))
|
||||||
|
|
||||||
(test-runner-current (system-test-runner #$output))
|
(test-runner-current (system-test-runner #$output))
|
||||||
|
|
@ -466,3 +499,24 @@ script.")
|
||||||
ubuntu-uidmap-deb-file)
|
ubuntu-uidmap-deb-file)
|
||||||
#:resize-image "+1G"
|
#:resize-image "+1G"
|
||||||
#:resize-proc resize-ext4-partition))))
|
#:resize-proc resize-ext4-partition))))
|
||||||
|
(define fedora-qcow2
|
||||||
|
(origin
|
||||||
|
(uri "https://download.fedoraproject.org/pub/fedora/linux/releases/43/Server/x86_64/images/Fedora-Server-Guest-Generic-43-1.6.x86_64.qcow2")
|
||||||
|
(method url-fetch)
|
||||||
|
(sha256
|
||||||
|
(base32
|
||||||
|
"0j142kbrfcv9fwds4bw57dqhnjvpzd6d6m15ar3sgf1yw9dq0pac"))))
|
||||||
|
|
||||||
|
;; This test starts failing when derivations in repo for GNU Hello and its dependencies
|
||||||
|
;; differs from versions in current Guix package. The simple way to fix it is to update
|
||||||
|
;; Guix package version.
|
||||||
|
(define %test-fedora-install
|
||||||
|
(system-test
|
||||||
|
(name "fedora-install")
|
||||||
|
(description
|
||||||
|
"Test installation of Guix on Fedora Linux using the @file{guix-install.sh}
|
||||||
|
script.")
|
||||||
|
(value (run-foreign-install-test fedora-qcow2 name
|
||||||
|
#:device "/dev/systemVG/LVRoot"
|
||||||
|
#:resize-image "+1G"
|
||||||
|
#:resize-proc resize-lvm-xfs-partition))))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue