]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test_librbd_fsx: clone/flatten probabilities 2153/head
authorIlya Dryomov <ilya.dryomov@inktank.com>
Fri, 25 Jul 2014 12:04:53 +0000 (16:04 +0400)
committerIlya Dryomov <ilya.dryomov@inktank.com>
Mon, 28 Jul 2014 09:53:54 +0000 (13:53 +0400)
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 <ilya.dryomov@inktank.com>
src/test/librbd/fsx.c

index ca218c8087d9658308aa7fa1ee14a6fcf3347d57..b7f31463962f74712a5b4c6240f352323acd76f1 100644 (file)
@@ -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) {