python api: fix syntax error in recent context changes
[pcp.git] / qa / 044
blob5376e02d2c9c012e5ca56eb93cd8ec8ed2cb023d
1 #! /bin/sh
2 # PCP QA Test No. 044
3 # check pmval and pminfo for numval == 0 and < 0
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard filters
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 _filter()
18 sed \
19 -e '/Warning.*license/d' \
20 -e "s/^host: .*/host: local:/g"
23 _doit()
25 $sudo rm -f core*
26 pmval -s 1 $m 2>$tmp.err | _filter
27 _filter <$tmp.err
28 case $1
30 proc.*)
31 # impossible pid
32 pmval -s 1 -i 123456789 $m 2>$tmp.err | _filter
33 _filter <$tmp.err
35 esac
36 if [ "`echo core*`" != "core*" ]
37 then
38 echo "Arrgh, pmval dumped core"
39 ls -l core*
40 file core*
43 $sudo rm -f core*
44 pminfo -f $m
45 if [ "`echo core*`" != "core*" ]
46 then
47 echo "Arrgh, pminfo dumped core"
48 ls -l core*
49 file core*
54 rm -f $seq.out $seq.full
55 if [ $PCP_PLATFORM = linux ]
56 then
57 # proc metrics may not be available
59 if pminfo proc.nprocs >/dev/null 2>&1
60 then
61 have_proc=true
62 ln $seq.linux $seq.out
63 else
64 have_proc=false
65 ln $seq.linux.1 $seq.out
67 elif [ $PCP_PLATFORM = darwin -o $PCP_PLATFORM = solaris ]
68 then
69 ln $seq.darwin $seq.out
70 else
71 echo "Warning: no validated output for $PCP_PLATFORM"
74 trap "rm -f $tmp.*; exit" 0 1 2 3 15
76 # real QA test starts here
78 for m in sample.noinst sampledso.needprofile \
79 proc.psinfo.pid proc.pstatus.syscall proc.pscred.ngroups \
80 proc.psusage.starttime proc.memory.physical.stack
82 case $m
84 proc.*)
85 [ $PCP_PLATFORM = linux ] && continue
86 [ $PCP_PLATFORM = darwin ] && continue
87 [ $PCP_PLATFORM = solaris ] && continue
89 esac
90 _doit $m
91 done
93 if [ $PCP_PLATFORM = linux ] && $have_proc
94 then
95 # impossible pid
96 echo
97 pmval -s 1 -i 123456789 proc.psinfo.utime 2>$tmp.err | _filter
98 _filter <$tmp.err
99 echo
102 _wait_for_pmcd