/var/lib/pcp/testsuite/964 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 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | #!/bin/sh
# PCP QA Test No. 964
# Ensure pmlogger not started via PMDA Install if it is
# not chkconfig'd on.
#
# Copyright (c) 2015 Red Hat.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
status=1 # failure is the default!
LOCALHOST=`hostname`
_needclean=true
$sudo rm -rf $tmp $tmp.* $seq.full
_interrupt()
{
status=1
}
_cleanup()
{
cd $here
if $_needclean
then
echo "Resetting system state"
_restore_loggers
_change_config pmlogger on
_restore_pmda_install simple
pmafm $LOGGING_DIR/$LOCALHOST/Latest remove >$tmp.cmd 2>&1 \
&& $sudo sh $tmp.cmd
$sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
_wait_for_pmcd
_wait_for_pmlogger
_needclean=false
fi
$sudo rm -f $tmp.*
exit $status
}
trap "_cleanup" 0
trap "_interrupt; _cleanup" 1 2 3 15
_count_pmloggers()
{
count=0
if [ -d $PCP_TMP_DIR/pmlogger ]
then cd $PCP_TMP_DIR/pmlogger
else return 0
fi
ls -l >>$here/$seq.full
plist=`ls -1`
cd $here
for process in $plist
do
[ "$process" = "primary" ] && continue
ps -p $process >/dev/null 2>&1
if [ $? = 1 ]
then
echo "urk, $PCP_TMP_DIR/pmlogger/$process has no running pmlogger instance"
else
count=`expr $count + 1`
fi
done
return $count
}
_filter_root_install()
{
_filter_pmda_install | $PCP_AWK_PROG '
/Check containers metrics have appeared/ { if ($7 >= 0) $7 = "X"
if ($10 >= 0) $10 = "Y"
}
{ print }'
}
# real QA test starts here
_prepare_pmda_install root
_disable_loggers
_change_config pmlogger off
pmafm $LOGGING_DIR/$LOCALHOST/Latest remove >$tmp.cmd 2>&1 \
&& $sudo sh $tmp.cmd
$sudo rm -f $PCP_TMP_DIR/pmlogger/*
_count_pmloggers
echo "pmlogger count at start of QA testing: $?" | tee -a $here/$seq.full
echo
# switch off pmcd and pmlogger
$sudo $PCP_RC_DIR/pcp stop | _filter_pcp_stop
# install a PMDA, which should restart only pmcd
cd $PCP_PMDAS_DIR/root
$sudo ./Install < /dev/null 2>&1 | _filter_root_install
# verify no pmloggers running
_count_pmloggers
echo "pmlogger count at end of Install (expect 0): $?" | tee -a $here/$seq.full
echo
# switch default pmlogger on once more
_restore_loggers
_change_config pmlogger on
# install a PMDA, should restart both pmcd and pmlogger
cd $PCP_PMDAS_DIR/root
$sudo ./Install < /dev/null 2>&1 | _filter_root_install
# verify pmlogger is running
_count_pmloggers
echo "pmlogger count at end of Install (expect 1): $?" | tee -a $here/$seq.full
echo
# success, all done
status=0
exit
|