c2f1e0
From 5384368467e20c3243223ed46b997954c0d9eea0 Mon Sep 17 00:00:00 2001
c2f1e0
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Nykr=C3=BDn?= <lnykryn@redhat.com>
c2f1e0
Date: Wed, 9 Jun 2021 14:12:25 +0200
c2f1e0
Subject: [PATCH] Merge pull request #6 from redhat-plumbers/centos-stream-job
c2f1e0
c2f1e0
ci: add a CentOS 8 Stream job
c2f1e0
---
c2f1e0
 .github/workflows/container.yml           |  1 +
c2f1e0
 .github/workflows/integration.yml         | 41 ++++++++++++++++++++
c2f1e0
 test/container/Dockerfile-CentOS-8-Stream | 63 +++++++++++++++++++++++++++++++
c2f1e0
 3 files changed, 105 insertions(+)
c2f1e0
c2f1e0
diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml
c2f1e0
index 32bb7f16..a8b3f9b8 100644
c2f1e0
--- a/.github/workflows/container.yml
c2f1e0
+++ b/.github/workflows/container.yml
c2f1e0
@@ -33,6 +33,7 @@ jobs:
c2f1e0
                     - { dockerfile: 'Dockerfile-Fedora-rawhide',    tag: 'fedora:rawhide' }
c2f1e0
                     - { dockerfile: 'Dockerfile-OpenSuse-latest',   tag: 'opensuse:latest' }
c2f1e0
                     - { dockerfile: 'Dockerfile-Arch',              tag: 'arch:latest' }
c2f1e0
+                    - { dockerfile: 'Dockerfile-CentOS-8-Stream',   tag: 'centos:stream8' }
c2f1e0
         steps:
c2f1e0
             -   name: Check out the repo
c2f1e0
                 uses: actions/checkout@v2
c2f1e0
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
c2f1e0
index 18582364..9ea718f1 100644
c2f1e0
--- a/.github/workflows/integration.yml
c2f1e0
+++ b/.github/workflows/integration.yml
c2f1e0
@@ -79,3 +79,44 @@ jobs:
c2f1e0
 
c2f1e0
             -   name: "${{ matrix.container }} TEST-${{ matrix.test }}"
c2f1e0
                 run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
c2f1e0
+    centos-8-stream:
c2f1e0
+        runs-on: ubuntu-latest
c2f1e0
+        timeout-minutes: 45
c2f1e0
+        concurrency:
c2f1e0
+            group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }}
c2f1e0
+            cancel-in-progress: true
c2f1e0
+        strategy:
c2f1e0
+            matrix:
c2f1e0
+                container: [
c2f1e0
+                        "centos:stream8",
c2f1e0
+                ]
c2f1e0
+                # Disabled tests (due to dropped packages in RHEL/CentOS):
c2f1e0
+                # 03, 04, 15: requires btrfs
c2f1e0
+                # 14: requires dmraid
c2f1e0
+                # 30, 31, 35, 36: requires scsi-target-utils
c2f1e0
+                test: [
c2f1e0
+                        "01",
c2f1e0
+                        "02",
c2f1e0
+                        "10",
c2f1e0
+                        "11",
c2f1e0
+                        "12",
c2f1e0
+                        "13",
c2f1e0
+                        "17",
c2f1e0
+                        "20",
c2f1e0
+                        "21",
c2f1e0
+                        "40",
c2f1e0
+                        "41",
c2f1e0
+                        "98",
c2f1e0
+                ]
c2f1e0
+            fail-fast: false
c2f1e0
+        container:
c2f1e0
+            image: ghcr.io/${{ github.repository_owner }}/${{ matrix.container }}
c2f1e0
+            options: "--privileged -v /dev:/dev"
c2f1e0
+        steps:
c2f1e0
+            -   name: "Checkout Repository"
c2f1e0
+                uses: actions/checkout@v2
c2f1e0
+                with:
c2f1e0
+                    fetch-depth: 0
c2f1e0
+
c2f1e0
+            -   name: "${{ matrix.container }} TEST-${{ matrix.test }}"
c2f1e0
+                run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
c2f1e0
diff --git a/test/container/Dockerfile-CentOS-8-Stream b/test/container/Dockerfile-CentOS-8-Stream
c2f1e0
new file mode 100644
c2f1e0
index 00000000..b14cc64a
c2f1e0
--- /dev/null
c2f1e0
+++ b/test/container/Dockerfile-CentOS-8-Stream
c2f1e0
@@ -0,0 +1,63 @@
c2f1e0
+FROM quay.io/centos/centos:stream8
c2f1e0
+
c2f1e0
+MAINTAINER https://github.com/dracutdevs/dracut
c2f1e0
+
c2f1e0
+ENV container docker
c2f1e0
+LABEL RUN="docker run -it --name NAME --privileged --ipc=host --net=host --pid=host -e NAME=NAME -e IMAGE=IMAGE IMAGE"
c2f1e0
+
c2f1e0
+RUN echo 'export DRACUT_NO_XATTR=1 KVERSION=$(cd /lib/modules; ls -1 | tail -1)' > /etc/profile.d/dracut-test.sh
c2f1e0
+
c2f1e0
+# FIXME: the mirrors were desynchronized at the time of writing, leading to several
c2f1e0
+#        conflicts when installing dependencies below
c2f1e0
+RUN sed -i -e 's/^mirrorlist=/#mirrorlist=/g' -e 's/^#baseurl=/baseurl=/g' /etc/yum.repos.d/*.repo
c2f1e0
+
c2f1e0
+# Install needed packages for the dracut CI container
c2f1e0
+RUN dnf -y install epel-release && \
c2f1e0
+    `# FIXME: this is required to work around a bug in e2fsprogs, remove when CentOS 8.5 is out` && \
c2f1e0
+    dnf -y install dnf-plugins-core && \
c2f1e0
+    dnf -y copr enable mrc0mmand/systemd-centos-ci-centos8 && \
c2f1e0
+    dnf -y install e2fsprogs && \
c2f1e0
+    `# End of FIXME` && \
c2f1e0
+    dnf -y install --enablerepo powertools --enablerepo epel --setopt=install_weak_deps=False \
c2f1e0
+    qemu-kvm \
c2f1e0
+    NetworkManager \
c2f1e0
+    asciidoc \
c2f1e0
+    bash-completion \
c2f1e0
+    bzip2 \
c2f1e0
+    cryptsetup \
c2f1e0
+    dash \
c2f1e0
+    dbus-daemon \
c2f1e0
+    dhcp-client \
c2f1e0
+    dhcp-server \
c2f1e0
+    e2fsprogs \
c2f1e0
+    gcc \
c2f1e0
+    git \
c2f1e0
+    iproute \
c2f1e0
+    iputils \
c2f1e0
+    iscsi-initiator-utils \
c2f1e0
+    kbd \
c2f1e0
+    kernel \
c2f1e0
+    kmod-devel \
c2f1e0
+    lvm2 \
c2f1e0
+    make \
c2f1e0
+    mdadm \
c2f1e0
+    nfs-utils \
c2f1e0
+    pigz \
c2f1e0
+    python3-imgcreate \
c2f1e0
+    rpm-build \
c2f1e0
+    strace \
c2f1e0
+    sudo \
c2f1e0
+    tar \
c2f1e0
+    tcpdump \
c2f1e0
+    wget \
c2f1e0
+    which \
c2f1e0
+    xz \
c2f1e0
+    && dnf -y update && dnf clean all
c2f1e0
+
c2f1e0
+# CentOS 8 ships only qemu-kvm, but it disables the KVM accel when it's not
c2f1e0
+# available
c2f1e0
+RUN ln -sv /usr/libexec/qemu-kvm /usr/bin/qemu-kvm && \
c2f1e0
+    ln -sv /usr/libexec/qemu-kvm /usr/bin/qemu-system-$(uname -m)
c2f1e0
+
c2f1e0
+# Set default command
c2f1e0
+CMD ["/usr/bin/bash"]
c2f1e0