From: Igor Fedotov Date: Wed, 14 Sep 2016 14:00:54 +0000 (+0000) Subject: test/store_test: extend Bluestore compression test to verify compression statistics... X-Git-Tag: v11.0.1~239^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=101be023fba74e22b9f9eb70355321d1fe5dcaed;p=ceph.git test/store_test: extend Bluestore compression test to verify compression statistics and hence compression workability Signed-off-by: Igor Fedotov --- diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index 25fe3384a9ab..b9e516ac5115 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -738,6 +738,7 @@ void doCompressionTest( boost::scoped_ptr& store) cerr << "CompressibleData (4xAU) Write" << std::endl; r = apply_transaction(store, &osr, std::move(t)); ASSERT_EQ(r, 0); + r = store->read(cid, hoid, 0, data.size() , newdata); ASSERT_EQ(r, (int)data.size()); @@ -762,6 +763,15 @@ void doCompressionTest( boost::scoped_ptr& store) expected.append(data.substr(0xf00f)); ASSERT_TRUE(bl_eq(expected, newdata)); } + { + struct store_statfs_t statfs; + int r = store->statfs(&statfs); + ASSERT_EQ(r, 0); + ASSERT_EQ((unsigned)data.size(), statfs.stored); + ASSERT_LE(statfs.compressed, 0x10000); + ASSERT_EQ((unsigned)data.size(), statfs.compressed_original); + ASSERT_EQ(0x10000, statfs.compressed_allocated); + } } std::string data2; data2.resize(0x10000 * 4 - 0x9000);