/var/lib/pcp/testsuite/626 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. 626
# pmlogger_daily with -x 0 and previously failing to merge correctly
# ... list of files below comes from an observed interactive run
# of pmlogger_daily during -x 0 development
#
# Copyright (c) 2018 Ken McDonell. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
if which xz >/dev/null 2>&1
then
PROG=xz
SUFF=xz
elif which bzip2 >/dev/null 2>&1
then
PROG=bzip2
SUFF=bz2
elif which gzip >/dev/null 2>&1
then
PROG=gzip
SUFF=gz
else
_notrun "cannot find a compression program!"
fi
_cleanup()
{
cd $here
$sudo rm -rf $tmp $tmp.*
}
status=1 # failure is the default!
$sudo rm -rf $tmp $tmp.* $seq.full
trap "_cleanup; exit \$status" 0 1 2 3 15
_setup_control()
{
echo '$version=1.1' >$tmp.control
for arg
do
echo "\$$arg" >>$tmp.control
done
echo "LOCALHOSTNAME n n $tmp $tmp.config" >>$tmp.control
cat $tmp.control >>$seq.full
}
_filter()
{
if [ $# -eq 0 ]
then
cmd=cat
elif [ -f "$1" ]
then
cmd="cat \"$1\""
else
return
fi
eval $cmd \
| tee -a $here/$seq.full \
| sed \
-e '/pmlogger_daily.pid: Permission denied/d' \
-e '/no pmlogger instance running for host/d' \
-e '/^pmlogger_daily:.*\.control:[0-9]]$/d' \
-e '/logging for host .* unchanged/d' \
# end
}
_showfiles()
{
ls $tmp/* \
| sed \
-e "s@$tmp@TMP@" \
-e "s/\.$SUFF$/.compressed/" \
-e "s/$DATE/DATE/" \
# end
}
cp archives/ok-foo.0 $tmp.0
$PROG $tmp.0
mkdir $tmp
cat <<End-of-File | while read f
20180225.0.xz
20180225.index
20180225.meta
20180226.0.xz
20180226.index
20180226.meta
20180227.0.xz
20180227.index
20180227.meta
20180301.0.xz
20180301.index
20180301.meta
20180302.0.xz
20180302.index
20180302.meta
20180303.0.xz
20180303.index
20180303.meta
20180304.0.xz
20180304.index
20180304.meta
20180306.0.xz
20180306.index
20180306.meta
20180307.0.xz
20180307.index
20180307.meta
20180308.0.xz
20180308.index
20180308.meta
20180311.00.10.0.xz
20180311.00.10.index
20180311.00.10.meta
20180311.19.16.0.xz
20180311.19.16.index
20180311.19.16.meta
20180311.19.17.0.xz
20180311.19.17.index
20180311.19.17.meta
20180311.19.18.0.xz
20180311.19.18.index
20180311.19.18.meta
20180311.19.20-00.0.xz
20180311.19.20-00.index
20180311.19.20-00.meta
20180311.19.20-01.0.xz
20180311.19.20-01.index
20180311.19.20-01.meta
20180311.19.22.0.xz
20180311.19.22.index
20180311.19.22.meta
20180311.19.23-00.0.xz
20180311.19.23-00.index
20180311.19.23-00.meta
20180311.19.23.0.xz
20180311.19.23.index
20180311.19.23.meta
20180311.19.24-00.0.xz
20180311.19.24-00.index
20180311.19.24-00.meta
20180311.19.24.0.xz
20180311.19.24.index
20180311.19.24.meta
20180311.19.28-00.0.xz
20180311.19.28-00.index
20180311.19.28-00.meta
20180311.19.28-01.0.xz
20180311.19.28-01.index
20180311.19.28-01.meta
20180311.19.28.0.xz
20180311.19.28.index
20180311.19.28.meta
20180311.20.51.0.xz
20180311.20.51.index
20180311.20.51.meta
20180311.20.56.0.xz
20180311.20.56.10.xz
20180311.20.56.11.xz
20180311.20.56.12.xz
20180311.20.56.1.xz
20180311.20.56.2.xz
20180311.20.56.3.xz
20180311.20.56.4.xz
20180311.20.56.5.xz
20180311.20.56.6.xz
20180311.20.56.7.xz
20180311.20.56.8.xz
20180311.20.56.9.xz
20180311.20.56.index
20180311.20.56.meta
20180312.00.10.0.xz
20180312.00.10.10.xz
20180312.00.10.11.xz
20180312.00.10.12.xz
20180312.00.10.13.xz
20180312.00.10.14.xz
20180312.00.10.15.xz
20180312.00.10.16.xz
20180312.00.10.17.xz
20180312.00.10.18.xz
20180312.00.10.19.xz
20180312.00.10.1.xz
20180312.00.10.20.xz
20180312.00.10.21.xz
20180312.00.10.22.xz
20180312.00.10.23.xz
20180312.00.10.24.xz
20180312.00.10.25.xz
20180312.00.10.26.xz
20180312.00.10.27.xz
20180312.00.10.28.xz
20180312.00.10.29.xz
20180312.00.10.2.xz
20180312.00.10.30.xz
20180312.00.10.31.xz
20180312.00.10.32.xz
20180312.00.10.33.xz
20180312.00.10.34.xz
20180312.00.10.3.xz
20180312.00.10.4.xz
20180312.00.10.5.xz
20180312.00.10.6.xz
20180312.00.10.7.xz
20180312.00.10.8.xz
20180312.00.10.9.xz
20180312.00.10.index
20180312.00.10.meta
20180312.08.45.0.xz
20180312.08.45.index
20180312.08.45.meta
End-of-File
do
case $f
in
*.index)
cp archives/ok-foo.index $tmp/$f
;;
*.meta)
cp archives/ok-foo.meta $tmp/$f
;;
*.[0-9].xz|*.[0-9][0-9].xz)
# fake out the .xz files with a compressed ok-foo.0
cp $tmp.0.$SUFF $tmp/$f
;;
*)
echo "$f - eh?"
exit
;;
esac
done
_showfiles >$tmp.before
# real QA test starts here
_setup_control PCP_COMPRESSAFTER=0
pmlogger_daily -f -c $tmp.control -l $tmp.log
_filter $tmp.log
_showfiles >$tmp.after
echo
echo "diffs ... expect 20180311 and 20180312 archives to be merged"
diff $tmp.before $tmp.after
# success, all done
status=0
exit
|