#!/bin/sh -e
+[ -z "$CEPH_ROOT" ] && CEPH_ROOT=..
+
dir=$CEPH_ROOT/ceph-object-corpus
set -e
numtests=0
pids=""
-myversion=`ceph-dencoder version`
+if [ -x ./ceph-dencoder ]; then
+ CEPH_DENCODER=./ceph-dencoder
+else
+ CEPH_DENCODER=ceph-dencoder
+fi
+
+myversion=`$CEPH_DENCODER version`
DEBUG=0
WAITALL_DELAY=.1
debug() { if [ "$DEBUG" -gt 0 ]; then echo "DEBUG: $*" >&2; fi }
tmp2=`mktemp /tmp/typ-XXXXXXXXX`
rm -f $output_file
- if ceph-dencoder type $type 2>/dev/null; then
+ if $CEPH_DENCODER type $type 2>/dev/null; then
#echo "type $type";
echo " $vdir/objects/$type"
continue
fi;
- ./ceph-dencoder type $type import $vdir/objects/$type/$f decode dump_json > $tmp1 &
+ $CEPH_DENCODER type $type import $vdir/objects/$type/$f decode dump_json > $tmp1 &
pid1="$!"
- ./ceph-dencoder type $type import $vdir/objects/$type/$f decode encode decode dump_json > $tmp2 &
+ $CEPH_DENCODER type $type import $vdir/objects/$type/$f decode encode decode dump_json > $tmp2 &
pid2="$!"
#echo "\t$vdir/$type/$f"
if ! wait $pid1; then
# nondeterministically. compare the sorted json
# output. this is a weaker test, but is better than
# nothing.
- if ! ceph-dencoder type $type is_deterministic; then
+ 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