crush/CrushTester: test fewer inputs when running crushtool

If there are a lot of crush rules (say, 100) then the test can
take a long time.  100 values per rule should be enough to catch
most issues.

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2015-08-21 16:40:34 -04:00
parent ea8609b25a
commit 0f82f461b3

View File

@ -359,7 +359,12 @@ int CrushTester::test_with_crushtool(const char *crushtool_cmd, int max_id, int
{
SubProcessTimed crushtool(crushtool_cmd, true, false, true, timeout);
string opt_max_id = boost::lexical_cast<string>(max_id);
crushtool.add_cmd_args("-i", "-", "--test", "--check", opt_max_id.c_str(), NULL);
crushtool.add_cmd_args(
"-i", "-",
"--test", "--check", opt_max_id.c_str(),
"--min-x", "1",
"--max-x", "50",
NULL);
int ret = crushtool.spawn();
if (ret != 0) {
err << "failed run crushtool: " << crushtool.err();