7
tmp1=`mktemp /tmp/typ-XXXXXXXXX`
8
tmp2=`mktemp /tmp/typ-XXXXXXXXX`
13
myversion=`./ceph-dencoder version`
15
for arversion in `ls -v $dir/archive`
17
vdir="$dir/archive/$arversion"
20
if [ ! -d "$vdir/objects" ]; then
24
for type in `ls $vdir/objects`
26
if ./ceph-dencoder type $type 2>/dev/null; then
28
echo " $vdir/objects/$type"
30
# is there a fwd incompat change between $arversion and $version?
33
for iv in `ls -v $dir/archive`
35
if [ "$iv" = "$arversion" ]; then
38
if [ $sawarversion -eq 1 ] && [ -e "$dir/archive/$iv/forward_incompat/$type" ]; then
41
if [ "$iv" = "$version" ]; then
45
if [ -n "$incompat" ]; then
46
echo "skipping incompat $type version $arversion, changed at $iv < code $myversion"
50
for f in `ls $vdir/objects/$type`; do
51
# echo "\t$vdir/$type/$f"
52
if ! ./ceph-dencoder type $type import $vdir/objects/$type/$f decode dump_json > $tmp1; then
53
echo "**** failed to decode $vdir/objects/$type/$f ****"
54
failed=$(($failed + 1))
57
if ! ./ceph-dencoder type $type import $vdir/objects/$type/$f decode encode decode dump_json > $tmp2; then
58
echo "**** failed to decode+encode+decode $vdir/objects/$type/$f ****"
59
failed=$(($failed + 1))
62
if ! cmp $tmp1 $tmp2; then
63
echo "**** reencode of $vdir/objects/$type/$f resulted in a different dump ****"
65
failed=$(($failed + 1))
67
numtests=$(($numtests + 1))
70
echo "skipping unrecognized type $type"
77
if [ $failed -gt 0 ]; then
78
echo "FAILED $failed / $numtests tests."
81
echo "passed $numtests tests."