ceph/qa/workunits/rbd/map-snapshot-io.sh
Ilya Dryomov 38a572011d qa: rbd/map-snapshot-io.sh: don't chown sysfs files
/sys/bus/rbd/add_single_major is used if present, so chown'ing
/sys/bus/rbd/add doesn't help.  Use sudo on rbd map instead.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2016-05-11 19:59:42 +02:00

18 lines
352 B
Bash
Executable File

#!/bin/sh
# http://tracker.ceph.com/issues/3964
set -ex
rbd create image -s 100
DEV=$(sudo rbd map image)
dd if=/dev/zero of=$DEV oflag=direct count=10
rbd snap create image@s1
dd if=/dev/zero of=$DEV oflag=direct count=10 # used to fail
rbd snap rm image@s1
dd if=/dev/zero of=$DEV oflag=direct count=10
sudo rbd unmap $DEV
rbd rm image
echo OK