Skip to content

Commit

Permalink
test/store_test: extend Bluestore compression test to verify compress…
Browse files Browse the repository at this point in the history
…ion statistics and hence compression workability

Signed-off-by: Igor Fedotov <ifedotov@mirantis.com>
  • Loading branch information
Igor Fedotov committed Sep 14, 2016
1 parent c2ac199 commit 101be02
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/test/objectstore/store_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@ void doCompressionTest( boost::scoped_ptr<ObjectStore>& 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());
Expand All @@ -762,6 +763,15 @@ void doCompressionTest( boost::scoped_ptr<ObjectStore>& 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);
Expand Down

0 comments on commit 101be02

Please sign in to comment.