/var/lib/pcp/testsuite/506 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 | #!/bin/sh
# PCP QA Test No. 506
# check 2^31 volume switching for pmlogrewrite
#
# Copyright (c) 2011 Ken McDonell. All Rights Reserved.
# Copyright (c) 2012 Red Hat.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
rm -f tmparch/big2.*
rm -f $seq.full
./tmparch/mkbig1 > $seq.full 2>&1
[ $? -eq 0 ] || _notrun `cat $seq.full`
# 10GB should keep us out of trouble
free=`_check_freespace 10240`
[ -z "$free" ] || _notrun $free
status=0 # success is the default!
$sudo rm -rf $tmp.* $seq.full
trap "rm -f $tmp.* tmparch/big2.*; exit \$status" 0 1 2 3 15
_filter()
{
sed \
-e 's/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9][0-9]*[0-9]/TIMESTAMP/g'
}
_check()
{
# expect 3 volumes, and all < 2^31 bytes in size
#
sts=0
limit=2147483648
nvol=`ls $1.? | wc -l | sed -e 's/ //g'`
if [ $nvol -ne 3 ]
then
ls -l $1.?
echo "Error: expecting 3 volumes, found $nvol"
sts=1
fi
for vol in $1.?
do
size=`_filesize $vol`
if [ -z "$size" ]
then
stat $vol
echo "Error: cannot extract size for volume $vol"
sts=1
elif [ "$size" -ge $limit ]
then
ls -l $vol
echo "Error: size ($size) exceeds limit ($limit)"
sts=1
fi
done
if [ $sts -eq 0 ]
then
echo "OK"
else
status=$sts
fi
}
echo "metric sample.hordes.one { type -> 64 }" >$tmp.config
echo "metric sample.hordes.two { type -> 64 }" >>$tmp.config
# real QA test starts here
echo "rewrite and copy" | tee -a $seq.full
rm -f tmparch/big2*
ls -l tmparch/big1* >>$seq.full 2>&1
pminfo -d -a tmparch/big1 >>$seq.full
pmlogrewrite -w -c $tmp.config tmparch/big1 tmparch/big2 2>&1 | _filter
ls -l tmparch/big2* >>$seq.full 2>&1
pminfo -d -a tmparch/big2 >>$seq.full
_check tmparch/big2
echo | tee -a $seq.full
echo "rewrite in place" | tee -a $seq.full
rm -f tmparch/big2*
for file in tmparch/big1.*
do
cp $file `echo $file | sed -e 's/big1/big2/'`
done
ls -l tmparch/big2* >>$seq.full 2>&1
pminfo -d -a tmparch/big2 >>$seq.full
pmlogrewrite -iw -c $tmp.config tmparch/big2 2>&1 | _filter
ls -l tmparch/big2* >>$seq.full 2>&1
pminfo -d -a tmparch/big2 >>$seq.full
_check tmparch/big2
# success, all done
exit
|