Skip to content

Commit

Permalink
qa/workunits/rbd: rbd-nbd test should use sudo for map/unmap ops
Browse files Browse the repository at this point in the history
Fixes: ceph#14221
Signed-off-by: Jason Dillaman <[email protected]>
  • Loading branch information
Jason Dillaman committed Jan 4, 2016
1 parent 749c424 commit 70a1392
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions qa/workunits/rbd/rbd-nbd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@ function expect_false()
}

rbd remove $gen || true
rbd-nbd unmap $dev || true
sudo rbd-nbd unmap $dev || true

#read test
dd if=/dev/urandom of=$data bs=1M count=$size
rbd --no-progress import $data $gen
rbd-nbd --device $dev map $gen
[ "`dd if=$data bs=1M | md5sum`" != "`dd if=$dev bs=1M | md5sum`" ] && false
sudo rbd-nbd --device $dev map $gen
[ "`dd if=$data bs=1M | md5sum`" != "`sudo dd if=$dev bs=1M | md5sum`" ] && false

#write test
dd if=/dev/urandom of=$data bs=1M count=$size
dd if=$data of=$dev bs=1M
sudo dd if=$data of=$dev bs=1M
sync
[ "`dd if=$data bs=1M | md5sum`" != "`rbd --no-progress export $gen - | md5sum`" ] && false

#trim test
mkfs.ext4 $dev # better idea?
sudo mkfs.ext4 $dev # better idea?
sync
info=`rbd du $gen | tail -n 1`
[ "`echo $info | awk '{print $2}'`" == "`echo $info | awk '{print $3}'`" ] && false

rbd-nbd unmap $dev
sudo rbd-nbd unmap $dev
popd
rm -rf rbd_nbd_test

Expand Down

0 comments on commit 70a1392

Please sign in to comment.