pmrep: fix archive end time reporting
[pcp.git] / qa / 024
blobcc1b007986c2d372321242fa659236faf1d1f5b8
1 #! /bin/sh
2 # PCP QA Test No. 024
3 # juggling with contexts, including the default one
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 PMCD_CONNECT_TIMEOUT=120
17 PMCD_REQUEST_TIMEOUT=120
18 export PMCD_CONNECT_TIMEOUT PMCD_REQUEST_TIMEOUT
20 _filter()
22 # unfortunatley, -D16 maps to an internal debug flag for some PMDAs
23 # for nodes et al
24 # filter for __pmDecodeXtendError diag because datum is not
25 # invariant
27 sed \
28 -e '/using .* kmem interface/d' \
29 -e 's/localhost/<&>/' \
30 -e "s/`hostname`\([):]\)/<localhost>\1/" \
31 -e "s/$remote\([):]\)/<remotehost>\1/" \
32 -e 's/fd=[0-9][0-9]*/fd=<n>/g' \
33 -e 's/port=[0-9][0-9]*/port=<n>/g' \
34 -e 's/handle=0x0/handle=(nil)/' \
35 -e '/ Debug: reload_nodes: /d'\
36 -e '/ Debug: reload_nodeinfo: /d'\
37 -e '/ Debug: node_init: /d' \
38 -e '/ Debug: reload_hubs: /d' \
39 -e '/ Debug: handle_entry: /d' \
40 -e '/^__pmDecodeXtendError: got error PDU/s/datum=[0-9][0-9]*/datum=DATA/' \
41 -e '/^pmWhichContext() -> /d' \
42 -e '/__pmSendCreds: #0/s/= 201/= 1020000/' \
43 -e '/^__pmDataIPC: /d' \
44 -e '/^__pmSetSocketIPC: fd/d' \
45 -e '/^IPC table fd/d' \
46 -e '/^__pmSetDataIPC/{
49 }' \
50 -e 's/ [0-9][0-9]*(?)//g' \
51 -e "s;$PCP_PMDAS_DIR;\$PCP_PMDAS_DIR;" \
52 -e "s/$DSO_SUFFIX\([ ,]\)/\$DSO_SUFFIX\1/" \
53 -e '/IPC table/{
54 s/ [0-9][0-9]*(?)//g
55 s/ [0-9][0-9]*(2)/ <n>(2)/g
56 s/ [0-9][0-9]*(2,1)/ <n>(2,1)/g
57 }' \
58 -e 's/^\[[0-9][0-9]*]/[N]/' \
59 -e "s;\([/_]\)linux/;/\1OS/;" \
60 -e "s;\([/_]\)darwin/;/\1OS/;" \
61 -e "s;\([/_]\)solaris/;/\1OS/;" \
62 -e "s;\([/_]\)windows/;/\1OS/;" \
63 -e "/jbd2/d" \
64 -e '/^0*x*[0-9a-f][0-9a-f]* /{
65 s//ADDR /
66 s/\[[0-9][0-9]*]/[N]/
67 s;=[0-9].*/OS/.*;=N name=OS_PMDA, ...;
68 }' \
69 -e '/^\[N] .*\/OS\//s/.*/[N] domain=N, name=OS_PMDA, .../' \
70 -e '/^__pmLocalPMDA(.*\/OS\//{
71 s/name=.*/name=OS_PMDA, ...)/
72 s/domain=[0-9][0-9]*/domain=N/
73 }' \
74 -e '/__pmConnect(fd=<n>(nsprFd=/d' \
75 -e '/^NotifyEndLocalContext:/{
76 /pmda_linux/d
77 }' \
78 # end
82 # some non-derminism after the build_dsotable lines for __pmSetSocketIPC and
83 # IPC table, hence skip these in this context
85 _filter2()
87 $PCP_AWK_PROG '
88 /build_dsotab:/ { strip=1; print; print "<stripped lines>"; next }
89 strip == 1 && /pmSetSocketIPC/ { next }
90 strip == 1 && /IPC table/ { next }
91 strip == 1 && /pmNewContext/ { strip=0 }
92 strip == 1 { print >"'$tmp.tmp'"; next }
93 { print }'
96 trap "rm -f $tmp.*; exit" 0 1 2 3 15
97 $sudo rm -rf $tmp.* $seq.full
99 remote=`./getpmcdhosts -L -n 1 -a sample 2>$tmp.out`
100 [ -z "$remote" ] && _notrun `cat $tmp.out`
102 # real QA test starts here
103 echo "=== expected to pass ==="
104 src/chkctx2 -D16 2>&1 | _filter
105 echo ""
106 src/chkctx2 -D16 -h localhost 2>&1 | _filter
107 echo ""
108 src/chkctx2 -D16 -h `hostname` 2>&1 | _filter
109 echo ""
110 src/chkctx2 -D16 -h $remote 2>&1 | _filter
111 echo ""
113 PCP_LITE_SAMPLE=yes
114 export PCP_LITE_SAMPLE
116 echo | tee -a $seq.full
117 echo "=== try CONTEXT_LOCAL ===" | tee -a $seq.full
118 $sudo src/chkctx2_lite -D16 -L 2>&1 \
119 | tee -a $seq.full \
120 | _filter \
121 | _filter2 \
122 | _filter_pmcd_log
124 echo
125 echo "sorted stripped lines ..."
126 LC_COLLATE=POSIX sort $tmp.tmp | uniq