summaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/bug-1099890.t19
-rw-r--r--tests/bugs/bug-858488-min-free-disk.t15
-rw-r--r--tests/bugs/bug-948729/bug-948729-force.t55
-rw-r--r--tests/bugs/bug-948729/bug-948729-mode-script.t29
-rw-r--r--tests/bugs/bug-948729/bug-948729.t30
5 files changed, 99 insertions, 49 deletions
diff --git a/tests/bugs/bug-1099890.t b/tests/bugs/bug-1099890.t
index a27d4e74fbf..c4be2cf56ba 100644
--- a/tests/bugs/bug-1099890.t
+++ b/tests/bugs/bug-1099890.t
@@ -17,16 +17,16 @@ TEST pidof glusterd;
TEST truncate -s 100M $B0/brick1
TEST truncate -s 100M $B0/brick2
-TEST L1=`losetup --find --show $B0/brick1`
-TEST mkfs.xfs $L1
+TEST L1=`SETUP_LOOP $B0/brick1`
+TEST MKFS_LOOP $L1
-TEST L2=`losetup --find --show $B0/brick2`
-TEST mkfs.xfs $L2
+TEST L2=`SETUP_LOOP $B0/brick2`
+TEST MKFS_LOOP $L2
TEST mkdir -p $B0/${V0}{1,2}
-TEST mount -t xfs $L1 $B0/${V0}1
-TEST mount -t xfs $L2 $B0/${V0}2
+TEST MOUNT_LOOP $L1 $B0/${V0}1
+TEST MOUNT_LOOP $L2 $B0/${V0}2
# Create a plain distribute volume with 2 subvols.
TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2};
@@ -117,4 +117,9 @@ EXPECT "$V0-client-1" dht_get_linkto_target "$B0/${V0}1/zz"
EXPECT "1" is_dht_linkfile "$B0/${V0}1/zz"
-cleanup;
+force_umount $M0
+$CLI volume stop $V0
+UMOUNT_LOOP ${B0}/${V0}{1,2}
+rm -f ${B0}/brick{1,2}
+
+cleanup
diff --git a/tests/bugs/bug-858488-min-free-disk.t b/tests/bugs/bug-858488-min-free-disk.t
index babb27c4e25..1933f707e9c 100644
--- a/tests/bugs/bug-858488-min-free-disk.t
+++ b/tests/bugs/bug-858488-min-free-disk.t
@@ -13,13 +13,13 @@ TEST $CLI volume info;
## Lets create partitions for bricks
TEST truncate -s 100M $B0/brick1
TEST truncate -s 200M $B0/brick2
-TEST LO1=`losetup --find --show $B0/brick1`
-TEST mkfs.xfs $LO1
-TEST LO2=`losetup --find --show $B0/brick2`
-TEST mkfs.xfs $LO2
+TEST LO1=`SETUP_LOOP $B0/brick1`
+TEST MKFS_LOOP $LO1
+TEST LO2=`SETUP_LOOP $B0/brick2`
+TEST MKFS_LOOP $LO2
TEST mkdir -p $B0/${V0}1 $B0/${V0}2
-TEST mount -t xfs $LO1 $B0/${V0}1
-TEST mount -t xfs $LO2 $B0/${V0}2
+TEST MOUNT_LOOP $LO1 $B0/${V0}1
+TEST MOUNT_LOOP $LO2 $B0/${V0}2
## Lets create volume
TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2};
@@ -102,4 +102,7 @@ TEST $CLI volume stop $V0;
EXPECT 'Stopped' volinfo_field $V0 'Status';
$CLI volume delete $V0;
+UMOUNT_LOOP ${B0}/${V0}{1,2}
+rm -f ${B0}/brick{1,2}
+
cleanup;
diff --git a/tests/bugs/bug-948729/bug-948729-force.t b/tests/bugs/bug-948729/bug-948729-force.t
index b68b8b88bdd..b4106a58736 100644
--- a/tests/bugs/bug-948729/bug-948729-force.t
+++ b/tests/bugs/bug-948729/bug-948729-force.t
@@ -1,6 +1,7 @@
#!/bin/bash
. $(dirname $0)/../../include.rc
+. $(dirname $0)/../../volume.rc
. $(dirname $0)/../../cluster.rc
function check_peers {
@@ -35,27 +36,27 @@ TEST truncate -s 16M $B4/brick4
TEST truncate -s 16M $B5/brick5
TEST truncate -s 16M $B6/brick6
-TEST LD1=`losetup --find --show $B1/brick1`
-TEST mkfs.xfs $LD1
-TEST LD2=`losetup --find --show $B2/brick2`
-TEST mkfs.xfs $LD2
-TEST LD3=`losetup --find --show $B3/brick3`
-TEST mkfs.xfs $LD3
-TEST LD4=`losetup --find --show $B4/brick4`
-TEST mkfs.xfs $LD4
-TEST LD5=`losetup --find --show $B5/brick5`
-TEST mkfs.xfs $LD5
-TEST LD6=`losetup --find --show $B6/brick6`
-TEST mkfs.xfs $LD6
+TEST LD1=`SETUP_LOOP $B1/brick1`
+TEST MKFS_LOOP $LD1
+TEST LD2=`SETUP_LOOP $B2/brick2`
+TEST MKFS_LOOP $LD2
+TEST LD3=`SETUP_LOOP $B3/brick3`
+TEST MKFS_LOOP $LD3
+TEST LD4=`SETUP_LOOP $B4/brick4`
+TEST MKFS_LOOP $LD4
+TEST LD5=`SETUP_LOOP $B5/brick5`
+TEST MKFS_LOOP $LD5
+TEST LD6=`SETUP_LOOP $B6/brick6`
+TEST MKFS_LOOP $LD6
mkdir -p $B1/$V0 $B2/$V0 $B3/$V0 $B4/$V0 $B5/$V0 $B6/$V0
-TEST mount -t xfs $LD1 $B1/$V0
-TEST mount -t xfs $LD2 $B2/$V0
-TEST mount -t xfs $LD3 $B3/$V0
-TEST mount -t xfs $LD4 $B4/$V0
-TEST mount -t xfs $LD5 $B5/$V0
-TEST mount -t xfs $LD6 $B6/$V0
+TEST MOUNT_LOOP $LD1 $B1/$V0
+TEST MOUNT_LOOP $LD2 $B2/$V0
+TEST MOUNT_LOOP $LD3 $B3/$V0
+TEST MOUNT_LOOP $LD4 $B4/$V0
+TEST MOUNT_LOOP $LD5 $B5/$V0
+TEST MOUNT_LOOP $LD6 $B6/$V0
#Case 0: Parent directory of the brick is absent
TEST ! $CLI1 volume create $V0 $H1:$B1/$V0/nonexistent/b1 $H2:$B2/$V0/nonexistent/b2 force
@@ -81,4 +82,22 @@ TEST $CLI1 volume add-brick $V2 $H1:$B4/$V0/brick3 force
rmdir /$uuid1 /$uuid2 /$uuid3;
+$CLI volume stop $V0
+$CLI volume stop $V1
+$CLI volume stop $V2
+
+UMOUNT_LOOP $B1/$V0
+UMOUNT_LOOP $B2/$V0
+UMOUNT_LOOP $B3/$V0
+UMOUNT_LOOP $B4/$V0
+UMOUNT_LOOP $B5/$V0
+UMOUNT_LOOP $B6/$V0
+
+rm -f $B1/brick1
+rm -f $B2/brick2
+rm -f $B3/brick3
+rm -f $B4/brick4
+rm -f $B5/brick5
+rm -f $B6/brick6
+
cleanup;
diff --git a/tests/bugs/bug-948729/bug-948729-mode-script.t b/tests/bugs/bug-948729/bug-948729-mode-script.t
index 5ac133a5bfe..6264e18f1bd 100644
--- a/tests/bugs/bug-948729/bug-948729-mode-script.t
+++ b/tests/bugs/bug-948729/bug-948729-mode-script.t
@@ -1,6 +1,7 @@
#!/bin/bash
. $(dirname $0)/../../include.rc
+. $(dirname $0)/../../volume.rc
. $(dirname $0)/../../cluster.rc
function check_peers {
@@ -26,18 +27,18 @@ TEST truncate -s 16M $B1/brick1
TEST truncate -s 16M $B2/brick2
TEST truncate -s 16M $B3/brick3
-TEST LD1=`losetup --find --show $B1/brick1`
-TEST mkfs.xfs $LD1
-TEST LD2=`losetup --find --show $B2/brick2`
-TEST mkfs.xfs $LD2
-TEST LD3=`losetup --find --show $B3/brick3`
-TEST mkfs.xfs $LD3
+TEST LD1=`SETUP_LOOP $B1/brick1`
+TEST MKFS_LOOP $LD1
+TEST LD2=`SETUP_LOOP $B2/brick2`
+TEST MKFS_LOOP $LD2
+TEST LD3=`SETUP_LOOP $B3/brick3`
+TEST MKFS_LOOP $LD3
mkdir -p $B1/$V0 $B2/$V0 $B3/$V0
-TEST mount -t xfs $LD1 $B1/$V0
-TEST mount -t xfs $LD2 $B2/$V0
-TEST mount -t xfs $LD3 $B3/$V0
+TEST MOUNT_LOOP $LD1 $B1/$V0
+TEST MOUNT_LOOP $LD2 $B2/$V0
+TEST MOUNT_LOOP $LD3 $B3/$V0
cli1=$(echo $CLI1 | sed 's/ --wignore//')
@@ -63,4 +64,14 @@ TEST $cli1 volume add-brick $V0 $H1:$B3/$V0/brick3
#FIX-ME : replace-brick does not currently work in the newly introduced
#####cluster test framework
+$CLI1 volume stop $V0
+
+UMOUNT_LOOP $B1/$V0
+UMOUNT_LOOP $B2/$V0
+UMOUNT_LOOP $B3/$V0
+
+rm -f $B1/brick1
+rm -f $B2/brick2
+rm -f $B3/brick3
+
cleanup;
diff --git a/tests/bugs/bug-948729/bug-948729.t b/tests/bugs/bug-948729/bug-948729.t
index 8a0620a7d60..46cdb3d8e8c 100644
--- a/tests/bugs/bug-948729/bug-948729.t
+++ b/tests/bugs/bug-948729/bug-948729.t
@@ -1,6 +1,7 @@
#!/bin/bash
. $(dirname $0)/../../include.rc
+. $(dirname $0)/../../volume.rc
. $(dirname $0)/../../cluster.rc
function check_peers {
@@ -27,18 +28,18 @@ TEST truncate -s 16M $B1/brick1
TEST truncate -s 16M $B2/brick2
TEST truncate -s 16M $B3/brick3
-TEST LD1=`losetup --find --show $B1/brick1`
-TEST mkfs.xfs $LD1
-TEST LD2=`losetup --find --show $B2/brick2`
-TEST mkfs.xfs $LD2
-TEST LD3=`losetup --find --show $B3/brick3`
-TEST mkfs.xfs $LD3
+TEST LD1=`SETUP_LOOP $B1/brick1`
+TEST MKFS_LOOP $LD1
+TEST LD2=`SETUP_LOOP $B2/brick2`
+TEST MKFS_LOOP $LD2
+TEST LD3=`SETUP_LOOP $B3/brick3`
+TEST MKFS_LOOP $LD3
mkdir -p $B1/$V0 $B2/$V0 $B3/$V0
-TEST mount -t xfs $LD1 $B1/$V0
-TEST mount -t xfs $LD2 $B2/$V0
-TEST mount -t xfs $LD3 $B3/$V0
+TEST MOUNT_LOOP $LD1 $B1/$V0
+TEST MOUNT_LOOP $LD2 $B2/$V0
+TEST MOUNT_LOOP $LD3 $B3/$V0
#Tests without options 'mode=script' and 'wignore'
cli1=$(echo $CLI1 | sed 's/ --mode=script//')
@@ -65,4 +66,15 @@ TEST $cli1 volume add-brick $V0 $H1:$B3/$V0/brick3
#FIX-ME: Replace-brick does not work currently in the newly introduced cluster
#####test framework.
+$CLI1 volume stop $V0
+
+UMOUNT_LOOP $B1/$V0
+UMOUNT_LOOP $B2/$V0
+UMOUNT_LOOP $B3/$V0
+
+rm -f $B1/brick1
+rm -f $B2/brick2
+rm -f $B3/brick3
+
+
cleanup;