summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/immutable_object_cache/MockCacheDaemon.h4
-rw-r--r--src/test/immutable_object_cache/test_DomainSocket.cc4
-rw-r--r--src/test/immutable_object_cache/test_message.cc6
-rw-r--r--src/test/immutable_object_cache/test_multi_session.cc2
-rw-r--r--src/test/immutable_object_cache/test_object_store.cc10
-rw-r--r--src/test/librbd/cache/test_mock_ParentCacheObjectDispatch.cc4
6 files changed, 17 insertions, 13 deletions
diff --git a/src/test/immutable_object_cache/MockCacheDaemon.h b/src/test/immutable_object_cache/MockCacheDaemon.h
index 3773e87ea9a..02e86acb2a7 100644
--- a/src/test/immutable_object_cache/MockCacheDaemon.h
+++ b/src/test/immutable_object_cache/MockCacheDaemon.h
@@ -24,8 +24,8 @@ class MockCacheClient {
MOCK_METHOD0(stop, void());
MOCK_METHOD0(connect, int());
MOCK_METHOD1(connect, void(Context*));
- MOCK_METHOD5(lookup_object, void(std::string, uint64_t, uint64_t, std::string,
- CacheGenContextURef));
+ MOCK_METHOD6(lookup_object, void(std::string, uint64_t, uint64_t, uint64_t,
+ std::string, CacheGenContextURef));
MOCK_METHOD1(register_client, int(Context*));
};
diff --git a/src/test/immutable_object_cache/test_DomainSocket.cc b/src/test/immutable_object_cache/test_DomainSocket.cc
index 3a538a3191c..31d1b9adc20 100644
--- a/src/test/immutable_object_cache/test_DomainSocket.cc
+++ b/src/test/immutable_object_cache/test_DomainSocket.cc
@@ -122,7 +122,7 @@ public:
usleep(1);
}
- m_cache_client->lookup_object("pool_nspace", 1, 2, "object_name", std::move(ctx));
+ m_cache_client->lookup_object("pool_nspace", 1, 2, 3, "object_name", std::move(ctx));
m_send_request_index++;
}
m_wait_event.wait();
@@ -135,7 +135,7 @@ public:
hit = ack->type == RBDSC_READ_REPLY;
m_wait_event.signal();
});
- m_cache_client->lookup_object(pool_nspace, 1, 2, object_id, std::move(ctx));
+ m_cache_client->lookup_object(pool_nspace, 1, 2, 3, object_id, std::move(ctx));
m_wait_event.wait();
return hit;
}
diff --git a/src/test/immutable_object_cache/test_message.cc b/src/test/immutable_object_cache/test_message.cc
index b03fa35313d..bbd6ad165b9 100644
--- a/src/test/immutable_object_cache/test_message.cc
+++ b/src/test/immutable_object_cache/test_message.cc
@@ -16,10 +16,11 @@ TEST(test_for_message, test_1)
uint64_t read_len = 333333UL;
uint64_t pool_id = 444444UL;
uint64_t snap_id = 555555UL;
+ uint64_t object_size = 666666UL;
// ObjectRequest --> bufferlist
ObjectCacheRequest* req = new ObjectCacheReadData(type, seq, read_offset, read_len,
- pool_id, snap_id, oid_name, pool_nspace);
+ pool_id, snap_id, object_size, oid_name, pool_nspace);
req->encode();
auto payload_bl = req->get_payload_bufferlist();
@@ -40,8 +41,9 @@ TEST(test_for_message, test_1)
ASSERT_EQ(((ObjectCacheReadData*)req_decode)->read_len, 333333UL);
ASSERT_EQ(((ObjectCacheReadData*)req_decode)->pool_id, 444444UL);
ASSERT_EQ(((ObjectCacheReadData*)req_decode)->snap_id, 555555UL);
- ASSERT_EQ(((ObjectCacheReadData*)req_decode)->pool_namespace, pool_nspace);
ASSERT_EQ(((ObjectCacheReadData*)req_decode)->oid, oid_name);
+ ASSERT_EQ(((ObjectCacheReadData*)req_decode)->pool_namespace, pool_nspace);
+ ASSERT_EQ(((ObjectCacheReadData*)req_decode)->object_size, 666666UL);
delete req;
delete req_decode;
diff --git a/src/test/immutable_object_cache/test_multi_session.cc b/src/test/immutable_object_cache/test_multi_session.cc
index e3a73bc373c..c0c629ab036 100644
--- a/src/test/immutable_object_cache/test_multi_session.cc
+++ b/src/test/immutable_object_cache/test_multi_session.cc
@@ -126,7 +126,7 @@ public:
});
m_send_request_index++;
// here just for concurrently testing register + lookup, so fix object id.
- m_cache_client_vec[index]->lookup_object(pool_nspace, 1, 2, "1234", std::move(ctx));
+ m_cache_client_vec[index]->lookup_object(pool_nspace, 1, 2, 3, "1234", std::move(ctx));
}
if (is_last) {
diff --git a/src/test/immutable_object_cache/test_object_store.cc b/src/test/immutable_object_cache/test_object_store.cc
index 6d2875a7d3e..e100ed44456 100644
--- a/src/test/immutable_object_cache/test_object_store.cc
+++ b/src/test/immutable_object_cache/test_object_store.cc
@@ -62,7 +62,8 @@ public:
m_object_cache_store = new ObjectCacheStore(m_ceph_context);
}
- void init_object_cache_store(std::string pool_name, std::string vol_name, uint64_t vol_size, bool reset) {
+ void init_object_cache_store(std::string pool_name, std::string vol_name,
+ uint64_t vol_size, bool reset) {
ASSERT_EQ(0, m_object_cache_store->init(reset));
ASSERT_EQ(0, m_object_cache_store->init_cache());
}
@@ -71,10 +72,11 @@ public:
ASSERT_EQ(0, m_object_cache_store->shutdown());
}
- void lookup_object_cache_store(std::string pool_name, std::string vol_name, std::string obj_name, int& ret) {
+ void lookup_object_cache_store(std::string pool_name, std::string vol_name,
+ std::string obj_name, int& ret) {
std::string cache_path;
- ret = m_object_cache_store->lookup_object(pool_name, 1, 2, obj_name, true,
- cache_path);
+ ret = m_object_cache_store->lookup_object(pool_name, 1, 2, 3,
+ obj_name, true, cache_path);
}
void TearDown() override {
diff --git a/src/test/librbd/cache/test_mock_ParentCacheObjectDispatch.cc b/src/test/librbd/cache/test_mock_ParentCacheObjectDispatch.cc
index 6609f1f02e4..2b262825127 100644
--- a/src/test/librbd/cache/test_mock_ParentCacheObjectDispatch.cc
+++ b/src/test/librbd/cache/test_mock_ParentCacheObjectDispatch.cc
@@ -105,8 +105,8 @@ public :
void expect_cache_lookup_object(MockParentImageCache& mparent_image_cache,
const std::string &cache_path) {
EXPECT_CALL(*(mparent_image_cache.get_cache_client()),
- lookup_object(_, _, _, _, _))
- .WillOnce(WithArg<4>(Invoke([cache_path](CacheGenContextURef on_finish) {
+ lookup_object(_, _, _, _, _, _))
+ .WillOnce(WithArg<5>(Invoke([cache_path](CacheGenContextURef on_finish) {
auto ack = new ObjectCacheReadReplyData(RBDSC_READ_REPLY, 0, cache_path);
on_finish.release()->complete(ack);
})));