test: add read balance mode test case

Signed-off-by: Zheng Yin <zhengyin@cmss.chinamobile.com>
This commit is contained in:
zhengyin 2020-02-25 22:51:36 +08:00
parent d92be8b585
commit 18e683932e
3 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,11 @@
overrides:
ceph:
conf:
client:
rbd read from replica policy: balance
tasks:
- exec:
osd.0:
- ceph osd require-osd-release octopus
- ceph osd set-require-min-compat-client octopus

View File

@ -98,6 +98,7 @@ struct MockImageCtx {
blkin_trace_all(image_ctx.blkin_trace_all),
enable_alloc_hint(image_ctx.enable_alloc_hint),
alloc_hint_flags(image_ctx.alloc_hint_flags),
read_flags(image_ctx.read_flags),
ignore_migrating(image_ctx.ignore_migrating),
enable_sparse_copyup(image_ctx.enable_sparse_copyup),
mtime_update_interval(image_ctx.mtime_update_interval),
@ -305,6 +306,7 @@ struct MockImageCtx {
bool blkin_trace_all;
bool enable_alloc_hint;
uint32_t alloc_hint_flags;
uint32_t read_flags;
bool ignore_migrating;
bool enable_sparse_copyup;
uint64_t mtime_update_interval;

View File

@ -1948,6 +1948,7 @@ TEST_F(TestLibRBD, TestIO)
uint64_t size = 2 << 20;
ASSERT_EQ(0, create_image(ioctx, name.c_str(), size, &order));
ASSERT_EQ(0, rados_conf_set(_cluster, "rbd_read_from_replica_policy", "balance"));
ASSERT_EQ(0, rbd_open(ioctx, name.c_str(), &image, NULL));
char test_data[TEST_IO_SIZE + 1];