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
|
#!/bin/sh
# PCP QA Test No. 1784
# Exercise interactive pmlogconf saving changes.
#
# Copyright (c) 2021 Red Hat.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
# need these metrics for pmlogctl predicates to be deterministic
#
_need_metric mmv.control.files
_need_metric pmproxy.control.files
_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.config,TMP.config,g" \
-e "s,$tmp.pmlogconf,GROUPDIR,g" \
-e "s/[0-9][0-9]*-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:.*/TIMESTAMP/g" \
-e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9][0-9][0-9][0-9]/TIMESTAMP/' \
# end
}
# real QA test starts here
echo "Create a well-known set of pmlogconf templates"
mkdir -p $tmp.pmlogconf/qa
cat >$tmp.pmlogconf/qa/mmv <<EOF
#pmlogconf-setup 2.0
ident Instrumented applications summary information
probe mmv.control.files exists ? include : exclude
mmv
EOF
cat >$tmp.pmlogconf/qa/hinv <<EOF
#pmlogconf-setup 2.0
ident Instrumented applications summary information
probe hinv.ncpu >= 1 ? include : exclude
hinv
EOF
cat >$tmp.pmlogconf/qa/pmproxy <<EOF
#pmlogconf-setup 2.0
ident Instrumented applications summary information
probe pmproxy.control.files exists ? include : exclude
pmproxy
EOF
head $tmp.pmlogconf/qa/* >> $seq_full
pmlogconf -d $tmp.pmlogconf $tmp.config 2>&1 | _filter
echo "== Initial pmlogger config created" | tee -a $seq_full
cat $tmp.config | tee -a $seq_full | _filter
echo "== Modify deltas and ensure changed values persist"
cat >$tmp.expect <<EOF
yes
1 minute
yes
5 seconds
no
yes
EOF
cat $tmp.expect \
| pmlogconf -d $tmp.pmlogconf $tmp.config \
| tee -a $seq_full \
| _filter
echo
echo
echo "== Completed pmlogger configuration"
cat $tmp.config | _filter
# success, all done
exit
|