diff options
| author | Jeff Darcy <jdarcy@fb.com> | 2017-05-12 08:09:12 -0700 | 
|---|---|---|
| committer | Jeff Darcy <jeff@pl.atyp.us> | 2017-05-13 01:53:17 +0000 | 
| commit | f3fa5ed6ab79dcd84e054cafa15a31874a712e95 (patch) | |
| tree | 45fe00807995d5ba4706b8153159056c1cff09d4 | |
| parent | 10bf2a1292dec01b0378a9ab33c11a531b15ac62 (diff) | |
tests: remove sloppy hard-coding of loopback devs
Change-Id: I163656985185c710e20ad80824e14645020522cd
Signed-off-by: Jeff Darcy <jdarcy@fb.com>
Reviewed-on: https://review.gluster.org/17279
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Kevin Vigor <kvigor@fb.com>
Tested-by: Jeff Darcy <jeff@pl.atyp.us>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
| -rwxr-xr-x | tests/basic/dht-min-free-space.t | 33 | 
1 files changed, 12 insertions, 21 deletions
diff --git a/tests/basic/dht-min-free-space.t b/tests/basic/dht-min-free-space.t index 17d10cc39a5..9553f9247aa 100755 --- a/tests/basic/dht-min-free-space.t +++ b/tests/basic/dht-min-free-space.t @@ -2,28 +2,24 @@  . $(dirname $0)/../include.rc  . $(dirname $0)/../volume.rc - -cleanup; +. $(dirname $0)/../traps.rc  grep $B0/patchy1 /proc/mounts &> /dev/null && umount $B0/patchy1  grep $B0/patchy2 /proc/mounts &> /dev/null && umount $B0/patchy2 -losetup -d /dev/loop0 2> /dev/null -losetup -d /dev/loop1 2> /dev/null  mkdir $B0/${V0}{1..2}  TEST glusterd -TEST dd if=/dev/zero of=/tmp/${V0}-dev1 bs=1M count=30 -TEST dd if=/dev/zero of=/tmp/${V0}-dev2 bs=1M count=30 - -TEST losetup /dev/loop0 /tmp/${V0}-dev1 -TEST losetup /dev/loop1 /tmp/${V0}-dev2 +TEST truncate --size $((30*1048576)) $B0/${V0}-dev1 +push_trapfunc "rm -f $B0/${V0}-dev1" +TEST truncate --size $((30*1048576)) $B0/${V0}-dev2 +push_trapfunc "rm -f $B0/${V0}-dev2" -TEST mkfs.xfs /dev/loop0 -TEST mkfs.xfs /dev/loop1 +TEST mkfs.xfs $B0/${V0}-dev1 +TEST mkfs.xfs $B0/${V0}-dev2 -TEST mount /dev/loop0 $B0/${V0}1 -TEST mount /dev/loop1 $B0/${V0}2 +TEST mount -o loop $B0/${V0}-dev1 $B0/${V0}1 +TEST mount -o loop $B0/${V0}-dev2 $B0/${V0}2  TEST $CLI volume create $V0 $H0:$B0/${V0}1 $H0:$B0/${V0}2  TEST $CLI volume set $V0 cluster.min-free-disk 2MB @@ -67,12 +63,7 @@ TEST $CLI volume set $V0 cluster.min-free-strict-mode on  TEST ! dd if=/dev/zero of=$M0/testfile1 bs=1M count=16  TEST rm -f $M0/testfile1 -killall gluster{fs,fsd,d} - -umount -lf $B0/${V0}1 -umount -lf $B0/${V0}2 - -losetup -d /dev/loop0 -losetup -d /dev/loop1 - +# Cleanup will deal with our mounts for us, and (because we used "-o loop") our +# device files too, but not the underlying files.  That will happen in the EXIT +# trap handler instead.  cleanup;  | 
