3
. $(dirname $0)/../../include.rc
4
. $(dirname $0)/../../volume.rc
8
# This tests that the replicate trash directory(.landfill) has following
10
# Note: This is to have backward compatibility with 3.3 glusterfs
11
# In the latest releases this dir is present inside .glusterfs of brick.
12
# 1) lookup of trash dir fails
13
# 2) readdir does not show this directory
14
# 3) Self-heal does not do any self-heal of these directories.
15
gfid1="0xc2e75dde97f346e7842d1076a8e699f8"
18
TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}0 $H0:$B0/${V0}1
19
TEST $CLI volume start $V0
20
TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0 --direct-io-mode=enable
22
TEST mkdir $B0/${V0}1/.landfill
23
TEST setfattr -n trusted.gfid -v $gfid1 $B0/${V0}1/.landfill
24
TEST mkdir $B0/${V0}0/.landfill
25
TEST setfattr -n trusted.gfid -v $gfid1 $B0/${V0}0/.landfill
27
TEST ! stat $M0/.landfill
28
EXPECT "" echo $(ls -a $M0 | grep ".landfill")
30
TEST rmdir $B0/${V0}0/.landfill
31
#Force a conservative merge and it should not create .landfill
32
TEST setfattr -n trusted.afr.$V0-client-0 -v 0x000000000000000000000000 $B0/${V0}0/
33
TEST setfattr -n trusted.afr.$V0-client-1 -v 0x000000000000000000000001 $B0/${V0}0/
35
TEST setfattr -n trusted.afr.$V0-client-0 -v 0x000000000000000000000001 $B0/${V0}1/
36
TEST setfattr -n trusted.afr.$V0-client-1 -v 0x000000000000000000000000 $B0/${V0}1/
38
EXPECT "" echo $(ls -a $M0 | grep ".landfill")
39
TEST ! stat $B0/${V0}0/.landfill
40
TEST stat $B0/${V0}1/.landfill
42
#TEST that the dir is not deleted even when xattrs suggest to delete
43
TEST setfattr -n trusted.afr.$V0-client-0 -v 0x000000000000000000000000 $B0/${V0}0/
44
TEST setfattr -n trusted.afr.$V0-client-1 -v 0x000000000000000000000001 $B0/${V0}0/
46
TEST setfattr -n trusted.afr.$V0-client-0 -v 0x000000000000000000000000 $B0/${V0}1/
47
TEST setfattr -n trusted.afr.$V0-client-1 -v 0x000000000000000000000000 $B0/${V0}1/
49
EXPECT "" echo $(ls -a $M0 | grep ".landfill")
50
TEST ! stat $B0/${V0}0/.landfill
51
TEST stat $B0/${V0}1/.landfill