]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/encoding/readable.sh: fix make check for autotools 8725/head
authorSage Weil <sage@redhat.com>
Mon, 25 Apr 2016 05:12:45 +0000 (01:12 -0400)
committerSage Weil <sage@redhat.com>
Mon, 25 Apr 2016 05:12:45 +0000 (01:12 -0400)
Use ./ if ceph-dencoder is in the local directory.

Signed-off-by: Sage Weil <sage@redhat.com>
src/test/encoding/readable.sh

index e5cfd177ad013c23ce6a97a1257a2b62143ef950..f55d309f2d5d8d781019e1215e570184f30bb543 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/sh -e
 
+[ -z "$CEPH_ROOT" ] && CEPH_ROOT=..
+
 dir=$CEPH_ROOT/ceph-object-corpus
 
 set -e
@@ -8,7 +10,13 @@ failed=0
 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 }
@@ -23,7 +31,7 @@ test_object() {
     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"
 
@@ -86,9 +94,9 @@ test_object() {
           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
@@ -108,7 +116,7 @@ test_object() {
         # 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