/var/lib/pcp/testsuite/245 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 | #! /bin/sh
# PCP QA Test No. 245
# exercise new pmnsdel
#
# 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
status=0
trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
# real QA test starts here
mkdir $tmp.dir
cd $tmp.dir
echo 'root {
}' >null
echo 'root {
one 1:1:1
}' >one
echo "+++ Errors +++"
echo
echo "=== no args ==="
pmnsdel
echo
echo "=== no such PMNS file ==="
pmnsdel -n no-such-input fumble
echo
echo "=== cannot open existing output file for writing ==="
cp one mypmns
chmod u-w mypmns
pmnsdel -n mypmns one
rm -f mypmns
echo
echo "=== cannot create output file ==="
cp one mypmns
chmod u-w .
pmnsdel -n mypmns one
chmod u+w .
rm -f mypmns
echo
echo "=== syntax error in input ==="
echo 'root {
bogus - this is not correct
}' >mypmns
pmnsdel -n mypmns bogus
echo 'root {
one 1:1:1
sub0
two 2:2:2
three 3:3:3
sub1
}
sub0 {
four 4:4:4
sub2
five 5:5:5
}
sub1 {
six 6:6:6
eight 8:8:8
}
sub0.sub2 {
seven 7:7:7
sub4
}
sub0.sub2.sub4 {
sub6
}
sub0.sub2.sub4.sub6 {
nine 9:9:9
}' >foo
pminfo -n foo -m | LC_COLLATE=POSIX sort >base.out
echo
echo "+++ Common starting PMNS for all remaing tests ..."
cat base.out
echo
echo "=== assorted undefined metricpaths ==="
cp foo mypmns
pmnsdel -n mypmns leaf
pmnsdel -n mypmns sub0.no_leaf
pmnsdel -n mypmns sub0.sub2.no_leaf
pmnsdel -n mypmns sub0.sub2.sub4.no_leaf
pmnsdel -n mypmns sub0.sub2.sub4.sub6.no_leaf
pmnsdel -n mypmns sub0.sub2.sub4.sub6.no_nonleaf.no_leaf
echo
echo "+++ Operations +++"
echo
echo "=== single metric ==="
for metric in one sub0.sub2.sub4.sub6.nine sub0.sub2.seven
do
echo $metric:
cp foo mypmns
pmnsdel -n mypmns $metric
echo "diffs ..."
pminfo -n mypmns -m | LC_COLLATE=POSIX sort | diff base.out -
done
echo
echo "=== multiple metrics ==="
for metric in "one sub0.sub2.sub4.sub6.nine sub0.sub2.seven"
do
echo "delete: $metric"
cp foo mypmns
pmnsdel -n mypmns $metric
echo "diffs ..."
pminfo -n mypmns -m | LC_COLLATE=POSIX sort | diff base.out -
done
echo
echo "=== non-leaves ==="
for metric in sub0 sub1 sub0.sub2 sub0.sub2.sub4 sub0.sub2.sub4.sub6 \
sub0.sub2 \
"sub1 sub0.sub2.sub4.sub6 sub0 "
do
echo "delete: $metric"
cp foo mypmns
pmnsdel -n mypmns $metric
echo "diffs ..."
pminfo -n mypmns -m | LC_COLLATE=POSIX sort | diff base.out -
done
echo
echo "=== all leaves ==="
cp foo mypmns
metric=`pminfo -n mypmns | sed -e '/^event\./d' | tr '\012' ' '`
echo "delete: $metric"
pmnsdel -n mypmns $metric
echo "diffs ..."
pminfo -n mypmns -m | LC_COLLATE=POSIX sort | diff base.out -
# all done
exit
|