crush: fix leaks in TestCrushWrapper.cc

To get a meaningfull valgrind output.

Signed-off-by: Loic Dachary <loic@dachary.org>
crush: add CrushWrapper::dump_rules() unit test

Signed-off-by: Loic Dachary <loic@dachary.org>
crush: add the dump_rule(int ruleset) method

And implement dump_rules() using dump_rule(). The indentiation and
variable names are intentionaly left as is to not confuse code being
moved around and the code changes.

Signed-off-by: Loic Dachary <loic@dachary.org>
crush: cosmetic changes to CrushWrapper::dump_rule()

Signed-off-by: Loic Dachary <loic@dachary.org>
crush: display item name in CrushWrapper::dump_rule()

When an item name is available used it instead of displaying the number.

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: if crush rule create-simple exists return

And it is consistent with the above. Also use a slightly different
string to allow the caller to differentiate between the two cases.

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: minor improvement to test-helpers.sh

* kill -9 daemons to better cope with stuck daemons
* reduce paxos propose interval to speedup tests
* look for erasure code plugins from the sources directory

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: osd create pool test refactor

* Use test-helpers.sh instead of duplicating it
* Isolate each test in a separate function for clarity

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: add missing format argument to crush rule dump

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: add missing format argument to crush dump

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: add ruleset name to crush rule dump

The crush rule name is made an optional first argument. If not provided, it
defaults to dumping all rules.

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: osd crush rule functional tests

* A set of test for the simplest operations
* A test covering all cases of osd crush rule

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: osd crush rule create-simple functional tests

Basic tests and a test that create the conditions where an OSDMap
is pending with a ruleset that is not yet in the OSDMap. An attempt to
create a rule by the same name will return success and not create it again.

Signed-off-by: Loic Dachary <loic@dachary.org>