ceph/qa/workunits/rbd/import_export.sh
Josh Durgin 9071764a6b qa: remove rbd image when done
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-07-30 11:19:53 -07:00

23 lines
493 B
Bash
Executable File

#!/bin/sh -ex
# create a sparse file
dd if=/bin/sh of=/tmp/img bs=1k count=1 seek=10
dd if=/bin/dd of=/tmp/img bs=1k count=10 seek=100
dd if=/bin/rm of=/tmp/img bs=1k count=100 seek=1000
dd if=/bin/ls of=/tmp/img bs=1k seek=10000
dd if=/bin/ln of=/tmp/img bs=1k seek=100000
dd if=/bin/grep of=/tmp/img bs=1k seek=1000000
rbd rm testimg || true
rbd import $RBD_CREATE_ARGS /tmp/img testimg
rbd export testimg /tmp/img2
rbd rm testimg
cmp /tmp/img /tmp/img2
rm /tmp/img /tmp/img2
echo OK