From: Igor Fedotov Date: Mon, 20 Jun 2016 14:21:27 +0000 (+0300) Subject: os/store_test: fix synthetic test cases to handle zero-writes properly, i.e. do not... X-Git-Tag: v11.0.0~110^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=6beb24352a2f1d4d0f47453a6a7b6179ac15cef0;p=ceph-ci.git os/store_test: fix synthetic test cases to handle zero-writes properly, i.e. do not increase object size. Signed-off-by: Igor Fedotov --- diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index af02b96729b..cf3e0f5fa96 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -1997,6 +1997,10 @@ TEST_P(StoreTest, ZeroLengthWrite) { r = store->stat(cid, hoid, &stat); ASSERT_EQ(0, r); ASSERT_EQ(0, stat.st_size); + + bufferlist newdata; + r = store->read(cid, hoid, 0, 1048576, newdata); + ASSERT_EQ(0, r); } TEST_P(StoreTest, SimpleAttrTest) { @@ -3465,8 +3469,10 @@ public: bufferlist& data = contents[new_obj].data; if (data.length() <= offset) { - data.append_zero(offset-data.length()); - data.append(bl); + if (len > 0) { + data.append_zero(offset-data.length()); + data.append(bl); + } } else { bufferlist value; assert(data.length() > offset);