From 156cf45214472777309cea92c79590e294ebfef9 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Tue, 30 May 2017 16:17:21 +0200 Subject: [PATCH] qa: krbd discard/zeroout tests Signed-off-by: Ilya Dryomov --- .../rbd-nomount/tasks/krbd_fallocate.yaml | 5 + qa/workunits/rbd/krbd_fallocate.sh | 124 ++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 qa/suites/krbd/rbd-nomount/tasks/krbd_fallocate.yaml create mode 100755 qa/workunits/rbd/krbd_fallocate.sh diff --git a/qa/suites/krbd/rbd-nomount/tasks/krbd_fallocate.yaml b/qa/suites/krbd/rbd-nomount/tasks/krbd_fallocate.yaml new file mode 100644 index 0000000000000..a7286982409bb --- /dev/null +++ b/qa/suites/krbd/rbd-nomount/tasks/krbd_fallocate.yaml @@ -0,0 +1,5 @@ +tasks: +- workunit: + clients: + all: + - rbd/krbd_fallocate.sh diff --git a/qa/workunits/rbd/krbd_fallocate.sh b/qa/workunits/rbd/krbd_fallocate.sh new file mode 100755 index 0000000000000..05fc8a98c6409 --- /dev/null +++ b/qa/workunits/rbd/krbd_fallocate.sh @@ -0,0 +1,124 @@ +#!/bin/bash + +# This documents the state of things as of 4.12-rc4. +# +# - fallocate -z deallocates because BLKDEV_ZERO_NOUNMAP hint is ignored by +# krbd +# +# - unaligned fallocate -z/-p appear to not deallocate -- see caveat #2 in +# linux.git commit 6ac56951dc10 ("rbd: implement REQ_OP_WRITE_ZEROES") + +set -ex + +# no blkdiscard(8) in trusty +function py_blkdiscard() { + local offset=$1 + + python <