Compare commits

..

18 Commits
rawhide ... f22

Author SHA1 Message Date
Nathan Scott
0e99bc4879 Merge branch 'master' into f22 2016-06-17 17:08:53 +10:00
Lukas Berk
b0f8ec8bce Change build revision to 1 2016-04-28 21:58:03 -04:00
Lukas Berk
c880aead67 Merge branch 'master' into f22 2016-04-28 21:57:18 -04:00
Dave Brolley
e60950cdda Merge branch 'master' into f22 2016-03-18 18:09:24 -04:00
Mark Goodwin
510661b9f8 Merge branch 'master' into f22 2016-02-03 12:51:00 +11:00
Lukas Berk
69ab37d40c Merge branch 'master' into f22 2015-12-16 20:06:06 -05:00
Mark Goodwin
54b3a4e392 Merge branch 'master' into f22 2015-10-29 21:16:41 +10:00
Nathan Scott
57fd1c156a Merge branch 'master' into f22 2015-09-17 13:25:24 +10:00
Lukas Berk
9def920c10 Fix SDT related build error (BZ 1250894) 2015-08-06 15:16:37 -04:00
Nathan Scott
63c9a6c10c Merge branch 'f22' of ssh://pkgs.fedoraproject.org/pcp into f22 2015-08-04 14:03:20 +10:00
Nathan Scott
ceebd1e1cd Merge branch 'master' into f22 2015-08-04 14:00:28 +10:00
Mark Goodwin
d0e37fc50b Merge branch 'master' into f22 2015-06-15 22:05:25 +10:00
Nathan Scott
952b5a578d Merge branch 'master' into f22 2015-04-16 12:29:16 +10:00
Nathan Scott
9962f5b177 Merge branch 'master' into f22
Conflicts:
	sources
2015-04-16 12:20:43 +10:00
Nathan Scott
3bffd5cd94 Merge branch 'master' into f22
Conflicts:
	.gitignore
	pcp.spec
	sources
2015-04-16 12:10:11 +10:00
Dave Brolley
8c441eccab New sources for PCP release 3.10.3 2015-03-02 16:54:28 -05:00
Slavek Kabrda
ddc5de5831 Only use Python 3 in Fedora >= 23, more info at
https://bugzilla.redhat.com/show_bug.cgi?id=1194324#c4
2015-02-23 13:53:09 +01:00
Nathan Scott
2d6536bd4c Initial changes to support python3 as default (1194323) 2015-02-23 22:16:31 +11:00
45 changed files with 1357 additions and 4243 deletions

View File

@ -1 +0,0 @@
1

94
.gitignore vendored
View File

@ -1,4 +1,90 @@
pcp-*.src.rpm
pcp-*.tar.gz
pcp-testsuite.sysusers
pcp.sysusers
pcp-3.3.3-1.src.tar.gz
/pcp-webjs.src.tar.gz
/pcp-3.5.0-1.src.tar.gz
/pcp-3.5.11-1.src.tar.gz
/pcp-3.5.11-2.src.tar.gz
/pcp-3.6.3-1.src.tar.gz
/pcp-3.6.5-1.src.tar.gz
/pcp-3.6.6-1.src.tar.gz
/pcp-3.6.7.src.tar.gz
/pcp-3.6.8.src.tar.gz
/pcp-3.6.9.src.tar.gz
/pcp-3.6.10.src.tar.gz
/pcp-3.7.0.src.tar.gz
/pcp-3.7.1.src.tar.gz
/pcp-3.7.2.src.tar.gz
/pcp-3.8.0.src.tar.gz
/pcp-3.8.1.src.tar.gz
/pcp-3.8.2.src.tar.gz
/pcp-3.8.3.src.tar.gz
/pcp-3.8.4.src.tar.gz
/pcp-3.8.5.src.tar.gz
/pcp-3.8.6.src.tar.gz
/pcp-3.8.9.src.tar.gz
/pcp-3.8.10.src.tar.gz
/pcp-3.8.11.src.tar.gz
/pcp-3.8.12.src.tar.gz
/pcp-3.9.0.src.tar.gz
/pcp-3.9.1.src.tar.gz
/pcp-3.9.2.src.tar.gz
/pcp-3.9.3.src.tar.gz
/pcp-3.9.4.src.tar.gz
/pcp-3.9.5.src.tar.gz
/pcp-3.9.7.src.tar.gz
/pcp-3.9.9.src.tar.gz
/pcp-3.9.10.src.tar.gz
/pcp-3.10.0.src.tar.gz
/pcp-3.10.1.src.tar.gz
/pcp-3.10.2.src.tar.gz
/pcp-3.10.3.src.tar.gz
/pcp-3.10.4.src.tar.gz
/pcp-3.10.5.src.tar.gz
/pcp-3.10.6.src.tar.gz
/pcp-3.10.7.src.tar.gz
/vector.tar.gz
/pcp-3.10.8-0.20150921gita7c756e.tar.gz
/pcp-3.10.8-0.20150928gitf8ceed0.tar.gz
/pcp-3.10.8-0.20151013git2af7d51.tar.gz
/pcp-3.10.8-0.20151019git5f56d74.tar.gz
/pcp-3.10.8-0.20151026git5f56d74.tar.gz
/pcp-3.10.8.src.tar.gz
/pcp-3.10.9-0.20151104git7a881e7.tar.gz
/pcp-3.10.9-0.20151111git892d4d7.tar.gz
/pcp-webjs-20151111git09da29d.src.tar.gz
/vector-20151111git6805518.tar.gz
/pcp-3.10.9-0.20151117gitf5f20cb.tar.gz
/pcp-webjs-20151117git09da29d.src.tar.gz
/vector-20151117git6805518.tar.gz
/pcp-3.10.9-0.20151123git587e16f.tar.gz
/pcp-webjs-20151123git09da29d.src.tar.gz
/vector-20151123git47fe02d.tar.gz
/pcp-3.10.9-0.20151130gitd63273c.tar.gz
/pcp-webjs-20151130git09da29d.src.tar.gz
/vector-20151130git47fe02d.tar.gz
/pcp-3.10.9-0.20151207gited763bb.tar.gz
/pcp-webjs-20151207git09da29d.src.tar.gz
/vector-20151207git0ec9197.tar.gz
/pcp-3.10.9-0.20151207git44f18ab.tar.gz
/pcp-webjs-20151207git17704ea.src.tar.gz
/vector-20151207gitv1.0.3.tar.gz
/pcp-3.10.9-0.20151214git127bd3f.tar.gz
/pcp-webjs-20151214git17704ea.src.tar.gz
/vector-20151214git117404f.tar.gz
/pcp-3.10.9.src.tar.gz
/pcp-3.11.0-0.20160128giteb5eb32.tar.gz
/pcp-webjs-20160128gitddff69a.src.tar.gz
/vector-20160128git117404f.tar.gz
/pcp-3.11.0.src.tar.gz
/pcp-3.11.1.src.tar.gz
/pcp-3.11.2.src.tar.gz
/vector-1.0.3.tar.gz
/pcp-3.11.3-0.20160606git566cf74.tar.gz
/pcp-webjs-20160606gitpcp-webjs-3.11.2.src.tar.gz
/vector-20160606gitc851eac.tar.gz
/pcp-3.11.3-0.20160606gita7ba4e4.tar.gz
/pcp-3.11.3-0.20160613git62d62f6.tar.gz
/pcp-webjs-20160613gitpcp-webjs-3.11.2.src.tar.gz
/vector-20160613gitc851eac.tar.gz
/pcp-3.11.3.src.tar.gz
/pcp-webjs-3.11.2.tar.gz
/vector-1.1.0.tar.gz

View File

@ -1,19 +0,0 @@
--- !Policy
product_versions:
- fedora-*
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}

3638
pcp.spec

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +0,0 @@
summary: CI Gating Plan
discover:
how: fmf
directory: tests
execute:
how: beakerlib

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,3 @@
SHA512 (pcp-6.0.1.src.tar.gz) = 922b787a2f28aab6355cb701500890ae83ee93b55047b65f142f9767619b2fbf91abe555106f9aa3f52f851fdb0413a92582dcf8f4dbb49894c2a557e80da5fd
2afbdac61697d2e2421914ad77e282f2 pcp-3.11.3.src.tar.gz
b59b0234969a14dec723c26fbae1fdab pcp-webjs-3.11.2.tar.gz
e1723b57dc9dad46650cdaf001a0d6e7 vector-1.1.0.tar.gz

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,390 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# lib.sh 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.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# library-prefix = pcpcommon
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
. /usr/share/beakerlib/beakerlib.sh
PACKAGES="pcp"
pcpcommon_TESTDIR="$(pwd)"
# Set all the usefull PCP variables
pcpcommon_PCP_ENV="${pcpcommon_PCP_ENV:-/etc/pcp.env}"
for i in $(. ${pcpcommon_PCP_ENV}; set | grep '^PCP_' | grep -v '\s'); do
eval pcpcommon_$i
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_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}')
pcpcommon_TESTSUITE_USER_HOME="${pcpcommon_TESTSUITE_USER_HOME:-/home/${pcpcommon_TESTSUITE_USER}}"
pcpcommon_REAL_TESTSUITE_USER="${pcpcommon_TESTSUITE_USER}"
function map_metric() {
case "$1" in
dm)
echo dmcache
;;
*)
echo $1
;;
esac
return 0
}
function _pcpcommon_pmda_bpftrace_setup() {
rlFileBackup --namespace pcpcommon_pcpqa "${pcpcommon_PCP_PMDAS_DIR}/bpftrace"
if rlIsRHEL '>8.2'; then
rlRun "sed -i \
-e 's/^enabled =.*\$/enabled = true/g' \
-e 's/^auth_enabled =.*\$/auth_enabled = false/g' \
${pcpcommon_PCP_PMDAS_DIR}/bpftrace/bpftrace.conf"
else
rlRun "sed -i \
-e 's/^enabled =.*\$/enabled = false/g' \
${pcpcommon_PCP_PMDAS_DIR}/bpftrace/bpftrace.conf"
fi
}
pcpcommon_PCPQA_CREATED=
pcpcommon_PCPQA_SETUP=
function pcpcommon_testsuite_user() {
# Check if we have already setup the testsuite user or not
[[ -n "${pcpcommon_PCPQA_SETUP}" ]] && return 0
pcpcommon_PCPQA_SETUP="done"
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}"
rlRun "chown -R ${pcpcommon_TESTSUITE_USER}:${pcpcommon_TESTSUITE_USER} \
${pcpcommon_TESTSUITE_DIR}"
rlFail "User ${pcpcommon_TESTSUITE_USER} was not created by pcp packages" \
"- see BZ#1025688"
pcpcommon_PCPQA_CREATED="yes"
fi
# Fallback
if [[ ! -d ${pcpcommon_TESTSUITE_USER_HOME} ]]; then
rlRun "mkdir -p ${pcpcommon_TESTSUITE_USER_HOME}"
fi
# Make sure all the testsuite files are owned by pcpqa
rlRun "chown -R ${pcpcommon_TESTSUITE_USER}:${pcpcommon_TESTSUITE_USER} \
${pcpcommon_TESTSUITE_DIR} ${pcpcommon_TESTSUITE_USER_HOME}"
# Configure sudo
if [[ -d "/etc/sudoers.d/" ]]; then
if [[ ! -f "/etc/sudoers.d/99_${pcpcommon_TESTSUITE_USER}" ]]; then
rlRun "rlFileBackup --clean --namespace pcpcommon_pcpqa --missing-ok \
/etc/sudoers.d/99_${pcpcommon_TESTSUITE_USER}"
rlRun "echo 'Defaults:${pcpcommon_TESTSUITE_USER} !requiretty' \
> /etc/sudoers.d/99_${pcpcommon_TESTSUITE_USER}"
rlRun "echo '${pcpcommon_TESTSUITE_USER} ALL=(ALL) NOPASSWD: ALL' \
>> /etc/sudoers.d/99_${pcpcommon_TESTSUITE_USER}"
rlRun "chmod 0440 /etc/sudoers.d/99_${pcpcommon_TESTSUITE_USER}"
fi
else
if ! grep -q "${pcpcommon_TESTSUITE_USER} ALL=(ALL) NOPASSWD: ALL" \
/etc/sudoers ; then
rlRun "rlFileBackup --namespace pcpcommon_pcpqa /etc/sudoers"
rlRun "echo 'Defaults:${pcpcommon_TESTSUITE_USER} !requiretty' \
>> /etc/sudoers"
rlRun "echo '${pcpcommon_TESTSUITE_USER} ALL=(ALL) NOPASSWD: ALL' \
>> /etc/sudoers"
fi
fi
# Setup ssh
rlRun "rlFileBackup --clean --namespace pcpcommon_pcpqa --missing-ok \
${pcpcommon_TESTSUITE_USER_HOME}/.ssh"
if [[ ! -f "${pcpcommon_TESTSUITE_USER_HOME}/.ssh/id_rsa" ]]; then
rlRun "su - -c 'mkdir ${pcpcommon_TESTSUITE_USER_HOME}/.ssh' \
${pcpcommon_TESTSUITE_USER}"
rlRun "su - -c 'ssh-keygen -t rsa -N \"\" \
-f ${pcpcommon_TESTSUITE_USER_HOME}/.ssh/id_rsa' ${pcpcommon_TESTSUITE_USER}"
fi
rlRun "su - -c 'cat ${pcpcommon_TESTSUITE_USER_HOME}/.ssh/id_rsa.pub \
>> ${pcpcommon_TESTSUITE_USER_HOME}/.ssh/authorized_keys' \
${pcpcommon_TESTSUITE_USER}"
rlRun "echo 'Host *' >> ${pcpcommon_TESTSUITE_USER_HOME}/.ssh/config"
rlRun "echo 'StrictHostKeyChecking no' \
>> ${pcpcommon_TESTSUITE_USER_HOME}/.ssh/config"
rlRun "echo 'UserKnownHostsFile=/dev/null' \
>> ${pcpcommon_TESTSUITE_USER_HOME}/.ssh/config"
rlRun "chmod 600 ${pcpcommon_TESTSUITE_USER_HOME}/.ssh/config"
rlRun "chmod 0700 ${pcpcommon_TESTSUITE_USER_HOME}/.ssh"
rlRun "chmod 0640 ${pcpcommon_TESTSUITE_USER_HOME}/.ssh/authorized_keys"
# Setup default PATHs etc.
rlFileBackup --clean --namespace pcpcommon_pcpqa --missing-ok \
"${pcpcommon_TESTSUITE_USER_HOME}/.bashrc"
rlRun "su -s /bin/sh -c 'touch ${pcpcommon_TESTSUITE_USER_HOME}/.bashrc' \
${pcpcommon_TESTSUITE_USER}"
rlRun "echo 'PATH=\${PATH}:\${PCP_BIN_DIR}:\${PCP_BINADM_DIR}:\${PCP_PLATFORM_PATHS}'\
>> ${pcpcommon_TESTSUITE_USER_HOME}/.bashrc"
return 0
}
function pcpcommon_testsuite_user_cleanup() {
# Check if we have anything to clenup
[[ -z "${pcpcommon_PCPQA_SETUP}" ]] && return 0
pcpcommon_PCPQA_SETUP=
# Kill everything related to pcpqa
rlRun "pkill --signal SIGTERM -u ${pcpcommon_TESTSUITE_USER}" 0-255
rlRun "pkill --signal SIGTERM -g ${pcpcommon_TESTSUITE_USER}" 0-255
rlRun "sleep 5" 0 "Wait a bit, so proceses can terminate gracefully"
rlRun "pkill --signal SIGKILL -u ${pcpcommon_TESTSUITE_USER}" 0-255
rlRun "pkill --signal SIGKILL -g ${pcpcommon_TESTSUITE_USER}" 0-255
if [[ -n "${pcpcommon_PCPQA_CREATED}" ]]; then
rlRun "userdel -f -r -Z ${pcpcommon_TESTSUITE_USER}" 0-255
fi
rlFileRestore --namespace pcpcommon_pcpqa
return 0
}
function pcpcommon_log_system_info() {
local pcpcommon_TMP=$(mktemp -d)
local pcpcommon_TAR=$(mktemp /tmp/XXXXXXXX.tar.gz)
rlShowRunningKernel
[[ -d /etc/os-release ]] && \
cp /etc/os-release ${pcpcommon_TMP}/os-release
env &> ${pcpcommon_TMP}/env
sestatus &> ${pcpcommon_TMP}/sestatus
[[ -d /var/run/pcp ]] && \
ls -alZ /var/run/pcp &> ${pcpcommon_TMP}/ls-alZ_var.run.pcp
pstree -u &> ${pcpcommon_TMP}/pstree
ps xau &> ${pcpcommon_TMP}/ps.aux
netstat -lpn &> ${pcpcommon_TMP}/netstat
ip addr &> ${pcpcommon_TMP}/ip.addr
hostname &> ${pcpcommon_TMP}/hostname
cp /etc/hosts ${pcpcommon_TMP}/etc.hosts
which iptables &> /dev/null && \
iptables -S &> ${pcpcommon_TMP}/iptables
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"
# Cleanup
rm -rf ${pcpcommon_TMP} ${pcpcommon_TAR}
return 0
}
function pcpcommon_test () {
local ret=0
local params="$@"
pcpcommon_testsuite_user
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"
local _test_results="${rlRun_LOG}"
if ! rlRun "egrep '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-)"
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"
fi
rm -rf ${_tmp_tar} ${_tmp_dir}
ret=1
fi
if rlRun -s "egrep 'Not run: [[:digit:]]+' ${_test_results}" 0,1; then
rlLogWarning "$(cat ${rlRun_LOG})"
fi
rlRun "popd"
fi
return ${ret}
}
function pcpcommon_cleanup () {
# Cleanup everything related to pcpqa
pcpcommon_testsuite_user_cleanup
rlFileRestore --namespace pcpcommon_init
return $?
}
function pcpcommon_pmda_install () {
local ret=1
local pmda="$1"
local retries=${2:-10}
local metrics
# Make sure the PMDA's RPM is installed
if ! rpm -q pcp-pmda-${pmda} &> /dev/null; then
rlRun "yum install -y pcp-pmda-${pmda}" || return 1
fi
# Check if the PMDA is already installed in PCP
rlRun -s "sed -e 's/^#.*\$//' -e '/^\\s*\$/d' -e '/^\\s*\\[.*\$/,\$ d' \
${pcpcommon_PCP_PMCDCONF_PATH} | cut -f 1" 0 "Get the list of installed PMDAs"
if grep -w ${pmda} "${rlRun_LOG}"; then
rlLogInfo "${pmda} is already installed"
ret=0
else
if rlRun "pushd ${pcpcommon_PCP_PMDAS_DIR}/${pmda}"; then
[[ "${pmda}" == "bpftrace" ]] && _pcpcommon_pmda_bpftrace_setup
if rlRun "./Install < /dev/null"; then
ret=0
# Log all values the pmda is providing
rlRun -s "pminfo -f $(map_metric ${pmda})"
metrics="${rlRun_LOG}"
while [[ ${retries} -gt 0 ]]; do
if grep -q 'Try again. Information not currently available' \
"${metrics}"; then
rlRun "sleep 10" 0 "Waiting for metrics to be available"
rlRun -s "pminfo -f $(map_metric ${pmda})"
metrics="${rlRun_LOG}"
rlLog "Number of retries left: $(( --retries ))"
else
retries=0
fi
done
rlAssertNotGrep "Error: Resource temporarily unavailable" \
"${metrics}" || ret=1
rlAssertNotGrep "Try again. Information not currently available" \
"${metrics}" || ret=1
rlFileSubmit "${metrics}" "pmda.${pmda}.metrics.log"
fi
rlRun "popd"
else
rlFail "Unable to find PMDA's basedir ${pcpcommon_PCP_PMDAS_DIR}/${pmda}"
fi
fi
return ${ret}
}
function pcpcommon_pmda_remove () {
local ret=1
local pmda="$1"
if rlRun "pushd ${pcpcommon_PCP_PMDAS_DIR}/${pmda}" 0-255; then
rlRun "./Remove" 0-255 && ret=0
rlRun "popd"
else
rlLogInfo "Unable to find PMDA's basedir ${pcpcommon_PCP_PMDAS_DIR}/${pmda}"
fi
return ${ret}
}
function pcpcommon_pmda_check_log () {
local pmda="$1"
local errstr="fail|warn|error|crit|denied"
local logf="${pcpcommon_PCP_LOG_DIR}/pmcd/${pmda}.log"
local result=0
# Skip the log check if requested
case "${PCPCOMMON_PMDA_CHECK_LOG}" in
0|[Ff][Aa][Ll][Ss][Ee]|[Nn][Oo])
rlLogInfo "Skipping check of the ${pmda} log file"
return 0
;;
esac
if [[ "${pmda}" == "nfsclient" ]]; then
rlRun -s "grep -v 'ignored, already in cache' ${logf}"
logf="${rlRun_LOG}"
fi
rlAssertNotGrep "${errstr}" ${logf} -Ei || result=1
rlFileSubmit "${logf}"
return ${result}
}
function pcpcommon_pmda_tests () {
local pmda="$1"
local addparam="$2"
local testgroup="pmda.${pmda}"
if rlRun "grep -q ${testgroup} ${pcpcommon_PCP_VAR_DIR}/testsuite/group" 0,1; then
pcpcommon_test "000 -g ${testgroup} ${addparam}"
pcpcommon_pmda_check_log ${pmda}
else
rlLogInfo "No upstream tests for ${pmda}"
fi
}
function pcpcommonLibraryLoaded () {
if ! rpm -q pcp-testsuite &>/dev/null; then
rlFail "pcp-testsuite RPM is not installed"
return 1
fi
rlFileBackup --namespace pcpcommon_init ${pcpcommon_PCP_ENV}
# RHEL-6 workaround
if ! ping -c 1 $(hostname) &> /dev/null; then
rlFileBackup --namespace pcpcommon_init /etc/hosts
echo 127.0.0.2 $(hostname) >> /etc/hosts
fi
# For PCP versions < '5.1.0' run the testuite as root
local _pcpver=$(rpm -q --qf '%{version}' pcp)
local _pcpcmp=$(rlCmpVersion "${_pcpver}" "5.2.0")
if [[ "${_pcpcmp}" == "<" ]];then
rlLogInfo "According to the PCP version, the testsuite will run as user: ${pcpcommon_REAL_TESTSUITE_USER}"
pcpcommon_REAL_TESTSUITE_USER="root"
fi
return 0
}

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,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.

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

@ -1,3 +0,0 @@
PURPOSE of /tools/pcp/Sanity/SASL-authentication-check
Description: A basic test of SASL authentication
Author: Jan Kuřík <jkurik@redhat.com>

View File

@ -1,15 +0,0 @@
summary: A basic test of SASL authentication
description: ''
contact: Jan Kuřík <jkurik@redhat.com>
component:
- pcp
test: ./runtest.sh
framework: beakerlib
recommend:
- pcp
- cyrus-sasl-md5
- cyrus-sasl-scram
- cyrus-sasl-lib
duration: 15m
extra-summary: /tools/pcp/Sanity/SASL-authentication-check
extra-task: /tools/pcp/Sanity/SASL-authentication-check

View File

@ -1,80 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh 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/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="pcp"
METRICUSER="pcpmetricuser"
METRICUSERPW="pcpmetricuserpw"
#HASHES="scram-sha-256 digest-md5"
HASHES="scram-sha-256" # digest-md5 is now obsolete
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlServiceStart "pmcd"
rlFileBackup --clean --missing-ok \
/etc/pcp.env \
/etc/sasl2/pmcd.conf \
/etc/pcp/passwd.db
rlRun "useradd -r ${METRICUSER}"
rlPhaseEnd
for HASH in ${HASHES}; do
rlPhaseStartTest "Test for ${HASH}"
rlRun "rm -f /etc/pcp/passwd.db"
rlRun "echo -e 'mech_list: ${HASH}\nsasldb_path: /etc/pcp/passwd.db\n' \
> /etc/sasl2/pmcd.conf"
rlRun "echo ${METRICUSERPW} | saslpasswd2 -p -a pmcd ${METRICUSER}"
rlRun "chown root:pcp /etc/pcp/passwd.db"
rlRun "chmod 640 /etc/pcp/passwd.db"
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"
rlAssertNotGrep "user not found" "${rlRun_LOG}"
rlAssertGrep ".*inst .*value .*" "${rlRun_LOG}" -E
rlFileSubmit "/var/log/pcp/pmcd/pmcd.log"
rlPhaseEnd
done
rlPhaseStartCleanup
rlRun "userdel -fr ${METRICUSER}"
rlFileRestore
rlServiceRestore
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

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

@ -1,3 +0,0 @@
PURPOSE of /tools/pcp/Sanity/pcp-python-compliance
Description: Check for a compliance with Fedora Packaging Guidelines
Author: Jan Kuřík <jkurik@redhat.com>

View File

@ -1,13 +0,0 @@
summary: Check for a compliance with Fedora Packaging Guidelines
description: ''
contact: Jan Kuřík <jkurik@redhat.com>
component:
- pcp
test: ./runtest.sh
framework: beakerlib
recommend:
- python3-pcp
- python-pcp
duration: 15m
extra-summary: /tools/pcp/Sanity/pcp-python-compliance
extra-task: /tools/pcp/Sanity/pcp-python-compliance

View File

@ -1,69 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh 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/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="pcp"
PYPACKAGE="$(rpm -q --qf '%{name}\n' python3-pcp python-pcp 2>/dev/null | grep '^python')"
rlJournalStart
rlPhaseStartSetup
rlLog "Compliance with Fedora Packaging Guidelines test"
rlLog "Check https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/"
rlAssertRpm ${PACKAGE}
rlAssertRpm ${PYPACKAGE}
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest "Check for *.pyc files"
rlRun "rpm -ql ${PYPACKAGE} > filelist.list"
while read f; do
if [[ ${f##*.} == "py" ]]; then
rlLog "Checking PYC file for $f"
BASE=$(basename $f)
DIR=$(dirname $f)
if [[ "${PYPACKAGE%%-*}" == "python3" ]]; then
rlAssertGrep "${DIR}/__pycache__/${BASE%.*}\..*\.pyc" filelist.list -E
else
rlAssertGrep "${DIR}/${BASE%.*}.*\.pyc" filelist.list -E
fi
fi
done < "filelist.list"
rlPhaseEnd
rlPhaseStartTest "Check for egg-info files"
rlAssertGrep "/${PACKAGE}-.*\.egg-info" filelist.list -E
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

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,5 +0,0 @@
PURPOSE of /tools/pcp/Sanity/pcp-services
Description: Test of pcp services (start / stop)
Author: Jan Kuřík <jkurik@redhat.com>
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

View File

@ -1,15 +0,0 @@
summary: Test for BZ#1944150 (Job for pmlogger.service failed because the)
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
contact: Jan Kuřík <jkurik@redhat.com>
component:
- pcp
test: ./runtest.sh
framework: beakerlib
recommend:
- pcp
- pcp-zeroconf
duration: 15m
extra-summary: /tools/pcp/Sanity/pcp-services
extra-task: /tools/pcp/Sanity/pcp-services

View File

@ -1,85 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh 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/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="pcp"
PCPSERVICES="pmlogger pmie pmproxy pmcd"
TOUT="90" # Timeout to wait for a service to start / stop
function service_action() {
local service=$1
local status=$2
local ss=
local t=${TOUT}
rlRun -s "systemctl show -p ActiveState --no-pager ${service}" 0 \
"Check if ${service} service is in expected state"
# Wait for the service to get into a proper state
while [[ "${ss}" != "${status}" ]]; do
[[ $(( t-- )) -le 0 ]] && break
sleep 1
ss=$(sed -n 's/^ActiveState=//g p' < ${rlRun_LOG})
done
if [[ "${ss}" != "${status}" ]]; then
rlFail "The ${service} service is in unexpected state '${ss}'"
return 1
else
rlPass "${service} state is OK '${ss}'"
return 0
fi
}
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "systemctl --no-pager stop ${PCPSERVICES}" 0-255
rlPhaseEnd
rlPhaseStartTest
for s in ${PCPSERVICES}; do
# All services should be stopped
service_action ${s} inactive
done
for s in ${PCPSERVICES}; do
# Start a service and check it runs
rlRun "systemctl start --no-pager ${s}"
service_action ${s} active
# Stop a service and check it is stopped
rlRun "systemctl stop --no-pager ${s}"
service_action ${s} inactive
done
rlPhaseEnd
rlPhaseStartCleanup
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

@ -1,3 +0,0 @@
PURPOSE of /tools/pcp/Sanity/pcp-testsuite-sanity
Description: pcp testing by upstream testsuite
Author: Jan Kuřík <jkurik@redhat.com>

View File

@ -1,2 +0,0 @@
034
178

View File

@ -1,31 +0,0 @@
summary: pcp testing by upstream testsuite
description: ''
contact:
- Jan Kuřík <jkurik@redhat.com>
component:
- pcp
test: ./runtest.sh
framework: beakerlib
recommend:
- pcp
- 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
duration: 4h
extra-summary: /tools/pcp/Sanity/pcp-testsuite-sanity
extra-task: /tools/pcp/Sanity/pcp-testsuite-sanity

View File

@ -1,115 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh 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/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
. ../../Library/pcpcommon/lib.sh || exit 1
PACKAGE="pcp"
TSUSER="pcpqa"
TCWD="$(pwd)"
export SYSTEMD_PAGER=''
function apply_bl() {
local bl="${1}"
local tc
if [[ ! -r "${bl}" ]] ; then
rlLogDebug "No BL $(basename ${bl}) found"
return
fi
rlLog "Applying BL $(basename ${bl})"
while read tc; do
rlRun "sed -i '/^${tc} /d' /var/lib/pcp/testsuite/group"
done < "${bl}"
return
}
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 "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
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,3 +0,0 @@
PURPOSE of /tools/pcp/Sanity/rpm-config-files
Description: Verification of rpm config files
Author: Jan Kuřík <jkurik@redhat.com>

View File

@ -1,13 +0,0 @@
summary: Verification of rpm's config files
description: 'Verification of rpms config files'
contact: Jan Kuřík <jkurik@redhat.com>
component:
- pcp
test: ./runtest.sh
framework: beakerlib
recommend:
- pcp
- rpm-build
duration: 15m
extra-summary: /tools/pcp/Sanity/rpm-config-files
extra-task: /tools/pcp/Sanity/rpm-config-files

View File

@ -1,67 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh 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/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="pcp"
rlJournalStart
rlPhaseStartSetup
rlRun "T=\$(mktemp -d /var/tmp/XXXXXXXXXXXX)"
rlRun "pushd ${T}" || rlDie 'Something is wrong .... giving up...'
# 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 "${T}/${SOURCEPKG}"
rlRun "rpm -D '_topdir ${T}' -i ${T}/${SOURCEPKG}"
rlRun "RPMS=\$(rpm -q --qf '%{name}\n' --specfile ${T}/SPECS/${PACKAGE}.spec | \
grep -v -e '-debuginfo' -e '-debugsource' | tr '\n' ' ')"
rlPhaseEnd
rlPhaseStartTest "Install and test all ${PACKAGE} rpms"
rlRun "yum install -y ${RPMS}"
for p in ${RPMS}; do
configs=$(rpm -qc ${p})
etc=$(rpm -ql ${p} | grep '^/etc/')
for f in ${etc}; do
if ! grep -q "${f}" <<< "${configs}"; then
[[ -f "${f}" ]] && [[ ! -h "${f}" ]] && rlFail \
"File ${f} from ${p} package is not marked as a config file"
fi
done
done
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd" # pushd ${T}
rlRun "rm -rf ${T}"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

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

@ -1,5 +0,0 @@
PURPOSE 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>
Bug summary: pcp shared libraries need symbol-versioning
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1037771

View File

@ -1,16 +0,0 @@
summary: A check for presence of version symbols
description: |
Bug summary: pcp shared libraries need symbol-versioning
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1037771
contact: Jan Kuřík <jkurik@redhat.com>
component:
- pcp
test: ./runtest.sh
framework: beakerlib
recommend:
- pcp
- 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

View File

@ -1,47 +0,0 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh 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.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="pcp"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlPhaseEnd
rlPhaseStartTest
for lib in `rpm -ql pcp-libs | grep lib64`; do
rlAssertExists "$lib"
rlRun "readelf -s $lib | grep '@PCP_[[:digit:]]\+\.[[:digit:]]\+'" 0 \
"$lib should contain versioned symbols"
done
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

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

@ -1,3 +0,0 @@
PURPOSE of /tools/pcp/Sanity/verify-systemd-units
Description: Verification of systemd unit files
Author: Jan Kuřík <jkurik@redhat.com>

View File

@ -1,15 +0,0 @@
summary: Verification of systemd unit files
description: ''
contact: Jan Kuřík <jkurik@redhat.com>
component:
- pcp
test: ./runtest.sh
framework: beakerlib
recommend:
- avahi
- pcp-manager
- pcp
- pcp-zeroconf
duration: 5m
extra-summary: /tools/pcp/Sanity/verify-systemd-units
extra-task: /tools/pcp/Sanity/verify-systemd-units

View File

@ -1,72 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh 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/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="pcp"
PKGS="pcp pcp-zeroconf"
UNITS=""
UNITFILESDIR="/usr/lib/systemd/system/"
rlJournalStart
rlPhaseStartSetup
PCPVER=$(rpm -q --qf '%{version}' pcp)
if rlTestVersion ${PCPVER} '<' '5.2.0'; then
PKGS="${PKGS} pcp-manager"
fi
for P in ${PKGS}; do
rlAssertRpm "${P}"
done
# Generate list of unit files
UNITS=$(rpm -ql ${PKGS} | grep "${UNITFILESDIR}")
rlLog "Available unit files: ${UNITS}"
rlPhaseEnd
rlPhaseStartTest
FAILEDU=""
for U in ${UNITS}; do
if [[ -f ${U} ]] && [[ "$(dirname ${U})" == "${UNITFILESDIR%/}" ]]; then
if ! rlRun -s "systemd-analyze --no-pager verify ${U}"; then
rlFail "Error in ${U}: $(cat ${rlRun_LOG})"
FAILEDU="${FAILEDU} $(basename ${U})"
fi
if grep -q 'is deprecated' ${rlRun_LOG}; then
rlFail "Error in ${U}: $(cat ${rlRun_LOG})"
FAILEDU="${FAILEDU} $(basename ${U})"
fi
else
rlLog "${U} is not a regular unit file ... skipping"
fi
done
[[ -n "${FAILEDU}" ]] && rlLog "List of failed units: ${FAILEDU}"
rlPhaseEnd
rlPhaseStartCleanup
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

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,5 +0,0 @@
PURPOSE 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>
Bug summary: pcp creates a world writeable directory /var/lib/pcp/tmp
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1025583

View File

@ -1,15 +0,0 @@
summary: Test for BZ#1025583 (pcp creates a world writeable directory)
description: |
Bug summary: pcp creates a world writeable directory /var/lib/pcp/tmp
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1025583
contact: Jan Kuřík <jkurik@redhat.com>
component:
- pcp
test: ./runtest.sh
framework: beakerlib
recommend:
- pcp
- pcp-testsuite
duration: 15m
extra-summary: /tools/pcp/Sanity/writeable-suid-guid
extra-task: /tools/pcp/Sanity/writeable-suid-guid

View File

@ -1,66 +0,0 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh 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.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.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"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "T=\$(mktemp -d)"
rlRun "pushd ${T}" || rlDie "Can not 'cd' into a temporary directory"
rlPhaseEnd
rlPhaseStartTest
rlRun -s "find ${DIRS} \
\\( -perm -4000 -fprintf suid.txt '%#m %u:%g %p\\\\n' \\) , \
\\( -perm -2000 -fprintf guid.txt '%#m %u:%g %p\\\\n' \\) , \
\\( -perm -1000 -fprintf sticky.txt '%#m %u:%g %p\\\\n' \\) , \
\\( -type d -perm -0002 -fprintf writeable-d.txt '%#m %u:%g %p\\\\n' \\) , \
\\( -type f -perm -0002 -fprintf writeable-f.txt '%#m %u:%g %p\\\\n' \\) \
" 0 "Search for world-writable, SUID, GUID or sticky bit files and directories"
for f in suid.txt guid.txt sticky.txt writeable-d.txt writeable-f.txt; do
if [[ -s ${f} ]]; then
rlLogInfo "${f} contains the following files:"
rlLogInfo "$(cat ${f})"
rlFail "PCP files/dirs should not contain SUID, GUID, sticky or world" \
"writeable files"
fi
done
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -rf ${T}"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd