/var/lib/pcp/testsuite/389 is in pcp-testsuite 4.0.1-1.
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 | #! /bin/sh
# PCP QA Test No. 389
# Exercise pmlogger behaviour when it loses pmcd connection
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard filters
. ./common.product
. ./common.filter
. ./common.check
signal=$PCP_BINADM_DIR/pmsignal
host=`hostname`
status=1 # failure is the default!
_filter()
{
sed -e '/myFetch: End of File: PMCD exited/d' \
-e '/pmlogger: Error: IPC protocol failure/d'
}
trap "[ -n "$pid" ] && $sudo $PCP_BINADM_DIR/pmsignal -s TERM $pid >/dev/null 2>&1; $sudo rm -f $tmp.*; exit \$status" 0 1 2 3 15
$sudo rm -f $tmp.* $seq.full
# real QA test starts here
echo "=== empty config and _no_ -L, should exit immediately ===" | tee -a $here/$seq.full
$sudo rm -f $tmp.*
pmlogger -c /dev/null -l $tmp.log $tmp &
sleep 2
echo "expect no pmlogger process ..."
ps $PCP_PS_ALL_FLAGS | $PCP_AWK_PROG '$2 == "'$!'" { print }'
_filter_pmlogger_log <$tmp.log | sed -e "s/$host/HOST/"
echo | tee -a $here/$seq.full
echo "=== empty config and -L, no reconnect and no exit ===" | tee -a $here/$seq.full
$sudo rm -f $tmp.*
_start_up_pmlogger -L -c /dev/null -l $tmp.log $tmp
_wait_for_pmlogger $pid $tmp.log 5
_service pcp restart | _filter_pcp_start
_wait_for_pmcd
_wait_for_pmlogger
echo "expect pmlogger process ..."
ps $PCP_PS_ALL_FLAGS | $PCP_AWK_PROG '$2 == "'$pid'" { print "OK"}'
_filter_pmlogger_log <$tmp.log | sed -e "s/$host/HOST/"
$sudo $signal -s TERM $pid
echo | tee -a $here/$seq.full
echo "=== non-empty config, reconnect when pmcd restarted ===" | tee -a $here/$seq.full
$sudo rm -f $tmp.*
echo "log mandatory on 1 sec pmcd.version" >$tmp.config
_start_up_pmlogger -c $tmp.config -l $tmp.log $tmp
_wait_for_pmlogger $pid $tmp.log 5
echo "pid=$pid" >>$here/$seq.full
ps $PCP_PS_ALL_FLAGS | grep pmlogger >>$here/$seq.full
_service pmcd stop | _filter_pcp_stop
sleep 2
_service pmcd start | _filter_pcp_start
_wait_for_pmcd
_wait_for_pmlogger
sleep 2
echo "expect pmlogger process ..." | tee -a $here/$seq.full
ps $PCP_PS_ALL_FLAGS \
| grep pmlogger \
| tee -a $here/$seq.full \
| $PCP_AWK_PROG '$2 == "'$pid'" { print "OK"}'
_filter_pmlogger_log <$tmp.log | _filter | sed -e "s/$host/HOST/"
$sudo $signal -s TERM $pid
sleep 2
echo "pmlogger log file ..." >>$here/$seq.full
cat $tmp.log >>$here/$seq.full
echo "expect one mark record ..."
pmdumplog -M $tmp | grep '<mark>' | wc -l | sed -e 's/ //g'
# success, all done
status=0
exit
|