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