summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2014-01-21 13:49:08 +0000
committerJeff Darcy <jdarcy@redhat.com>2014-01-21 13:49:08 +0000
commit6bcbf03b5aa4448832645a29ec2bc4b2fc5f2eaf (patch)
tree750f73a40aa62c20d66a2532fef6fd158cebb9c4 /tests
parent0225d7bc712609232d592d48116ec771cd97c2cf (diff)
parent17c4fb2d04f84b5632983866e8bddfbd7d77a054 (diff)
Merge branch 'upstream'
Conflicts: api/src/glfs-fops.c api/src/glfs-handleops.c Change-Id: I6811674cc4ec4be6fa6e4cdebb4bc428194bebd8
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/bug-1023974.t33
-rw-r--r--tests/bugs/bug-1047378.t12
-rwxr-xr-xtests/bugs/bug-1049323.t64
-rw-r--r--tests/bugs/bug-858488-min-free-disk.t7
4 files changed, 109 insertions, 7 deletions
diff --git a/tests/bugs/bug-1023974.t b/tests/bugs/bug-1023974.t
new file mode 100644
index 000000000..56766b979
--- /dev/null
+++ b/tests/bugs/bug-1023974.t
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# This regression test tries to ensure renaming a directory with content, and
+# no limit set, is accounted properly, when moved into a directory with quota
+# limit set.
+
+. $(dirname $0)/../include.rc
+
+cleanup;
+
+TEST glusterd
+TEST pidof glusterd;
+TEST $CLI volume info;
+
+TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2,3,4,5,6};
+TEST $CLI volume start $V0;
+
+TEST $CLI volume quota $V0 enable;
+
+TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0;
+
+TEST mkdir -p $M0/1/2;
+TEST $CLI volume quota $V0 limit-usage /1/2 100MB 70%;
+
+#The corresponding write(3) should fail with EDQUOT ("Disk quota exceeded")
+TEST ! dd if=/dev/urandom of=$M0/1/2/file bs=1M count=102;
+TEST mkdir $M0/1/3 -p;
+TEST dd if=/dev/urandom of=$M0/1/3/file bs=1M count=102;
+
+#The corresponding rename(3) should fail with EDQUOT ("Disk quota exceeded")
+TEST ! mv $M0/1/3/ $M0/1/2/3_mvd;
+
+cleanup;
diff --git a/tests/bugs/bug-1047378.t b/tests/bugs/bug-1047378.t
new file mode 100644
index 000000000..b441ee9b1
--- /dev/null
+++ b/tests/bugs/bug-1047378.t
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+. $(dirname $0)/../include.rc
+
+cleanup;
+
+TEST glusterd
+TEST pidof glusterd
+
+TEST "echo volume list | $CLI --xml | xmllint --format -"
+
+cleanup
diff --git a/tests/bugs/bug-1049323.t b/tests/bugs/bug-1049323.t
new file mode 100755
index 000000000..203612e91
--- /dev/null
+++ b/tests/bugs/bug-1049323.t
@@ -0,0 +1,64 @@
+#!/bin/bash
+. $(dirname $0)/../include.rc
+. $(dirname $0)/../volume.rc
+
+cleanup;
+
+function _init()
+{
+# Start glusterd
+TEST glusterd;
+TEST pidof glusterd;
+TEST $CLI volume info;
+
+#Create a volume
+TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2};
+
+#Verify volume is created
+EXPECT "$V0" volinfo_field $V0 'Volume Name';
+EXPECT 'Created' volinfo_field $V0 'Status';
+
+#Start volume and verify
+TEST $CLI volume start $V0;
+EXPECT 'Started' volinfo_field $V0 'Status';
+TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0
+
+#Enable Quota
+TEST $CLI volume quota $V0 enable
+
+##Wait for the auxiliary mount to comeup
+sleep 3;
+}
+
+function get_aux()
+{
+##Check if a auxiliary mount is there
+df -h | grep "/var/run/gluster/$V0" -
+
+if [ $? -eq 0 ]
+then
+ echo "0"
+else
+ echo "1"
+fi
+}
+
+function create_data()
+{
+#set some limit on the volume
+TEST $CLI volume quota $V0 limit-usage / 50MB;
+
+#Auxiliary mount should be there before stopping the volume
+EXPECT "0" get_aux;
+
+TEST $CLI volume stop $V0;
+
+#Aux mount should have been removed
+EXPECT "1" get_aux;
+
+}
+
+
+_init;
+create_data;
+cleanup;
diff --git a/tests/bugs/bug-858488-min-free-disk.t b/tests/bugs/bug-858488-min-free-disk.t
index ae5ac3bde..dfed0fd33 100644
--- a/tests/bugs/bug-858488-min-free-disk.t
+++ b/tests/bugs/bug-858488-min-free-disk.t
@@ -5,11 +5,6 @@
cleanup;
-function pidgrep()
-{
- ps ax | grep "$1" | grep -v grep | awk '{print $1}' | head -1
-}
-
## Start glusterd
TEST glusterd;
TEST pidof glusterd;
@@ -38,7 +33,6 @@ EXPECT 'Created' volinfo_field $V0 'Status';
TEST $CLI volume start $V0;
EXPECT 'Started' volinfo_field $V0 'Status';
TEST glusterfs -s $H0 --volfile-id=$V0 --acl $M0
-MOUNT_PID=`ps ax |grep "glusterfs -s $H0 --volfile-id=$V0 --acl $M0" | awk '{print $1}' | head -1`
## Real test starts here
## ----------------------------------------------------------------------------
@@ -103,7 +97,6 @@ dd if=/dev/zero of=$M0/$FILETOCREATE bs=1024 count=2048 1>/dev/null 2>&1
TEST [ -e $OTHERBRICK/$FILETOCREATE ]
## Done testing, lets clean up
-EXPECT "$MOUNT_PID" pidgrep $MOUNT_PID
TEST rm -rf $M0/*
## Finish up