diff options
author | vmallika <vmallika@redhat.com> | 2014-11-13 15:13:39 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-11-13 06:55:11 -0800 |
commit | b4597a92ccfebf362c63977bc4bada7b65e28753 (patch) | |
tree | 1a447813d4c4ab95125c217139a65d602fcceeff /tests | |
parent | 75474f148daada475c235d0acaf345acad4ba9f3 (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: 1159840
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>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basic/uss.t | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/tests/basic/uss.t b/tests/basic/uss.t index 56cb757514d..f86c19d981e 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 @@ -148,9 +154,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 @@ -200,8 +206,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 @@ -246,9 +252,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 |