python api: fix syntax error in recent context changes
[pcp.git] / qa / 073
blob604cbc649c3888d63092891ed0210dc77096422c
1 #! /bin/sh
2 # PCP QA Test No. 073
3 # check out pmclient_fg python script (live mode)
4 # Python toolchain variant of test 109.
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 trap "rm -f $tmp.*; exit" 0 1 2 3 15
21 _filter()
23 sed \
24 -e 's/^Host: .*/Host: .../' \
25 -e 's/ *[0-9][0-9]*\.[0-9][0-9]*/ FLOAT/g' \
26 -e 's/ *[0-9][0-9]*/ INTEGER/g'
29 # real QA test starts here
31 ncpu=`pmprobe -v hinv.ncpu 2>&1 \
32 | $PCP_AWK_PROG '
33 NF == 3 && $2 == 1 { print $3; exit }
34 { print "0"; exit }'`
37 # output is sensitive to SP/MP ... so do the one that is real, and fake
38 # the other
40 if [ "$ncpu" -eq 1 ]
41 then
42 $pmclient -t 1 -s 3 | _filter
43 echo "..."
44 # fake MP output
45 cat <<End-of-File
46 Host: ...
47 CPU Busy Busy Free Mem Disk Load Average
48 Util CPU Util (Mbytes) IOPS INTEGER Min INTEGER Min
49 FLOAT INTEGER FLOAT FLOAT INTEGER FLOAT FLOAT
50 FLOAT INTEGER FLOAT FLOAT INTEGER FLOAT FLOAT
51 FLOAT INTEGER FLOAT FLOAT INTEGER FLOAT FLOAT
52 End-of-File
53 else
54 # fake SP output
55 cat <<End-of-File
56 Host: ...
57 CPU Free Mem Disk Load Average
58 Util (Mbytes) IOPS INTEGER Min INTEGER Min
59 FLOAT FLOAT INTEGER FLOAT FLOAT
60 FLOAT FLOAT INTEGER FLOAT FLOAT
61 FLOAT FLOAT INTEGER FLOAT FLOAT
62 End-of-File
63 echo "..."
64 $pmclient -t 1 -s 3 | _filter