/var/lib/pcp/testsuite/1044 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 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 126 127 128 129 130 | #! /bin/sh
# PCP QA Test No. 1044 (formerly 525)
# exercises pmieconf cmd line
#
# Copyright (c) 1995-2002 Silicon Graphics, 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
which pmieconf >/dev/null 2>&1 || _notrun "No pmieconf binary installed"
status=1 # failure is the default!
_cleanup()
{
[ -f $tmp.save ] && cp $tmp.save $HOME/.pcp/pmie/config.pmie
rm -f $tmp.*
exit $status
}
filterpmieerr()
{
sed -e '
/^pmieconf:.* already been used,/ {
s/"[^"]*"/"SOME.RULE"/
}
/, line [0-9]*\./ {
s/, line [0-9]*\./, line LINENUMBER./
s/"\.\/pconf\/.*",/"\.\/pconf\/SOME\/RULE",/
}'
}
trap "_cleanup" 0 1 2 3 15
# keep this to restore later in case its someones local pmie config file
[ -f $HOME/.pcp/pmie/config.pmie ] && cp $HOME/.pcp/pmie/config.pmie $tmp.save
rm -f $HOME/.pcp/pmie/config.pmie
# real QA test starts here
echo
echo "=== basic test - check that we get one rule..."
pmieconf -r ./pconf list memory
echo
echo "=== basic test - check that we get one rule..."
pmieconf -r ./pconf l memory.exhausted
echo
echo "=== check for non-existant rules location"
pmieconf -r /no/such/file -v 5 all
rm -f $seq.full
echo
echo "=== check no fatal errors when creating config.pmie"
pmieconf -r ./pconf -f $seq.full -F >/dev/null 2>$tmp.out
sed -e "s/$$/PID/g" $tmp.out
wc -l <$seq.full | sed -e 's/ //g' # check the file is what we expect
head -2 $seq.full # check the initial lines generated OK
echo
echo "=== check generated config.pmie is good pmie syntax"
# Mac OS X issue ... swap.pagesout is not supported, so we get
# pmie: metric swap.pagesout not in namespace for host Colleens-iMac.local
# pmLookupName failed: Unknown metric name
#
# Solaris issue ... some filesys.* metrics and swap.pagesout not
# supported, so similar problem there
#
pmie -C $seq.full >$tmp.out 2>&1
sts=$?
if [ $PCP_PLATFORM = darwin ]
then
$PCP_AWK_PROG <$tmp.out '
BEGIN { skip = 0 }
/pmie: metric swap.pagesout not in namespace/ { skip = 2 }
skip > 0 { skip--; next }
{ print }'
elif [ $PCP_PLATFORM = solaris ]
then
$PCP_AWK_PROG <$tmp.out '
BEGIN { skip = 0 }
/pmie: metric filesys.used not in namespace/ { skip = 2 }
/pmie: metric filesys.capacity not in namespace/{ skip = 2 }
/pmie: metric swap.pagesout not in namespace/ { skip = 2 }
skip > 0 { skip--; next }
{ print }'
else
cat $tmp.out
fi
echo status=$sts
cat > $tmp.input << EOF
list all
quit
EOF
echo
echo "=== check interactive similar to command line...."
pmieconf -r ./pconf list all > $tmp.cmdline
pmieconf -r ./pconf > $tmp.interact < $tmp.input
echo >> $tmp.interact
diff $tmp.cmdline $tmp.interact | sed -e "s,$HOME,HOME,g"
echo
echo "=== check rules path & duplicate rule names (-r)..."
pmieconf -F -r ./pconf:./pconf 2>&1 | filterpmieerr
echo status=$?
echo
echo "=== check rules path & duplicate rule names (env)..."
PMIECONF_PATH=./pconf:/no/such/rules:./pconf
export PMIECONF_PATH
pmieconf -F -r ./pconf:./pconf 2>&1 | filterpmieerr
echo status=$?
echo
echo "=== check env variable gets used over default..."
pmieconf list all
echo status=$?
# success, all done
status=0
exit
|