From 125c59bcda1d7bb9f8b2aecc0789b74cb59a3681 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Thu, 30 Apr 2015 02:06:20 +0200 Subject: [PATCH] tests: erasure coded pools do not allow offset on creation If a write operation implicitly creates an object on an erasure coded pool, there cannot be an offset > 0, even if it is properly aligned. Signed-off-by: Loic Dachary --- src/test/librados/io.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/librados/io.cc b/src/test/librados/io.cc index 6f391df7353..d01f09023b9 100644 --- a/src/test/librados/io.cc +++ b/src/test/librados/io.cc @@ -231,6 +231,13 @@ TEST_F(LibRadosIo, RoundTrip) { memset(buf2, 0, sizeof(buf2)); ASSERT_EQ((int)sizeof(buf2), rados_read(ioctx, "foo", buf2, sizeof(buf2), 0)); ASSERT_EQ(0, memcmp(buf, buf2, sizeof(buf))); + + uint64_t off = 19; + memset(buf, 0xcc, sizeof(buf)); + ASSERT_EQ(0, rados_write(ioctx, "bar", buf, sizeof(buf), off)); + memset(buf2, 0, sizeof(buf2)); + ASSERT_EQ((int)sizeof(buf2), rados_read(ioctx, "bar", buf2, sizeof(buf2), off)); + ASSERT_EQ(0, memcmp(buf, buf2, sizeof(buf))); } TEST_F(LibRadosIoPP, RoundTripPP) { @@ -697,6 +704,9 @@ TEST_F(LibRadosIoEC, RoundTrip) { memset(buf2, 0, sizeof(buf2)); ASSERT_EQ((int)sizeof(buf2), rados_read(ioctx, "foo", buf2, sizeof(buf2), 0)); ASSERT_EQ(0, memcmp(buf, buf2, sizeof(buf))); + + uint64_t off = 19; + ASSERT_EQ(-EOPNOTSUPP, rados_write(ioctx, "bar", buf, sizeof(buf), off)); } TEST_F(LibRadosIoECPP, RoundTripPP) {