Skip to content

Commit

Permalink
crushtool: improve straw2 compile/decompile test
Browse files Browse the repository at this point in the history
This way it catches ceph#11079.

Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Mar 10, 2015
1 parent 6445d9e commit ac527a2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
6 changes: 4 additions & 2 deletions src/test/cli/crushtool/straw2.t
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
$ crushtool -c "$TESTDIR/straw2.txt" -o straw2
$ rm straw2
$ crushtool -c $TESTDIR/straw2.txt -o straw2
$ crushtool -d straw2 -o straw2.txt.new
$ diff -b $TESTDIR/straw2.txt straw2.txt.new
$ rm straw2 straw2.txt.new
36 changes: 19 additions & 17 deletions src/test/cli/crushtool/straw2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,29 @@ type 2 default

# buckets
host host0 {
id -1 # do not change unnecessarily
# weight 1.000
alg straw2
hash 0 # rjenkins1
item device0 weight 1.000
id -1 # do not change unnecessarily
# weight 1.000
alg straw2
hash 0 # rjenkins1
item device0 weight 1.000
}
default default {
id -2 # do not change unnecessarily
# weight 1.000
alg straw2
hash 0 # rjenkins1
item host0 weight 1.000
id -2 # do not change unnecessarily
# weight 1.000
alg straw2
hash 0 # rjenkins1
item host0 weight 1.000
}

# rules
rule replicated_ruleset {
ruleset 0
type replicated
min_size 1
max_size 10
step take default
step chooseleaf firstn 0 type host
step emit
ruleset 0
type replicated
min_size 1
max_size 10
step take default
step chooseleaf firstn 0 type host
step emit
}

# end crush map

0 comments on commit ac527a2

Please sign in to comment.