From: Jason Dillaman Date: Thu, 9 Apr 2015 19:06:27 +0000 (-0400) Subject: tests: ensure old-format RBD tests still work X-Git-Tag: v9.0.1~152^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3b95edb5bd373bd05f83516eccfd30a6b5cf4693;p=ceph.git tests: ensure old-format RBD tests still work Override the RBD default image format back to version 1 to ensure tests properly cover the old format. Signed-off-by: Jason Dillaman --- diff --git a/src/test/librbd/test_librbd.cc b/src/test/librbd/test_librbd.cc index a5bbeb9d6138..fe7a7036f118 100644 --- a/src/test/librbd/test_librbd.cc +++ b/src/test/librbd/test_librbd.cc @@ -82,6 +82,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(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); @@ -112,6 +116,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(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);