qa: add krbd_discard_granularity.t test

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
Ilya Dryomov 2019-03-18 20:06:20 +01:00
parent 481b6c2146
commit a337cc58cd
2 changed files with 41 additions and 0 deletions

View File

@ -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

View File

@ -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