summaryrefslogtreecommitdiffstats
path: root/tests/basic/geo-replication/marker-xattrs.t
blob: dd5483d7e95a93dc7558f358a2d404f719022f7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/bash

. $(dirname $0)/../../include.rc
. $(dirname $0)/../../volume.rc

TEST glusterd
TEST pidof glusterd

## Start and create a replicated volume
TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}-{0,1,2,3}

TEST $CLI volume set $V0 indexing on

TEST $CLI volume start $V0;

## Mount native
TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0

## Mount client-pid=-1
TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 --client-pid=-1 $M1

TEST touch $M0

vol_uuid=$(get_volume_mark $M1)
xtime=trusted.glusterfs.$vol_uuid.xtime

TEST "getfattr -n $xtime $M1 | grep -q ${xtime}="

TEST kill_brick $V0 $H0 $B0/${V0}-0

TEST "getfattr -n $xtime $M1 | grep -q ${xtime}="

TEST getfattr -d -m. -e hex $M1
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M1

TEST $CLI volume stop $V0;
TEST $CLI volume delete $V0;

cleanup
TEST glusterd
TEST pidof glusterd
## Start and create a disperse volume
TEST $CLI volume create $V0 disperse 3 redundancy 1 $H0:$B0/${V0}-{0,1,2}

TEST $CLI volume set $V0 indexing on

TEST $CLI volume start $V0;

## Mount native
TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0
EXPECT_WITHIN $CHILD_UP_TIMEOUT "3" mount_get_option_value $M0 $V0-disperse-0 childs_up

## Mount client-pid=-1
TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 --client-pid=-1 $M1
EXPECT_WITHIN $CHILD_UP_TIMEOUT "3" mount_get_option_value $M1 $V0-disperse-0 childs_up

TEST touch $M0

vol_uuid=$(get_volume_mark $M1)
xtime=trusted.glusterfs.$vol_uuid.xtime
stime=trusted.glusterfs.$vol_uuid.stime

stime_val=$(getfattr -e hex -n $xtime $M1 | grep ${xtime}= | cut -f2 -d'=')
TEST "setfattr -n $stime -v $stime_val $B0/${V0}-1"
TEST "getfattr -n $xtime $M1 | grep -q ${xtime}="

TEST kill_brick $V0 $H0 $B0/${V0}-0

TEST "getfattr -n $xtime $M1 | grep -q ${xtime}="
TEST "getfattr -n $stime $M1 | grep -q ${stime}="

TEST getfattr -d -m. -e hex $M1
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M1

TEST $CLI volume stop $V0;
TEST $CLI volume delete $V0;

cleanup
TEST glusterd
TEST pidof glusterd
## Start and create a stripe volume
TEST $CLI volume create $V0 stripe 2 $H0:$B0/${V0}-{0,1}

TEST $CLI volume set $V0 indexing on

TEST $CLI volume start $V0;

## Mount native
TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0

## Mount client-pid=-1
TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 --client-pid=-1 $M1

TEST touch $M0

vol_uuid=$(get_volume_mark $M1)
xtime=trusted.glusterfs.$vol_uuid.xtime

TEST "getfattr -n $xtime $M1 | grep -q ${xtime}="

TEST kill_brick $V0 $H0 $B0/${V0}-0

#Stripe doesn't tolerate ENOTCONN
TEST ! "getfattr -n $xtime $M1 | grep -q ${xtime}="

EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M1

TEST $CLI volume stop $V0;
TEST $CLI volume delete $V0;

cleanup