]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_test_objectstore: test unprintable chars
authorSage Weil <sage@redhat.com>
Fri, 14 Oct 2016 19:35:06 +0000 (15:35 -0400)
committerSage Weil <sage@redhat.com>
Mon, 17 Oct 2016 15:46:22 +0000 (11:46 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/test/objectstore/store_test.cc

index f519135e46e897d26d45cf46f37bddc07f0c5f9e..f219566ef7bb3fe01d9ff45e30228b9de2e1d57c 100644 (file)
@@ -229,6 +229,37 @@ TEST_P(StoreTest, IORemount) {
   }
 }
 
+TEST_P(StoreTest, UnprintableCharsName) {
+  ObjectStore::Sequencer osr("test");
+  coll_t cid;
+  string name = "funnychars_";
+  for (unsigned i = 0; i < 256; ++i) {
+    name.push_back(i);
+  }
+  ghobject_t oid(hobject_t(sobject_t(name, CEPH_NOSNAP)));
+  int r;
+  {
+    cerr << "create collection + object" << std::endl;
+    ObjectStore::Transaction t;
+    t.create_collection(cid, 0);
+    t.touch(cid, oid);
+    r = apply_transaction(store, &osr, std::move(t));
+    ASSERT_EQ(r, 0);
+  }
+  r = store->umount();
+  ASSERT_EQ(0, r);
+  r = store->mount();
+  ASSERT_EQ(0, r);
+  {
+    cout << "removing" << std::endl;
+    ObjectStore::Transaction t;
+    t.remove(cid, oid);
+    t.remove_collection(cid);
+    r = apply_transaction(store, &osr, std::move(t));
+    ASSERT_EQ(r, 0);
+  }
+}
+
 TEST_P(StoreTest, FiemapEmpty) {
   ObjectStore::Sequencer osr("test");
   coll_t cid;