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
|
#!/bin/sh
# PCP QA Test No. 1440
# pmlogrewrite - indom renumbering tests
#
# Copyright (c) 2023 Ken McDonell. All Rights Reserved.
#
if [ $# -eq 0 ]
then
seq=`basename $0`
echo "QA output created by $seq"
else
# use $seq from caller, unless not set
[ -n "$seq" ] || seq=`basename $0`
echo "QA output created by `basename $0` $*"
fi
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
_cleanup()
{
cd $here
$sudo rm -rf $tmp $tmp.*
}
status=0 # success is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
_filter()
{
sed \
-e "s@$tmp@TMP@g" \
# end
}
# real QA test starts here
for indom in NULL 30.2 30.42 30.43 30.44
do
for pick in 'inst 500' 'iname "bin-500"' 'inst 542' 'iname "bin-542"'
do
rm -f $tmp.config $tmp.head
touch $tmp.head
case "$indom"
in
30.42) # renumbered
echo "indom 30.2 { indom -> $indom }" >$tmp.head
;;
30.43) # not found
;;
30.44) # renumbered & inst 500 -> inst 542
cat <<End-of-File >$tmp.head
indom 30.2 {
indom -> $indom
inst 500 -> 542
iname "bin-500" -> "new bin 542"
}
End-of-File
;;
esac
cat $tmp.head >$tmp.config
cat <<End-of-File >>$tmp.config
# input metric has indom
metric sample.bin {
# PMID needs to be in domain 30, but not used for anything else
pmid -> 30.42.6
indom -> $indom output $pick
}
End-of-File
echo
echo "=== non-singular metric indom=$indom pick=$pick ==="
rm -f $tmp.0 $tmp.meta $tmp.index
pmlogrewrite -w -c $tmp.config archives/rewrite $tmp 2>&1 | _filter
pmlogcheck $tmp 2>&1 | _filter
pminfo -mdf -a $tmp sample.bin 2>&1 | _filter
if [ "$indom" != NULL ]
then
cat $tmp.head >$tmp.config
cat <<End-of-File >>$tmp.config
# input metric is singular
metric sampledso.long.hundred {
indom -> $indom output $pick
}
End-of-File
echo
echo "=== singular metric indom=$indom pick=$pick ==="
rm -f $tmp.0 $tmp.meta $tmp.index
pmlogrewrite -w -c $tmp.config archives/rewrite $tmp 2>&1 | _filter
pmlogcheck $tmp 2>&1 | _filter
pminfo -mdf -a $tmp sampledso.long.hundred 2>&1 | _filter
fi
done
done
# success, all done
exit
|