Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 053
blob00a974c27bb243f5636c73e4be1673c1a94e3a55
1 #! /bin/sh
2 # PCP QA Test No. 053
3 # Verify the good stuff happens with pmclient and pmclient_fg
5 # Copyright (c) 2016 Red Hat.
6 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
9 seq=`basename $0`
10 echo "QA output created by $seq"
12 # get standard filters
13 . ./common.product
14 . ./common.filter
16 _filter()
18 tee -a $seq.full \
19 | sed -e 's/pmFetchGroup/pmFetch/g' \
20 | $PCP_AWK_PROG '
21 /^Archive: / { print "... title ..."; next }
22 /^[0-9. ]*$/ { print "... " NF " numbers ..."; next }
23 { print }'
26 trap "rm -f $tmp $tmp.*; exit" 0 1 2 3 15
28 rm -f $here/$seq.full
30 # real QA test starts here
31 cat >$tmp.config <<End-of-File
32 log mandatory on once {
33 hinv.ncpu
35 log mandatory on 5 secs {
36 kernel.all.load [ "1 minute", "15 minute" ]
37 kernel.percpu.cpu.user
38 kernel.percpu.cpu.sys
39 mem.freemem
40 disk.all.total
42 End-of-File
43 pmlogger -c $tmp.config -l $tmp.log -s 4 $tmp
44 _filter_pmlogger_log <$tmp.log
45 cat $tmp.log >>$here/$seq.full
47 pmdumplog $tmp >>$here/$seq.full
49 ncpu=`pmprobe -v hinv.ncpu 2>&1 \
50 | $PCP_AWK_PROG '
51 NF == 3 && $2 == 1 { print $3; exit }
52 { print "0"; exit }'`
54 run()
56 pmclient=$1
57 echo "== $pmclient variant =="
59 # output is sensitive to SP/MP ... so do the one that is real,
60 # and fake the other
62 if [ "$ncpu" -eq 1 ]
63 then
64 echo "real SP case" >>$here/$seq.full
65 $pmclient -a $tmp 2>&1 | _filter
66 echo "..."
67 # fake MP output
68 cat <<End-of-File
69 ... title ...
70 CPU Busy Busy Free Mem Disk Load Average
71 Util CPU Util (Mbytes) IOPS 1 Min 15 Min
72 ... 7 numbers ...
73 ... 7 numbers ...
74 $pmclient: pmFetch: End of PCP archive log
75 End-of-File
76 else
77 # fake SP output
78 cat <<End-of-File
79 ... title ...
80 CPU Free Mem Disk Load Average
81 Util (Mbytes) IOPS 1 Min 15 Min
82 ... 5 numbers ...
83 ... 5 numbers ...
84 $pmclient: pmFetch: End of PCP archive log
85 End-of-File
86 echo "..."
87 echo "real MP case" >>$here/$seq.full
88 $pmclient -a $tmp 2>&1 | _filter
91 echo "== $pmclient done ==" && echo
94 run pmclient
95 run pmclient_fg