diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index 4bd33179b0..da06074618 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -71,7 +71,7 @@ jobs: steps: - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - uses: systemd/mkosi@8cbde8a4ed20a078ad5c70fe38c0dd2294a68bb1 + - uses: systemd/mkosi@11b112094e659d50cdb25f67829857cfefb69e6d # Freeing up disk space with rm -rf can take multiple minutes. Since we don't need the extra free space # immediately, we remove the files in the background. However, we first move them to a different location diff --git a/mkosi.images/system/mkosi.conf b/mkosi.images/system/mkosi.conf index 90f302e44d..a65caf58d8 100644 --- a/mkosi.images/system/mkosi.conf +++ b/mkosi.images/system/mkosi.conf @@ -10,6 +10,7 @@ ExtraTrees= Packages= acl + attr bash-completion coreutils diffutils @@ -29,6 +30,7 @@ Packages= mtools nano nftables + nvme-cli openssl python3 qrencode diff --git a/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.conf b/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.conf index cf5d4f3103..3007510b0d 100644 --- a/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.conf +++ b/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.conf @@ -36,6 +36,7 @@ Packages= pkgconf polkit procps-ng + psmisc quota-tools sbsigntools shadow diff --git a/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.conf b/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.conf index ce80e5513f..7446da0914 100644 --- a/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.conf +++ b/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.conf @@ -58,6 +58,7 @@ Packages= passwd policykit-1 procps + psmisc quota sbsigntool tzdata diff --git a/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.conf b/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.conf index 5bcf7b8efd..d3801f419e 100644 --- a/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.conf +++ b/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.conf @@ -53,6 +53,7 @@ Packages= pam patterns-base-minimal_base procps4 + psmisc python3-pefile quota rpm-build diff --git a/test/integration-test-wrapper.py b/test/integration-test-wrapper.py index b89975d13d..eb7b5b3fc5 100755 --- a/test/integration-test-wrapper.py +++ b/test/integration-test-wrapper.py @@ -64,6 +64,7 @@ def main(): """ [Unit] SuccessAction=exit + SuccessActionExitStatus=123 FailureAction=exit """ ) @@ -87,7 +88,9 @@ def main(): f"systemd.extra-unit.emergency-exit.service={shlex.quote(EMERGENCY_EXIT_SERVICE)}", '--credential', f"systemd.unit-dropin.emergency.target={shlex.quote(EMERGENCY_EXIT_DROPIN)}", - '--kernel-command-line-extra=systemd.mask=serial-getty@.service', + '--kernel-command-line-extra=systemd.mask=serial-getty@.service systemd.show_status=no systemd.crash_shell=0 systemd.crash_reboot', + # Custom firmware variables allow bypassing the EFI auto-enrollment reboot so we only reboot on crash + '--qemu-firmware-variables=custom', ] if not sys.stderr.isatty() else [] @@ -103,12 +106,13 @@ def main(): ]), *args.mkosi_args, 'qemu', + *(['-no-reboot'] if not sys.stderr.isatty() else []) ] - try: - subprocess.run(cmd, check=True) - except subprocess.CalledProcessError as e: - if e.returncode != 77 and journal_file: + result = subprocess.run(cmd) + # Return code 123 is the expected success code + if result.returncode != (0 if sys.stderr.isatty() else 123): + if result.returncode != 77 and journal_file: cmd = [ 'journalctl', '--no-hostname', @@ -119,7 +123,7 @@ def main(): ] print("Test failed, relevant logs can be viewed with: \n\n" f"{shlex.join(str(a) for a in cmd)}\n", file=sys.stderr) - exit(e.returncode) + exit(result.returncode or 1) # Do not keep journal files for tests that don't fail. if journal_file: diff --git a/test/units/testsuite-15.sh b/test/units/testsuite-15.sh index 0266f6266f..204fa99219 100755 --- a/test/units/testsuite-15.sh +++ b/test/units/testsuite-15.sh @@ -8,6 +8,7 @@ set -o pipefail # shellcheck source=test/units/util.sh . "$(dirname "$0")"/util.sh +# Needed to write units to /usr/lib/systemd/system to test /etc and /run overrides. maybe_mount_usr_overlay trap 'maybe_umount_usr_overlay' EXIT diff --git a/test/units/testsuite-26.sh b/test/units/testsuite-26.sh index 2dd62a4f67..6734aee654 100755 --- a/test/units/testsuite-26.sh +++ b/test/units/testsuite-26.sh @@ -18,6 +18,7 @@ at_exit() { return 0 } +# Needed for /usr/lib/systemd/system/$UNIT_NAME to test overrides in /etc and /run maybe_mount_usr_overlay trap at_exit EXIT diff --git a/test/units/testsuite-60.sh b/test/units/testsuite-60.sh index 3d0723e7dc..c777de8526 100755 --- a/test/units/testsuite-60.sh +++ b/test/units/testsuite-60.sh @@ -6,6 +6,7 @@ set -o pipefail # shellcheck source=test/units/util.sh . "$(dirname "$0")"/util.sh +# Needed to create mount.mytmpfs helper maybe_mount_usr_overlay trap 'maybe_umount_usr_overlay' EXIT diff --git a/test/units/testsuite-73.sh b/test/units/testsuite-73.sh index 3e5b78879a..59f84f20ab 100755 --- a/test/units/testsuite-73.sh +++ b/test/units/testsuite-73.sh @@ -9,6 +9,7 @@ set -o pipefail # shellcheck source=test/units/util.sh . "$(dirname "$0")"/util.sh +# Needed to generate test locales in /usr/lib maybe_mount_usr_overlay trap 'maybe_umount_usr_overlay' EXIT