diff --git a/image-trigger b/image-trigger index e94637b0d5..7fa71019b9 100755 --- a/image-trigger +++ b/image-trigger @@ -41,6 +41,8 @@ REFRESH = { "fedora-38": {}, "fedora-39": {}, "fedora-coreos": {}, + "fedora-eln": {}, + "fedora-eln-boot": {}, "fedora-rawhide": {}, "fedora-rawhide-boot": {}, "fedora-rawhide-anaconda-payload": {"refresh-days": 30}, diff --git a/images/fedora-eln b/images/fedora-eln new file mode 120000 index 0000000000..2e5fb74e8a --- /dev/null +++ b/images/fedora-eln @@ -0,0 +1 @@ +fedora-eln-3ee26c7c51f51f7fe7560705791335598051faac78cfbc2328685890ce073b59.qcow2 \ No newline at end of file diff --git a/images/fedora-eln-boot b/images/fedora-eln-boot new file mode 120000 index 0000000000..7e28a7512a --- /dev/null +++ b/images/fedora-eln-boot @@ -0,0 +1 @@ +fedora-eln-boot-499cdb2e4d565dcc293626eea1ea20ba987460dc629c32b54d68970cb7a99547.iso \ No newline at end of file diff --git a/images/scripts/fedora-eln-boot.bootstrap b/images/scripts/fedora-eln-boot.bootstrap new file mode 100755 index 0000000000..1252bd5fe6 --- /dev/null +++ b/images/scripts/fedora-eln-boot.bootstrap @@ -0,0 +1,29 @@ +#!/bin/bash +# +# Copyright (C) 2023 Red Hat Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA. + +set -eux + +OUTPUT="$1" + +# Read the boot.iso file name from the MD5SUM file +URL=https://odcs.fedoraproject.org/composes/production/latest-Fedora-ELN/compose/BaseOS/x86_64/iso/ +ISO=$(curl -L -s $URL | grep -o '"Fedora-ELN.*boot.iso"' | tr -d '"') +[ -n "$ISO" ] + +curl -L "$URL$ISO" -o "$OUTPUT" diff --git a/images/scripts/fedora-eln.bootstrap b/images/scripts/fedora-eln.bootstrap new file mode 100755 index 0000000000..3c181c6fb4 --- /dev/null +++ b/images/scripts/fedora-eln.bootstrap @@ -0,0 +1,26 @@ +#!/bin/bash +# +# Copyright (C) 2023 Red Hat Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA. + +set -eux + +URL='https://odcs.fedoraproject.org/composes/production/latest-Fedora-ELN/compose/BaseOS/x86_64/images' +IMAGE=$(curl -L -s "$URL" | grep -o 'Fedora-ELN-Guest-[^"]*qcow2' | tr -d '"' | tail -n1) +[ -n "$IMAGE" ] + +exec $(dirname $0)/lib/cloudimage.bootstrap "$1" "$URL/$IMAGE" diff --git a/images/scripts/fedora-eln.setup b/images/scripts/fedora-eln.setup new file mode 120000 index 0000000000..f78434e0cb --- /dev/null +++ b/images/scripts/fedora-eln.setup @@ -0,0 +1 @@ +fedora.setup \ No newline at end of file diff --git a/images/scripts/fedora.setup b/images/scripts/fedora.setup index eca213bb19..211bdfbae4 100755 --- a/images/scripts/fedora.setup +++ b/images/scripts/fedora.setup @@ -21,16 +21,7 @@ echo foobar | passwd --stdin root # them to not spontaneously change from one test run to the next when # the distribution repository is updated. # -COCKPIT_DEPS="\ -criu-libs \ -device-mapper-multipath \ -glibc-langpack-de \ -glibc-langpack-pt \ -glib-networking \ -grubby \ -json-glib \ -kexec-tools \ -libssh \ +COCKPIT_MACHINES_DEPS=" libvirt-daemon-config-network \ libvirt-daemon-driver-qemu \ libvirt-daemon-driver-network \ @@ -40,6 +31,31 @@ libvirt-daemon-driver-interface \ libvirt-daemon-driver-storage-disk \ libvirt-client \ libvirt-dbus \ +qemu-block-curl \ +qemu-audio-spice \ +qemu-char-spice \ +qemu-device-usb-host \ +qemu-device-usb-redirect \ +qemu-kvm-core \ +virt-install \ +" +COCKPIT_STORAGE_DEPS=" +device-mapper-multipath \ +udisks2 \ +udisks2-btrfs \ +udisks2-lvm2 \ +udisks2-iscsi \ +" + +COCKPIT_DEPS="\ +criu-libs \ +glibc-langpack-de \ +glibc-langpack-pt \ +glib-networking \ +grubby \ +json-glib \ +kexec-tools \ +libssh \ NetworkManager-team \ openssl \ PackageKit \ @@ -47,12 +63,6 @@ pcp \ pcp-libs \ python3-pip \ python3-tracer \ -qemu-block-curl \ -qemu-audio-spice \ -qemu-char-spice \ -qemu-device-usb-host \ -qemu-device-usb-redirect \ -qemu-kvm-core \ realmd \ selinux-policy-targeted \ setroubleshoot-server \ @@ -61,11 +71,6 @@ sscg \ system-logos \ subscription-manager \ tuned \ -virt-install \ -udisks2 \ -udisks2-btrfs \ -udisks2-lvm2 \ -udisks2-iscsi \ " # We also install the packages necessary to join a FreeIPA domain so @@ -161,8 +166,14 @@ fi # man-db cache update is a CPU/memory hog rpm -e --verbose man-db +# fedora-eln image is just used for building/fetching the anaconda-webui RPM dependencies +# no need to install all dependencies there +ALL_DEPS="$COCKPIT_DEPS" +if [ "fedora-eln" != "$IMAGE" ]; then + ALL_DEPS="$COCKPIT_MACHINES_DEPS $COCKPIT_STORAGE_DEPS $COCKPIT_DEPS $IPA_CLIENT_PACKAGES $TEST_PACKAGES $ABRT_PACKAGES" +fi dnf $DNF_OPTS -y upgrade -dnf $DNF_OPTS -y install $TEST_PACKAGES $COCKPIT_DEPS $IPA_CLIENT_PACKAGES $ABRT_PACKAGES +dnf $DNF_OPTS -y install $ALL_DEPS mkdir -p /var/lib/package-sets/clevis dnf $DNF_OPTS download --destdir=/var/lib/package-sets/clevis $PACKAGE_SET_CLEVIS @@ -190,22 +201,31 @@ fi # don't use a bootstrap chroot to save time and space; everything is offline, and we always just do exactly one build echo "config_opts['use_bootstrap'] = False" >>/etc/mock/site-defaults.cfg -su builder -c "/usr/bin/mock --no-bootstrap-chroot --verbose -i $(/var/lib/testvm/build-deps.sh "${ID} ${VERSION_ID}")" +su builder -c "/usr/bin/mock --no-bootstrap-chroot --verbose -i $(/var/lib/testvm/build-deps.sh "${ID} ${VERSION_ID} ${VARIANT_ID}")" # we need to ensure that mock's selinux-policy is older than the host: # disabling the updates repository will surely get us a very old version mkdir /tmp/selinux-policy-rpms selinux_pkgs="selinux-policy selinux-policy-devel selinux-policy-targeted" -dnf download --destdir /tmp/selinux-policy-rpms --repo=fedora $selinux_pkgs +if [ "${VARIANT_ID}" != "eln" ]; then + dnf download --destdir /tmp/selinux-policy-rpms --repo=fedora $selinux_pkgs +else + dnf download --destdir /tmp/selinux-policy-rpms $selinux_pkgs +fi su builder -c "/usr/bin/mock --install /tmp/selinux-policy-rpms/*.rpm" # host system gets the versions with fedora-updates enabled dnf install -y $selinux_pkgs -# for containers.install and cockpit's container/* tests -podman build --tag cockpit/base --build-arg VERSION=${VERSION_ID} /var/tmp/cockpit-base +# eln image fails on running podman with: +# error running container: did not get container start message from parent: EOF +# fedora-eln is not used in podman tests, so we can just skip this section +if [ "$VARIANT_ID" != "eln" ]; then + # for containers.install and cockpit's container/* tests + podman build --tag cockpit/base --build-arg VERSION=${VERSION_ID} /var/tmp/cockpit-base -# for c-podman tests -/var/lib/testvm/podman-images.setup + # for c-podman tests + /var/lib/testvm/podman-images.setup +fi ln -sf ../selinux/config /etc/sysconfig/selinux printf "SELINUX=enforcing\nSELINUXTYPE=targeted\n" > /etc/selinux/config diff --git a/images/scripts/lib/build-deps.sh b/images/scripts/lib/build-deps.sh index cf7551f39e..205193b4a7 100755 --- a/images/scripts/lib/build-deps.sh +++ b/images/scripts/lib/build-deps.sh @@ -10,6 +10,8 @@ set -o pipefail GET="curl --silent --show-error --fail" COCKPIT_GIT="https://raw.githubusercontent.com/cockpit-project/cockpit" OS_VER="$1" +# Remove variant information from OS_VER (e.g. fedora 40 eln -> fedora 40) +OS_VER_NO_VARIANT="$(echo $OS_VER | cut -d' ' -f 1,2)" # most images use cockpit.spec from main branch, but there's a RHEL 7 stable branch with a completely different layout case "$OS_VER" in @@ -23,7 +25,7 @@ case "$OS_VER" in ;; esac -echo "$spec" | rpmspec -D "$OS_VER" -D 'version 0' -D 'enable_old_bridge 0' --buildrequires --query /dev/stdin | sed 's/.*/"&"/' | tr '\n' ' ' +echo "$spec" | rpmspec -D "$OS_VER_NO_VARIANT" -D 'version 0' -D 'enable_old_bridge 0' --buildrequires --query /dev/stdin | sed 's/.*/"&"/' | tr '\n' ' ' # some extra build dependencies: # - libappstream-glib for validating appstream metadata in starter-kit and derivatives @@ -47,6 +49,7 @@ esac # pull nodejs-devel on Fedora for compliance with the guidelines on using nodejs modules: # https://docs.fedoraproject.org/en-US/packaging-guidelines/Node.js/#_buildrequires case "$OS_VER" in + fedora*eln) ;; fedora*) EXTRA_DEPS="$EXTRA_DEPS nodejs-devel" ;; *) ;; esac diff --git a/lib/testmap.py b/lib/testmap.py index 6a34505af9..a16cae20ca 100644 --- a/lib/testmap.py +++ b/lib/testmap.py @@ -217,6 +217,9 @@ def contexts(image, *scenarios: Iterable[str], repo: Optional[str] = None): 'main': [ 'fedora-rawhide-boot', ], + '_manual': [ + 'fedora-eln-boot', + ], }, }