From d00ee4f9f2b8da2730643d026d8204650ddaf8b3 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 22 Jun 2023 12:14:14 -0400 Subject: [PATCH 1/4] ci/test-container: Various fixes - Update hardcoded Ignition build, the previous one was likely GC'd. - Drop support for f37, we don't need it anymore - Clarify the variables - Read `/usr/lib/os-release` as it's preferred over `/etc` - Parse os-release in the shell-native way it was intended to be done --- ci/test-container.sh | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/ci/test-container.sh b/ci/test-container.sh index 0a5a0ba3e2..aa3e1fc286 100755 --- a/ci/test-container.sh +++ b/ci/test-container.sh @@ -74,33 +74,20 @@ if ! grep -qFe "not yet implemented" err.txt; then fi # Test overrides -versionid=$(grep -E '^VERSION_ID=' /etc/os-release) -versionid=${versionid:11} # trim off VERSION_ID= +versionid=$(. /usr/lib/os-release && echo $VERSION_ID) case $versionid in - 37) - url_suffix=2.14.0/3.fc37/x86_64/ignition-2.14.0-3.fc37.x86_64.rpm - # 2.14.0-4 - koji_url="https://koji.fedoraproject.org/koji/buildinfo?buildID=2013062" - koji_kernel_url="https://koji.fedoraproject.org/koji/buildinfo?buildID=2084352" - kver=6.0.7 - krev=301 - ;; 38) - url_suffix=2.15.0/2.fc38/x86_64/ignition-2.15.0-2.fc38.x86_64.rpm - # 2.15.0-3 - koji_url="https://koji.fedoraproject.org/koji/buildinfo?buildID=2158585" + koji_ignition_url="https://koji.fedoraproject.org/koji/buildinfo?buildID=2158585" + koji_ignition_direct=https://kojipkgs.fedoraproject.org//packages/ignition/2.15.0/3.fc38/$(arch)/ignition-2.15.0-3.fc38.$(arch).rpm koji_kernel_url="https://koji.fedoraproject.org/koji/buildinfo?buildID=2174317" kver=6.2.8 krev=300 ;; *) fatal "Unsupported Fedora version: $versionid";; esac -URL=https://kojipkgs.fedoraproject.org//packages/ignition/$url_suffix -# test replacement by URL -rpm-ostree override replace $URL rpm-ostree override remove ignition # test local RPM install -curl -Lo ignition.rpm $URL +curl -Lo ignition.rpm "${koji_ignition_direct}" rpm-ostree install ignition.rpm rpm -q ignition @@ -109,7 +96,7 @@ dnf -y uninstall kexec-tools if rpm -q kexec-tools; then fatal "failed to remove kexec-tools"; fi # test replacement by Koji URL -rpm-ostree override replace $koji_url |& tee out.txt +rpm-ostree override replace "${koji_ignition_url}" |& tee out.txt n_downloaded=$(grep Downloading out.txt | wc -l) if [[ $n_downloaded != 1 ]]; then fatal "Expected 1 'Downloading', but got $n_downloaded" From bdf244b2e28f7096ebcdcd57cc5d575aaebdefdb Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 30 Jun 2023 08:01:01 -0400 Subject: [PATCH 2/4] neuter tests --- .github/workflows/ci.yaml | 350 +++++++++++++++++++------------------- 1 file changed, 175 insertions(+), 175 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1cc87cd29d..c6b736d147 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,25 +18,25 @@ env: ACTION_LINTS_TOOLCHAIN: 1.60.0 jobs: - build: - name: "Build" - runs-on: ubuntu-latest - container: registry.ci.openshift.org/coreos/fcos-buildroot:testing-devel - steps: - - name: Checkout repository - uses: actions/checkout@v3 - # https://github.com/actions/checkout/issues/760 - - name: Mark git checkout as safe - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - - name: Codestyle - run: ./ci/codestyle.sh - - name: Build - run: ./ci/build.sh && make install DESTDIR=$(pwd)/install && tar -C install -czf install.tar . - - name: Upload binary - uses: actions/upload-artifact@v3 - with: - name: install.tar - path: install.tar + # build: + # name: "Build" + # runs-on: ubuntu-latest + # container: registry.ci.openshift.org/coreos/fcos-buildroot:testing-devel + # steps: + # - name: Checkout repository + # uses: actions/checkout@v3 + # # https://github.com/actions/checkout/issues/760 + # - name: Mark git checkout as safe + # run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + # - name: Codestyle + # run: ./ci/codestyle.sh + # - name: Build + # run: ./ci/build.sh && make install DESTDIR=$(pwd)/install && tar -C install -czf install.tar . + # - name: Upload binary + # uses: actions/upload-artifact@v3 + # with: + # name: install.tar + # path: install.tar build-tests: name: "Build Integration Test Data" runs-on: ubuntu-latest @@ -60,18 +60,18 @@ jobs: with: name: tests.tar path: tests.tar - cxx-verify: - name: "Verify CXX generation" - runs-on: ubuntu-latest - container: registry.ci.openshift.org/coreos/fcos-buildroot:testing-devel - steps: - - name: Checkout repository - uses: actions/checkout@v3 - # https://github.com/actions/checkout/issues/760 - - name: Mark git checkout as safe - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - - name: Codestyle - run: ./ci/verify-cxx.sh + # cxx-verify: + # name: "Verify CXX generation" + # runs-on: ubuntu-latest + # container: registry.ci.openshift.org/coreos/fcos-buildroot:testing-devel + # steps: + # - name: Checkout repository + # uses: actions/checkout@v3 + # # https://github.com/actions/checkout/issues/760 + # - name: Mark git checkout as safe + # run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + # - name: Codestyle + # run: ./ci/verify-cxx.sh # TODO: Enable this once we've switched closer to having `cargo build` # be the primary buildsystem entrypoint. Right now the problem is # in order to build the libdnf-sys dependency it relies on us having @@ -97,32 +97,32 @@ jobs: # run: cargo fmt -- --check -l # - name: cargo clippy (warnings) # run: cargo clippy -- -D warnings - build-clang: - name: "Build (clang)" - runs-on: ubuntu-latest - container: registry.ci.openshift.org/coreos/fcos-buildroot:testing-devel - steps: - - name: Checkout repository - uses: actions/checkout@v3 - # https://github.com/actions/checkout/issues/760 - - name: Mark git checkout as safe - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - - name: Build - run: ./ci/clang-build-check.sh + # build-clang: + # name: "Build (clang)" + # runs-on: ubuntu-latest + # container: registry.ci.openshift.org/coreos/fcos-buildroot:testing-devel + # steps: + # - name: Checkout repository + # uses: actions/checkout@v3 + # # https://github.com/actions/checkout/issues/760 + # - name: Mark git checkout as safe + # run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + # - name: Build + # run: ./ci/clang-build-check.sh integration: name: "Container Integration" - needs: [build, build-tests] + needs: [build-tests] runs-on: ubuntu-latest container: quay.io/fedora/fedora-coreos:testing-devel steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Download build - uses: actions/download-artifact@v3 - with: - name: install.tar - - name: Install - run: tar -C / -xzvf install.tar && rm -f install.tar + # - name: Download build + # uses: actions/download-artifact@v3 + # with: + # name: install.tar + # - name: Install + # run: tar -C / -xzvf install.tar && rm -f install.tar - name: Download tests uses: actions/download-artifact@v3 with: @@ -132,130 +132,130 @@ jobs: - name: Integration tests run: ./ci/test-container.sh # Try to keep this in sync with https://github.com/ostreedev/ostree-rs-ext/blob/1fc115a760eeada22599e0f57026f58b22efded4/.github/workflows/rust.yml#L163 - container-build: - name: "Container build" - needs: build - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: Checkout coreos-layering-examples - uses: actions/checkout@v3 - with: - repository: coreos/coreos-layering-examples - path: coreos-layering-examples - - name: Download - uses: actions/download-artifact@v3 - with: - name: install.tar - - name: Integration tests - run: ./ci/container-build-integration.sh - cargo-deny: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: EmbarkStudios/cargo-deny-action@v1 - with: - log-level: warn - command: check bans sources licenses - compose: - name: "Compose tests" - needs: build - runs-on: ubuntu-latest - container: - image: registry.ci.openshift.org/coreos/coreos-assembler:latest - options: "--user root --privileged -v /var/tmp:/var/tmp" - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: Install test dependencies - run: ./ci/install-test-deps.sh - - name: Download build - uses: actions/download-artifact@v3 - with: - name: install.tar - - name: Install - run: tar -C / -xzvf install.tar - - name: Integration tests - run: env TMPDIR=/var/tmp JOBS=3 ./tests/compose.sh - compose-image: - name: "compose-image tests" - needs: build - runs-on: ubuntu-latest - container: - image: registry.ci.openshift.org/coreos/coreos-assembler:latest - options: "--user root --privileged -v /var/tmp:/var/tmp" - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: Install test dependencies - run: ./ci/install-test-deps.sh - - name: Download build - uses: actions/download-artifact@v3 - with: - name: install.tar - - name: Install - run: tar -C / -xzvf install.tar - - name: Integration tests - run: env TMPDIR=/var/tmp JOBS=3 ./tests/compose-image.sh - container-encapsulate: - name: "Encapsulate tests" - needs: build - runs-on: ubuntu-latest - container: - image: registry.ci.openshift.org/coreos/coreos-assembler:latest - options: "--user root --privileged -v /var/tmp:/var/tmp" - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: Download build - uses: actions/download-artifact@v3 - with: - name: install.tar - - name: Install - run: tar -C / -xzvf install.tar - - name: Integration tests - run: env TMPDIR=/var/tmp ./tests/encapsulate.sh - build-c9s: - name: "Build (c9s)" - runs-on: ubuntu-latest - container: quay.io/centos/centos:stream9 - steps: - - name: Install git - run: yum -y install git - - name: Checkout repository - uses: actions/checkout@v3 - with: - submodules: true - # https://github.com/actions/checkout/issues/760 - - name: Mark git checkout as safe - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - - name: Run ridiculous RHEL -devel package workaround - run: ./ci/ridiculous-rhel-devel-workaround.sh - - name: Install dependencies - run: ./ci/installdeps.sh - - name: Build - run: ./ci/build.sh && make install DESTDIR=$(pwd)/install && tar -C install -czf install.tar . - - name: Upload binary - uses: actions/upload-artifact@v3 - with: - name: install-c9s.tar - path: install.tar - # Doc: https://github.com/redhat-plumbers-in-action/differential-shellcheck#usage - differential-shellcheck: - name: Differential ShellCheck - runs-on: ubuntu-latest + # container-build: + # name: "Container build" + # needs: build + # runs-on: ubuntu-latest + # steps: + # - name: Checkout repository + # uses: actions/checkout@v3 + # - name: Checkout coreos-layering-examples + # uses: actions/checkout@v3 + # with: + # repository: coreos/coreos-layering-examples + # path: coreos-layering-examples + # - name: Download + # uses: actions/download-artifact@v3 + # with: + # name: install.tar + # - name: Integration tests + # run: ./ci/container-build-integration.sh + # cargo-deny: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # - uses: EmbarkStudios/cargo-deny-action@v1 + # with: + # log-level: warn + # command: check bans sources licenses + # compose: + # name: "Compose tests" + # needs: build + # runs-on: ubuntu-latest + # container: + # image: registry.ci.openshift.org/coreos/coreos-assembler:latest + # options: "--user root --privileged -v /var/tmp:/var/tmp" + # steps: + # - name: Checkout repository + # uses: actions/checkout@v3 + # - name: Install test dependencies + # run: ./ci/install-test-deps.sh + # - name: Download build + # uses: actions/download-artifact@v3 + # with: + # name: install.tar + # - name: Install + # run: tar -C / -xzvf install.tar + # - name: Integration tests + # run: env TMPDIR=/var/tmp JOBS=3 ./tests/compose.sh + # compose-image: + # name: "compose-image tests" + # needs: build + # runs-on: ubuntu-latest + # container: + # image: registry.ci.openshift.org/coreos/coreos-assembler:latest + # options: "--user root --privileged -v /var/tmp:/var/tmp" + # steps: + # - name: Checkout repository + # uses: actions/checkout@v3 + # - name: Install test dependencies + # run: ./ci/install-test-deps.sh + # - name: Download build + # uses: actions/download-artifact@v3 + # with: + # name: install.tar + # - name: Install + # run: tar -C / -xzvf install.tar + # - name: Integration tests + # run: env TMPDIR=/var/tmp JOBS=3 ./tests/compose-image.sh + # container-encapsulate: + # name: "Encapsulate tests" + # needs: build + # runs-on: ubuntu-latest + # container: + # image: registry.ci.openshift.org/coreos/coreos-assembler:latest + # options: "--user root --privileged -v /var/tmp:/var/tmp" + # steps: + # - name: Checkout repository + # uses: actions/checkout@v3 + # - name: Download build + # uses: actions/download-artifact@v3 + # with: + # name: install.tar + # - name: Install + # run: tar -C / -xzvf install.tar + # - name: Integration tests + # run: env TMPDIR=/var/tmp ./tests/encapsulate.sh + # build-c9s: + # name: "Build (c9s)" + # runs-on: ubuntu-latest + # container: quay.io/centos/centos:stream9 + # steps: + # - name: Install git + # run: yum -y install git + # - name: Checkout repository + # uses: actions/checkout@v3 + # with: + # submodules: true + # # https://github.com/actions/checkout/issues/760 + # - name: Mark git checkout as safe + # run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + # - name: Run ridiculous RHEL -devel package workaround + # run: ./ci/ridiculous-rhel-devel-workaround.sh + # - name: Install dependencies + # run: ./ci/installdeps.sh + # - name: Build + # run: ./ci/build.sh && make install DESTDIR=$(pwd)/install && tar -C install -czf install.tar . + # - name: Upload binary + # uses: actions/upload-artifact@v3 + # with: + # name: install-c9s.tar + # path: install.tar + # # Doc: https://github.com/redhat-plumbers-in-action/differential-shellcheck#usage + # differential-shellcheck: + # name: Differential ShellCheck + # runs-on: ubuntu-latest - permissions: - security-events: write + # permissions: + # security-events: write - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Differential ShellCheck - uses: redhat-plumbers-in-action/differential-shellcheck@v4 - with: - severity: warning - token: ${{ secrets.GITHUB_TOKEN }} + # steps: + # - name: Checkout repository + # uses: actions/checkout@v3 + # with: + # fetch-depth: 0 + # - name: Differential ShellCheck + # uses: redhat-plumbers-in-action/differential-shellcheck@v4 + # with: + # severity: warning + # token: ${{ secrets.GITHUB_TOKEN }} From 2a4cdf3a22cabb1ca1c14f4f6a3cbd71eec65077 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 30 Jun 2023 11:44:41 -0400 Subject: [PATCH 3/4] hack in new rpm-ostree --- ci/test-container.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/test-container.sh b/ci/test-container.sh index aa3e1fc286..123ccb82cd 100755 --- a/ci/test-container.sh +++ b/ci/test-container.sh @@ -6,6 +6,8 @@ fatal() { exit 1 } +rpm -Uvh https://download.copr.fedorainfracloud.org/results/@CoreOS/continuous/fedora-38-x86_64/06105345-rpm-ostree/rpm-ostree-{libs-,}2023.5.4.g1701971d-1.fc38.x86_64.rpm + repodir=/usr/lib/coreos-assembler/tests/kola/rpm-ostree/destructive/data/rpm-repos/ cat >/etc/yum.repos.d/libtest.repo < Date: Sat, 1 Jul 2023 02:10:38 -0400 Subject: [PATCH 4/4] test strace --- ci/test-container.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ci/test-container.sh b/ci/test-container.sh index 123ccb82cd..2a2f157726 100755 --- a/ci/test-container.sh +++ b/ci/test-container.sh @@ -80,18 +80,17 @@ versionid=$(. /usr/lib/os-release && echo $VERSION_ID) case $versionid in 38) koji_ignition_url="https://koji.fedoraproject.org/koji/buildinfo?buildID=2158585" - koji_ignition_direct=https://kojipkgs.fedoraproject.org//packages/ignition/2.15.0/3.fc38/$(arch)/ignition-2.15.0-3.fc38.$(arch).rpm + koji_strace_direct="https://kojipkgs.fedoraproject.org//packages/strace/6.2/1.fc38/$(arch)/strace-6.2-1.fc38.$(arch).rpm" koji_kernel_url="https://koji.fedoraproject.org/koji/buildinfo?buildID=2174317" kver=6.2.8 krev=300 ;; *) fatal "Unsupported Fedora version: $versionid";; esac -rpm-ostree override remove ignition # test local RPM install -curl -Lo ignition.rpm "${koji_ignition_direct}" -rpm-ostree install ignition.rpm -rpm -q ignition +curl -Lo strace.rpm "${koji_strace_direct}" +rpm-ostree install strace.rpm +rpm -q strace # And verify it's uninstalled dnf -y uninstall kexec-tools