summaryrefslogtreecommitdiffstats
path: root/tests/basic
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2014-11-13 15:13:39 +0530
committerRaghavendra Bhat <raghavendra@redhat.com>2014-12-22 04:19:04 -0800
commitfc67bb6e45da96aee381ca804d79c94d4e3a59a6 (patch)
tree7a193f5d697af5aeabdfd8321d0ffd9637410d76 /tests/basic
parentf9b4ef19d9e80ab4723e947a04c1c094843a0b6f (diff)
uss/gluster: creating file/directories inside .snaps should fail with EROFS.
When an attempt is made to create file/directories inside .snaps, it fails with wrong error message as "Stale file handle". It should fail with "Read-only file system" Change-Id: I3a812a0afc4762cbb71ab180b9394c866e576a66 BUG: 1175730 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9039 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com> Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/9300 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'tests/basic')
-rw-r--r--tests/basic/uss.t22
1 files changed, 14 insertions, 8 deletions
diff --git a/tests/basic/uss.t b/tests/basic/uss.t
index 53a36cf4639..ff59a78ad87 100644
--- a/tests/basic/uss.t
+++ b/tests/basic/uss.t
@@ -6,6 +6,12 @@
. $(dirname $0)/../fileio.rc
. $(dirname $0)/../nfs.rc
+function check_readonly()
+{
+ $@ 2>&1 | grep -q 'Read-only file system'
+ return $?
+}
+
cleanup;
TEST init_n_bricks 3;
@@ -86,8 +92,8 @@ TEST ! fd_open $fd1 'w' $M0/.snaps/snap1/file2;
TEST ! stat $M0/.snaps/snap1/.snaps
# creating new entries in snapshots should fail
-TEST ! mkdir $M0/.snaps/new
-TEST ! touch $M0/.snaps/snap2/other;
+TEST check_readonly mkdir $M0/.snaps/new
+TEST check_readonly touch $M0/.snaps/snap2/other;
TEST fd3=`fd_available`
TEST fd_open $fd3 'r' $M0/dir1/.snaps/snap3/foo1
@@ -146,9 +152,9 @@ TEST ! fd_open $fd1 'w' $N0/.snaps/snap1/file2;
TEST ! stat $N0/.snaps/snap1/.stat
-TEST ! mkdir $N0/.snaps/new
+TEST check_readonly mkdir $N0/.snaps/new
-TEST ! touch $N0/.snaps/snap2/other;
+TEST check_readonly touch $N0/.snaps/snap2/other;
TEST fd3=`fd_available`
TEST fd_open $fd3 'r' $N0/dir1/.snaps/snap3/foo1
@@ -198,8 +204,8 @@ TEST ! fd_open $fd1 'w' $M0/.history/snap1/file2;
TEST ! stat $M0/.history/snap1/.history
# creating new entries in snapshots should fail
-TEST ! mkdir $M0/.history/new
-TEST ! touch $M0/.history/snap2/other;
+TEST check_readonly mkdir $M0/.history/new
+TEST check_readonly touch $M0/.history/snap2/other;
TEST fd3=`fd_available`
TEST fd_open $fd3 'r' $M0/dir1/.history/snap3/foo1
@@ -244,9 +250,9 @@ TEST ! fd_open $fd1 'w' $N0/.history/snap1/file2;
TEST ! stat $N0/.history/snap1/.stat
-TEST ! mkdir $N0/.history/new
+TEST check_readonly mkdir $N0/.history/new
-TEST ! touch $N0/.history/snap2/other;
+TEST check_readonly touch $N0/.history/snap2/other;
TEST fd3=`fd_available`
TEST fd_open $fd3 'r' $N0/dir1/.history/snap3/foo1