From: Julien COLLET Date: Tue, 20 Feb 2018 09:42:52 +0000 (+0100) Subject: test/librbd: use v1 images in the rbd unit tests X-Git-Tag: v13.1.0~422^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=18d9a74b6979eeb8f5bf9d2ebebbeb2b8ce61942;p=ceph.git test/librbd: use v1 images in the rbd unit tests Update the test/qa scripts to support the v1 creation disallow fix (using the RBD_FORCE_ALLOW_V1 environment variable). Signed-off-by: Julien Collet --- diff --git a/qa/workunits/rbd/cli_generic.sh b/qa/workunits/rbd/cli_generic.sh index 3a4bdb39ebbd7..11d6b73d832f5 100755 --- a/qa/workunits/rbd/cli_generic.sh +++ b/qa/workunits/rbd/cli_generic.sh @@ -1,5 +1,7 @@ #!/bin/sh -ex +export RBD_FORCE_ALLOW_V1=1 + # make sure rbd pool is EMPTY.. this is a test script!! rbd ls | wc -l | grep -v '^0$' && echo "nonempty rbd pool, aborting! run this script on an empty test cluster only." && exit 1 diff --git a/qa/workunits/rbd/image_read.sh b/qa/workunits/rbd/image_read.sh index 779e315fec4f0..ddca8356ef6b7 100755 --- a/qa/workunits/rbd/image_read.sh +++ b/qa/workunits/rbd/image_read.sh @@ -54,6 +54,8 @@ DEFAULT_OBJECT_ORDER=22 MIN_OBJECT_ORDER=12 # technically 9, but the rbd CLI enforces 12 MAX_OBJECT_ORDER=32 +RBD_FORCE_ALLOW_V1=1 + PROGNAME=$(basename $0) ORIGINAL=original-$$ diff --git a/qa/workunits/rbd/krbd_data_pool.sh b/qa/workunits/rbd/krbd_data_pool.sh index 7ecdf03d6b121..23dc3806015fe 100755 --- a/qa/workunits/rbd/krbd_data_pool.sh +++ b/qa/workunits/rbd/krbd_data_pool.sh @@ -2,6 +2,8 @@ set -ex +export RBD_FORCE_ALLOW_V1=1 + function fill_image() { local spec=$1 diff --git a/qa/workunits/rbd/merge_diff.sh b/qa/workunits/rbd/merge_diff.sh index d0f26072eeeb6..eb8597304d0b1 100755 --- a/qa/workunits/rbd/merge_diff.sh +++ b/qa/workunits/rbd/merge_diff.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -ex +export RBD_FORCE_ALLOW_V1=1 + pool=rbd gen=$pool/gen out=$pool/out diff --git a/src/test/librbd/test_main.cc b/src/test/librbd/test_main.cc index 654c8912d6f7e..932163147c4fb 100644 --- a/src/test/librbd/test_main.cc +++ b/src/test/librbd/test_main.cc @@ -24,6 +24,8 @@ extern void register_test_operations(); int main(int argc, char **argv) { + setenv("RBD_FORCE_ALLOW_V1","1",1); + register_test_librbd(); #ifdef TEST_LIBRBD_INTERNALS register_test_deep_copy(); diff --git a/src/test/pybind/test_rbd.py b/src/test/pybind/test_rbd.py index 6ce6c32c9d5cc..a6d308ee13710 100644 --- a/src/test/pybind/test_rbd.py +++ b/src/test/pybind/test_rbd.py @@ -37,6 +37,8 @@ pool_name = None IMG_SIZE = 8 << 20 # 8 MiB IMG_ORDER = 22 # 4 MiB objects +os.environ["RBD_FORCE_ALLOW_V1"] = "1" + def setup_module(): global rados rados = Rados(conffile='')