From af9a26dec047caddf40da3139f2cb3c2891475e6 Mon Sep 17 00:00:00 2001 From: Jan Kurik Date: Tue, 26 Mar 2024 13:28:40 +0100 Subject: [PATCH] Gating configuration for c10s Setup of gating configuration for c10s/rhel-10 Modification of gating plan to select specific tests from Fedora Removal of redundant tests from the grafana-pcp repo --- tests/README | 2 - tests/Sanity/install-and-configure/main.fmf | 10 --- tests/Sanity/install-and-configure/runtest.sh | 47 ------------- tests/Sanity/licence-check/epel.repo | 30 --------- tests/Sanity/licence-check/main.fmf | 12 ---- tests/Sanity/licence-check/test.sh | 67 ------------------- tests/main.fmf | 3 - 7 files changed, 171 deletions(-) delete mode 100644 tests/README delete mode 100644 tests/Sanity/install-and-configure/main.fmf delete mode 100755 tests/Sanity/install-and-configure/runtest.sh delete mode 100644 tests/Sanity/licence-check/epel.repo delete mode 100644 tests/Sanity/licence-check/main.fmf delete mode 100755 tests/Sanity/licence-check/test.sh delete mode 100644 tests/main.fmf diff --git a/tests/README b/tests/README deleted file mode 100644 index 9ad59d4..0000000 --- a/tests/README +++ /dev/null @@ -1,2 +0,0 @@ -The test's Makefiles are not used in Fedora CI infrastructure. But are kept here -for backward compatibility with traditional beakerlib test harness in RHEL. diff --git a/tests/Sanity/install-and-configure/main.fmf b/tests/Sanity/install-and-configure/main.fmf deleted file mode 100644 index 01c4331..0000000 --- a/tests/Sanity/install-and-configure/main.fmf +++ /dev/null @@ -1,10 +0,0 @@ -summary: grafana-pcp testing as grafana datasource -test: ./runtest.sh -recommend: -- grafana -- curl -duration: 2h -tag: -- gating -extra-summary: /tools/grafana-pcp/Sanity/install-and-configure -extra-task: /tools/grafana-pcp/Sanity/install-and-configure diff --git a/tests/Sanity/install-and-configure/runtest.sh b/tests/Sanity/install-and-configure/runtest.sh deleted file mode 100755 index 28c9a1b..0000000 --- a/tests/Sanity/install-and-configure/runtest.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# runtest.sh of /tools/grafana-pcp/Sanity/install-and-configure -# Description: grafana testing via grafana testsuite -# Author: Jan Kuřík -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2019 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, see http://www.gnu.org/licenses/. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -# Include Beaker environment -. /usr/share/beakerlib/beakerlib.sh || exit 1 - -PACKAGE="grafana-pcp" - -rlJournalStart - rlPhaseStartTest "Check if $PACKAGE is installed" - rlAssertRpm $PACKAGE || \ - { rlFail "$PACKAGE is not installed"; rlDie "Giving up"; } - rlRun "grafana-cli plugins ls | grep performancecopilot-pcp-app" - rlPhaseEnd - - rlPhaseStartTest "Check if Grafana is aware of the $PACKAGE plugin" - rlServiceStart grafana-server - rlRun "curl -X GET -s http://admin:admin@localhost:3000//api/datasources |& \ - grep -q 'plugins/performancecopilot-pcp-app'" 0 - rlServiceRestore - rlPhaseEnd -rlJournalPrintText -rlJournalEnd diff --git a/tests/Sanity/licence-check/epel.repo b/tests/Sanity/licence-check/epel.repo deleted file mode 100644 index d52a962..0000000 --- a/tests/Sanity/licence-check/epel.repo +++ /dev/null @@ -1,30 +0,0 @@ -[epel] -name=Extra Packages for Enterprise Linux $releasever - $basearch -# It is much more secure to use the metalink, but if you wish to use a local mirror -# place its address here. -#baseurl=https://download.example/pub/epel/$releasever/Everything/$basearch/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir -enabled = 0 -gpgcheck=1 -countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever - -[epel-debuginfo] -name=Extra Packages for Enterprise Linux $releasever - $basearch - Debug -# It is much more secure to use the metalink, but if you wish to use a local mirror -# place its address here. -#baseurl=https://download.example/pub/epel/$releasever/Everything/$basearch/debug/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-$releasever&arch=$basearch&infra=$infra&content=$contentdir -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever -gpgcheck=1 - -[epel-source] -name=Extra Packages for Enterprise Linux $releasever - $basearch - Source -# It is much more secure to use the metalink, but if you wish to use a local mirror -# place its address here. -#baseurl=https://download.example/pub/epel/$releasever/Everything/source/tree/ -metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-$releasever&arch=$basearch&infra=$infra&content=$contentdir -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever -gpgcheck=1 diff --git a/tests/Sanity/licence-check/main.fmf b/tests/Sanity/licence-check/main.fmf deleted file mode 100644 index 889db7b..0000000 --- a/tests/Sanity/licence-check/main.fmf +++ /dev/null @@ -1,12 +0,0 @@ -summary: Chek for used licenses in packages -test: ./test.sh -link: - - relates: https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_1 - - relates: https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_2 -recommend: -- grafana-pcp -- rpm-build -- license-validate -duration: 15m -tag: - - gating diff --git a/tests/Sanity/licence-check/test.sh b/tests/Sanity/licence-check/test.sh deleted file mode 100755 index bf831e5..0000000 --- a/tests/Sanity/licence-check/test.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -. /usr/share/beakerlib/beakerlib.sh || exit 1 - -PACKAGE=grafana-pcp -TCWD="$(pwd)" - -rlJournalStart - rlPhaseStartSetup - rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory" - rlRun "pushd $tmp" - rlRun "set -o pipefail" - - # Ensure we have license tools available - EPELREPO= - if ! which license-fedora2spdx &>/dev/null; then - YUMPARAM= - if rlIsRHEL || rlIsCentOS; then - EPELREPO="/etc/yum.repos.d/$(basename ${tmp})" - rlRun "cp ${TCWD}/epel.repo ${EPELREPO}" - YUMPARAM="--enablerepo=epel" - else - rlDie "Can not find license-validate tool" - fi - rlRun "yum install -y ${YUMPARAM} license-validate" \ - || rlDie "Failed to install license-validate tool" - fi - - # Get list of rpms - rlFetchSrcForInstalled --quiet "${PACKAGE}" || \ - rlDie 'Can not get source package of ${PACKAGE} .... giving up...' - SOURCEPKG=$(rpm -q --qf '%{name}-%{version}-%{release}.src.rpm' ${PACKAGE}) - rlAssertExists "${tmp}/${SOURCEPKG}" - rlRun "rpm -D '_topdir ${tmp}' -i ${tmp}/${SOURCEPKG}" - rlRun "LICENSES=\"\$(rpm -q --qf '%{license}\n' --specfile ${tmp}/SPECS/${PACKAGE}.spec\ - | sed -e 's/ and /\\n/g' -e 's/^ *//' -e 's/ *$//')\"" - rlRun "TUPLE=\"\$(rpm -q --qf '%{name} %{license}\n' \ - --specfile ${tmp}/SPECS/${PACKAGE}.spec )\"" - rlPhaseEnd - -while read l; do - rlPhaseStart FAIL "License check of ${l}" - retcode= - rlRun -s "license-validate '${l}'" || retcode=Fail - #rlAssertNotGrep 'Warning: ' "${rlRun_LOG}" \ - # || { rlLogInfo "$(cat ${rlRun_LOG})"; retcode="warn"; } - #rlAssertEquals "Check if the package license is SPDX identifier" \ - # "${l}" "$(cat ${rlRun_LOG})" || retcode="fail" - - # Report affected packages - if [[ -n "${retcode}" ]]; then - rlLogInfo "The following packages needs to fix the ${l} license:" - #for p in $(awk "\$0~/${l}/{print \$1;}" <<< "${TUPLE}"); do - for p in $(grep "${l}" <<< "${TUPLE}" | cut -d ' ' -f 1); do - rlLogInfo " - ${p}" - done - fi - rlPhaseEnd -done < <(sort -u <<< "${LICENSES}") - - rlPhaseStartCleanup - rlRun "popd" - # rlRun "rm -r $tmp" 0 "Remove tmp directory" - rlRun "yum clean metadata" - [[ -n "${EPELREPO}" ]] && rlRun "rm -f ${EPELREPO}" - rlPhaseEnd -rlJournalEnd diff --git a/tests/main.fmf b/tests/main.fmf deleted file mode 100644 index e4ff873..0000000 --- a/tests/main.fmf +++ /dev/null @@ -1,3 +0,0 @@ -contact: Jan Kuřík -component: grafana-pcp -framework: beakerlib