glusterfs

Форк
0
/
bug-1700078.t 
87 строк · 2.8 Кб
1
#!/bin/bash
2

3
. $(dirname $0)/../include.rc
4
. $(dirname $0)/../volume.rc
5

6
cleanup;
7

8
## Start glusterd
9
TEST glusterd;
10
TEST pidof glusterd;
11

12
## Lets create and start the volume
13
TEST $CLI volume create $V0 $H0:$B0/${V0}1
14
TEST $CLI volume start $V0
15

16
## Enable bitrot for volume $V0
17
TEST $CLI volume bitrot $V0 enable
18

19
## Turn off quick-read so that it wont cache the contents
20
# of the file in lookup. For corrupted files, it might
21
# end up in reads being served from the cache instead of
22
# an error.
23
TEST $CLI volume set $V0 performance.quick-read off
24

25
EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" get_bitd_count
26

27
EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'Active' scrub_status $V0 'State of scrub'
28
EXPECT_WITHIN $PROCESS_UP_TIMEOUT '/var/log/glusterfs/bitd.log' scrub_status $V0 'Bitrot error log location'
29
EXPECT_WITHIN $PROCESS_UP_TIMEOUT '/var/log/glusterfs/scrub.log' scrub_status $V0 'Scrubber error log location'
30

31
## Set expiry-timeout to 1 sec
32
TEST $CLI volume set $V0 features.expiry-time 1
33

34
##Mount $V0
35
TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0
36

37
## Turn off quick-read xlator so that, the contents are not served from the
38
# quick-read cache.
39
TEST $CLI volume set $V0 performance.quick-read off
40

41
#Create sample file
42
TEST `echo "1234" > $M0/FILE1`
43
EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'trusted.bit-rot.signature' check_for_xattr 'trusted.bit-rot.signature' "/$B0/${V0}1/FILE1"
44

45
##disable bitrot
46
TEST $CLI volume bitrot $V0 disable
47

48
## modify the file
49
TEST `echo "write" >> $M0/FILE1`
50

51
# unmount and remount when the file has to be accessed.
52
# This is to ensure that, when the remount happens,
53
# and the file is read, its contents are served from the
54
# brick instead of cache.
55
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
56

57
##enable bitrot
58
TEST $CLI volume bitrot $V0 enable
59

60
# expiry time is set to 1 second. Hence sleep for 2 seconds for the
61
# oneshot crawler to finish its crawling and sign the file properly.
62
sleep 2
63

64
EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" get_bitd_count
65

66
EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'Active' scrub_status $V0 'State of scrub'
67
EXPECT_WITHIN $PROCESS_UP_TIMEOUT '/var/log/glusterfs/bitd.log' scrub_status $V0 'Bitrot error log location'
68
EXPECT_WITHIN $PROCESS_UP_TIMEOUT '/var/log/glusterfs/scrub.log' scrub_status $V0 'Scrubber error log location'
69

70
## Ondemand scrub
71
TEST $CLI volume bitrot $V0 scrub ondemand
72

73
# the scrub ondemand CLI command, just ensures that
74
# the scrubber has received the ondemand scrub directive
75
# and started. sleep for 2 seconds for scrubber to finish
76
# crawling and marking file(s) as bad (if if finds that
77
# corruption has happened) which are filesystem operations.
78
sleep 2
79

80
TEST ! getfattr -n 'trusted.bit-rot.bad-file' $B0/${V0}1/FILE1
81

82
##Mount $V0
83
TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0
84

85
TEST cat $M0/FILE1
86

87
cleanup;
88

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

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

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

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