qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 000
blobfa0e1b89d161a8008c2aa6a7e00179cae4364161
1 #! /bin/sh
2 # PCP QA Test No. 000
3 # check how many processes we have running and their arguments
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
15 trap "rm -f $tmp.*; exit" 0 1 2 3 15
17 # check PMCS processes
18 rm -f $tmp.err
19 # pmdaoracle is optional, so skip it and other optional ones
20 ps $PCP_PS_ALL_FLAGS \
21 | _filter_optional_pmdas \
22 | sed \
23 -e '/dbpmda/d' \
24 -e '/<defunct>/d' \
25 | $PCP_AWK_PROG '
26 $7 == "TIME" || $10 == "TIME" { next }
27 { want = 0
28 psargs = 0
29 for (i = 12; i >= 7; i--) {
30 # most ps variants have TIME as N:NN
31 if ($i ~ /[0-9]:[0-9][0-9]$/) {
32 psargs=i+1
33 break
35 # darwin ps has TIME as N:NN.NN
36 if ($i ~ /[0-9]:[0-9][0-9]\.[0-9][0-9]$/) {
37 psargs=i+1
38 break
41 if (psargs == 0) {
42 print "Error: cannot find psargs in this ps line" >"'$tmp.err'"
43 print $0 >"'$tmp.err'"
44 next
47 $psargs ~ /pmcd/ { want = 1 }
48 $psargs ~ /pmda/ { want = 1 }
49 want == 1 { print $psargs }' \
50 | sed \
51 -e 's;.*/\([^/]*\);\1;' \
52 | LC_COLLATE=POSIX sort
54 if [ -s $tmp.err ]
55 then
56 echo
57 echo "Warnings ..."
58 cat $tmp.err