From: Sage Weil Date: Thu, 27 Aug 2015 17:27:57 +0000 (-0400) Subject: test/encoding/readable: handle nondeterministic items in corpus too X-Git-Tag: v9.1.0~249^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4a1cb825362029956cca5dbb88e4e6bba636fd5e;p=ceph.git test/encoding/readable: handle nondeterministic items in corpus too In paritcular, 0.94.2-207-g88e7ee7/objects/ExplicitHashHitSet Signed-off-by: Sage Weil --- diff --git a/src/test/encoding/readable.sh b/src/test/encoding/readable.sh index a0d41dc811e7..f387bd118091 100755 --- a/src/test/encoding/readable.sh +++ b/src/test/encoding/readable.sh @@ -59,6 +59,20 @@ do failed=$(($failed + 1)) continue fi + + # nondeterministic classes may dump + # nondeterministically. compare the sorted json + # output. this is a weaker test, but is better than + # nothing. + if ! ./ceph-dencoder type $type is_deterministic + then + echo " sorting json output for nondeterministic object" + for f in $tmp1 $tmp2; do + sort $f | sed 's/,$//' > $f.new + mv $f.new $f + done + fi + if ! cmp $tmp1 $tmp2; then echo "**** reencode of $vdir/objects/$type/$f resulted in a different dump ****" diff $tmp1 $tmp2