pmrep: update TODO, man page
[pcp.git] / qa / 947
blob5f3fe808403c7020b26f7ff0fe57b436536cfda1
1 #!/bin/sh
2 # PCP QA Test No. 947
3 # pmlogger --PID functionality
5 # Copyright (c) 2015 Red Hat Inc. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 status=1 # failure is the default!
17 $sudo rm -rf $tmp.* $seq.full
18 trap "cd $here; $sudo rm -rf $tmp.*; exit \$status" 0 1 2 3 15
20 cat <<End-of-File >$tmp.config
21 log mandatory on 1 sec {
22 sample.long.one
24 End-of-File
26 # real QA test starts here
27 sleep 5 &
28 SLEEP_PID=$!
29 pmlogger -c $tmp.config -l $tmp.log --PID $SLEEP_PID $tmp >$tmp.err 2>&1
31 echo "expect 3, 4 or 5 sample lines"
32 pmdumplog $tmp \
33 | _filter_pmdumplog \
34 | grep sample \
35 | sed -e 4d -e 5d
37 pmdumplog $tmp >>$seq.full
39 $sudo rm -f $tmp.0 $tmp.index $tmp.meta
40 echo "expecting an error from PID selection"
41 pmlogger -c $tmp.config -l $tmp.log --PID -666 $tmp >$tmp.err 2>&1
42 cat $tmp.err | grep "PID error"
43 cat $tmp.err >>$seq.full
45 # success, all done
46 status=0
48 exit