]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: ensure old-format RBD tests still work
authorJason Dillaman <dillaman@redhat.com>
Thu, 9 Apr 2015 19:06:27 +0000 (15:06 -0400)
committerLoic Dachary <ldachary@redhat.com>
Sun, 6 Sep 2015 14:05:30 +0000 (16:05 +0200)
Override the RBD default image format back to version 1
to ensure tests properly cover the old format.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 3b95edb5bd373bd05f83516eccfd30a6b5cf4693)

src/test/librbd/test_librbd.cc

index dee752110c7d5f72091e21e308cbbe8e72c52a5a..8be68de8480423cbbe51bd06c8649fe216aa54db 100644 (file)
@@ -83,6 +83,10 @@ static int create_image_full(rados_ioctx_t ioctx, const char *name,
                              uint64_t features)
 {
   if (old_format) {
+    // ensure old-format tests actually use the old format
+    CephContext *cct = reinterpret_cast<CephContext*>(rados_ioctx_cct(ioctx));
+    cct->_conf->set_val_or_die("rbd_default_format", "1");
+
     return rbd_create(ioctx, name, size, order);
   } else if ((features & RBD_FEATURE_STRIPINGV2) != 0) {
     return rbd_create3(ioctx, name, size, features, order, 65536, 16);
@@ -113,6 +117,10 @@ static int create_image_pp(librbd::RBD &rbd,
   if (r < 0)
     return r;
   if (old_format) {
+    // ensure old-format tests actually use the old format
+    CephContext *cct = reinterpret_cast<CephContext*>(ioctx.cct());
+    cct->_conf->set_val_or_die("rbd_default_format", "1");
+
     return rbd.create(ioctx, name, size, order);
   } else {
     return rbd.create2(ioctx, name, size, features, order);