test/encoding/readable.sh: skip old version with known incompatibilities

Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
Sage Weil 2012-02-13 12:40:33 -08:00
parent 3e1cc0b951
commit 9fded38f53
3 changed files with 40 additions and 11 deletions

@ -1 +1 @@
Subproject commit bbfb894fdbd2611c08f234f07420ad3a7e0c58a0
Subproject commit b2639b83db4620aefdbee91f5f4f7268bb014fda

View File

@ -18,7 +18,7 @@ TESTS = $(check_PROGRAMS)
check-local:
test/encoding/check-generated.sh
test/encoding/readable.sh ../ceph-object-corpus/archive
test/encoding/readable.sh ../ceph-object-corpus
EXTRALIBS = -luuid
if FREEBSD

View File

@ -10,28 +10,57 @@ tmp2=`mktemp /tmp/typ-XXXXXXXXX`
failed=0
numtests=0
for vdir in $dir/*
myversion=`./ceph-dencoder version`
for arversion in `ls -v $dir/archive`
do
vdir="$dir/archive/$arversion"
# echo $vdir
for type in `ls $vdir`
if [ ! -d "$vdir/objects" ]; then
continue;
fi
for type in `ls $vdir/objects`
do
if ./ceph-dencoder type $type 2>/dev/null; then
# echo "type $type";
echo " $vdir/$type"
for f in `ls $vdir/$type`; do
echo " $vdir/objects/$type"
# is there a fwd incompat change between $arversion and $version?
incompat=""
sawarversion=0
for iv in `ls -v $dir/archive`
do
if [ "$iv" == "$arversion" ]; then
sawarversion=1
fi
if [ $sawarversion -eq 1 ] && [ -e "$dir/archive/$iv/forward_incompat/$type" ]; then
incompat="$iv"
fi
if [ "$iv" == "$version" ]; then
break
fi
done
if [ -n "$incompat" ]; then
echo "skipping incompat $type version $arversion, changed at $iv < code $myversion"
continue
fi
for f in `ls $vdir/objects/$type`; do
# echo "\t$vdir/$type/$f"
if ! ./ceph-dencoder type $type import $vdir/$type/$f decode dump_json > $tmp1; then
echo "**** failed to decode $vdir/$type/$f ****"
if ! ./ceph-dencoder type $type import $vdir/objects/$type/$f decode dump_json > $tmp1; then
echo "**** failed to decode $vdir/objects/$type/$f ****"
failed=$(($failed + 1))
continue
fi
if ! ./ceph-dencoder type $type import $vdir/$type/$f decode encode decode dump_json > $tmp2; then
echo "**** failed to decode+encode+decode $vdir/$type/$f ****"
if ! ./ceph-dencoder type $type import $vdir/objects/$type/$f decode encode decode dump_json > $tmp2; then
echo "**** failed to decode+encode+decode $vdir/objects/$type/$f ****"
failed=$(($failed + 1))
continue
fi
if ! cmp $tmp1 $tmp2; then
echo "**** reencode of $vdir/$type/$f resulted in a different dump ****"
echo "**** reencode of $vdir/objects/$type/$f resulted in a different dump ****"
diff $tmp1 $tmp2
failed=$(($failed + 1))
fi