File: 013

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 (61 lines) | stat: -rwxr-xr-x 1,481 bytes parent folder | download | duplicates (2)
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
#! /bin/sh
# PCP QA Test No. 013
# pmdumplog dumps core when fed a metadata file instead of a basename?
#
# 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

_filter_trace()
{
    sed \
	-e '/chkLabel:/d' \
	-e '/__pmLogChkLabel:/d' \
	-e '/__pmLogLoadMeta:/d' \
	-e '/__pmLogSetTime/d' \
	-e '/__pmLogRead/d'
}

trap "rm -f $tmp.* /tmp/bogus.* /tmp/fungus.* /tmp/fungus /tmp/bogus; exit 0" 0 1 2 3 15

# real QA test starts here
echo "For PCP 1.1 Expect cannot open archive error message, and no core file ..."
echo "For PCP 2.0 -l tmparch/foo.meta is a synonym for -l src/foo, so this works ..."

$sudo rm -f /tmp/bogus.* /tmp/fungus.* /tmp/fungus
touch /tmp/bogus.verylongsuffix /tmp/fungus
for dir in /etc /sbin /bin /usr/sbin /usr/bin
do
    [ ! -f $dir/init ] && continue
    cp $dir/init /tmp/fungus
    break
done

for bad in tmparch/foo.meta /tmp/fungus /tmp/bogus
do
    echo
    if [ -f $bad ]
    then
	echo "=== $bad: exists ==="
    else
	echo "=== $bad: does not exist ==="
    fi
    $sudo rm -f core*
    pmdumplog -D log -l $bad 2>$tmp.err >$tmp.out

    _filter_pmdumplog --any-version <$tmp.out
    if [ -s $tmp.err ]
    then
	# need sort 'cause "inspect file" diag order is not determinisitic
	echo "[filtered and sorted stderr]"
	_filter_trace <$tmp.err | LC_COLLATE=POSIX sort
    fi
    _check_core
done