]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd/cache: fix UTs related to image cache state 37669/head
authorlixiaoy1 <xiaoyan.li@intel.com>
Thu, 15 Oct 2020 11:00:07 +0000 (07:00 -0400)
committerlixiaoy1 <xiaoyan.li@intel.com>
Thu, 15 Oct 2020 11:00:07 +0000 (07:00 -0400)
Signed-off-by: Li, Xiaoyan <xiaoyan.li@intel.com>
src/test/librbd/cache/test_mock_ReplicatedWriteLog.cc

index 5c650021e290889ab91b56056b33ddb828c2d362..80208e9a9977875a4d23cfe2947a9d68e119aa01 100644 (file)
@@ -65,20 +65,13 @@ struct TestMockCacheReplicatedWriteLog : public TestMockFixture {
   void validate_cache_state(librbd::ImageCtx *image_ctx,
                             MockImageCacheStateRWL &state,
                             bool present, bool empty, bool clean,
-                            string host="", string path="",
-                            uint64_t size=0) {
+                            string host, string path,
+                            uint64_t size) {
     ConfigProxy &config = image_ctx->config;
     ASSERT_EQ(present, state.present);
     ASSERT_EQ(empty, state.empty);
     ASSERT_EQ(clean, state.clean);
-    
-    if (host.empty())
-      host = ceph_get_short_hostname();
-    if (path.empty())
-      path = config.get_val<string>("rbd_rwl_path");
-    if (!size)
-      size = config.get_val<uint64_t>("rbd_rwl_size");
-    
+   
     ASSERT_EQ(host, state.host);
     ASSERT_EQ(path, state.path);
     ASSERT_EQ(size, state.size);
@@ -122,7 +115,7 @@ TEST_F(TestMockCacheReplicatedWriteLog, init_state_write) {
   MockImageCtx mock_image_ctx(*ictx);
   MockImageCacheStateRWL image_cache_state(&mock_image_ctx);
 
-  validate_cache_state(ictx, image_cache_state, true, true, true);
+  validate_cache_state(ictx, image_cache_state, false, true, true, "", "", 0);
   
   image_cache_state.empty = false;
   image_cache_state.clean = false;