glusterfs

Форк
0
/
bug-1786679.t 
69 строк · 1.4 Кб
1
#!/bin/bash
2

3
SCRIPT_TIMEOUT=250
4

5
. $(dirname $0)/../../include.rc
6
. $(dirname $0)/../../volume.rc
7
. $(dirname $0)/../../dht.rc
8

9

10
# create 2 subvols
11
# create a dir
12
# create a file
13
# change layout
14
# remove the file
15
# execute create from a different mount
16
# Without the patch, the file will be present on both of the bricks
17

18
cleanup
19

20
function get_layout () {
21

22
layout=`getfattr -n trusted.glusterfs.dht -e hex $1 2>&1 | grep dht | gawk -F"=" '{print $2}'`
23

24
echo $layout
25

26
}
27

28
function set_layout()
29
{
30
    setfattr -n  "trusted.glusterfs.dht" -v $1 $2
31
}
32

33
TEST glusterd
34
TEST pidof glusterd
35

36
BRICK1=$B0/${V0}-0
37
BRICK2=$B0/${V0}-1
38

39
TEST $CLI volume create $V0 $H0:$BRICK1 $H0:$BRICK2
40
TEST $CLI volume start $V0
41

42
# Mount FUSE and create symlink
43
TEST glusterfs -s $H0 --volfile-id $V0 $M0
44
TEST mkdir $M0/dir
45
TEST touch $M0/dir/file
46
TEST ! stat "$BRICK1/dir/file"
47
TEST stat "$BRICK2/dir/file"
48

49
layout1="$(get_layout "$BRICK1/dir")"
50
layout2="$(get_layout "$BRICK2/dir")"
51

52
TEST set_layout $layout1 "$BRICK2/dir"
53
TEST set_layout $layout2 "$BRICK1/dir"
54

55
TEST rm $M0/dir/file -f
56
TEST gluster v set $V0 client-log-level DEBUG
57

58
#Without the patch in place, this client will create the file in $BRICK2
59
#which will lead to two files being on both the bricks when a new client
60
#create the file with the same name
61
TEST touch $M0/dir/file
62

63
TEST glusterfs -s $H0 --volfile-id $V0 $M1
64
TEST touch $M1/dir/file
65

66
TEST stat "$BRICK1/dir/file"
67
TEST ! stat "$BRICK2/dir/file"
68

69
cleanup
70

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.