This file is indexed.

/var/lib/pcp/testsuite/274 is in pcp-testsuite 4.0.1-1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
#! /bin/sh
# PCP QA Test No. 274
# Throw a broken PMDA at libpcp_pmda and dbpmda
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc.  All Rights Reserved.
#

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

# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check

signal=$PCP_BINADM_DIR/pmsignal
status=1
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
$sudo rm -f $here/$seq.full

_filter()
{
    # "dbpmda> $" filter for Linux
    sed \
    	-e '/pmResult/s/0x[^ ]*/ADDR/g' \
    	-e '/pmResult/s/amp: 0.000000 .* numpmid:/amp: EPOCH in LOCALTIME numpmid:/' \
    	-e '/Error: .*() failed/s/Broken pipe/[PMDA died]/' \
    	-e '/Error: .*() failed/s/PDU empty, PMDA may have died/[PMDA died]/' \
	-e 's/\/tmp.*/logfile/g' \
	-e 's/\(broken_pmda_2_[0-9]\)([0-9][0-9]*)/\1(PID)/' \
	-e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z]  *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/DATE/' \
	-e 's/ [0-9\.]*e-[0-9]* 0x/ REAL 0x/g' \
	-e 's/ 0 0x/ REAL 0x/g' \
        -e '/dbpmda> $/d' \
	-e '/Error PDU:/s/One-line/Oneline/'

# last sed substitution thanks to pv:937345 which changed the wording
# ... preserving the old form so QA passes
}

_filter2()
{
    sed \
    	-e 's/^\[.*\] broken_pmda_2_.([0-9]*)/broken pmda/g' \
        -e '/Info: direct map  =/d' \
        -e '/Info: metric map  =/d' \
	-e 's/^Log for.*/Log started/g' \
	-e 's/^Log finished.*/Log finished/g'
}

_filter_ins()
{
    sed \
	-e 's/.* \(hash table entries\)/  NNN \1/' \
	-e 's/.* \(non-leaf nodes\)/  NNN \1/' \
	-e 's/.* \(leaf nodes\)/  NNN \1/' \
	-e 's/.* \(bytes of symbol table\)/  NNN \1/'
}

_filterStartBrokenPMDA25 () {
    #  This filter came about as a result of a different ordering of
    #  output in both stdout and stderr from dbpmda in PCP 2.1. This
    #  filter makes it appear as it would in PCP 2.2 onwards so that
    #  the test can detect changes to the text itself rather than the
    #  position of the line "Start broken_pmda_2_5 PMDA..." in the
    #  output for the dbpmda "open" command.
    $PCP_AWK_PROG '
BEGIN   { found = false }
/Start broken_pmda_2_5 PMDA: / {
            if (found = false) found = $0
            else found = found $0
            next
        }
/dbpmda> / {
            if ( found != false ) {
                print found
                found = false
            }
            print $0
            next
        }
        { print }
'
}


# real QA test starts here
unset ROOT MAKEFLAGS

echo "=== Install broken namespace ==="
cd $here/pmdas/broken
if pmnsmerge $PCP_VAR_DIR/pmns/root ./root $tmp.pmns
then
    :
else
    echo "Error: pmnsmerge failed!"
    exit
fi
$sudo cp $tmp.pmns $PCP_VAR_DIR/pmns/root
$sudo $signal -a -s HUP pmcd >/dev/null 2>&1
# ensure everything is built
if [ -f GNUmakefile.install ]
then
    $sudo $PCP_MAKE_PROG -f GNUmakefile.install >>$here/$seq.full 2>&1
else
    $sudo $PCP_MAKE_PROG >>$here/$seq.full 2>&1
fi
cd $here

# Remove the PMDA
_remove()
{
    cd $here/pmdas/broken
    $sudo ./broken_Remove
    cd $here
}

trap "_remove; rm -f $tmp.*; exit \$status" 0 1 2 3 15

dbpmda -ie 2>&1 <<End-of-File | _filter
open pipe pmdas/broken/broken_pmda_2_0 -D47104 -l $tmp.log
status
# Test the valid metrics
fetch broken.valid.one broken.valid.two broken.valid.three
text broken.valid.one
# Test for metric not defined in table but in the PMNS and fetch callback
fetch broken.bogus.one
# Test for metric not defined in table and PMNS but in the fetch callback
fetch broken.bogus.two
# Test for metric defined in table and fetch, but not the pmns
fetch broken.no.pmns
# Test for multiple fetch with an invalid metric between valid metrics
fetch broken.valid.one broken.bogus.one broken.valid.two
# Test for illegal data types
fetch broken.bad.type
# Test for metric with no fetch support
fetch broken.no.fetch
# Test for metric with no help
fetch broken.no.help broken.no.shorthelp broken.no.longhelp
text broken.no.help
text broken.no.shorthelp
text broken.no.longhelp
# Test for handling of bad semantics
fetch broken.bad.semantics
# Test for handling of bad scale
fetch broken.bad.scale
# Test for handling of empty instance lists
fetch broken.no.instances
# Test for handling of missing instances in fetch
fetch broken.no.instfetch
close
quit
End-of-File

sleep 1
if [ -f $tmp.log ]
then
    cat $tmp.log | _filter2
    echo "=== PMDA should survive tests ===" >>$here/$seq.full
    cat $tmp.log >>$here/$seq.full
    rm -f $tmp.log
fi

dbpmda -ie 2>&1 <<End-of-File | _filter
open pipe pmdas/broken/broken_pmda_2_1 -D47104 -l $tmp.log
status
wait 5
fetch broken.bad.indom
close
quit
End-of-File

sleep 1
if [ -f $tmp.log ]
then
    cat $tmp.log | _filter2
    echo >>$here/$seq.full
    echo "=== broken_pmda_2_1 ===" >>$here/$seq.full
    cat $tmp.log >>$here/$seq.full
    rm -f $tmp.log
fi

dbpmda -ie 2>&1 <<End-of-File | _filter
open pipe pmdas/broken/broken_pmda_2_2 -D47104 -l $tmp.log
status
close
quit
End-of-File

sleep 1
if [ -f $tmp.log ]
then
    cat $tmp.log | _filter2
    echo >>$here/$seq.full
    echo "=== broken_pmda_2_2 ===" >>$here/$seq.full
    cat $tmp.log >>$here/$seq.full
    rm -f $tmp.log
fi

dbpmda -ie 2>&1 <<End-of-File | _filter
open pipe pmdas/broken/broken_pmda_2_3 -D47104 -l $tmp.log
status
close
quit
End-of-File

sleep 1
if [ -f $tmp.log ]
then
    cat $tmp.log | _filter2
    echo >>$here/$seq.full
    echo "=== broken_pmda_2_3 ===" >>$here/$seq.full
    cat $tmp.log >>$here/$seq.full
    rm -f $tmp.log
fi

dbpmda -ie 2>&1 <<End-of-File | _filter
open pipe pmdas/broken/broken_pmda_2_4 -D47104 -l $tmp.log
status
text broken.valid.one
close
quit
End-of-File

sleep 1
if [ -f $tmp.log ]
then
    cat $tmp.log | _filter2
    echo >>$here/$seq.full
    echo "=== broken_pmda_2_4 ===" >>$here/$seq.full
    cat $tmp.log >>$here/$seq.full
    rm -f $tmp.log
fi

dbpmda -ie 2>&1 <<End-of-File | _filter | _filterStartBrokenPMDA25
open pipe pmdas/broken/broken_pmda_2_5 -D47104 -l $tmp.log
status
text broken.valid.one
close
quit
End-of-File

sleep 1
if [ -f $tmp.log ]
then
    cat $tmp.log | _filter2
    echo >>$here/$seq.full
    echo "=== broken_pmda_2_5 ===" >>$here/$seq.full
    cat $tmp.log >>$here/$seq.full
    rm -f $tmp.log
fi

# all done
status=0
exit