#!/bin/bash -e
-source ../qa/workunits/ceph-helpers.sh
+source $CEPH_ROOT/qa/workunits/ceph-helpers.sh
dir=$1
numtests=0
echo "checking ceph-dencoder generated test instances..."
echo "numgen type"
-for type in `./ceph-dencoder list_types`; do
- num=`./ceph-dencoder type $type count_tests`
+for type in `ceph-dencoder list_types`; do
+ num=`ceph-dencoder type $type count_tests`
echo "$num $type"
for n in `seq 1 1 $num 2>/dev/null`; do
safe_type=$type
fi
pids=""
- run_in_background pids bash -c "./ceph-dencoder type $safe_type select_test $n dump_json > $tmp1"
- run_in_background pids bash -c "./ceph-dencoder type $safe_type select_test $n encode decode dump_json > $tmp2"
- run_in_background pids bash -c "./ceph-dencoder type $safe_type select_test $n copy dump_json > $tmp3"
- run_in_background pids bash -c "./ceph-dencoder type $safe_type select_test $n copy_ctor dump_json > $tmp4"
+ run_in_background pids bash -c "ceph-dencoder type $safe_type select_test $n dump_json > $tmp1"
+ run_in_background pids bash -c "ceph-dencoder type $safe_type select_test $n encode decode dump_json > $tmp2"
+ run_in_background pids bash -c "ceph-dencoder type $safe_type select_test $n copy dump_json > $tmp3"
+ run_in_background pids bash -c "ceph-dencoder type $safe_type select_test $n copy_ctor dump_json > $tmp4"
wait_background pids
if [ $? -ne 0 ]; then
# the sorted json output. this is a weaker test, but is better
# than nothing.
deterministic=0
- if ./ceph-dencoder type $type is_deterministic; then
+ if ceph-dencoder type $type is_deterministic; then
deterministic=1
fi
if ! cmp $tmp1 $tmp2; then
echo "**** $type test $n dump_json check failed ****"
- echo " ./ceph-dencoder type $type select_test $n dump_json > $tmp1"
- echo " ./ceph-dencoder type $type select_test $n encode decode dump_json > $tmp2"
+ echo " ceph-dencoder type $type select_test $n dump_json > $tmp1"
+ echo " ceph-dencoder type $type select_test $n encode decode dump_json > $tmp2"
echo " diff $tmp1 $tmp2"
failed=$(($failed + 1))
fi
if ! cmp $tmp1 $tmp3; then
echo "**** $type test $n copy dump_json check failed ****"
- echo " ./ceph-dencoder type $type select_test $n dump_json > $tmp1"
- echo " ./ceph-dencoder type $type select_test $n copy dump_json > $tmp2"
+ echo " ceph-dencoder type $type select_test $n dump_json > $tmp1"
+ echo " ceph-dencoder type $type select_test $n copy dump_json > $tmp2"
echo " diff $tmp1 $tmp2"
failed=$(($failed + 1))
fi
if ! cmp $tmp1 $tmp4; then
echo "**** $type test $n copy_ctor dump_json check failed ****"
- echo " ./ceph-dencoder type $type select_test $n dump_json > $tmp1"
- echo " ./ceph-dencoder type $type select_test $n copy_ctor dump_json > $tmp2"
+ echo " ceph-dencoder type $type select_test $n dump_json > $tmp1"
+ echo " ceph-dencoder type $type select_test $n copy_ctor dump_json > $tmp2"
echo " diff $tmp1 $tmp2"
failed=$(($failed + 1))
fi
if [ $deterministic -ne 0 ]; then
- run_in_background pids bash -c "./ceph-dencoder type $safe_type select_test $n encode export $tmp1"
- run_in_background pids bash -c "./ceph-dencoder type $safe_type select_test $n encode decode encode export $tmp2"
+ run_in_background pids bash -c "ceph-dencoder type $safe_type select_test $n encode export $tmp1"
+ run_in_background pids bash -c "ceph-dencoder type $safe_type select_test $n encode decode encode export $tmp2"
wait_background pids
if ! cmp $tmp1 $tmp2; then
echo "**** $type test $n binary reencode check failed ****"
- echo " ./ceph-dencoder type $type select_test $n encode export $tmp1"
- echo " ./ceph-dencoder type $type select_test $n encode decode encode export $tmp2"
+ echo " ceph-dencoder type $type select_test $n encode export $tmp1"
+ echo " ceph-dencoder type $type select_test $n encode decode encode export $tmp2"
echo " cmp $tmp1 $tmp2"
failed=$(($failed + 1))
fi
#!/bin/sh -e
-dir=../ceph-object-corpus
+dir=$CEPH_ROOT/ceph-object-corpus
set -e
numtests=0
pids=""
-myversion=`./ceph-dencoder version`
+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"
# 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