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
|
#!/bin/sh
# PCP QA Test No. 1477
# pmlogrewrite (and pmlogredact) failure when one data volume of
# an archive is missing
#
# Copyright (c) 2024 Ken McDonell. All Rights Reserved.
#
if [ $# -eq 0 ]
then
seq=`basename $0`
echo "QA output created by $seq"
else
# use $seq from caller, unless not set
[ -n "$seq" ] || seq=`basename $0`
echo "QA output created by `basename $0` $*"
fi
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
do_valgrind=false
if [ "$1" = "--valgrind" ]
then
_check_valgrind
do_valgrind=true
fi
_cleanup()
{
cd $here
$sudo rm -rf $tmp $tmp.*
}
status=0 # success is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
_filter()
{
sed \
-e "s@$tmp@TMP@g" \
# end
}
_doit()
{
cmd=$1
shift
echo | tee -a $seq_full
echo "=== cmd=$cmd $* ===" | tee -a $seq_full
[ -d $tmp ] || mkdir $tmp
cd $tmp
rm -f out.* ok-mv-bar.*
pmlogcp $here/archives/ok-mv-bar .
for cull
do
rm ok-mv-bar.$cull
done
echo ok-mv-bar.*
ls -l ok-mv-bar.* >>$seq_full
pmlogcheck -v ok-mv-bar 2>&1 | LC_COLLATE=POSIX sort
pmlogdump -dehiIlmMtz ok-mv-bar >$tmp.ok-mv-bar
pmdumplog -tz ok-mv-bar >>$seq_full
if $do_valgrind
then
_run_valgrind $cmd ok-mv-bar out
else
$cmd ok-mv-bar out 2>&1
fi \
| _filter
echo out.*
ls -l out.* >>$seq_full
pmdumplog -tz out >>$seq_full
for in in ok-mv-bar.*
do
out=`echo $in | sed -e 's/ok-mv-bar/out/'`
if [ ! -f $out ]
then
echo "Error: input file $in but no corresponding output file $out"
fi
done
for out in out.*
do
in=`echo $out | sed -e 's/out/ok-mv-bar/'`
if [ ! -f $in ]
then
echo "Error: output file $out but no corresponding input file $in"
fi
done
if pmlogcheck -v out 2>&1 | LC_COLLATE=POSIX sort
then
# output archive seems OK, check contents ...
#
pmlogdump -dehiIlmMtz out >$tmp.out
echo "pmdumplog diffs .."
diff $tmp.ok-mv-bar $tmp.out
else
for f in out.*
do
file $f
ls -l $f
done
fi
cd $here
}
# real QA test starts here
_doit pmlogrewrite
_doit pmlogrewrite 0
_doit pmlogrewrite 3
_doit pmlogrewrite 0 2
_doit pmlogredact 1 2
# success, all done
exit
|