/var/lib/pcp/testsuite/524 is in pcp-testsuite 3.8.12ubuntu1.
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 | #!/bin/sh
# PCP QA Test No. 524
# pmlogger silently exits when started in a directory that is
# not writeable
#
# Copyright (c) 2013 [who are you?]. All Rights Reserved.
#
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!
$sudo rm -rf $tmp.* $seq.full
trap "cd $here; chmod 755 $tmp.home; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
# _check log archive
#
_check()
{
if [ -f $1 ]
then
_filter_pmlogger_log <$1
else
echo "Error: no pmlogger.log created"
fi
if [ -f $2.0 -a -f $2.meta ]
then
pmdumplog $2 sampledso.colour \
| _filter_pmdumplog \
| sed -e '/green/s/[0-9][0-9]*$/NUMBER/'
else
echo "Error: no TEST archive created"
fi
for type in out err
do
if [ -f $tmp.$type ]
then
if [ -s $tmp.$type ]
then
echo "std$type contains ..."
_filter_pmlogger_log <$tmp.$type
else
echo "std$type is empty"
fi
else
echo "Error: std$type not created!"
fi
done
}
mkdir $tmp.home
cat >$tmp.home/config <<End-of-File
log mandatory on 1 sec {
sampledso.colour["green"]
}
End-of-File
# real QA test starts here
cd $tmp.home
echo "default case ... should work"
rm -f $tmp.out $tmp.err
$PCP_BINADM_DIR/pmlogger -s 2 -c ./config -l ./pmlogger.log ./TEST >$tmp.out 2>$tmp.err
_check ./pmlogger.log ./TEST
echo
echo "make current directory non-writeable and try again"
rm -f TEST.* pmlogger.log
rm -f $tmp.out $tmp.err
chmod 555 .
$PCP_BINADM_DIR/pmlogger -s 2 -c ./config -l ./pmlogger.log ./TEST >$tmp.out 2>$tmp.err
_check ./pmlogger.log ./TEST
echo
echo "now try with log somewhere writeable"
rm -f TEST.* $tmp.log
rm -f $tmp.out $tmp.err
chmod 555 .
$PCP_BINADM_DIR/pmlogger -s 2 -c ./config -l $tmp.log ./TEST >$tmp.out 2>$tmp.err
_check $tmp.log ./TEST
echo
echo "and finally with the archive somewhere writeable"
rm -f $tmp.TEST.* pmlogger.log
rm -f $tmp.out $tmp.err
chmod 555 .
$PCP_BINADM_DIR/pmlogger -s 2 -c ./config -l ./pmlogger.log $tmp.TEST >$tmp.out 2>$tmp.err
_check ./pmlogger.log $tmp.TEST
# success, all done
status=0
exit
|