/var/lib/pcp/testsuite/416 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 | #!/bin/sh
# PCP QA Test No. 416
# news pmda ... exercise perl PMDA bits-n-bobs
#
# Copyright (c) 2010 Ken McDonell. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
perl -e "use PCP::PMDA" >/dev/null 2>&1
[ $? -eq 0 ] || _notrun "perl PCP::PMDA module not installed"
status=0 # success is the default!
$sudo rm -rf $tmp.* $seq.full
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
here=`pwd`
_filter()
{
sed \
-e "s;$tmp;TMP;g" \
-e "s;/[a-zA-Z0-9_/.\-]*/perl;PERL;" \
-e "s;$PCP_PMDAS_DIR;PCP_PMDAS_DIR;" \
-e '/^Log for pmdanews/s/ on .*/ on .../' \
-e '/^Log finished/s/ed .*/ed .../' \
-e '/^pmResult dump/{
s/ 0x[0-9a-f][0-9a-f]* / ADDR /
s/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9][0-9][0-9]/TIMESTAMP/
}'
}
cat >$tmp.pmns <<End-of-File
/* need local pmns in case the news PMDA is not installed */
root {
news
}
news {
articles
readers
}
news.articles {
total 28:0:201
count 28:0:301
last 28:0:302
}
news.readers {
xrn 28:0:113
rn 28:0:111
nnrpd 28:0:101
trn 28:0:112
vn 28:0:114
}
End-of-File
home=$PCP_PMDAS_DIR
if [ ! -d $home/news ]
then
echo "Where is $home/news?"
exit 1
fi
cd $home/news
# real QA test starts here
cat <<End-of-File | $sudo dbpmda -ie -n $tmp.pmns >$tmp.out 2>&1
open pipe `which perl` `pwd`/pmdanews.pl
traverse news
children news.articles
children news.articles.count
pmid news.articles.total
fetch news.articles.total
desc news.articles.count
instance 28.0
fetch news.articles.count
profile 28.0 none
profile 28.0 add 2
profile 28.0 add 4
getdesc on
fetch news.articles.count
close
quit
End-of-File
cat $tmp.out >>$here/$seq.full
_filter <$tmp.out
# ensure news pmda is all done ...
#
sleep 3
echo
echo "=== news.log ==="
_filter <news.log
# success, all done
status=0
exit
|