From 1818ba3ad8a637bc175f26f23e19e3b9d05c97c9 Mon Sep 17 00:00:00 2001 From: Jan Kurik Date: Wed, 9 Aug 2023 11:26:34 +0200 Subject: [PATCH] Transfer of tests to tests/grafana repo --- plans/gating.fmf | 1 + .../Install-test-of-grafana-package/Makefile | 63 ----------------- .../Install-test-of-grafana-package/PURPOSE | 3 - .../Install-test-of-grafana-package/main.fmf | 16 ----- .../runtest.sh | 64 ------------------ tests/README | 2 - .../Makefile | 64 ------------------ .../PURPOSE | 5 -- .../main.fmf | 14 ---- .../runtest.sh | 48 ------------- tests/Sanity/licence-check/epel.repo | 30 --------- tests/Sanity/licence-check/main.fmf | 16 ----- tests/Sanity/licence-check/test.sh | 67 ------------------- tests/Sanity/verify-systemd-units/Makefile | 63 ----------------- tests/Sanity/verify-systemd-units/PURPOSE | 3 - tests/Sanity/verify-systemd-units/main.fmf | 13 ---- tests/Sanity/verify-systemd-units/runtest.sh | 59 ---------------- 17 files changed, 1 insertion(+), 530 deletions(-) delete mode 100644 tests/Install/Install-test-of-grafana-package/Makefile delete mode 100644 tests/Install/Install-test-of-grafana-package/PURPOSE delete mode 100644 tests/Install/Install-test-of-grafana-package/main.fmf delete mode 100755 tests/Install/Install-test-of-grafana-package/runtest.sh delete mode 100644 tests/README delete mode 100644 tests/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home/Makefile delete mode 100644 tests/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home/PURPOSE delete mode 100644 tests/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home/main.fmf delete mode 100755 tests/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home/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/Sanity/verify-systemd-units/Makefile delete mode 100644 tests/Sanity/verify-systemd-units/PURPOSE delete mode 100644 tests/Sanity/verify-systemd-units/main.fmf delete mode 100755 tests/Sanity/verify-systemd-units/runtest.sh diff --git a/plans/gating.fmf b/plans/gating.fmf index 5ed0c31..5b0d2a0 100644 --- a/plans/gating.fmf +++ b/plans/gating.fmf @@ -2,5 +2,6 @@ summary: CI Gating Plan discover: how: fmf filter: tag:gating + url: https://src.fedoraproject.org/tests/grafana execute: how: tmt diff --git a/tests/Install/Install-test-of-grafana-package/Makefile b/tests/Install/Install-test-of-grafana-package/Makefile deleted file mode 100644 index 6389ba6..0000000 --- a/tests/Install/Install-test-of-grafana-package/Makefile +++ /dev/null @@ -1,63 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Makefile of /tools/grafana/Install/Install-test-of-grafana-package -# Description: Installation of grafana package and a check if grafana server runs -# Author: Jan Kuřík -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2021 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/. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -export TEST=/tools/grafana/Install/Install-test-of-grafana-package -export TESTVERSION=1.0 - -BUILT_FILES= - -FILES=$(METADATA) runtest.sh Makefile PURPOSE - -.PHONY: all install download clean - -run: $(FILES) build - ./runtest.sh - -build: $(BUILT_FILES) - test -x runtest.sh || chmod a+x runtest.sh - -clean: - rm -f *~ $(BUILT_FILES) - - -include /usr/share/rhts/lib/rhts-make.include - -$(METADATA): Makefile - @echo "Owner: Jan Kuřík " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: Installation of grafana package and a check if grafana server runs" >> $(METADATA) - @echo "Type: Install" >> $(METADATA) - @echo "TestTime: 15m" >> $(METADATA) - @echo "RunFor: grafana" >> $(METADATA) - @echo "Requires: grafana curl" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: GPLv2+" >> $(METADATA) - @echo "Confidential: no" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - @echo "Releases: -RHEL4 -RHEL6 -RHEL7 -RHELClient5 -RHELServer5" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/tests/Install/Install-test-of-grafana-package/PURPOSE b/tests/Install/Install-test-of-grafana-package/PURPOSE deleted file mode 100644 index 1986e1e..0000000 --- a/tests/Install/Install-test-of-grafana-package/PURPOSE +++ /dev/null @@ -1,3 +0,0 @@ -PURPOSE of /tools/grafana/Install/Install-test-of-grafana-package -Description: Installation of grafana package and a check if grafana server runs -Author: Jan Kuřík diff --git a/tests/Install/Install-test-of-grafana-package/main.fmf b/tests/Install/Install-test-of-grafana-package/main.fmf deleted file mode 100644 index 57b9f7d..0000000 --- a/tests/Install/Install-test-of-grafana-package/main.fmf +++ /dev/null @@ -1,16 +0,0 @@ -summary: Installation of grafana package and a check if grafana server runs -description: '' -contact: -- Jan Kuřík -component: -- grafana -test: ./runtest.sh -framework: beakerlib -recommend: -- grafana -- curl -duration: 15m -extra-summary: /tools/grafana/Install/Install-test-of-grafana-package -extra-task: /tools/grafana/Install/Install-test-of-grafana-package -tag: - - gating diff --git a/tests/Install/Install-test-of-grafana-package/runtest.sh b/tests/Install/Install-test-of-grafana-package/runtest.sh deleted file mode 100755 index 6d029ba..0000000 --- a/tests/Install/Install-test-of-grafana-package/runtest.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# runtest.sh of /tools/grafana/Install/Install-test-of-grafana-package -# Description: Installation of grafana package and a check if grafana server runs -# Author: Jan Kuřík -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2021 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" - -rlJournalStart - rlPhaseStartTest - rlAssertRpm $PACKAGE || \ - { rlFail "$PACKAGE is not installed"; rlDie "Giving up"; } - rlServiceStart grafana-server - - HTTP_CODE="000" - RETRIES=12 - while [[ "${HTTP_CODE}" == "000" ]]; do - rlRun -s "curl -X GET -s -w \"\\n%{http_code}\\n\" \ - http://localhost:3000/login" \ - 0-255 "Checking if Grafana is alive and responding" - HTTP_CODE=$(tail -n 1 ${rlRun_LOG}) - if [[ "${HTTP_CODE}" == "000" ]]; then - ((RETRIES--)) - if [[ ${RETRIES} -eq 0 ]]; then - rlFail "Retry limit has been reached" - break - fi - else - rlAssertEquals "Response code should be 200" "${HTTP_CODE}" "200" - break - fi - rlRun "sleep 10" 0 "Give grafana more time to start" - done - rlPhaseEnd - - rlPhaseStartCleanup - rlServiceRestore - rlPhaseEnd -rlJournalPrintText -rlJournalEnd 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/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home/Makefile b/tests/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home/Makefile deleted file mode 100644 index 42a6485..0000000 --- a/tests/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home/Makefile +++ /dev/null @@ -1,64 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Makefile of /tools/grafana/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home -# Description: Test for BZ#1916083 (grafana-cli crashes when run from root's home) -# Author: Jan Kuřík -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2021 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/. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -export TEST=/tools/grafana/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home -export TESTVERSION=1.0 - -BUILT_FILES= - -FILES=$(METADATA) runtest.sh Makefile PURPOSE - -.PHONY: all install download clean - -run: $(FILES) build - ./runtest.sh - -build: $(BUILT_FILES) - test -x runtest.sh || chmod a+x runtest.sh - -clean: - rm -f *~ $(BUILT_FILES) - - -include /usr/share/rhts/lib/rhts-make.include - -$(METADATA): Makefile - @echo "Owner: Jan Kuřík " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: Test for BZ#1916083 (grafana-cli crashes when run from root's home)" >> $(METADATA) - @echo "Type: Regression" >> $(METADATA) - @echo "TestTime: 15m" >> $(METADATA) - @echo "RunFor: grafana" >> $(METADATA) - @echo "Requires: grafana" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: GPLv2+" >> $(METADATA) - @echo "Confidential: no" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - @echo "Bug: 1916083" >> $(METADATA) - @echo "Releases: -RHEL4 -RHEL6 -RHEL7 -RHELClient5 -RHELServer5" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/tests/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home/PURPOSE b/tests/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home/PURPOSE deleted file mode 100644 index a53e064..0000000 --- a/tests/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home/PURPOSE +++ /dev/null @@ -1,5 +0,0 @@ -PURPOSE of /tools/grafana/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home -Description: Test for BZ#1916083 (grafana-cli crashes when run from root's home) -Author: Jan Kuřík -Bug summary: grafana-cli crashes when run from root's home directory -Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1916083 diff --git a/tests/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home/main.fmf b/tests/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home/main.fmf deleted file mode 100644 index 432f63c..0000000 --- a/tests/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home/main.fmf +++ /dev/null @@ -1,14 +0,0 @@ -summary: Test for BZ#1916083 (grafana-cli crashes when run from root's home) -contact: -- Jan Kuřík -component: -- grafana -test: ./runtest.sh -framework: beakerlib -recommend: -- grafana -duration: 15m -extra-summary: /tools/grafana/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home -extra-task: /tools/grafana/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home -tag: - - gating diff --git a/tests/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home/runtest.sh b/tests/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home/runtest.sh deleted file mode 100755 index b739cec..0000000 --- a/tests/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home/runtest.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# runtest.sh of /tools/grafana/Regression/bz1916083-grafana-cli-crashes-when-run-from-root-s-home -# Description: Test for BZ#1916083 (grafana-cli crashes when run from root's home) -# Author: Jan Kuřík -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2021 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" - -rlJournalStart - rlPhaseStartSetup - rlAssertRpm $PACKAGE - rlRun "pushd ~root" - rlPhaseEnd - - rlPhaseStartTest - rlRun "grafana-cli plugins ls" 0 \ - "This should not crash when CWD is in inaccessible directory for grafana user" - rlPhaseEnd - - rlPhaseStartCleanup - rlRun "popd" - 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 33e46f6..0000000 --- a/tests/Sanity/licence-check/main.fmf +++ /dev/null @@ -1,16 +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 -framework: beakerlib -component: -- grafana -contact: Jan Kuřík -recommend: -- grafana -- 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 886ae24..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 -TCWD="$(pwd)" - -rlJournalStart - rlPhaseStartSetup - rlRun "tmp=\$(mktemp -d /var/tmp/XXXXXXXXXXXXXX)" 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/Sanity/verify-systemd-units/Makefile b/tests/Sanity/verify-systemd-units/Makefile deleted file mode 100644 index 21d5f1e..0000000 --- a/tests/Sanity/verify-systemd-units/Makefile +++ /dev/null @@ -1,63 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Makefile of /tools/grafana/Sanity/verify-systemd-units -# Description: Verification of systemd unit files -# Author: Jan Kuřík -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2020 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/. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -export TEST=/tools/grafana/Sanity/verify-systemd-units -export TESTVERSION=1.0 - -BUILT_FILES= - -FILES=$(METADATA) runtest.sh Makefile PURPOSE - -.PHONY: all install download clean - -run: $(FILES) build - ./runtest.sh - -build: $(BUILT_FILES) - test -x runtest.sh || chmod a+x runtest.sh - -clean: - rm -f *~ $(BUILT_FILES) - - -include /usr/share/rhts/lib/rhts-make.include - -$(METADATA): Makefile - @echo "Owner: Jan Kuřík " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: Verification of systemd unit files" >> $(METADATA) - @echo "Type: Sanity" >> $(METADATA) - @echo "TestTime: 5m" >> $(METADATA) - @echo "RunFor: grafana" >> $(METADATA) - @echo "Requires: grafana" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: GPLv2+" >> $(METADATA) - @echo "Confidential: no" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - @echo "Releases: -RHEL7 -RHEL4 -RHEL6 -RHELClient5 -RHELServer5" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/tests/Sanity/verify-systemd-units/PURPOSE b/tests/Sanity/verify-systemd-units/PURPOSE deleted file mode 100644 index 7d3a661..0000000 --- a/tests/Sanity/verify-systemd-units/PURPOSE +++ /dev/null @@ -1,3 +0,0 @@ -PURPOSE of /tools/grafana/Sanity/verify-systemd-units -Description: Verification of systemd unit files -Author: Jan Kuřík diff --git a/tests/Sanity/verify-systemd-units/main.fmf b/tests/Sanity/verify-systemd-units/main.fmf deleted file mode 100644 index c162ba1..0000000 --- a/tests/Sanity/verify-systemd-units/main.fmf +++ /dev/null @@ -1,13 +0,0 @@ -summary: Verification of systemd unit files -contact: Jan Kuřík -component: - - grafana -test: ./runtest.sh -framework: beakerlib -recommend: - - grafana -duration: 5m -extra-summary: /tools/grafana/Sanity/verify-systemd-units -extra-task: /tools/grafana/Sanity/verify-systemd-units -tag: - - gating diff --git a/tests/Sanity/verify-systemd-units/runtest.sh b/tests/Sanity/verify-systemd-units/runtest.sh deleted file mode 100755 index 3e14a5f..0000000 --- a/tests/Sanity/verify-systemd-units/runtest.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# runtest.sh of /tools/grafana/Sanity/verify-systemd-units -# Description: Verification of systemd unit files -# Author: Jan Kuřík -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2020 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" -PKGS="grafana" -UNITS="" - -rlJournalStart - rlPhaseStartSetup - for P in ${PKGS}; do - rlAssertRpm "${P}" - done - # Generate list of unit files - UNITS="$(rpm -ql ${PKGS} | grep /usr/lib/systemd/system/)" - rlLog "Available unit files: ${UNITS}" - rlPhaseEnd - - rlPhaseStartTest - FAILEDU="" - for U in ${UNITS}; do - if ! rlRun -s "systemd-analyze verify ${U}"; then - rlFail "Error in ${U}: $(cat ${rlRun_LOG})" - FAILEDU="${FAILEDU} $(basename ${U})" - fi - done - [[ -n "${FAILEDU}" ]] && rlLog "List of failed units: ${FAILEDU}" - rlPhaseEnd - - rlPhaseStartCleanup - rlPhaseEnd -rlJournalPrintText -rlJournalEnd