/var/lib/pcp/testsuite/652 is in pcp-testsuite 3.10.8build1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | #! /bin/sh
# PCP QA Test No. 652
# checks basic pmdasystemd functionality
#
# Copyright (c) 2012 Red Hat, Inc. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
[ -d $PCP_VAR_DIR/pmdas/systemd ] || _notrun "systemd PMDA not installed"
which logger >/dev/null 2>&1 || _notrun no logger
which journalctl >/dev/null 2>&1 || _notrun no journalctl
journal_version=`journalctl --version | grep ^systemd | awk '{print $2}'`
[ "$journal_version" -ge 193 ] || _notrun journalctl too old "$journal_version"
_cleanup()
{
_restore_pmda_install $iam
$sudo rm -fr $tmp.dir
$sudo rm -f $tmp.*
exit $status
}
_filter()
{
sed \
-e "s,$tmp,TMPFILE,g" \
-e "s,$PCP_VAR_DIR,PCP_VAR_DIR,g" \
-e 's/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9][0-9][0-9]/TIMESTAMP/g'
}
_filter_probe()
{
sed \
-e 's/^\(systemd.journal.count 1\) [0-9][0-9]*/\1 COUNT/g' \
-e 's/^\(systemd.journal.bytes 1\) [0-9][0-9]*/\1 BYTES/g'
}
_filter_events()
{
fgrep 'MESSAGE=yo'
}
_filter_events_raw()
{
fgrep '4d4553534147453d796f'
}
_filter_pmda_warning()
{
# drop the adm-user-doesn't-exist warnings, optional blank line
fgrep -v 'Warning:' | grep . |
grep -v "Starting pm.*" # don't fuss about what pcp daemons are default-on
}
iam=systemd
status=1 # failure is the default!
trap "_cleanup" 0 1 2 3 15
$sudo rm -fr $tmp.dir
$sudo rm -f $tmp.* $seq.full
#debug# exec 2>$seq.full
#debug# set -x # trace this test case
# real QA test starts here
_prepare_pmda_install $iam
# install PMDA accepting the defaults (esp config file)
$sudo ./Remove </dev/null >>$here/$seq.full 2>&1
$sudo ./Install </dev/null >$tmp.out 2>&1
_wait_for_pmcd
cat $tmp.out >>$here/$seq.full
cat $tmp.out | _filter_pmda_install | _filter_pmda_warning | _filter
echo | tee -a $here/$seq.full
echo "=== 1. scalar metrics ===" | tee -a $here/$seq.full
pmprobe -v systemd | tee -a $here/$seq.full | _filter_probe
echo | tee -a $here/$seq.full
echo "=== 2. journald.records ===" | tee -a $here/$seq.full
(pmsleep 2.5; logger yo) &
pmevent -T 5 systemd.journal.records | tee -a $here/$seq.full | _filter_events
echo | tee -a $here/$seq.full
echo "=== 3. journald.records ===" | tee -a $here/$seq.full
(pmsleep 2.5; logger yo) &
pmevent -T 5 systemd.journal.records_raw | tee -a $here/$seq.full | _filter_events_raw
# remove PMDA to ensure proper cleanup (in case it wasnt already installed beforehand)
$sudo ./Remove </dev/null >>$here/$seq.full 2>&1
$sudo journalctl MESSAGE=yo >>$here/$seq.full
cat $PCP_LOG_DIR/pmcd/systemd.log >>$here/$seq.full
status=0
exit
|