summaryrefslogtreecommitdiff
path: root/qa/024
blob: 7247484e5c30dee87648a95466859ea55062a221 (plain)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#! /bin/sh
# PCP QA Test No. 024
# juggling with contexts, including the default one
#
# 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

PMCD_CONNECT_TIMEOUT=120
PMCD_REQUEST_TIMEOUT=120
export PMCD_CONNECT_TIMEOUT PMCD_REQUEST_TIMEOUT

_filter()
{
    # unfortunatley, -D16 maps to an internal libirixpmda debug flag
    # for nodes et al
    # filter for __pmDecodeXtendError diag, added in rev 2.23 of
    # libpcp/src/p_error.c ... not always present
    #
    sed \
	-e '/using .* kmem interface/d' \
	-e 's/localhost/<&>/' \
	-e "s/`hostname`\([):]\)/<localhost>\1/" \
	-e "s/$remote\([):]\)/<remotehost>\1/" \
	-e 's/fd=[0-9][0-9]*/fd=<n>/g' \
	-e 's/port=[0-9][0-9]*/port=<n>/g' \
	-e 's/handle=0x0/handle=(nil)/' \
	-e '/ Debug: reload_nodes: /d'\
	-e '/ Debug: reload_nodeinfo: /d'\
	-e '/ Debug: node_init: /d' \
	-e '/ Debug: reload_hubs: /d' \
	-e '/ Debug: handle_entry: /d' \
	-e '/^__pmDecodeXtendError: got error PDU/d' \
	-e '/^pmWhichContext() -> /d' \
	-e '/__pmSendCreds: #0/s/= 201/= 1020000/' \
	-e '/^__pmDataIPC: /d' \
	-e '/^__pmSetDataIPC/{
N
d
}' \
	-e 's/ [0-9][0-9]*(?)//g' \
	-e "s;$PCP_PMDAS_DIR;\$PCP_PMDAS_DIR;" \
	-e "s/$DSO_SUFFIX\([ ,]\)/\$DSO_SUFFIX\1/" \
        -e '/IPC table/{
s/ [0-9][0-9]*(?)//g
s/ [0-9][0-9]*(2)/ <n>(2)/g
s/ [0-9][0-9]*(2,1)/ <n>(2,1)/g
}' \
	-e 's/^\[[0-9][0-9]*]/[N]/' \
	-e "s;/irix/;/OS/;" \
	-e "s;/linux/;/OS/;" \
	-e "s;/darwin/;/OS/;" \
	-e "s;/solaris/;/OS/;" \
	-e "s;/windows/;/OS/;" \
	-e "/jbd2/d" \
	-e '/^0*x*[0-9a-f][0-9a-f]* /{
s//ADDR /
s/\[[0-9][0-9]*]/[N]/
s;=[0-9].*/OS/.*;=N name=OS_PMDA, ...;
}' \
	-e '/^\[N] .*\/OS\//s/.*/[N] domain=N, name=OS_PMDA, .../' \
	-e '/^__pmLocalPMDA(.*\/OS\//{
s/name=.*/name=OS_PMDA, ...)/
s/domain=[0-9][0-9]*/domain=N/
}' \
	-e '/__pmConnect(fd=<n>(nsprFd=/d'

}

_filter2()
{
    $PCP_AWK_PROG '
/build_dsotab:/			{ strip=1; print; print "<stripped lines>"; next }
strip == 1 && /pmNewContext/	{ strip=0 }
strip == 1			{ print >"'$tmp.tmp'"; next }
				{ print }'
}

rm -f $seq.out
if pmcd -x /dev/null -p x 2>&1 | grep '.-p requires a posi*tive numeric argument' >/dev/null
then
    if test $PCP_EOE_VER -ge 3013
    then
	ln $seq.out.4 $seq.out
    elif test $PCP_EOE_VER -ge 2704
    then
	ln $seq.out.3 $seq.out
    else
	ln $seq.out.2 $seq.out
    fi
else
    ln $seq.out.1 $seq.out
fi


trap "rm -f $tmp.*; exit" 0 1 2 3 15
$sudo rm -rf $tmp.* $seq.full

remote=`./getpmcdhosts -L -n 1 -a sample 2>$tmp.out`
if [ -z "$remote" ]
then
    cat $tmp.out >$seq.notrun
    exit
fi

# real QA test starts here
echo "=== expected to pass ==="
src/chkctx2 -D16 2>&1 | _filter
echo ""
src/chkctx2 -D16 -h localhost 2>&1 | _filter
echo ""
src/chkctx2 -D16 -h `hostname` 2>&1 | _filter
echo ""
src/chkctx2 -D16 -h $remote 2>&1 | _filter
echo ""

PCP_LITE_SAMPLE=yes
export PCP_LITE_SAMPLE

echo | tee -a $seq.full
echo "=== try CONTEXT_LOCAL ===" | tee -a $seq.full
$sudo src/chkctx2_lite -D16 -L 2>&1 \
| tee -a $seq.full \
| _filter \
| _filter2 \
| _filter_pmcd_log

echo
echo "sorted stripped lines ..."
LC_COLLATE=POSIX sort $tmp.tmp | uniq