qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 271
blob0c81cb38956b1687ee16dd7175533a6efe4173f4
1 #! /bin/sh
2 # PCP QA Test No. 271
3 # __pmLogOpen() failed if basename.anything was a directory
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 host=`hostname`
18 status=1 # failure is the default!
19 trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
21 _filter()
23 _filter_dbg \
24 | _filter_pmdumplog \
25 | sed \
26 -e 's/__pmLogChkLabel/chkLabel/g' \
27 -e 's/TIMESTAMP (t=[0-9][0-9.]*)/TIMESTAMP/g' \
28 | grep -v "$tmp.tmp" \
29 | grep -v "$tmp.out" \
30 | $PCP_AWK_PROG '
31 $1 == "chkLabel:" && /vol=0/ { if (fd1 == "") fd1 = $2
32 if (fd1 == $2) $2 = "fd=<n1>"
34 $1 == "chkLabel:" && /vol=-2/ { if (fd2 == "") fd2 = $2
35 if (fd2 == $2) $2 = "fd=<n2>"
37 $1 == "chkLabel:" && /vol=-1/ { if (fd3 == "") fd3 = $2
38 if (fd3 == $2) $2 = "fd=<n3>"
40 $1 == "__pmLogRead:" { if (fd4 == "") fd4 = $2
41 if (fd4 == $2) $2 = "fd=<n4>"
43 { print }' \
44 | sed >$tmp.tmp \
45 -e "s;$tmp;TMP;g" \
46 -e "s/$host.*\]/HOST]/g" \
47 -e "s/$host/HOST/g" \
48 -e 's/pid=[0-9][0-9]*/pid=PID/g' \
49 -e 's/posn=[0-9][0-9]*/posn=OFFSET/g' \
50 -e 's/header+[0-9][0-9]*+trailer/header+LEN+trailer/g'
51 grep __pmLogOpen $tmp.tmp | LC_COLLATE=POSIX sort
52 grep -v __pmLogOpen $tmp.tmp
55 echo "log mandatory on once pmcd.control" \
56 | pmlogger -s 1 -l $tmp.log $tmp >$tmp.out 2>&1
58 echo === no dir ===
59 pmdumplog -D128 -l $tmp >$tmp.out 2>&1
60 echo "[filtered and sorted stderr]"
61 _filter <$tmp.out
63 echo
64 echo === empty dir ===
65 mkdir $tmp.dir
66 pmdumplog -D128 -l $tmp >$tmp.out 2>&1
67 echo "[filtered and sorted stderr]"
68 _filter <$tmp.out
70 echo
71 echo === non-empty dir ===
72 touch $tmp.dir/dummy
73 pmdumplog -D128 -l $tmp >$tmp.out 2>&1
74 echo "[filtered and sorted stderr]"
75 _filter <$tmp.out
77 # success, all done
78 status=0
79 exit