/var/lib/pcp/testsuite/812 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 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 131 132 133 134 135 136 137 138 139 140 141 | #!/bin/sh
# PCP QA Test No. 812
# pmlogextract with config file and various instance specifications
#
# Copyright (c) 2015 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
status=1 # failure is the default!
$sudo rm -rf $tmp.* $seq.full
trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
_filter()
{
sed \
-e 's/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9][0-9]*[0-9]/TIMESTAMP/g'
}
_sort_pmdumplog()
{
$PCP_AWK_PROG '
BEGIN { in_inst = 0
part = 0
pname = sprintf("%03d",part)
outname = "'"$tmp"'." pname
}
in_inst == 1 && NF == 0 { in_inst = 0
close(outname)
part++
pname = sprintf("%03d",part)
outname = "'"$tmp"'." pname
}
in_inst == 0 && / inst \[/ { in_inst = 1
close(outname)
part++
pname = sprintf("%03d",part)
outname = "'"$tmp"'." pname
}
{ if (part <= 999)
print >outname
else {
# too many parts to sort
exit 1
}
}'
if [ $? -ne 0 ]
then
echo >&2 "--- 000 ---"
[ -f $tmp.000 ] && cat >&2 $tmp.000
echo >&2 "--- 001 ---"
[ -f $tmp.001 ] && cat >&2 $tmp.001
echo >&2 "--- ... ---"
echo >&2 "--- 999 ---"
[ -f $tmp.999 ] && cat >&2 $tmp.999
echo >&2 "_sort_pmdumplog failed: more than 999 parts to sort"
exit 1
fi
for p in $tmp.[0-9][0-9][0-9]
do
LC_COLLATE=POSIX sort $p
rm $p
done
}
pmdumplog -z archives/chartqa1 sample.mirage >$tmp.tmp
_sort_pmdumplog <$tmp.tmp >$tmp.ref.mirage || exit
pmdumplog -z archives/chartqa1 sample.bin >$tmp.tmp
_sort_pmdumplog <$tmp.tmp >$tmp.ref.bin || exit
_do_diffs()
{
echo "--- sample.mirage diffs ---"
pmdumplog -z $tmp sample.mirage >$tmp.tmp
if _sort_pmdumplog <$tmp.tmp
then
:
else
exit
fi \
| diff - $tmp.ref.mirage
echo "--- sample.bin diffs ---"
pmdumplog -z $tmp sample.bin | _sort_pmdumplog | diff - $tmp.ref.bin
}
# real QA test starts here
echo "=== pmlogextract no config ==="
rm -f $tmp.0 $tmp.meta $tmp.index
pmlogextract -z archives/chartqa1 $tmp
_do_diffs
echo
echo "=== pmlogextract config with metrics, no instances ==="
rm -f $tmp.0 $tmp.meta $tmp.index
cat <<End-of-File >$tmp.config
sample.mirage
sample.bin
End-of-File
pmlogextract -z -c $tmp.config archives/chartqa1 $tmp
_do_diffs
echo
echo "=== pmlogextract config with metrics, all instances in order ==="
rm -f $tmp.0 $tmp.meta $tmp.index
cat <<End-of-File >$tmp.config
sample.mirage["m-00","m-01","m-02","m-03","m-04","m-05","m-08","m-09","m-10","m-11","m-12","m-13","m-14","m-15","m-16","m-17","m-18","m-19","m-20"]
sample.bin[ "bin-100" "bin-200" "bin-300" "bin-400" "bin-500" "bin-600" "bin-700" "bin-800" "bin-900" ]
End-of-File
pmlogextract -z -c $tmp.config archives/chartqa1 $tmp
_do_diffs
echo
echo "=== pmlogextract config with metrics, all instances in reverse order ==="
rm -f $tmp.0 $tmp.meta $tmp.index
cat <<End-of-File >$tmp.config
sample.mirage["m-20","m-19","m-18","m-17","m-16","m-15","m-14","m-13","m-12","m-11","m-10","m-09","m-08","m-05","m-04","m-03","m-02","m-01","m-00"]
sample.bin[ "bin-900" "bin-800" "bin-700" "bin-600" "bin-500" "bin-400" "bin-300" "bin-200" "bin-100" ]
End-of-File
pmlogextract -z -c $tmp.config archives/chartqa1 $tmp
_do_diffs
echo
echo "=== pmlogextract config with metrics, some instances ==="
rm -f $tmp.0 $tmp.meta $tmp.index
cat <<End-of-File >$tmp.config
sample.mirage["m-19","m-18","m-17","m-16","m-15","m-14","m-13","m-12","m-11","m-09","m-08","m-05","m-04","m-03","m-02","m-00"]
sample.bin[ "bin-800" "bin-700" "bin-600" "bin-500" "bin-400" "bin-300" "bin-200" ]
End-of-File
pmlogextract -z -c $tmp.config archives/chartqa1 $tmp
_do_diffs
# success, all done
status=0
exit
|