5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 if [ $PCP_PLATFORM = darwin
-o $PCP_PLATFORM = solaris
]
18 _notrun
"No proc metrics for $PCP_PLATFORM"
20 # proc metrics may not be available
22 if pminfo proc.nprocs
>/dev
/null
2>&1
26 _notrun proc PMDA not installed
30 trap "rm -f $tmp.*; exit" 0 1 2 3 15
32 # real QA test starts here
42 # make sure we have latest ttymap
44 $sudo rm -f /tmp
/pcp.ttymap
45 # make sure proc agent reloads it
46 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
51 # tty filtering per host
53 if [ $PCP_PLATFORM = irix
]
55 # handle stupid /dev/tablet as controlling tty!
56 ls -lr /dev |
grep '^c.* 0, 1' \
58 NR == 1 { good=$NF; next }
59 { print "s/" $NF "/" good "/" }' >$tmp.
sed
60 ps
-e |
tee -a $seq.full |\
61 sed -e 's#pts/#ttyq#' |
62 sed -f $tmp.
sed > $tmp.ps
63 elif [ $PCP_PLATFORM = linux
]
65 ps
-e |
tee -a $seq.full |
sed \
68 /<defunct>/ { print $1, "?" }
71 echo "Arrgh ... Need to know how to do tty filtering for $PCP_PLATFORM"
75 echo "=====================" >>$seq.full
77 pminfo
-F proc.psinfo.ttyname |\
82 echo "----" > $tmp.sep
86 cat $tmp.ps
$tmp.sep
$tmp.pminfo |
tee -a $seq.full |\
87 $PCP_AWK_PROG -v verbose
=$verbose -v maxfailures
=$maxfailures -v failfile
=$tmp.fail
'
88 $0 == "----" { pminfo = 1; next; }
90 # handle defunct processes which have "-" as tty
98 sub(/.* inst \[/, "") # delete up to [
100 # fall-through, expect value on same line, but not
104 sub(/.*] value "/, "") # delete up to value "
105 sub(/"/,"") # delete the final "
110 if (ps[pid] != value && value != "?") {
111 printf("mismatch: pid = %s, ps = %s, proc = %s, cmd = %s\n", pid, ps[pid], value, ps_cmd[pid]) > failfile;
114 else if (verbose == 1) {
115 printf("match for pid = %d, value = %s, ps[pid] = %s, cmd = %s\n", pid, value, ps[pid], ps_cmd[pid]);
120 if (failures > maxfailures) {
121 printf("Number of failures = %d\n", failures)
122 system("cat " failfile)
125 printf("proc.psinfo.ttyname matches with ps\n")
129 echo "If failure, check $seq.full"