From 557aa9f63534d7e389431de156c3f7f412214e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Prchl=C3=ADk?= Date: Wed, 30 Aug 2023 11:50:04 +0200 Subject: [PATCH] Add the first regression test Therefore adding a plan for it as well, and since it's a collection-only test, we need a bit more tweaks of `adjust` to play nicely with the rest of the coverage. --- plans/regression.fmf | 40 +++++++++++++++++++ .../main.fmf | 17 ++++++++ .../test.sh | 28 +++++++++++++ tests/lib.sh | 1 + tests/main.fmf | 40 ++++++++++++++++--- 5 files changed, 121 insertions(+), 5 deletions(-) create mode 100644 plans/regression.fmf create mode 100644 tests/binutils-gold-and-binutils-devel-rpms-provide-the-wrong-tags/main.fmf create mode 100755 tests/binutils-gold-and-binutils-devel-rpms-provide-the-wrong-tags/test.sh diff --git a/plans/regression.fmf b/plans/regression.fmf new file mode 100644 index 0000000..eba42ee --- /dev/null +++ b/plans/regression.fmf @@ -0,0 +1,40 @@ +# +# Regression tests for binutils +# + +summary: "Regression tests for binutils" + +discover: + - how: fmf + filter: "tag:-gate-build" + +# Adjust rules +adjust+: + - because: "Plan to be ran when executed locally, or executed by CI system to gate a build or PR." + when: >- + trigger is defined + and trigger != commit + and trigger != build + enabled: false + + - because: "On CentOS Stream 9, CRB repository must be enabled for various BuildRequires" + when: distro == centos-stream-9 + prepare+: + - how: shell + script: dnf config-manager --set-enabled crb + + - because: "On RHEL-9, CRB and buildroot repositories must be enabled for various BuildRequires" + when: distro == rhel-9 + prepare+: + - how: shell + script: + - dnf config-manager --set-enabled rhel-CRB + - dnf config-manager --set-enabled rhel-buildroot + + - because: "On RHEL-8, CRB and buildroot repositories must be enabled for various BuildRequires" + when: distro == rhel-8 + prepare+: + - how: shell + script: + - dnf config-manager --set-enabled rhel-CRB + - dnf config-manager --set-enabled rhel-buildroot diff --git a/tests/binutils-gold-and-binutils-devel-rpms-provide-the-wrong-tags/main.fmf b/tests/binutils-gold-and-binutils-devel-rpms-provide-the-wrong-tags/main.fmf new file mode 100644 index 0000000..fae1a71 --- /dev/null +++ b/tests/binutils-gold-and-binutils-devel-rpms-provide-the-wrong-tags/main.fmf @@ -0,0 +1,17 @@ +summary: The gcc-toolset binutils-gold RPM provides unprefixed names. +description: | + The gcc-toolset-*-binutils-gold RPM provides 'binutils-gold' instead of 'gcc-toolset-*-binutils-gold'. Likewise for + the gcc-toolset-*-binutils-devel rpm. +tag: + - collection-only +duration: 15m + +# Configurable fields +link+: + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2216456 + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2103056 + +# Adjust rules +adjust+: + - when: collection is not defined + enabled: false diff --git a/tests/binutils-gold-and-binutils-devel-rpms-provide-the-wrong-tags/test.sh b/tests/binutils-gold-and-binutils-devel-rpms-provide-the-wrong-tags/test.sh new file mode 100755 index 0000000..e101da8 --- /dev/null +++ b/tests/binutils-gold-and-binutils-devel-rpms-provide-the-wrong-tags/test.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +. "$TMT_TREE/tests/lib.sh" || exit 1 + +rlJournalStart + rlPhaseStartSetup + buTestHeader + + buEnterTmpDir + rlPhaseEnd + + rlPhaseStartTest + rlRun -s "rpm -q --provides ${COLLECTION_PACKAGES} | sort" + + rlRun "grep -E '^${PACKAGES} =' $rlRun_LOG" + rlRun "grep -E '^${PACKAGES}-static =' $rlRun_LOG" + rlRun "grep -E '^${PACKAGES}-devel =' $rlRun_LOG" + rlRun "grep -E '^${PACKAGES}-gold =' $rlRun_LOG" + rlRun "grep -E '^binutils' $rlRun_LOG" 1 + rlPhaseEnd + + rlPhaseStartCleanup + buExitTmpDir + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/lib.sh b/tests/lib.sh index 18b7748..ec345aa 100644 --- a/tests/lib.sh +++ b/tests/lib.sh @@ -13,6 +13,7 @@ function buTestHeader () { rlLogInfo "PACKAGES=$PACKAGES" rlLogInfo "REQUIRES=$REQUIRES" rlLogInfo "COLLECTIONS=$COLLECTIONS" + rlLogInfo "COLLECTION_PACKAGES=$COLLECTION_PACKAGES" rlLogInfo "LD=$_LD" rlLogInfo "GCC=$_GCC" diff --git a/tests/main.fmf b/tests/main.fmf index fb17bc2..7d238f2 100644 --- a/tests/main.fmf +++ b/tests/main.fmf @@ -5,6 +5,8 @@ framework: beakerlib test: "$WITH_SCL ./test.sh" component: binutils +link: [] + require+: - type: file pattern: @@ -16,6 +18,8 @@ adjust+: - when: distro == rhel-9 and collection is not defined require+: - binutils + - binutils-devel + - binutils-gold - gcc - gcc-c++ - annobin @@ -29,31 +33,35 @@ adjust+: - when: distro == rhel-9 and collection == gcc-toolset-13 require+: - gcc-toolset-13-binutils + - gcc-toolset-13-binutils-devel + - gcc-toolset-13-binutils-gold - gcc-toolset-13-gcc - gcc-toolset-13-gcc-c++ - gcc-toolset-13-gcc-plugin-annobin environment+: PACKAGES: gcc-toolset-13-binutils _REQUIRES: gcc-toolset-13-gcc gcc-toolset-13-gcc-c++ gcc-toolset-13-gcc-plugin-annobin glibc - # COLLECTIONS: gcc-toolset-13 WITH_SCL: scl enable gcc-toolset-13 BINUTILS_PACKAGE: gcc-toolset-13-binutils GCC_PACKAGE: gcc-toolset-13-gcc + COLLECTION_PACKAGES: gcc-toolset-13-binutils gcc-toolset-13-binutils-devel gcc-toolset-13-binutils-gold # RHEL-9 / gcc-toolset-12 - when: distro == rhel-9 and collection == gcc-toolset-12 require+: - gcc-toolset-12-binutils + - gcc-toolset-12-binutils-devel + - gcc-toolset-12-binutils-gold - gcc-toolset-12-gcc - gcc-toolset-12-gcc-c++ - gcc-toolset-12-gcc-plugin-annobin environment+: PACKAGES: gcc-toolset-12-binutils _REQUIRES: gcc-toolset-12-gcc gcc-toolset-12-gcc-c++ gcc-toolset-12-gcc-plugin-annobin glibc - # COLLECTIONS: gcc-toolset-12 WITH_SCL: scl enable gcc-toolset-12 BINUTILS_PACKAGE: gcc-toolset-12-binutils GCC_PACKAGE: gcc-toolset-12-gcc + COLLECTION_PACKAGES: gcc-toolset-12-binutils gcc-toolset-12-binutils-devel gcc-toolset-12-binutils-gold # RHEL-9 / gcc-toolset-11 @@ -71,19 +79,38 @@ adjust+: GCC_PACKAGE: gcc # RHEL-8 / gcc-toolset-13 - - when: distro == rhel-8 and collection == gcc-toolset-13 + - when: distro == rhel-8 and collection == gcc-toolset-13 and arch == x86_64,aarch64 require+: - gcc-toolset-13-binutils + - gcc-toolset-13-binutils-devel + - gcc-toolset-13-binutils-gold + - gcc-toolset-13-binutils-gprofng - gcc-toolset-13-gcc - gcc-toolset-13-gcc-c++ - gcc-toolset-13-gcc-plugin-annobin environment+: PACKAGES: gcc-toolset-13-binutils _REQUIRES: gcc-toolset-13-gcc gcc-toolset-13-gcc-c++ gcc-toolset-13-gcc-plugin-annobin glibc - # COLLECTIONS: gcc-toolset-13 WITH_SCL: scl enable gcc-toolset-13 BINUTILS_PACKAGE: gcc-toolset-13-binutils GCC_PACKAGE: gcc-toolset-13-gcc + COLLECTION_PACKAGES: gcc-toolset-13-binutils gcc-toolset-13-binutils-devel gcc-toolset-13-binutils-gold gcc-toolset-13-binutils-gprofng + + - when: distro == rhel-8 and collection == gcc-toolset-13 and arch != x86_64,aarch64 + require+: + - gcc-toolset-13-binutils + - gcc-toolset-13-binutils-devel + - gcc-toolset-13-binutils-gold + - gcc-toolset-13-gcc + - gcc-toolset-13-gcc-c++ + - gcc-toolset-13-gcc-plugin-annobin + environment+: + PACKAGES: gcc-toolset-13-binutils + _REQUIRES: gcc-toolset-13-gcc gcc-toolset-13-gcc-c++ gcc-toolset-13-gcc-plugin-annobin glibc + WITH_SCL: scl enable gcc-toolset-13 + BINUTILS_PACKAGE: gcc-toolset-13-binutils + GCC_PACKAGE: gcc-toolset-13-gcc + COLLECTION_PACKAGES: gcc-toolset-13-binutils gcc-toolset-13-binutils-devel gcc-toolset-13-binutils-gold # RHEL-8 / gcc-toolset-12 # RHEL-8 / gcc-toolset-11 @@ -91,15 +118,18 @@ adjust+: - when: distro == rhel-7 and collection == devtoolset-13 require+: - devtoolset-13-binutils + - devtoolset-13-binutils-devel + - devtoolset-13-binutils-gold + - devtoolset-13-binutils-gprofng - devtoolset-13-gcc - devtoolset-13-gcc-c++ environment+: PACKAGES: devtoolset-13-binutils _REQUIRES: devtoolset-13-gcc devtoolset-13-gcc-c++ glibc - # COLLECTIONS: devtoolset-13 WITH_SCL: scl enable devtoolset-13 BINUTILS_PACKAGE: devtoolset-13-binutils GCC_PACKAGE: devtoolset-13-gcc + COLLECTION_PACKAGES: devtoolset-13-binutils devtoolset-13-binutils-devel devtoolset-13-binutils-gold devtoolset-13-binutils-gprofng # RHEL-7 / no collection # RHEL-7 / devtoolset-13