From a337cc58cdee1d0443744eef2a43d86738b3124d Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Mon, 18 Mar 2019 20:06:20 +0100 Subject: [PATCH] qa: add krbd_discard_granularity.t test Signed-off-by: Ilya Dryomov --- qa/rbd/krbd_discard_granularity.t | 40 ++++++++++++++++++++ qa/suites/krbd/basic/tasks/krbd_discard.yaml | 1 + 2 files changed, 41 insertions(+) create mode 100644 qa/rbd/krbd_discard_granularity.t diff --git a/qa/rbd/krbd_discard_granularity.t b/qa/rbd/krbd_discard_granularity.t new file mode 100644 index 00000000000..844643baedb --- /dev/null +++ b/qa/rbd/krbd_discard_granularity.t @@ -0,0 +1,40 @@ + + $ rbd create --size 20M img + + $ DEV=$(sudo rbd map img) + $ blockdev --getiomin $DEV + 65536 + $ blockdev --getioopt $DEV + 65536 + $ cat /sys/block/${DEV#/dev/}/queue/discard_granularity + 65536 + $ sudo rbd unmap $DEV + + $ DEV=$(sudo rbd map -o alloc_size=512 img) + $ blockdev --getiomin $DEV + 512 + $ blockdev --getioopt $DEV + 512 + $ cat /sys/block/${DEV#/dev/}/queue/discard_granularity + 512 + $ sudo rbd unmap $DEV + + $ DEV=$(sudo rbd map -o alloc_size=4194304 img) + $ blockdev --getiomin $DEV + 4194304 + $ blockdev --getioopt $DEV + 4194304 + $ cat /sys/block/${DEV#/dev/}/queue/discard_granularity + 4194304 + $ sudo rbd unmap $DEV + + $ DEV=$(sudo rbd map -o alloc_size=8388608 img) + $ blockdev --getiomin $DEV + 4194304 + $ blockdev --getioopt $DEV + 4194304 + $ cat /sys/block/${DEV#/dev/}/queue/discard_granularity + 4194304 + $ sudo rbd unmap $DEV + + $ rbd rm --no-progress img diff --git a/qa/suites/krbd/basic/tasks/krbd_discard.yaml b/qa/suites/krbd/basic/tasks/krbd_discard.yaml index 869bef00ae3..59ec5b943cf 100644 --- a/qa/suites/krbd/basic/tasks/krbd_discard.yaml +++ b/qa/suites/krbd/basic/tasks/krbd_discard.yaml @@ -6,3 +6,4 @@ tasks: - qa/rbd/krbd_discard_512b.t - qa/rbd/krbd_discard_4M.t - qa/rbd/krbd_zeroout.t + - qa/rbd/krbd_discard_granularity.t