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
* waitfor function to be used when expecting an output on an
  asynchronous operation

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 a paxos proposal
is pending and the rule is found to exist in the pending proposal.

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