]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/allocator_replay_test: make allocator type configurable 41655/head
authorIgor Fedotov <ifed@suse.com>
Mon, 17 May 2021 19:21:53 +0000 (22:21 +0300)
committerNeha Ojha <nojha@redhat.com>
Wed, 2 Jun 2021 14:43:10 +0000 (14:43 +0000)
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
(cherry picked from commit f4d1ef9a95e31cb67499ddb265548eda73ab4289)
Signed-off-by: Neha Ojha <nojha@redhat.com>
 Conflicts:
src/test/objectstore/allocator_replay_test.cc - trivial resolution

src/test/objectstore/allocator_replay_test.cc

index 8f4fe18f017e79404a07b9408ccae1a3a8ec3a59..3fe0d362b35b09a9d7f1f674474bb5834b35c986 100644 (file)
@@ -182,7 +182,20 @@ int replay_and_check_for_duplicate(char* fname)
       continue;
     }
 
+    string alloc_type = "bitmap";
     sp = strstr(s, "BitmapAllocator");
+    if (!sp) {
+      alloc_type = "avl";
+      sp = strstr(s, "AvlAllocator");
+    }
+    if (!sp) {
+      alloc_type = "hybrid";
+      sp = strstr(s, "HybridAllocator");
+    }
+    if (!sp) {
+      alloc_type = "stupid";
+      sp = strstr(s, "StupidAllocator");
+    }
     if (sp) {
       // 2019-05-30 03:23:43.460 7f889a5edf00 10 fbmap_alloc 0x5642ed36e900 BitmapAllocator 0x15940000000/100000
       std::cout << s << std::endl;
@@ -202,7 +215,7 @@ int replay_and_check_for_duplicate(char* fname)
        std::cerr << "error: invalid init: " << s << std::endl;
       return -1;
       }
-      alloc.reset(Allocator::create(g_ceph_context, string("bitmap"), total,
+      alloc.reset(Allocator::create(g_ceph_context, alloc_type, total,
                                    alloc_unit));
       owned_by_app.insert(0, total);