~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-07-16 09:56:24 UTC
  • mfrom: (0.3.11)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: package-import@ubuntu.com-20120716095624-azr2w4hbhei1rxmx
Tags: upstream-0.48
ImportĀ upstreamĀ versionĀ 0.48

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
for type in `ls $dir`
 
11
do
 
12
    if ./ceph-dencoder type $type 2>/dev/null; then
 
13
        echo "type $type"
 
14
        for o in `ls $dir/$type`; do
 
15
            f="$dir/$type/$o"
 
16
            echo "\t$f"
 
17
 
 
18
            ./ceph-dencoder type $type import $f decode dump_json > $tmp1
 
19
            ./ceph-dencoder type $type import $f decode encode decode dump_json > $tmp2
 
20
            cmp $tmp1 $tmp2 || exit 1
 
21
 
 
22
            ./ceph-dencoder type $type import $f decode encode export $tmp1
 
23
            cmp $tmp1 $f || exit 1
 
24
        done
 
25
    else
 
26
        echo "skip $type"
 
27
    fi
 
28
done
 
29
 
 
30
rm -f $tmp1 $tmp2
 
31
 
 
32
echo OK