~ubuntu-branches/ubuntu/raring/ceph/raring

« back to all changes in this revision

Viewing changes to src/test/encoding/readable.sh

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-06-08 15:54:37 UTC
  • mfrom: (1.1.8) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20120608155437-gy3j9k6wzv7w4gn9
Tags: 0.44.1-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - d/control: Switch from libcryptopp to libnss as libcryptopp
    is not seeded.
  - d/control,d/rules: Move from python-support to dh_python2.
  - d/patches/manpage_updates*.patch: cherry picked upstream manpage
    updates warning about lack of encryption, per MIR review.
  - d/rules,d/control: Drop radosgw since libfcgi is not in main and
    the code may not be suitable for LTS.
  - d/rules,d/control: Drop tcmalloc since google perftools is not
    in main yet.
  - d/rules,d/control: Drop ceph-fuse entirely per MIR review
    recommendation.
* d/patches/fix-radosgw-tests.patch: Cherry picked patch from upstream
  VCS to fixup tests to conditionally use radosgw if enabled.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh -e
 
2
 
 
3
dir=$1
 
4
 
 
5
set -e
 
6
 
 
7
tmp1=`mktemp /tmp/typ-XXXXXXXXX`
 
8
tmp2=`mktemp /tmp/typ-XXXXXXXXX`
 
9
 
 
10
failed=0
 
11
numtests=0
 
12
 
 
13
myversion=`./ceph-dencoder version`
 
14
 
 
15
for arversion in `ls -v $dir/archive`
 
16
do
 
17
    vdir="$dir/archive/$arversion"
 
18
#    echo $vdir
 
19
 
 
20
    if [ ! -d "$vdir/objects" ]; then
 
21
        continue;
 
22
    fi
 
23
 
 
24
    for type in `ls $vdir/objects`
 
25
    do
 
26
        if ./ceph-dencoder type $type 2>/dev/null; then
 
27
#           echo "type $type";
 
28
            echo "        $vdir/objects/$type"
 
29
 
 
30
            # is there a fwd incompat change between $arversion and $version?
 
31
            incompat=""
 
32
            sawarversion=0
 
33
            for iv in `ls -v $dir/archive`
 
34
            do
 
35
                if [ "$iv" = "$arversion" ]; then
 
36
                    sawarversion=1
 
37
                fi
 
38
                if [ $sawarversion -eq 1 ] && [ -e "$dir/archive/$iv/forward_incompat/$type" ]; then
 
39
                    incompat="$iv"
 
40
                fi
 
41
                if [ "$iv" = "$version" ]; then
 
42
                    break
 
43
                fi
 
44
            done
 
45
            if [ -n "$incompat" ]; then
 
46
                echo "skipping incompat $type version $arversion, changed at $iv < code $myversion"
 
47
                continue
 
48
            fi
 
49
 
 
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))
 
55
                    continue        
 
56
                fi
 
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))
 
60
                    continue
 
61
                fi
 
62
                if ! cmp $tmp1 $tmp2; then
 
63
                    echo "**** reencode of $vdir/objects/$type/$f resulted in a different dump ****"
 
64
                    diff $tmp1 $tmp2
 
65
                    failed=$(($failed + 1))
 
66
                fi
 
67
                numtests=$(($numtests + 1))
 
68
            done
 
69
        else
 
70
            echo "skipping unrecognized type $type"
 
71
        fi
 
72
    done
 
73
done
 
74
 
 
75
rm -f $tmp1 $tmp2
 
76
 
 
77
if [ $failed -gt 0 ]; then
 
78
    echo "FAILED $failed / $numtests tests."
 
79
    exit 1
 
80
fi
 
81
echo "passed $numtests tests."
 
82