From e183a4d9897b965a02fe15a6194f166b8ec284cc Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Fri, 25 Jul 2014 16:04:53 +0400 Subject: [PATCH] test_librbd_fsx: clone/flatten probabilities Higher the clone probability to 8% and lower the probability of flatten to 2%. This should give us longer parent chaines (before this we would usually have one parent and even then only for a few ops time). Signed-off-by: Ilya Dryomov --- src/test/librbd/fsx.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/test/librbd/fsx.c b/src/test/librbd/fsx.c index ca218c8087d9..b7f31463962f 100644 --- a/src/test/librbd/fsx.c +++ b/src/test/librbd/fsx.c @@ -1634,11 +1634,19 @@ test(void) } break; case OP_CLONE: - if (!clone_calls || get_random() % 100 > 5 || file_size == 0) { + /* clone, 8% chance */ + if (!clone_calls || file_size == 0 || get_random() % 100 >= 8) { log4(OP_SKIPPED, OP_CLONE, 0, 0); goto out; } break; + case OP_FLATTEN: + /* flatten four times as rarely as clone, 2% chance */ + if (get_random() % 100 >= 2) { + log4(OP_SKIPPED, OP_FLATTEN, 0, 0); + goto out; + } + break; } switch (op) { -- 2.47.3