summaryrefslogtreecommitdiffstats
path: root/src/test/cli/crushtool/show-choose-tries.t
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/cli/crushtool/show-choose-tries.t109
-rw-r--r--src/test/cli/crushtool/show-choose-tries.txt43
2 files changed, 152 insertions, 0 deletions
diff --git a/src/test/cli/crushtool/show-choose-tries.t b/src/test/cli/crushtool/show-choose-tries.t
new file mode 100644
index 000000000..6a7ecaec0
--- /dev/null
+++ b/src/test/cli/crushtool/show-choose-tries.t
@@ -0,0 +1,109 @@
+ $ crushtool -c "$TESTDIR/show-choose-tries.txt" -o "$TESTDIR/show-choose-tries.crushmap"
+ $ FIRSTN_RULESET=0
+ $ crushtool -i "$TESTDIR/show-choose-tries.crushmap" --test --show-choose-tries --rule $FIRSTN_RULESET --x 1 --num-rep 2
+ 0: 1
+ 1: 1
+ 2: 0
+ 3: 0
+ 4: 0
+ 5: 0
+ 6: 0
+ 7: 0
+ 8: 0
+ 9: 0
+ 10: 0
+ 11: 0
+ 12: 0
+ 13: 0
+ 14: 0
+ 15: 0
+ 16: 0
+ 17: 0
+ 18: 0
+ 19: 0
+ 20: 0
+ 21: 0
+ 22: 0
+ 23: 0
+ 24: 0
+ 25: 0
+ 26: 0
+ 27: 0
+ 28: 0
+ 29: 0
+ 30: 0
+ 31: 0
+ 32: 0
+ 33: 0
+ 34: 0
+ 35: 0
+ 36: 0
+ 37: 0
+ 38: 0
+ 39: 0
+ 40: 0
+ 41: 0
+ 42: 0
+ 43: 0
+ 44: 0
+ 45: 0
+ 46: 0
+ 47: 0
+ 48: 0
+ 49: 0
+ $ INDEP_RULESET=1
+ $ crushtool -i "$TESTDIR/show-choose-tries.crushmap" --test --show-choose-tries --rule $INDEP_RULESET --x 1 --num-rep 1
+ 0: 0
+ 1: 1
+ 2: 0
+ 3: 0
+ 4: 0
+ 5: 0
+ 6: 0
+ 7: 0
+ 8: 0
+ 9: 0
+ 10: 0
+ 11: 0
+ 12: 0
+ 13: 0
+ 14: 0
+ 15: 0
+ 16: 0
+ 17: 0
+ 18: 0
+ 19: 0
+ 20: 0
+ 21: 0
+ 22: 0
+ 23: 0
+ 24: 0
+ 25: 0
+ 26: 0
+ 27: 0
+ 28: 0
+ 29: 0
+ 30: 0
+ 31: 0
+ 32: 0
+ 33: 0
+ 34: 0
+ 35: 0
+ 36: 0
+ 37: 0
+ 38: 0
+ 39: 0
+ 40: 0
+ 41: 0
+ 42: 0
+ 43: 0
+ 44: 0
+ 45: 0
+ 46: 0
+ 47: 0
+ 48: 0
+ 49: 0
+ $ rm -f "$TESTDIR/show-choose-tries.crushmap"
+# Local Variables:
+# compile-command: "cd ../../.. ; make -j4 crushtool && test/run-cli-tests"
+# End:
diff --git a/src/test/cli/crushtool/show-choose-tries.txt b/src/test/cli/crushtool/show-choose-tries.txt
new file mode 100644
index 000000000..c467408b4
--- /dev/null
+++ b/src/test/cli/crushtool/show-choose-tries.txt
@@ -0,0 +1,43 @@
+# begin crush map
+tunable choose_local_tries 0
+tunable choose_local_fallback_tries 0
+tunable choose_total_tries 50
+tunable chooseleaf_descend_once 1
+
+# devices
+device 0 device0
+device 1 device1
+device 2 device2
+
+# types
+type 0 device
+type 1 root
+
+# buckets
+root root {
+ id -1 # do not change unnecessarily
+ # weight 3.00000
+ alg straw
+ hash 0 # rjenkins1
+ item device0 weight 1.00000
+ item device1 weight 1.00000
+ item device2 weight 1.00000
+}
+
+rule first_rule {
+ id 0
+ type replicated
+ step take root
+ step choose firstn 0 type device
+ step emit
+}
+
+rule indep_rule {
+ id 1
+ type erasure
+ step set_chooseleaf_tries 5
+ step take root
+ step choose indep 0 type device
+ step emit
+}
+