From e5930a3189fc41b0608d10ec6e76d76e456fcf3e Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Thu, 28 Aug 2014 12:47:03 +0200 Subject: [PATCH] tests: reduce osd-crush.sh execution time A loop creating 255 crush rulesets via the command line takes minutes. It is replaced by the generation of a crushmap instead. Signed-off-by: Loic Dachary --- src/test/mon/osd-crush.sh | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/test/mon/osd-crush.sh b/src/test/mon/osd-crush.sh index 8f39a1a923a8..0aa9c9bd3e80 100755 --- a/src/test/mon/osd-crush.sh +++ b/src/test/mon/osd-crush.sh @@ -192,16 +192,28 @@ function TEST_add_ruleset_failed() { ./ceph osd crush add-bucket $root host ./ceph osd crush rule create-simple test_rule1 $root osd firstn || return 1 ./ceph osd crush rule create-simple test_rule2 $root osd firstn || return 1 - #./ceph osd crush rule rm test_rule1 - for i in `seq 3 255` - do - ./ceph osd crush rule create-simple test_rule$i $root osd firstn || return 1 - Check_ruleset_id_match_rule_id test_rule$i || return 1 - done - + ./ceph osd getcrushmap > $dir/crushmap || return 1 + ./crushtool --decompile $dir/crushmap > $dir/crushmap.txt || return 1 + for i in $(seq 3 255) + do + cat <> $dir/crushmap.txt + ./crushtool --compile $dir/crushmap.txt -o $dir/crushmap || return 1 + ./ceph osd setcrushmap -i $dir/crushmap || return 1 ./ceph osd crush rule create-simple test_rule_nospace $root osd firstn 2>&1 | grep "Error ENOSPC" || return 1 } + main osd-crush # Local Variables: -- 2.47.3