File: 271

package info (click to toggle)
pcp 7.1.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 252,748 kB
  • sloc: ansic: 1,483,656; sh: 182,366; xml: 160,462; cpp: 83,813; python: 24,980; perl: 18,327; yacc: 6,877; lex: 2,864; makefile: 2,738; awk: 165; fortran: 60; java: 52
file content (88 lines) | stat: -rwxr-xr-x 2,099 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#! /bin/sh
# PCP QA Test No. 271
# __pmLogOpen() failed if basename.anything was a directory
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc.  All Rights Reserved.
#

seq=`basename $0`
echo "QA output created by $seq"

# get standard filters
. ./common.product
. ./common.filter
. ./common.check

host=`hostname`

status=1	# failure is the default!
trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15

_filter()
{
    _filter_dbg \
    | _filter_pmdumplog --any-version \
    | sed \
	-e 's/]/ ]/g' \
	-e 's/__pmLogChkLabel/chkLabel/g' \
	-e 's/TIMESTAMP (t=[0-9][0-9.]*)/TIMESTAMP/g' \
	-e 's/tz=[^ ]*/tz=TZ/' \
	-e 's/ ]/]/g' \
	-e '/magic=/{
s/2 version=2/X version=X/
s/3 version=3/X version=X/
}' \
    | grep -v "$tmp.tmp" \
    | grep -v "$tmp.out" \
    | $PCP_AWK_PROG '
$1 == "chkLabel:" && /vol=0/	{ if (fd1 == "") fd1 = $2
				  if (fd1 == $2) $2 = "fd=<n1>"
				}
$1 == "chkLabel:" && /vol=-2/	{ if (fd2 == "") fd2 = $2
				  if (fd2 == $2) $2 = "fd=<n2>"
				}
$1 == "chkLabel:" && /vol=-1/	{ if (fd3 == "") fd3 = $2
				  if (fd3 == $2) $2 = "fd=<n3>"
				}
$1 == "__pmLogRead:"		{ if (fd4 == "") fd4 = $2
				  if (fd4 == $2) $2 = "fd=<n4>"
				}
				{ print }' \
    | sed >$tmp.tmp \
	-e "s;$tmp;TMP;g" \
	-e 's/^\(__pmFopen("TMP\.\)[^"]*"/\1???"/g' \
	-e "s/$host.*\]/HOST]/g" \
	-e "s/$host/HOST/g" \
	-e 's/pid=[0-9][0-9]*/pid=PID/g' \
	-e 's/posn=[0-9][0-9]*/posn=OFFSET/g' \
	-e 's/header+[0-9][0-9]*+trailer/header+LEN+trailer/g'
    grep __pmLogFindOpen $tmp.tmp | LC_COLLATE=POSIX sort
    grep -v __pmLogFindOpen $tmp.tmp
}

echo "log mandatory on once pmcd.control" \
| pmlogger -s 1 -l $tmp.log $tmp >$tmp.out 2>&1

echo === no dir ===
pmdumplog -Dlog -l $tmp >$tmp.out 2>&1
echo "[filtered and sorted stderr]"
_filter <$tmp.out
cat $tmp.out >>$seq_full

echo
echo === empty dir ===
mkdir $tmp.dir
pmdumplog -Dlog -l $tmp >$tmp.out 2>&1
echo "[filtered and sorted stderr]"
_filter <$tmp.out

echo
echo === non-empty dir ===
touch $tmp.dir/dummy
pmdumplog -Dlog -l $tmp >$tmp.out 2>&1
echo "[filtered and sorted stderr]"
_filter <$tmp.out

# success, all done
status=0
exit