From 5f22a836f2c3330d9f2c3707167096e1e3ece31f Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sun, 6 Apr 2025 10:08:34 +0200 Subject: salsa-ci: add basic tests for debefivm-* --- .gitlab-ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to '.gitlab-ci.yml') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 09e8a5f..97fc9a0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,6 +35,22 @@ release_test: - apt-get --no-install-recommends --yes install curl e2fsprogs expect gpgv mmdebstrap openssh-client qemu-kvm dpkg-dev - PATH=$(pwd)/bin:$PATH ./tests/create-and-run.sh $(dpkg --print-architecture) "$RELEASE" +release_test_efi: + parallel: + matrix: + - RELEASE: + - sid + - trixie + - bookworm + UKIFY: + - systemd-ukify + - binutils-multiarch + script: + - apt-get update + - apt-get dist-upgrade --yes + - apt-get --no-install-recommends --yes install dosfstools dpkg-dev e2fsprogs expect fdisk mmdebstrap mount mtools openssh-client ovmf qemu-kvm systemd $UKIFY + - PATH=$(pwd)/bin:$PATH ./tests/efi-create-and-run.sh $(dpkg --print-architecture) "$RELEASE" + debci_test: script: - apt-get update @@ -61,3 +77,18 @@ arch_test: - apt-get --no-install-recommends --yes install curl e2fsprogs expect mmdebstrap openssh-client qemu-system arch-test qemu-user-static file systemd dpkg-dev debian-ports-archive-keyring - /lib/systemd/systemd-binfmt - PATH=$(pwd)/bin:$PATH ./tests/create-and-run.sh "$ARCHITECTURE" "$DEFAULT_SUITE" + +arch_test_efi: + parallel: + matrix: + - ARCHITECTURE: + - arm64 + - armhf + - riscv64 + script: + - test -e /proc/sys/fs/binfmt_misc/status || mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc + - apt-get update + - apt-get dist-upgrade --yes + - apt-get --no-install-recommends --yes install dosfstools dpkg-dev e2fsprogs expect fdisk mmdebstrap mount mtools openssh-client ovmf qemu-efi-aarch64 qemu-efi-arm qemu-efi-riscv64 qemu-system arch-test qemu-user-static systemd systemd-ukify + - /lib/systemd/systemd-binfmt + - PATH=$(pwd)/bin:$PATH ./tests/efi-create-and-run.sh "$ARCHITECTURE" "$DEFAULT_SUITE" -- cgit v1.2.3 From 4991b8e2a0456c1f96042fd7206983738b9a3946 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sun, 6 Apr 2025 17:33:06 +0200 Subject: salsa-ci: add a test case for the mmdebstrap-autopkgtest-build-qemu use case --- .gitlab-ci.yml | 7 +++++++ tests/autopkgtest-qemu-efi.sh | 46 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100755 tests/autopkgtest-qemu-efi.sh (limited to '.gitlab-ci.yml') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 97fc9a0..fd9b193 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -92,3 +92,10 @@ arch_test_efi: - apt-get --no-install-recommends --yes install dosfstools dpkg-dev e2fsprogs expect fdisk mmdebstrap mount mtools openssh-client ovmf qemu-efi-aarch64 qemu-efi-arm qemu-efi-riscv64 qemu-system arch-test qemu-user-static systemd systemd-ukify - /lib/systemd/systemd-binfmt - PATH=$(pwd)/bin:$PATH ./tests/efi-create-and-run.sh "$ARCHITECTURE" "$DEFAULT_SUITE" + +autopkgtest-qemu-efi: + script: + - apt-get update + - apt-get dist-upgrade --yes + - apt-get --no-install-recommends --yes install autopkgtest dosfstools e2fsprogs fdisk mmdebstrap mount mtools ovmf qemu-utils qemu-kvm systemd systemd-ukify + - PATH=$(pwd)/bin:$PATH ./tests/autopkgtest-qemu-efi.sh "$ARCHITECTURE" "$DEFAULT_SUITE" diff --git a/tests/autopkgtest-qemu-efi.sh b/tests/autopkgtest-qemu-efi.sh new file mode 100755 index 0000000..bc761d5 --- /dev/null +++ b/tests/autopkgtest-qemu-efi.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +set -eux + +IMAGE=test.img +RELEASE="${1:-}" + +cleanup() { + rm -f "$IMAGE" +} +trap cleanup EXIT +cleanup_abort() { + cleanup + echo aborted >&2 + exit 2 +} +trap cleanup_abort HUP INT TERM QUIT + +INSTALL_LOCATION=$(command -v debefivm-create) +if test "${INSTALL_LOCATION#/usr/}" = "$INSTALL_LOCATION"; then + USERADDHOOK="${INSTALL_LOCATION%/*}/../useraddhook" +else + USERADDHOOK=/usr/share/mmdebstrap/hooks/useradd +fi + +set -- -- +if test -z "$RELEASE"; then + # We no longer need usrmerge in trixie and later and it does not work + # with copy-host-apt-sources-and-preferences in the default order. + set -- \ + --skip=usrmerge \ + "$@" \ + --hook-dir=/usr/share/mmdebstrap/hooks/copy-host-apt-sources-and-preferences \ + --hook-dir=/usr/share/mmdebstrap/hooks/file-mirror-automount \ + "" +fi + +debefivm-create \ + -o "$IMAGE" \ + -r "$RELEASE" \ + "$@" \ + --include=linux-image-generic,libpam-systemd,passwd,python3 \ + --hook-dir="$USERADDHOOK" \ + --customize-hook=/usr/share/autopkgtest/setup-commands/setup-testbed + +autopkgtest hello -- qemu --boot=efi --show-boot "$IMAGE" -- cgit v1.2.3