From 72edaae04d9463dd7d8b3ffd47fdf7d85026b321 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Fri, 23 Feb 2018 11:03:33 +0100 Subject: [PATCH] qa: krbd latest-osdmap-on-map test Make sure we get the latest osdmap when using an existing client. Signed-off-by: Ilya Dryomov --- .../tasks/krbd_latest_osdmap_on_map.yaml | 5 ++++ qa/workunits/rbd/krbd_latest_osdmap_on_map.sh | 30 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 qa/suites/krbd/rbd-nomount/tasks/krbd_latest_osdmap_on_map.yaml create mode 100755 qa/workunits/rbd/krbd_latest_osdmap_on_map.sh diff --git a/qa/suites/krbd/rbd-nomount/tasks/krbd_latest_osdmap_on_map.yaml b/qa/suites/krbd/rbd-nomount/tasks/krbd_latest_osdmap_on_map.yaml new file mode 100644 index 00000000000..522be6a42ac --- /dev/null +++ b/qa/suites/krbd/rbd-nomount/tasks/krbd_latest_osdmap_on_map.yaml @@ -0,0 +1,5 @@ +tasks: +- workunit: + clients: + all: + - rbd/krbd_latest_osdmap_on_map.sh diff --git a/qa/workunits/rbd/krbd_latest_osdmap_on_map.sh b/qa/workunits/rbd/krbd_latest_osdmap_on_map.sh new file mode 100755 index 00000000000..f70f3863928 --- /dev/null +++ b/qa/workunits/rbd/krbd_latest_osdmap_on_map.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +set -ex + +function run_test() { + ceph osd pool create foo 12 + rbd pool init foo + rbd create --size 1 foo/img + + local dev + dev=$(sudo rbd map foo/img) + sudo rbd unmap $dev + + ceph osd pool delete foo foo --yes-i-really-really-mean-it +} + +NUM_ITER=20 + +for ((i = 0; i < $NUM_ITER; i++)); do + run_test +done + +rbd create --size 1 img +DEV=$(sudo rbd map img) +for ((i = 0; i < $NUM_ITER; i++)); do + run_test +done +sudo rbd unmap $DEV + +echo OK