]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
clitests: add test case for crush exhaustive search
authorJosh Durgin <josh.durgin@dreamhost.com>
Fri, 7 Oct 2011 21:08:30 +0000 (14:08 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Fri, 7 Oct 2011 21:13:37 +0000 (14:13 -0700)
This detects the bug that caused #1594.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
src/test/cli/crushtool/exhaustive-search.t [new file with mode: 0644]
src/test/cli/crushtool/five-devices.crushmap [new file with mode: 0644]

diff --git a/src/test/cli/crushtool/exhaustive-search.t b/src/test/cli/crushtool/exhaustive-search.t
new file mode 100644 (file)
index 0000000..0fc054f
--- /dev/null
@@ -0,0 +1,12 @@
+# This detects the incorrect mapping (due to off by one error in
+# linear search) that caused #1594
+  $ crushtool -i "$TESTDIR/five-devices.crushmap" --test --x 3 --rule 2 --force 3 -v --weight 1 0 --weight 2 0 --weight 4 0
+  devices weights (hex): [10000,0,0,10000,0]
+  rule 2 (rbd), x = 3..3
+  rule 2 x 3 [3,0]
+   device 0:\t1 (esc)
+   device 1:\t0 (esc)
+   device 2:\t0 (esc)
+   device 3:\t1 (esc)
+   device 4:\t0 (esc)
+   result size 2x:\t1 (esc)
diff --git a/src/test/cli/crushtool/five-devices.crushmap b/src/test/cli/crushtool/five-devices.crushmap
new file mode 100644 (file)
index 0000000..ced76fc
Binary files /dev/null and b/src/test/cli/crushtool/five-devices.crushmap differ