From 0b298cb9f7212e68dd89da5c78d26ac8622ad611 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Thu, 23 Sep 2021 13:25:39 +0200 Subject: tests: install: Test an XFS root file system. * gnu/tests/install.scm (%xfs-root-os, %xfs-root-os-source) (%xfs-root-installation-script, %test-xfs-root-os): New variables. --- gnu/tests/install.scm | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) (limited to 'gnu/tests') diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index 130a4f76b0..98de4c8359 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -72,6 +72,7 @@ %test-btrfs-raid-root-os %test-jfs-root-os %test-f2fs-root-os + %test-xfs-root-os %test-lvm-separate-home-os %test-gui-installed-os @@ -1394,6 +1395,79 @@ build (current-guix) and then store a couple of full system images.") (command (qemu-command/writable-image image))) (run-basic-test %f2fs-root-os command "f2fs-root-os"))))) + +;;; +;;; XFS root file system. +;;; + +(define-os-with-source (%xfs-root-os %xfs-root-os-source) + ;; The OS we want to install. + (use-modules (gnu) (gnu tests) (srfi srfi-1)) + + (operating-system + (host-name "liberigilo") + (timezone "Europe/Paris") + (locale "en_US.UTF-8") + + (bootloader (bootloader-configuration + (bootloader grub-bootloader) + (targets (list "/dev/vdb")))) + (kernel-arguments '("console=ttyS0")) + (file-systems (cons (file-system + (device (file-system-label "my-root")) + (mount-point "/") + (type "xfs")) + %base-file-systems)) + (users (cons (user-account + (name "charlie") + (group "users") + (supplementary-groups '("wheel" "audio" "video"))) + %base-user-accounts)) + (services (cons (service marionette-service-type + (marionette-configuration + (imported-modules '((gnu services herd) + (guix combinators))))) + %base-services)))) + +(define %xfs-root-installation-script + ;; Shell script of a simple installation. + "\ +. /etc/profile +set -e -x +guix --version + +export GUIX_BUILD_OPTIONS=--no-grafts +ls -l /run/current-system/gc-roots +parted --script /dev/vdb mklabel gpt \\ + mkpart primary ext2 1M 3M \\ + mkpart primary ext2 3M 2G \\ + set 1 boot on \\ + set 1 bios_grub on +mkfs.xfs -L my-root -q /dev/vdb2 +mount /dev/vdb2 /mnt +herd start cow-store /mnt +mkdir /mnt/etc +cp /etc/target-config.scm /mnt/etc/config.scm +guix system build /mnt/etc/config.scm +guix system init /mnt/etc/config.scm /mnt --no-substitutes +sync +reboot\n") + +(define %test-xfs-root-os + (system-test + (name "xfs-root-os") + (description + "Test basic functionality of an OS installed like one would do by hand. +This test is expensive in terms of CPU and storage usage since we need to +build (current-guix) and then store a couple of full system images.") + (value + (mlet* %store-monad ((image (run-install %xfs-root-os + %xfs-root-os-source + #:script + %xfs-root-installation-script)) + (command (qemu-command/writable-image image))) + (run-basic-test %xfs-root-os command "xfs-root-os"))))) + ;;; ;;; Installation through the graphical interface. -- cgit v1.2.3 From 93f69b02a290e0c82a4d166d84e1cbe056e6cc18 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sun, 10 Oct 2021 13:54:07 +0200 Subject: gnu: ganeti: Update to 3.0.1. * gnu/packages/virtualization.scm (ganeti): Update to 3.0.1. [source](patches): Remove obsolete. * gnu/tests/ganeti.scm (%ganeti-os): Adjust network configuration so QEMU port forwarding can work. (run-ganeti-test): Remove unused port mapping. Adjust and enable previously failing test. * gnu/packages/patches/ganeti-deterministic-manual.patch, gnu/packages/patches/ganeti-drbd-compat.patch, gnu/packages/patches/ganeti-os-disk-size.patch: Delete files. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. --- gnu/local.mk | 3 - .../patches/ganeti-deterministic-manual.patch | 16 -- gnu/packages/patches/ganeti-drbd-compat.patch | 166 --------------------- gnu/packages/patches/ganeti-os-disk-size.patch | 17 --- gnu/packages/virtualization.scm | 9 +- gnu/tests/ganeti.scm | 33 ++-- 6 files changed, 19 insertions(+), 225 deletions(-) delete mode 100644 gnu/packages/patches/ganeti-deterministic-manual.patch delete mode 100644 gnu/packages/patches/ganeti-drbd-compat.patch delete mode 100644 gnu/packages/patches/ganeti-os-disk-size.patch (limited to 'gnu/tests') diff --git a/gnu/local.mk b/gnu/local.mk index 502f198c5e..068cdb6730 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1063,11 +1063,8 @@ dist_patch_DATA = \ %D%/packages/patches/fuse-overlapping-headers.patch \ %D%/packages/patches/fxdiv-system-libraries.patch \ %D%/packages/patches/gajim-honour-GAJIM_PLUGIN_PATH.patch \ - %D%/packages/patches/ganeti-deterministic-manual.patch \ %D%/packages/patches/ganeti-disable-version-symlinks.patch \ - %D%/packages/patches/ganeti-drbd-compat.patch \ %D%/packages/patches/ganeti-haskell-pythondir.patch \ - %D%/packages/patches/ganeti-os-disk-size.patch \ %D%/packages/patches/ganeti-preserve-PYTHONPATH.patch \ %D%/packages/patches/ganeti-shepherd-master-failover.patch \ %D%/packages/patches/ganeti-shepherd-support.patch \ diff --git a/gnu/packages/patches/ganeti-deterministic-manual.patch b/gnu/packages/patches/ganeti-deterministic-manual.patch deleted file mode 100644 index 2d90aa740e..0000000000 --- a/gnu/packages/patches/ganeti-deterministic-manual.patch +++ /dev/null @@ -1,16 +0,0 @@ -Sort the ecode list in the gnt-cluster manual for deterministic results. - -Submitted upstream: . - -diff --git a/lib/build/sphinx_ext.py b/lib/build/sphinx_ext.py ---- a/lib/build/sphinx_ext.py -+++ b/lib/build/sphinx_ext.py -@@ -108,7 +108,7 @@ CV_ECODES_DOC = "ecodes" - # pylint: disable=W0621 - CV_ECODES_DOC_LIST = [(name, doc) for (_, name, doc) in constants.CV_ALL_ECODES] - DOCUMENTED_CONSTANTS = { -- CV_ECODES_DOC: CV_ECODES_DOC_LIST, -+ CV_ECODES_DOC: sorted(CV_ECODES_DOC_LIST, key=lambda tup: tup[0]), - } - - diff --git a/gnu/packages/patches/ganeti-drbd-compat.patch b/gnu/packages/patches/ganeti-drbd-compat.patch deleted file mode 100644 index 32f46bc7ed..0000000000 --- a/gnu/packages/patches/ganeti-drbd-compat.patch +++ /dev/null @@ -1,166 +0,0 @@ -This patch adds support for newer versions of DRBD. - -Submitted upstream: . - -diff --git a/lib/storage/drbd.py b/lib/storage/drbd.py ---- a/lib/storage/drbd.py -+++ b/lib/storage/drbd.py -@@ -315,6 +315,13 @@ class DRBD8Dev(base.BlockDev): - """ - return self._show_info_cls.GetDevInfo(self._GetShowData(minor)) - -+ @staticmethod -+ def _NeedsLocalSyncerParams(): -+ # For DRBD >= 8.4, syncer init must be done after local, not in net. -+ info = DRBD8.GetProcInfo() -+ version = info.GetVersion() -+ return version["k_minor"] >= 4 -+ - def _MatchesLocal(self, info): - """Test if our local config matches with an existing device. - -@@ -397,6 +404,20 @@ class DRBD8Dev(base.BlockDev): - base.ThrowError("drbd%d: can't attach local disk: %s", - minor, result.output) - -+ def _WaitForMinorSyncParams(): -+ """Call _SetMinorSyncParams and raise RetryAgain on errors. -+ """ -+ if self._SetMinorSyncParams(minor, self.params): -+ raise utils.RetryAgain() -+ -+ if self._NeedsLocalSyncerParams(): -+ # Retry because disk config for DRBD resource may be still uninitialized. -+ try: -+ utils.Retry(_WaitForMinorSyncParams, 1.0, 5.0) -+ except utils.RetryTimeout as e: -+ base.ThrowError("drbd%d: can't set the synchronization parameters: %s" % -+ (minor, utils.CommaJoin(e.args[0]))) -+ - def _AssembleNet(self, minor, net_info, dual_pri=False, hmac=None, - secret=None): - """Configure the network part of the device. -@@ -432,21 +453,24 @@ class DRBD8Dev(base.BlockDev): - # sync speed only after setting up both sides can race with DRBD - # connecting, hence we set it here before telling DRBD anything - # about its peer. -- sync_errors = self._SetMinorSyncParams(minor, self.params) -- if sync_errors: -- base.ThrowError("drbd%d: can't set the synchronization parameters: %s" % -- (minor, utils.CommaJoin(sync_errors))) -+ -+ if not self._NeedsLocalSyncerParams(): -+ sync_errors = self._SetMinorSyncParams(minor, self.params) -+ if sync_errors: -+ base.ThrowError("drbd%d: can't set the synchronization parameters: %s" % -+ (minor, utils.CommaJoin(sync_errors))) - - family = self._GetNetFamily(minor, lhost, rhost) - -- cmd = self._cmd_gen.GenNetInitCmd(minor, family, lhost, lport, -+ cmds = self._cmd_gen.GenNetInitCmds(minor, family, lhost, lport, - rhost, rport, protocol, - dual_pri, hmac, secret, self.params) - -- result = utils.RunCmd(cmd) -- if result.failed: -- base.ThrowError("drbd%d: can't setup network: %s - %s", -- minor, result.fail_reason, result.output) -+ for cmd in cmds: -+ result = utils.RunCmd(cmd) -+ if result.failed: -+ base.ThrowError("drbd%d: can't setup network: %s - %s", -+ minor, result.fail_reason, result.output) - - def _CheckNetworkConfig(): - info = self._GetShowInfo(minor) -@@ -463,19 +487,20 @@ class DRBD8Dev(base.BlockDev): - base.ThrowError("drbd%d: timeout while configuring network", minor) - - # Once the assembly is over, try to set the synchronization parameters -- try: -- # The minor may not have been set yet, requiring us to set it at least -- # temporarily -- old_minor = self.minor -- self._SetFromMinor(minor) -- sync_errors = self.SetSyncParams(self.params) -- if sync_errors: -- base.ThrowError("drbd%d: can't set the synchronization parameters: %s" % -- (self.minor, utils.CommaJoin(sync_errors))) -- finally: -- # Undo the change, regardless of whether it will have to be done again -- # soon -- self._SetFromMinor(old_minor) -+ if not self._NeedsLocalSyncerParams(): -+ try: -+ # The minor may not have been set yet, requiring us to set it at least -+ # temporarily -+ old_minor = self.minor -+ self._SetFromMinor(minor) -+ sync_errors = self.SetSyncParams(self.params) -+ if sync_errors: -+ base.ThrowError("drbd%d: can't set the synchronization parameters: %s" % -+ (self.minor, utils.CommaJoin(sync_errors))) -+ finally: -+ # Undo the change, regardless of whether it will have to be done again -+ # soon -+ self._SetFromMinor(old_minor) - - @staticmethod - def _GetNetFamily(minor, lhost, rhost): -diff --git a/lib/storage/drbd_cmdgen.py b/lib/storage/drbd_cmdgen.py ---- a/lib/storage/drbd_cmdgen.py -+++ b/lib/storage/drbd_cmdgen.py -@@ -56,7 +56,7 @@ class BaseDRBDCmdGenerator(object): - def GenLocalInitCmds(self, minor, data_dev, meta_dev, size_mb, params): - raise NotImplementedError - -- def GenNetInitCmd(self, minor, family, lhost, lport, rhost, rport, protocol, -+ def GenNetInitCmds(self, minor, family, lhost, lport, rhost, rport, protocol, - dual_pri, hmac, secret, params): - raise NotImplementedError - -@@ -138,7 +138,7 @@ class DRBD83CmdGenerator(BaseDRBDCmdGenerator): - - return [args] - -- def GenNetInitCmd(self, minor, family, lhost, lport, rhost, rport, protocol, -+ def GenNetInitCmds(self, minor, family, lhost, lport, rhost, rport, protocol, - dual_pri, hmac, secret, params): - args = ["drbdsetup", self._DevPath(minor), "net", - "%s:%s:%s" % (family, lhost, lport), -@@ -155,7 +155,7 @@ class DRBD83CmdGenerator(BaseDRBDCmdGenerator): - if params[constants.LDP_NET_CUSTOM]: - args.extend(shlex.split(params[constants.LDP_NET_CUSTOM])) - -- return args -+ return [args] - - def GenSyncParamsCmd(self, minor, params): - args = ["drbdsetup", self._DevPath(minor), "syncer"] -@@ -345,8 +345,14 @@ class DRBD84CmdGenerator(BaseDRBDCmdGenerator): - - return cmds - -- def GenNetInitCmd(self, minor, family, lhost, lport, rhost, rport, protocol, -+ def GenNetInitCmds(self, minor, family, lhost, lport, rhost, rport, protocol, - dual_pri, hmac, secret, params): -+ cmds = [] -+ -+ cmds.append(["drbdsetup", "new-resource", self._GetResource(minor)]) -+ cmds.append(["drbdsetup", "new-minor", self._GetResource(minor), -+ str(minor), "0"]) -+ - args = ["drbdsetup", "connect", self._GetResource(minor), - "%s:%s:%s" % (family, lhost, lport), - "%s:%s:%s" % (family, rhost, rport), -@@ -362,7 +368,8 @@ class DRBD84CmdGenerator(BaseDRBDCmdGenerator): - if params[constants.LDP_NET_CUSTOM]: - args.extend(shlex.split(params[constants.LDP_NET_CUSTOM])) - -- return args -+ cmds.append(args) -+ return cmds - - def GenSyncParamsCmd(self, minor, params): - args = ["drbdsetup", "disk-options", minor] diff --git a/gnu/packages/patches/ganeti-os-disk-size.patch b/gnu/packages/patches/ganeti-os-disk-size.patch deleted file mode 100644 index 16b1d7615c..0000000000 --- a/gnu/packages/patches/ganeti-os-disk-size.patch +++ /dev/null @@ -1,17 +0,0 @@ -This exposes information about disk sizes to OS install scripts. instance-guix -uses this if available to determine the size of the VM image. - -Submitted upstream: -https://github.com/ganeti/ganeti/pull/1503 - -diff --git a/lib/backend.py b/lib/backend.py ---- a/lib/backend.py -+++ b/lib/backend.py -@@ -4305,6 +4305,7 @@ def OSEnvironment(instance, inst_os, debug=0): - uri = _CalculateDeviceURI(instance, disk, real_disk) - result["DISK_%d_ACCESS" % idx] = disk.mode - result["DISK_%d_UUID" % idx] = disk.uuid -+ result["DISK_%d_SIZE" % idx] = str(disk.size) - if real_disk.dev_path: - result["DISK_%d_PATH" % idx] = real_disk.dev_path - if uri: diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index 09f27461a9..65f611736d 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -14,7 +14,7 @@ ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2020, 2021 Brice Waegeneire ;;; Copyright © 2020 Mathieu Othacehe -;;; Copyright © 2020 Marius Bakke +;;; Copyright © 2020, 2021 Marius Bakke ;;; Copyright © 2020, 2021 Maxim Cournoyer ;;; Copyright © 2020 Brett Gilio ;;; Copyright © 2021 Leo Famulari @@ -513,20 +513,17 @@ firmware blobs. You can (name "ganeti") ;; Note: we use a pre-release for Python 3 compatibility as well as many ;; other fixes. - (version "3.0.0beta1-24-g024cc9fa2") + (version "3.0.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/ganeti/ganeti") (commit (string-append "v" version)))) (sha256 - (base32 "1ll34qd2mifni3bhg7cnir3xfnkafig8ch33qndqwrsby0y5ssia")) + (base32 "1i7gx0sdx9316fnldbv738s0ihym1370nhc1chk0biandkl8vvq0")) (file-name (git-file-name name version)) (patches (search-patches "ganeti-shepherd-support.patch" "ganeti-shepherd-master-failover.patch" - "ganeti-deterministic-manual.patch" - "ganeti-drbd-compat.patch" - "ganeti-os-disk-size.patch" "ganeti-haskell-pythondir.patch" "ganeti-disable-version-symlinks.patch" "ganeti-preserve-PYTHONPATH.patch")))) diff --git a/gnu/tests/ganeti.scm b/gnu/tests/ganeti.scm index b64a332dde..5ac2fd48dd 100644 --- a/gnu/tests/ganeti.scm +++ b/gnu/tests/ganeti.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2020 Marius Bakke . +;;; Copyright © 2020, 2021 Marius Bakke ;;; Copyright © 2020 Brice Waegeneire ;;; ;;; This file is part of GNU Guix. @@ -52,17 +52,17 @@ (hosts-file (plain-file "hosts" (format #f " 127.0.0.1 localhost ::1 localhost -10.0.2.2 gnt1.example.com gnt1 +10.0.2.15 gnt1.example.com gnt1 192.168.254.254 ganeti.example.com "))) (packages (append (list ganeti-instance-debootstrap ganeti-instance-guix) %base-packages)) (services - (append (list (static-networking-service "eth0" "10.0.2.2" + (append (list (static-networking-service "eth0" "10.0.2.15" #:netmask "255.255.255.0" - #:gateway "10.0.2.1" - #:name-servers '("10.0.2.1")) + #:gateway "10.0.2.2" + #:name-servers '("10.0.2.3")) (service openssh-service-type (openssh-configuration @@ -83,8 +83,7 @@ (master-netdev "eth0") (hvparams '()) (extra-packages '()) - (rapi-port 5080) - (noded-port 1811)) + (rapi-port 5080)) "Run tests in %GANETI-OS." (define os (marionette-operating-system @@ -96,7 +95,6 @@ (guix combinators)))) (define %forwarded-rapi-port 5080) - (define %forwarded-noded-port 1811) (define vm (virtual-machine @@ -104,14 +102,14 @@ ;; Some of the daemons are fairly memory-hungry. (memory-size 512) ;; Forward HTTP ports so we can access them from the "outside". - (port-forwardings `((,%forwarded-rapi-port . ,rapi-port) - (,%forwarded-noded-port . ,noded-port))))) + (port-forwardings `((,%forwarded-rapi-port . ,rapi-port))))) (define test (with-imported-modules '((gnu build marionette)) #~(begin (use-modules (srfi srfi-11) (srfi srfi-64) (web uri) (web client) (web response) + (ice-9 iconv) (gnu build marionette)) (define marionette @@ -213,18 +211,19 @@ "watcher" "continue")) marionette)) - ;; Try accessing the RAPI. This causes an expected failure: - ;; https://github.com/ganeti/ganeti/issues/1502 - ;; Run it anyway for easy testing of potential fixes. + ;; Try accessing the RAPI. (test-equal "http-get RAPI version" - '(200 "2") + '(200 "2\n") (let-values (((response text) (http-get #$(simple-format #f "http://localhost:~A/version" %forwarded-rapi-port) - #:decode-body? #t))) - (list (response-code response) text))) + #:decode-body? #f))) + (list (response-code response) + ;; The API response lacks a content-type, so + ;; (http-client) won't decode it for us. + (bytevector->string text "UTF-8")))) (test-equal "gnt-os list" "debootstrap+default\nguix+default\n" @@ -249,7 +248,7 @@ marionette)) (test-end) - (exit (= (test-runner-fail-count (test-runner-current)) 1))))) + (exit (= (test-runner-fail-count (test-runner-current)) 0))))) (gexp->derivation (string-append "ganeti-" hypervisor "-test") test)) -- cgit v1.2.3