Compare commits

...

11 Commits

Author SHA1 Message Date
David Abdurachmanov 2bff0bda56
Fix paths on riscv64
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2023-04-28 10:15:02 +03:00
Nathan Scott 0ffe7191b4 Update to latest community sources 2023-02-23 13:03:30 +11:00
Nathan Scott 2f7f8fc93f Update to latest community sources 2023-02-13 15:43:25 +11:00
Jan Kurik 34b119e820 Fixed sed expression in upgrade test 2023-02-08 13:04:30 +01:00
Fedora Release Engineering ad0a2b872c Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-19 23:32:42 +00:00
Jan Kurik a2abc65bc7 Modified upgrade test, excluding unstable tests 2023-01-17 23:18:57 +01:00
Jan Kurik 151bf47d67 Fixed dependencies for upgrade testing 2023-01-16 19:40:28 +01:00
Jan Kurik 356df95bb6 Reworked gating plan to support upgrade testing
- Allowed multiple plans
- CI Gating tied up with gating.fmf plan
- Added basic framework for upgrade testing
- Testcases tagged to make those linked with plans
2023-01-16 18:48:52 +01:00
Jan Kurik 7df44b0c3b Cleanup of gating tests
Removed all the obsolete Makefile's
rlFileSubmit commands now run only on RHEL
Cleanup of fixed paths in tests
   replaced with paths relative to pcp.env setting
Removed usage of deprecated egrep/fgrep
2022-12-15 15:42:06 +01:00
Jan Kurik 3ac37a39fd Merge #17 `Redefinition of the CI Gating Plan` 2022-12-14 08:30:45 +00:00
Jan Kurik 4a184c3438 Redefinition of the CI Gating Plan 2022-12-14 09:12:59 +01:00
36 changed files with 330 additions and 873 deletions

1
ci.fmf Normal file
View File

@ -0,0 +1 @@
resultsdb-testcase: separate

View File

@ -4,16 +4,4 @@ product_versions:
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/gating.functional}

View File

@ -1,68 +0,0 @@
Avoid calling the undeclared exit function. Include <string.h> for
strcmp. Improves compatibility with future compilers which are likely
to reject implicit function declarations by default.
Submitted upstream:
<https://github.com/performancecopilot/pcp/pull/1727>
diff --git a/configure b/configure
index d8726f045b264191..f285191756825493 100755
--- a/configure
+++ b/configure
@@ -14409,7 +14409,7 @@ main ()
{
double x = 123.456;
- if (fpclassify(x) == FP_NAN) exit(1);
+ if (fpclassify(x) == FP_NAN) return 1;
;
return 0;
@@ -14438,7 +14438,7 @@ main ()
{
double x = 123.456;
- if (fpclassify(x) == FP_NAN) exit(1);
+ if (fpclassify(x) == FP_NAN) return 1;
;
return 0;
@@ -16433,6 +16433,7 @@ else
/* end confdefs.h. */
#include <time.h>
+#include <string.h>
int main () {
char b[32]="";
time_t t = time(NULL);
diff --git a/configure.ac b/configure.ac
index f12e652dd5e6f20e..4f737c78ff63e670 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3097,7 +3097,7 @@ AC_TRY_LINK(
],
[
double x = 123.456;
- if (fpclassify(x) == FP_NAN) exit(1);
+ if (fpclassify(x) == FP_NAN) return 1;
], ac_cv_func_fpclassify=yes)
AC_MSG_RESULT($ac_cv_func_fpclassify)
if test $ac_cv_func_fpclassify = no
@@ -3112,7 +3112,7 @@ then
],
[
double x = 123.456;
- if (fpclassify(x) == FP_NAN) exit(1);
+ if (fpclassify(x) == FP_NAN) return 1;
], ac_cv_func_fpclassify=yes)
AC_MSG_RESULT($ac_cv_func_fpclassify)
if test $ac_cv_func_fpclassify = yes
@@ -3737,6 +3737,7 @@ AC_MSG_CHECKING([if strftime knows about %z])
AC_TRY_RUN(
[
#include <time.h>
+#include <string.h>
int main () {
char b[32]="";
time_t t = time(NULL);

View File

@ -1,13 +1,12 @@
Name: pcp
Version: 6.0.1
Release: 4%{?dist}
Version: 6.0.3
Release: 1.0.riscv64%{?dist}
Summary: System-level performance monitoring and performance management
License: GPLv2+ and LGPLv2+ and CC-BY
URL: https://pcp.io
%global artifactory https://performancecopilot.jfrog.io/artifactory
Source0: %{artifactory}/pcp-source-release/pcp-%{version}.src.tar.gz
Patch0: pcp-configure-c99.patch
# The additional linker flags break out-of-tree PMDAs.
# https://bugzilla.redhat.com/show_bug.cgi?id=2043092
@ -94,7 +93,7 @@ Patch0: pcp-configure-c99.patch
%endif
# support for pmdabpf, check bcc.spec for supported architectures of libbpf-tools
%if 0%{?fedora} >= 33 || 0%{?rhel} > 8
%if 0%{?fedora} >= 37 || 0%{?rhel} > 8
%ifarch x86_64 ppc64 ppc64le aarch64
%global disable_bpf 0
%else
@ -278,7 +277,7 @@ BuildRequires: perl-devel perl(strict)
BuildRequires: perl(ExtUtils::MakeMaker) perl(LWP::UserAgent) perl(JSON)
BuildRequires: perl(Time::HiRes) perl(Digest::MD5)
BuildRequires: perl(XML::LibXML) perl(File::Slurp)
BuildRequires: man %{_hostname_executable}
BuildRequires: %{_hostname_executable}
%if !%{disable_systemd}
BuildRequires: systemd-devel
%endif
@ -2383,7 +2382,7 @@ sed -i '/.a$/d' pcp-devel-files
sed -i '/\/man\//d' pcp-devel-files
sed -i '/\/include\//d' pcp-devel-files
%ifarch x86_64 ppc64 ppc64le aarch64 s390x
%ifarch x86_64 ppc64 ppc64le aarch64 s390x riscv64
sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-libs-files
sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-devel-files
sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-libs-devel-files
@ -3372,16 +3371,25 @@ fi
%files zeroconf -f pcp-zeroconf-files.rpm
%changelog
* Fri Apr 28 2023 David Abdurachmanov <davidlt@rivosinc.com> - 6.0.3-1.0.riscv64
- Fix paths on riscv64
* Thu Feb 23 2023 Nathan Scott <nathans@redhat.com> - 6.0.3-1
- Update to latest PCP sources.
* Mon Feb 13 2023 Nathan Scott <nathans@redhat.com> - 6.0.2-1
- Resolve a dstat swap plugin related failure (BZ 2168774)
- Update to latest PCP sources.
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 6.0.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Mon Dec 12 2022 Florian Weimer <fweimer@redhat.com> - 6.0.1-4
- Port configure script to C99
* Thu Nov 03 2022 Jiri Olsa <jolsa@kernel.org> - 6.0.1-3
- rebuilt for libbpf 1.0
* Fri Nov 11 2022 Nathan Scott <nathans@redhat.com> - 6.0.1-2
- Resolve an issue with installing sysusers entries
- Fix RPM spec file scriptlet relating to pmieconf (BZ 2139720)
* Thu Oct 27 2022 Nathan Scott <nathans@redhat.com> - 6.0.1-1
- Resolve a BPF module related build failure (BZ 2132998)
- Update to latest PCP sources.

View File

@ -1,5 +1,6 @@
summary: CI Gating Plan
discover:
how: fmf
filter: tag:gating
execute:
how: tmt

View File

@ -1,20 +0,0 @@
commit d2dff63a0f4d4eacafa16c561b4b9e32c59f248c
Author: Nathan Scott <nathans@redhat.com>
Date: Fri Apr 8 08:19:32 2022 +1000
build: fix translation of PCP_SYSCONFIG_DIR in pmie unit file
Resolves Red Hat BZ #2072971
diff --git a/src/pmie/GNUmakefile b/src/pmie/GNUmakefile
index e0525d49e8..dc182e444a 100644
--- a/src/pmie/GNUmakefile
+++ b/src/pmie/GNUmakefile
@@ -80,6 +80,7 @@ pmie.service : pmie.service.in
$(SED) <$< >$@ \
-e 's;@PCP_RC_DIR@;'$(PCP_RC_DIR)';' \
-e 's;@PCP_RUN_DIR@;'$(PCP_RUN_DIR)';' \
+ -e 's;@PCP_SYSCONFIG_DIR@;'$(PCP_SYSCONFIG_DIR)';' \
# END
pmie_farm.service : pmie_farm.service.in

View File

@ -1 +1 @@
SHA512 (pcp-6.0.1.src.tar.gz) = 922b787a2f28aab6355cb701500890ae83ee93b55047b65f142f9767619b2fbf91abe555106f9aa3f52f851fdb0413a92582dcf8f4dbb49894c2a557e80da5fd
SHA512 (pcp-6.0.3.src.tar.gz) = f012c1e45f72874952af480bab9044957565e79b5c75cba08cb9466ce1f497dae89fbee036f2bd2802c937107b3784a9876ffd1f94a8b1f346d1fe4e83d72f64

View File

@ -1,65 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/pcp/Library/pcpcommon
# Description: Common functions for PCP tests
# Author: Milos Prchlik <mprchlik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# 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, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/CoreOS/pcp/Library/pcpcommon
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) lib.sh Makefile runtest.sh
.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 <jkurik@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Common functions for PCP tests" >> $(METADATA)
@echo "Provides: library(pcp/pcpcommon)" >> $(METADATA)
@echo "Type: Library" >> $(METADATA)
@echo "TestTime: 15m" >> $(METADATA)
@echo "RunFor: pcp" >> $(METADATA)
@echo "Requires: pcp pcp-testsuite" >> $(METADATA)
@echo "Releases: -RedHatEnterpriseLinux3 -RedHatEnterpriseLinux4 -RedHatEnterpriseLinuxClient5 -RedHatEnterpriseLinuxServer5" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,12 +1,11 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# lib.sh of /CoreOS/pcp/Library/pcpcommon
# Description: Common functions for PCP tests
# Author: Milos Prchlik <mprchlik@redhat.com>
# Author: Jan Kuřík <jkurik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
# Copyright (c) 2013-2022 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
@ -28,7 +27,7 @@
. /usr/share/beakerlib/beakerlib.sh
PACKAGES="pcp"
PACKAGE="pcp"
pcpcommon_TESTDIR="$(pwd)"
@ -40,12 +39,13 @@ done
pcpcommon_PCP_VAR_DIR=${pcpcommon_PCP_VAR_DIR:-/var/lib/pcp}
pcpcommon_PCP_PMDAS_DIR=${pcpcommon_PCP_PMDAS_DIR:-${pcpcommon_PCP_VAR_DIR}/pmdas}
pcpcommon_PCP_PMCDCONF_PATH=${pcpcommon_PCP_PMCDCONF_PATH:-/etc/pcp/pmcd/pmcd.conf}
pcpcommon_PCP_ETC_DIR=${pcpcommon_PCP_ETC_DIR:-/etc}
pcpcommon_PCP_PMCDCONF_PATH=${pcpcommon_PCP_PMCDCONF_PATH:-/${pcpcommon_PCP_ETC_DIR}/pcp/pmcd/pmcd.conf}
pcpcommon_PCP_LOG_DIR=${pcpcommon_PCP_LOG_DIR:-/var/log/pcp}
pcpcommon_TESTSUITE_DIR=${pcpcommon_TESTSUITE_DIR:-${pcpcommon_PCP_VAR_DIR}/testsuite}
pcpcommon_TESTSUITE_USER="${pcpcommon_TESTSUITE_USER:-pcpqa}"
pcpcommon_TESTSUITE_USER_HOME=$(getent passwd ${pcpcommon_TESTSUITE_USER} \
| awk -F : '{print $6}')
IFS=: read __x __x __x __x __x pcpcommon_TESTSUITE_USER_HOME __x \
< <(getent passwd ${pcpcommon_TESTSUITE_USER})
pcpcommon_TESTSUITE_USER_HOME="${pcpcommon_TESTSUITE_USER_HOME:-/home/${pcpcommon_TESTSUITE_USER}}"
pcpcommon_REAL_TESTSUITE_USER="${pcpcommon_TESTSUITE_USER}"
@ -63,8 +63,9 @@ function map_metric() {
}
function _pcpcommon_pmda_bpftrace_setup() {
rlFileBackup --namespace pcpcommon_pcpqa "${pcpcommon_PCP_PMDAS_DIR}/bpftrace"
if rlIsRHEL '>8.2'; then
rlFileBackup --clean --missing-ok --namespace pcpcommon_pcpqa \
"${pcpcommon_PCP_PMDAS_DIR}/bpftrace"
if rlIsRHEL '>8.2' || rlIsFedora || rlIsCentOS; then
rlRun "sed -i \
-e 's/^enabled =.*\$/enabled = true/g' \
-e 's/^auth_enabled =.*\$/auth_enabled = false/g' \
@ -76,6 +77,98 @@ function _pcpcommon_pmda_bpftrace_setup() {
fi
}
function _pcpcommon_apply_bl() {
local bl="${1}"
local tc
if [[ ! -r "${bl}" ]] ; then
rlLogDebug "No BL ${bl} found"
return 1
fi
rlLog "Applying BL $(basename ${bl})"
while read tc; do
rlRun "sed -i '/^${tc} /d' ${pcpcommon_TESTSUITE_DIR}/group"
done < "${bl}"
return 0
}
_pcpcommon_bl_applied=
function pcpcommon_testsuite_bl() {
local blfile="${1}"
local arch="$(arch)"
local id
local version_id
local major
local minor
local micro
local bl
local _blseq
local blseq
local libdir
if [[ -n "${blfile}" ]]; then
if [[ -d "${blfile}" ]]; then
# The BL is a directory with BL files
libdir="${blfile}"
elif [[ -r "${blfile}" ]]; then
# The BL is a file with already listed TC numbers to be removed
libdir=
else
# Unknown BL
rlLogWarn "Unknown ${blfile} when applying BL"
return 1
fi
else
libdir="$(readlink -f $(dirname ${BASH_SOURCE}))"
fi
rlRun "rlFileBackup --namespace bl '${pcpcommon_TESTSUITE_DIR}/group'"
_pcpcommon_bl_applied="Yes"
if [[ -n "${libdir}" ]]; then
# Get all the variables we need
read id version_id < <( \
. /etc/os-release && \
echo ${ID} ${VERSION_ID} || \
echo rhel 6.10 \
)
IFS='.,-_ ' read major minor micro <<< "${version_id}"
_blseq="${id} ${id}-${major}"
[[ -n "${minor}" ]] && _blseq="${_blseq} ${id}-${major}.${minor}"
[[ -n "${micro}" ]] && _blseq="${_blseq} ${id}-${major}.${minor}.${micro}"
IFS='.,-_ ' read major minor micro < <(rpm -q --qf '%{version}' ${PACKAGE})
_blseq="${_blseq} ${PACKAGE}"
[[ -n "${major}" ]] && _blseq="${_blseq} ${PACKAGE}-${major}"
[[ -n "${minor}" ]] && _blseq="${_blseq} ${PACKAGE}-${major}.${minor}"
[[ -n "${micro}" ]] && _blseq="${_blseq} ${PACKAGE}-${major}.${minor}.${micro}"
for bl in ${_blseq}; do
blseq="${blseq} ${bl} ${bl}.${arch}"
done
for bl in ${arch} ${blseq}; do
rlLogInfo "Looking for BL list ${bl}"
rlLogInfo " ... ${libdir}/bl/${bl}"
if [[ -r "${libdir}/bl/${bl}" ]]; then
apply_bl "${libdir}/bl/${bl}"
fi
done
else
rlLogInfo "Applying BL list ${blfile}"
apply_bl "${blfile}" || return 1
fi
return 0
}
pcpcommon_testsuite_bl_restore() {
[[ -n "${_pcpcommon_bl_applied}" ]] && rlFileRestore --namespace bl
_pcpcommon_bl_applied=
}
pcpcommon_PCPQA_CREATED=
pcpcommon_PCPQA_SETUP=
function pcpcommon_testsuite_user() {
@ -83,8 +176,8 @@ function pcpcommon_testsuite_user() {
[[ -n "${pcpcommon_PCPQA_SETUP}" ]] && return 0
pcpcommon_PCPQA_SETUP="done"
rlFileBackup --clean --namespace pcpcommon_pcpqa --missing-ok \
"${pcpcommon_TESTSUITE_USER_HOME}"
#rlFileBackup --clean --namespace pcpcommon_pcpqa --missing-ok \
# "${pcpcommon_TESTSUITE_USER_HOME}"
if ! rlRun "id ${pcpcommon_TESTSUITE_USER}" 0,1; then
rlRun "useradd -d ${pcpcommon_TESTSUITE_USER_HOME} -m \
-s /bin/bash -U ${pcpcommon_TESTSUITE_USER}"
@ -200,9 +293,10 @@ function pcpcommon_log_system_info() {
which nft &> /dev/null && \
nft list ruleset &> ${pcpcommon_TMP}/nftables
# Upload everything
tar czf ${pcpcommon_TAR} -C ${pcpcommon_TMP} $(cd ${pcpcommon_TMP} && ls -1)
rlFileSubmit "${pcpcommon_TAR}" "system.info.tar.gz"
if rlIsRHEL; then # Upload everything
tar czf ${pcpcommon_TAR} -C ${pcpcommon_TMP} $(cd ${pcpcommon_TMP} && ls -1)
rlFileSubmit "${pcpcommon_TAR}" "system.info.tar.gz"
fi
# Cleanup
rm -rf ${pcpcommon_TMP} ${pcpcommon_TAR}
@ -219,30 +313,36 @@ function pcpcommon_test () {
if rlRun "pushd ${pcpcommon_TESTSUITE_DIR}"; then
rlRun -s "su -l -s /bin/bash -c 'cd ${pcpcommon_TESTSUITE_DIR} && \
./check ${params}' ${pcpcommon_REAL_TESTSUITE_USER}"
rlFileSubmit "${rlRun_LOG}" "check.log"
rlIsRHEL && rlFileSubmit "${rlRun_LOG}" "check.log"
local _test_results="${rlRun_LOG}"
if ! rlRun "egrep 'Passed all [[:digit:]]+ tests' ${_test_results}" 0 \
if ! rlRun "grep -E 'Passed (all)* *[[:digit:]]+ tests' ${_test_results}" 0 \
"Assert all testcases passed"; then
local _tmp_dir=$(mktemp -d)
local _tmp_tar=$(mktemp /tmp/XXXXXXXX.tar.gz)
local failid
local failids="$(egrep 'Failures: ' ${_test_results} | cut -d' ' -f2-)"
local failids="$(grep -E 'Failures: ' ${_test_results} | cut -d' ' -f2-)"
if [[ -n "${failids}" ]]; then
for failid in ${failids}; do
rlFail "TC $failid failed"
rlRun "cp ${failid}.out ${_tmp_dir}/"
rlRun "cp ${failid}.out.bad ${_tmp_dir}/"
done
tar czf ${_tmp_tar} -C ${_tmp_dir} $(cd ${_tmp_dir} && ls -1)
rlFileSubmit "${_tmp_tar}" "failed.tests.tar.gz"
if rlIsRHEL; then
for failid in ${failids}; do
rlFail "TC $failid failed"
rlRun "cp ${failid}.out ${_tmp_dir}/"
rlRun "cp ${failid}.out.bad ${_tmp_dir}/"
done
tar czf ${_tmp_tar} -C ${_tmp_dir} $(cd ${_tmp_dir} && ls -1)
rlFileSubmit "${_tmp_tar}" "failed.tests.tar.gz"
else
for failid in ${failids}; do
rlFail "TC $failid failed"
done
fi
fi
rm -rf ${_tmp_tar} ${_tmp_dir}
ret=1
fi
if rlRun -s "egrep 'Not run: [[:digit:]]+' ${_test_results}" 0,1; then
if rlRun -s "grep -E 'Not run: [[:digit:]]+' ${_test_results}" 0,1; then
rlLogWarning "$(cat ${rlRun_LOG})"
fi
@ -255,6 +355,7 @@ function pcpcommon_test () {
function pcpcommon_cleanup () {
# Cleanup everything related to pcpqa
pcpcommon_testsuite_user_cleanup
pcpcommon_testsuite_bl_restore
rlFileRestore --namespace pcpcommon_init
return $?
@ -301,7 +402,7 @@ function pcpcommon_pmda_install () {
"${metrics}" || ret=1
rlAssertNotGrep "Try again. Information not currently available" \
"${metrics}" || ret=1
rlFileSubmit "${metrics}" "pmda.${pmda}.metrics.log"
rlIsRHEL && rlFileSubmit "${metrics}" "pmda.${pmda}.metrics.log"
fi
rlRun "popd"
else
@ -346,7 +447,7 @@ function pcpcommon_pmda_check_log () {
fi
rlAssertNotGrep "${errstr}" ${logf} -Ei || result=1
rlFileSubmit "${logf}"
rlIsRHEL && rlFileSubmit "${logf}"
return ${result}
}
@ -356,7 +457,7 @@ function pcpcommon_pmda_tests () {
local addparam="$2"
local testgroup="pmda.${pmda}"
if rlRun "grep -q ${testgroup} ${pcpcommon_PCP_VAR_DIR}/testsuite/group" 0,1; then
if rlRun "grep -q ${testgroup} ${pcpcommon_TESTSUITE_DIR}/group" 0,1; then
pcpcommon_test "000 -g ${testgroup} ${addparam}"
pcpcommon_pmda_check_log ${pmda}
else

View File

@ -1,16 +0,0 @@
summary: Common functions for PCP tests
contact:
- Jan Kuřík <jkurik@redhat.com>
component:
- pcp
test: ./runtest.sh
framework: beakerlib
recommend:
- pcp
- pcp-testsuite
duration: 15m
adjust:
- enabled: false
continue: false
extra-summary: /CoreOS/pcp/Library/pcpcommon
extra-task: /CoreOS/pcp/Library/pcpcommon

View File

@ -1,55 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/pcp/Library/pcpcommon
# Description: Common functions for PCP tests
# Author: Jan Kuřík <jkurik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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
. ../../Library/pcpcommon/lib.sh || exit 1
PACKAGE="pcp"
rlJournalStart
rlPhaseStartTest
rlRun "pcpcommonLibraryLoaded"
rlServiceStart pmcd
rlServiceStart pmlogger
rlServiceStart pmproxy
rlServiceStart pmie
err=0
pmda=bash
rlRun "pcpcommon_test -g sanity" || err=1
rlRun "pcpcommon_pmda_install ${pmda}" || err=1
rlRun "pcpcommon_pmda_tests ${pmda}" || err=1
rlRun "pcpcommon_pmda_remove ${pmda}" || err=1
rlRun "pcpcommon_cleanup"
[[ ${err} -ne 0 ]] && \
rlRun "pcpcommon_log_system_info"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,64 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/pcp/Sanity/SASL-authentication-check
# Description: A basic test of SASL authentication
# Author: Jan Kuřík <jkurik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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/pcp/Sanity/SASL-authentication-check
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 <jkurik@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: A basic test of SASL authentication" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 15m" >> $(METADATA)
@echo "RunFor: pcp" >> $(METADATA)
@echo "Requires: pcp cyrus-sasl-md5 cyrus-sasl-scram" >> $(METADATA)
@echo "Requires: cyrus-sasl-lib" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHEL6 -RHELClient5 -RHELServer5 -RHEL7" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -11,5 +11,5 @@ recommend:
- cyrus-sasl-scram
- cyrus-sasl-lib
duration: 15m
extra-summary: /tools/pcp/Sanity/SASL-authentication-check
extra-task: /tools/pcp/Sanity/SASL-authentication-check
tag:
- gating

View File

@ -62,11 +62,13 @@ for HASH in ${HASHES}; do
rlServiceStart "pmcd"
rlRun "sleep 3" 0 "Give pmcd some time to start"
rlRun -s "pminfo -f -h 'pcp://127.0.0.1?username=${METRICUSER}&password=${METRICUSERPW}' disk.dev.read"
rlFileSubmit "${rlRun_LOG}" "pminfo.output"
rlRun -s "pminfo -f -h \
'pcp://127.0.0.1?username=${METRICUSER}&password=${METRICUSERPW}' \
disk.dev.read"
rlIsRHEL && rlFileSubmit "${rlRun_LOG}" "pminfo.output"
rlAssertNotGrep "user not found" "${rlRun_LOG}"
rlAssertGrep ".*inst .*value .*" "${rlRun_LOG}" -E
rlFileSubmit "/var/log/pcp/pmcd/pmcd.log"
rlIsRHEL && rlFileSubmit "/var/log/pcp/pmcd/pmcd.log"
rlPhaseEnd
done

View File

@ -1,63 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/pcp/Sanity/pcp-python-compliance
# Description: Check for a compliance with Fedora Packaging Guidelines
# Author: Jan Kuřík <jkurik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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/pcp/Sanity/pcp-python-compliance
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 <jkurik@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Check for a compliance with Fedora Packaging Guidelines" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 15m" >> $(METADATA)
@echo "RunFor: pcp" >> $(METADATA)
@echo "Requires: python3-pcp python-pcp" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -9,5 +9,5 @@ recommend:
- python3-pcp
- python-pcp
duration: 15m
extra-summary: /tools/pcp/Sanity/pcp-python-compliance
extra-task: /tools/pcp/Sanity/pcp-python-compliance
tag:
- gating

View File

@ -1,64 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/pcp/Sanity/pcp-services
# Description: Test of pcp services
# Author: Jan Kuřík <jkurik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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/pcp/Sanity/pcp-services
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 <jkurik@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Test for BZ#1944150 (Job for pmlogger.service failed because the)" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 15m" >> $(METADATA)
@echo "RunFor: pcp" >> $(METADATA)
@echo "Requires: pcp pcp-zeroconf" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Bug: 1998491 1929556 1944150" >> $(METADATA)
@echo "Releases: -RHEL4 -RHEL6 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,4 +1,4 @@
summary: Test for BZ#1944150 (Job for pmlogger.service failed because the)
summary: Test if PCP services are starting/stopping gracefully
description: |
Bug summary: Job for pmlogger.service failed because the service did not take the steps required by its unit configuration.
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1944150
@ -10,6 +10,7 @@ framework: beakerlib
recommend:
- pcp
- pcp-zeroconf
- redis
duration: 15m
extra-summary: /tools/pcp/Sanity/pcp-services
extra-task: /tools/pcp/Sanity/pcp-services
tag:
- gating

View File

@ -29,7 +29,7 @@
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="pcp"
PCPSERVICES="pmlogger pmie pmproxy pmcd"
PCPSERVICES="pmcd pmlogger pmproxy pmie"
TOUT="90" # Timeout to wait for a service to start / stop
function service_action() {
@ -59,20 +59,31 @@ function service_action() {
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlServiceStart redis
rlRun "systemctl --no-pager stop ${PCPSERVICES}" 0-255
# First stop all the services in reverse order
for s in $(echo ${PCPSERVICES} | tr ' ' '\n' | tac | tr '\n' ' '); do
# All services should be stopped
service_action ${s} inactive
rlRun "killall --signal SIGTERM ${s}" 0-255
done
for s in $(echo ${PCPSERVICES} | tr ' ' '\n' | tac | tr '\n' ' '); do
rlRun "killall --signal SIGKILL ${s}" 0-255
done
rlPhaseEnd
rlPhaseStartTest
for s in ${PCPSERVICES}; do
# All services should be stopped
service_action ${s} inactive
done
# Start all the services
for s in ${PCPSERVICES}; do
# Start a service and check it runs
rlRun "systemctl start --no-pager ${s}"
service_action ${s} active
done
# Stop all the services in reverse order
for s in $(echo ${PCPSERVICES} | tr ' ' '\n' | tac | tr '\n' ' '); do
# Stop a service and check it is stopped
rlRun "systemctl stop --no-pager ${s}"
service_action ${s} inactive
@ -80,6 +91,7 @@ rlJournalStart
rlPhaseEnd
rlPhaseStartCleanup
rlServiceRestore
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,72 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/pcp/Sanity/pcp-testsuite-sanity
# Description: pcp testing by upstream testsuite
# Author: Jan Kuřík <jkurik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2018 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/pcp/Sanity/pcp-testsuite-sanity
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE bl
.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 <jkurik@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: pcp testing by upstream testsuite" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 4h" >> $(METADATA)
@echo "RunFor: pcp" >> $(METADATA)
@echo "Requires: pcp time" >> $(METADATA)
@echo "Requires: sudo procps-ng avahi bzip2 pcp-pmda-cisco" >> $(METADATA)
@echo "Requires: coreutils pcp-pmda-news perl-PCP-LogImport" >> $(METADATA)
@echo "Requires: perl-PCP-LogSummary python-pcp gcc" >> $(METADATA)
@echo "Requires: redhat-rpm-config perl-PCP-LogSummary" >> $(METADATA)
@echo "Requires: libuv libuv-devel" >> $(METADATA)
@echo "Requires: /usr/bin/netstat pcp-testsuite" >> $(METADATA)
#@echo "Requires: library(pcp/pcpcommon)" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
@echo "Bug: 1760750" >> $(METADATA)
#@echo "RhtsRequires: library(pcp/pcpcommon)" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -27,5 +27,5 @@ recommend:
- /usr/bin/netstat
- pcp-testsuite
duration: 4h
extra-summary: /tools/pcp/Sanity/pcp-testsuite-sanity
extra-task: /tools/pcp/Sanity/pcp-testsuite-sanity
tag:
- gating

View File

@ -8,7 +8,7 @@
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2018 Red Hat, Inc.
# Copyright (c) 2018-2022 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
@ -45,7 +45,7 @@ function apply_bl() {
fi
rlLog "Applying BL $(basename ${bl})"
while read tc; do
rlRun "sed -i '/^${tc} /d' /var/lib/pcp/testsuite/group"
rlRun "sed -i '/^${tc} /d' ${pcpcommon_TESTSUITE_DIR}/group"
done < "${bl}"
return
@ -55,52 +55,13 @@ rlJournalStart
rlPhaseStartSetup
rlShowRunningKernel
rlAssertRpm "${PACKAGE}"
rlFileBackup --clean --missing-ok /etc/pcp /etc/pcp.conf /etc/pcp.env \
/etc/sysconfig/pmcd /etc/sysconfig/pmie_timers /etc/sysconfig/pmlogger \
/etc/sysconfig/pmlogger_timers /etc/sysconfig/pmproxy /var/lib/pcp/config
rlRun "TmpDir=\$(mktemp -d)"
rlRun "pcpcommonLibraryLoaded"
rlPhaseEnd
rlPhaseStartSetup "PCP restart"
rlRun "pcpcommon_testsuite_bl"
rlRun "rlServiceStart pmcd pmlogger" 0-255
rlRun "rlServiceEnable pmcd pmlogger" 0-255
rlRun "sleep 30" 0 "Give services some time to fully start"
rlPhaseEnd
rlPhaseStartSetup "BL listing"
# Get all the variables we need
read ID VERSION_ID < <(
. /etc/os-release && \
echo ${ID} ${VERSION_ID} || \
echo rhel 6.10
)
IFS='.,-_ ' read MAJOR MINOR MICRO <<< "${VERSION_ID}"
ARCH=$(arch)
_BLSEQ="${ID} ${ID}-${MAJOR}"
[[ -n "${MINOR}" ]] && _BLSEQ="${BLSEQ} ${ID}-${MAJOR}.${MINOR}"
[[ -n "${MICRO}" ]] && _BLSEQ="${BLSEQ} ${ID}-${MAJOR}.${MINOR}.${MICRO}"
IFS='.,-_ ' read MAJOR MINOR MICRO < <(rpm -q --qf '%{version}' ${PACKAGE})
_BLSEQ="${BLSEQ} ${PACKAGE}"
[[ -n "${MAJOR}" ]] && _BLSEQ="${BLSEQ} ${PACKAGE}-${MAJOR}"
[[ -n "${MINOR}" ]] && _BLSEQ="${BLSEQ} ${PACKAGE}-${MAJOR}.${MINOR}"
[[ -n "${MICRO}" ]] && _BLSEQ="${BLSEQ} ${PACKAGE}-${MAJOR}.${MINOR}.${MICRO}"
BLSEQ=
for bl in ${_BLSEQ}; do
BLSEQ="${BLSEQ} ${bl} ${bl}.${ARCH}"
done
for bl in ${BLSEQ}; do
rlLog "Looking for BL list ${bl}"
if [[ -r "${TCWD}/bl/${bl}" ]]; then
apply_bl "${TCWD}/bl/${bl}"
fi
done
rlPhaseEnd
rlPhaseStartTest "run testsuite"
rlRun "pcpcommon_test -g sanity" || rlRun "pcpcommon_log_system_info"
rlPhaseEnd
@ -108,8 +69,6 @@ rlJournalStart
rlPhaseStartCleanup
rlRun "pcpcommon_cleanup"
rlRun "rlServiceRestore" 0-255
rlRun "rm -r $TmpDir"
rlFileRestore
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,68 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/pcp/Sanity/rpm-config-files
# Description: Verification of rpm config files
# Author: Jan Kuřík <jkurik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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/pcp/Sanity/rpm-config-files
export TESTVERSION=1.0
export TEST_GIT_REF ?= main
export TEST_GIT_URL ?= https://src.fedoraproject.org/rpms/pcp.git
export TEST_GIT_PATH ?= tests/Sanity/rpm-config-files
export TEST_GIT_SCRIPT ?= ./runtest.sh
export GIT_SSL_NO_VERIFY=true
BUILT_FILES=
FILES=$(METADATA) Makefile PURPOSE runtest.sh
.PHONY: all install download clean
run: $(FILES)
chmod +x ./runtest.sh
./runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Jan Kuřík <jkurik@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Verification of rpm config files" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 30m" >> $(METADATA)
@echo "RunFor: pcp" >> $(METADATA)
@echo "Requires: pcp rpm-build" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Bug: 1963938 1964253" >> $(METADATA)
@echo "Releases: -RHEL4 -RHEL6 -RHELClient5 -RHELServer5 -RHEL7" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,4 +1,4 @@
summary: Verification of rpm's config files
summary: Verification of rpms config files
description: 'Verification of rpms config files'
contact: Jan Kuřík <jkurik@redhat.com>
component:
@ -9,5 +9,5 @@ recommend:
- pcp
- rpm-build
duration: 15m
extra-summary: /tools/pcp/Sanity/rpm-config-files
extra-task: /tools/pcp/Sanity/rpm-config-files
tag:
- gating

View File

@ -41,7 +41,8 @@ rlJournalStart
SOURCEPKG=$(rpm -q --qf '%{name}-%{version}-%{release}.src.rpm' ${PACKAGE})
rlAssertExists "${T}/${SOURCEPKG}"
rlRun "rpm -D '_topdir ${T}' -i ${T}/${SOURCEPKG}"
rlRun "RPMS=\$(rpm -q --qf '%{name}\n' --specfile ${T}/SPECS/${PACKAGE}.spec | \
rlRun "RPMS=\$(rpm -q --qf '%{name}\n' \
--specfile ${T}/SPECS/${PACKAGE}.spec | \
grep -v -e '-debuginfo' -e '-debugsource' | tr '\n' ' ')"
rlPhaseEnd

View File

@ -1,65 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/pcp/Sanity/shared-libraries-need-symbol-versioning
# Description: A check for presence of version symbols
# Author: Milos Prchlik <mprchlik@redhat.com>, Jan Kuřík <jkurik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2014-2021 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# 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, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/pcp/Sanity/shared-libraries-need-symbol-versioning
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 <jkurik@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: A check for presence of version symbols" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 15m" >> $(METADATA)
@echo "RunFor: pcp" >> $(METADATA)
@echo "Requires: pcp pcp-libs binutils" >> $(METADATA)
@echo "Releases: -RHEL4 -RHEL6 -RHELClient5 -RHELServer5" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Bug: 1037771" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -12,5 +12,5 @@ recommend:
- pcp-libs
- binutils
duration: 15m
extra-summary: /tools/pcp/Sanity/shared-libraries-need-symbol-versioning
extra-task: /tools/pcp/Sanity/shared-libraries-need-symbol-versioning
tag:
- gating

View File

@ -0,0 +1,3 @@
PURPOSE of /Sanity/upgrade
Description: upgrade test between different distro releases
Author: Jan Kurik <jkurik@redhat.com>

View File

@ -0,0 +1,35 @@
summary: upgrade
description: ''
contact: Jan Kurik <jkurik@redhat.com>
component:
- pcp
test: ./runtest.sh
framework: beakerlib
require:
- library(ControlFlow/mcase)
recommend:
- pcp
- beakerlib
- time
- sudo
- procps-ng
- avahi
- bzip2
- pcp-pmda-cisco
- coreutils
- pcp-pmda-news
- perl-PCP-LogImport
- perl-PCP-LogSummary
- python-pcp
- gcc
- redhat-rpm-config
- perl-PCP-LogSummary
- libuv
- libuv-devel
- /usr/bin/netstat
- pcp-testsuite
- nmap
- valgrind
duration: 1h
tag:
- upgrade

86
tests/Sanity/upgrade/runtest.sh Executable file
View File

@ -0,0 +1,86 @@
#!/bin/bash
#shellcheck disable=SC1091
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/pcp/Sanity/upgrade
# Description: upgrade
# Author: Jan Kurik <jkurik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2022 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
. ../../Library/pcpcommon/lib.sh || exit 1
#shellcheck disable=SC2034
PACKAGE=pcp
distribution_mcase__test() {
rlLogInfo 'Verify scenario upgrade works'
rlRun "yum remove -y pcp-testsuite" 0-255
rlRun "rm -rf /var/lib/pcp/testsuite"
rlRun "yum install -y pcp-testsuite" 0 "Ensure pcp-testsuite is installed"
rlRun "pushd /var/lib/pcp/pmdas/sample/"
rlRun "./Remove" 0-255
rlRun "echo | ./Install" 0-255
rlRun "popd"
rlRun "pcpcommonLibraryLoaded"
rlRun "rlServiceStart pmcd pmlogger" 0,1
rlRun "rlServiceEnable pmcd pmlogger" 0-255
rlRun "sleep 10"
# BL
for tc in 359 665 821 1393; do
rlRun "sed -i -e '/^${tc} /d' /var/lib/pcp/testsuite/group" 0-255
done
rlRun "pcpcommon_test -g sanity -g pmda.linux -x kernel -x pmda.sample -x valgrind \
-x containers -x cgroups -x pmda.mmv" \
|| rlRun "pcpcommon_log_system_info"
rlRun "pcpcommon_cleanup"
}
rlJournalStart
rlPhaseStartSetup "init"
export LANG=en_US.UTF-8
export LANGUAGE=en_US:en
export LC_CTYPE=POSIX
export LC_NUMERIC=POSIX
export LC_TIME=POSIX
export LC_COLLATE=POSIX
export LC_MONETARY=POSIX
export LC_MESSAGES=POSIX
export LC_PAPER=POSIX
export LC_NAME=POSIX
export LC_ADDRESS=POSIX
export LC_TELEPHONE=POSIX
export LC_MEASUREMENT=POSIX
export LC_IDENTIFICATION=POSIX
export LC_ALL=
rlImport "ControlFlow/mcase"
rlPhaseEnd
distribution_mcase__run
rlJournalPrintText
rlJournalEnd
#template by morf-0.29.25

View File

@ -1,63 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/pcp/Sanity/verify-systemd-units
# Description: Verification of systemd unit files
# Author: Jan Kuřík <jkurik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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/pcp/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 <jkurik@redhat.com>" > $(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: pcp" >> $(METADATA)
@echo "Requires: avahi pcp-manager pcp pcp-zeroconf" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHEL6 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -11,5 +11,5 @@ recommend:
- pcp
- pcp-zeroconf
duration: 5m
extra-summary: /tools/pcp/Sanity/verify-systemd-units
extra-task: /tools/pcp/Sanity/verify-systemd-units
tag:
- gating

View File

@ -1,65 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/pcp/Sanity/writeable-suid-guid
# Description: Test for BZ#1025583 (pcp creates a world writeable directory)
# Author: Milos Prchlik <mprchlik@redhat.com>, Jan Kuřík <jkurik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2014-2021 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# 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, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/pcp/Sanity/writeable-suid-guid
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 <jkurik@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Test for BZ#1025583 (pcp creates a world writeable directory)" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 15m" >> $(METADATA)
@echo "RunFor: pcp" >> $(METADATA)
@echo "Requires: pcp pcp-testsuite" >> $(METADATA)
@echo "Releases: -RHEL4 -RHEL6 -RHELClient5 -RHELServer5" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Bug: 1025583" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,4 +1,4 @@
summary: Test for BZ#1025583 (pcp creates a world writeable directory)
summary: Test if PCP packages do not create world writeable or suid or guid files
description: |
Bug summary: pcp creates a world writeable directory /var/lib/pcp/tmp
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1025583
@ -11,5 +11,5 @@ recommend:
- pcp
- pcp-testsuite
duration: 15m
extra-summary: /tools/pcp/Sanity/writeable-suid-guid
extra-task: /tools/pcp/Sanity/writeable-suid-guid
tag:
- gating

View File

@ -28,10 +28,17 @@
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
. ../../Library/pcpcommon/lib.sh || exit 1
PACKAGE="pcp"
DIRS="/var/lib/pcp /usr/include/pcp /etc/pcp /usr/libexec/pcp /var/log/pcp \
/usr/share/pcp /usr/share/doc/pcp"
DIRS="${pcpcommon_PCP_VAR_DIR} ${pcpcommon_PCP_INC_DIR} ${pcpcommon_PCP_SYSCONF_DIR} \
/usr/libexec/pcp ${pcpcommon_PCP_BINADM_DIR} ${pcpcommon_PCP_LIBADM_DIR} \
${pcpcommon_PCP_PMDASADM_DIR} ${pcpcommon_PCP_RC_DIR} ${pcpcommon_PCP_LOG_DIR} \
${pcpcommon_PCP_SHARE_DIR} ${pcpcommon_PCP_DOC_DIR} ${pcpcommon_PCP_DEMOS_DIR} \
${pcpcommon_PCP_HTML_DIR} ${pcpcommon_PCP_HTML_DIR} /usr/share/doc/pcp-doc \
"
rlJournalStart
rlPhaseStartSetup