4 # pmlogconf - handle changes in installed group files
6 # Copyright (c) 2014 Red Hat.
7 # Copyright (c) 2010 Ken McDonell. All Rights Reserved.
11 echo "QA output created by $seq"
13 # get standard environment, filters and checks
18 [ -f $PCP_BINADM_DIR/pmlogconf-setup
] || _notrun pmlogconf-setup not installed
19 postgres
=`pmprobe postgresql.stat.all_tables.seq_scan | awk '{ print $2 }'`
20 [ "$postgres" -ge 0 ] && _notrun
"Test $seq sensitive to local postgres install"
23 if [ $PCP_PLATFORM = darwin
]
25 ln $seq.darwin
$seq.out ||
exit 1
27 ln $seq.other
$seq.out ||
exit 1
30 status
=0 # success is the default!
31 $sudo rm -rf $tmp.
* $seq.full
32 trap "rm -rf $tmp $tmp.*; exit \$status" 0 1 2 3 15
35 # need to handle diff-c lines like this
36 # *** TMP.conf 2010-06-17 06:36:00.000000000 +1000
37 # --- /var/tmp/pcp.[a0Sg619P4/]ctl 2012-11-16 13:37:29.000000000 +0000
43 -e '/^\*\*\* TMP\.conf/s/\.conf.*/.orig .../' \
44 -e '/^--- .*\/ctl/s/ .*/ TMP.new .../' \
45 -e '/^--- .*\.ctl/s/ .*/ TMP.new .../'
48 cat <<End-of-File >$tmp/01
50 probe sample.long.ten == 10 ? include : exclude
57 cat <<End-of-File >$tmp/02
59 probe sample.ulong.ten != 10 ? include : exclude
64 cat <<End-of-File >$tmp/03
66 probe sample.longlong.ten >= 10 ? include : available
71 cat <<End-of-File >$tmp/04
73 probe sample.ulonglong.ten < 10 ? include : available
78 # real QA test starts here
80 pmlogconf
-d $tmp $tmp.conf \
83 echo "--- start initial config file ---"
84 cat $tmp.conf | _filter
85 echo "--- end initial config file ---"
87 cat <<End-of-File >$tmp/00
94 cat <<End-of-File >$tmp/05
103 ( echo q
; echo '') | pmlogconf
-v -d $tmp $tmp.conf \
106 # reverse the condition
108 cat <<End-of-File >$tmp/02
110 probe sample.ulong.ten <= 10 ? include : exclude
115 # reverse the condition
117 cat <<End-of-File >$tmp/03
119 probe sample.longlong.ten > 10 ? include : available
124 ( echo q
; echo '') | pmlogconf
-r -d $tmp $tmp.conf \
129 cat <<End-of-File >$tmp/01
131 probe sample.long.ten ~ ^10$ ? include : exclude
139 cat <<End-of-File >$tmp/02
141 probe sample.ulong.ten ~ 10 ? include : exclude
147 cat <<'End-of-File' >$tmp/98
149 ident postgresql summary information
150 probe postgresql.stat.all_tables.seq_scan ? include : available
151 postgresql.stat.database
152 postgresql.stat.all_tables
153 postgresql.stat.all_indexes
154 postgresql.statio.all_tables
155 postgresql.statio.all_indexes
158 cat <<'End-of-File' >$tmp/99
160 ident Example from pmlogconf(1) man page
161 ident ... more descripton
163 probe sample.secret.foo.one values ? include : exclude
164 sample.secret.foo.one
165 sample.secret.foo.bar # non-leaf in the PMNS
166 sample.colour [ red green ]
169 ( echo q
; echo '') | pmlogconf
-d $tmp $tmp.conf \
172 echo "--- start final config file ---"
173 cat $tmp.conf | _filter
174 echo "--- end final config file ---"