diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2015-07-22 15:18:20 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-07-30 00:28:52 -0700 |
commit | fc62b329ad6dc5f2e986f5cd50225015c3af199e (patch) | |
tree | 6ef0c3a98e4907e3f400b75bed9825092baa1d81 /tests/bugs | |
parent | 2bb92b4837ee81b826c615b2e2280bf37fc5906f (diff) |
features/shard: Handle unlink of files with holes appropriately in unlink() and rename().
Backport of: http://review.gluster.org/11737
Change-Id: I94b089dc943ca20952834aa513134f7b9e925bd4
BUG: 1247014
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/11767
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'tests/bugs')
-rw-r--r-- | tests/bugs/shard/bug-1245547.t | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/bugs/shard/bug-1245547.t b/tests/bugs/shard/bug-1245547.t new file mode 100644 index 00000000000..c19b2a6a042 --- /dev/null +++ b/tests/bugs/shard/bug-1245547.t @@ -0,0 +1,35 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc + +cleanup; + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume create $V0 $H0:$B0/${V0}{0,1} +TEST $CLI volume set $V0 features.shard on +TEST $CLI volume start $V0 + +TEST $GFS --volfile-id=$V0 --volfile-server=$H0 $M0 +#Create a file. +TEST touch $M0/foo +#Write some data into it. +TEST `echo "abc" > $M0/foo` + +#This should ensure /.shard is created on the bricks. +TEST stat $B0/${V0}0/.shard +TEST stat $B0/${V0}1/.shard + +#Create a file 'bar' with holes. +TEST touch $M0/bar +TEST truncate -s 10G $M0/bar +#Unlink on such a file should succeed. +TEST unlink $M0/bar +# +#Create a file 'baz' with holes. +TEST touch $M0/baz +TEST truncate -s 10G $M0/baz +#Rename with a sharded existing dest that has holes must succeed. +TEST mv -f $M0/foo $M0/baz + +cleanup; |