diff options
author | Tor Brede Vekterli <vekterli@oath.com> | 2018-01-11 14:18:27 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@oath.com> | 2018-01-11 14:18:27 +0000 |
commit | 16e6a4569d44a2975cfabb5eba7199112068eee9 (patch) | |
tree | 043aaf8aff6b7db03a0d164f447a6dcb30b53e12 /memfilepersistence/src/tests/spi | |
parent | 985325621dc72673dadd0236e902072a99a52284 (diff) |
Ignore non-default bucket spaces for listBuckets and getModifiedBuckets
Assert that default space is used for all other ops, as VDS does not
support multiple bucket spaces.
Diffstat (limited to 'memfilepersistence/src/tests/spi')
-rw-r--r-- | memfilepersistence/src/tests/spi/basicoperationhandlertest.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/memfilepersistence/src/tests/spi/basicoperationhandlertest.cpp b/memfilepersistence/src/tests/spi/basicoperationhandlertest.cpp index ba540d851a9..8053ed045f5 100644 --- a/memfilepersistence/src/tests/spi/basicoperationhandlertest.cpp +++ b/memfilepersistence/src/tests/spi/basicoperationhandlertest.cpp @@ -6,6 +6,7 @@ #include <vespa/document/fieldset/fieldsetrepo.h> #include <vespa/document/fieldset/fieldsets.h> #include <vespa/persistence/spi/test.h> +#include <vespa/persistence/spi/fixed_bucket_spaces.h> #include <vespa/vdstestlib/cppunit/macros.h> using storage::spi::test::makeSpiBucket; @@ -40,6 +41,8 @@ class BasicOperationHandlerTest : public SingleDiskMemFileTestUtils CPPUNIT_TEST(testEraseFromCacheOnFlushException); CPPUNIT_TEST(testEraseFromCacheOnMaintainException); CPPUNIT_TEST(testEraseFromCacheOnDeleteBucketException); + CPPUNIT_TEST(list_buckets_returns_empty_set_for_non_default_bucketspace); + CPPUNIT_TEST(get_modified_buckets_returns_empty_set_for_non_default_bucketspace); CPPUNIT_TEST_SUITE_END(); void doTestRemoveDocumentNotFound( @@ -74,6 +77,8 @@ public: void testEraseFromCacheOnFlushException(); void testEraseFromCacheOnMaintainException(); void testEraseFromCacheOnDeleteBucketException(); + void list_buckets_returns_empty_set_for_non_default_bucketspace(); + void get_modified_buckets_returns_empty_set_for_non_default_bucketspace(); }; CPPUNIT_TEST_SUITE_REGISTRATION(BasicOperationHandlerTest); @@ -718,6 +723,21 @@ BasicOperationHandlerTest::testEraseFromCacheOnDeleteBucketException() } +void BasicOperationHandlerTest::list_buckets_returns_empty_set_for_non_default_bucketspace() { + document::BucketId bucket(16, 4); + doPut(createRandomDocumentAtLocation(4), bucket, Timestamp(4567), 0); + flush(bucket); + + auto buckets = getPersistenceProvider().listBuckets(spi::FixedBucketSpaces::global_space(), spi::PartitionId(0)); + CPPUNIT_ASSERT_EQUAL(size_t(0), buckets.getList().size()); +} + +void BasicOperationHandlerTest::get_modified_buckets_returns_empty_set_for_non_default_bucketspace() { + env().addModifiedBucket(document::BucketId(16, 1234)); + auto buckets = getPersistenceProvider().getModifiedBuckets(spi::FixedBucketSpaces::global_space()); + CPPUNIT_ASSERT_EQUAL(size_t(0), buckets.getList().size()); +} + } } |