glusterfs

Форк
0
59 строк · 1.6 Кб
1
#!/bin/bash
2

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

7
cleanup;
8

9
TEST glusterd
10
TEST pidof glusterd
11
TEST $CLI volume info;
12

13
function volinfo_field()
14
{
15
    local vol=$1;
16
    local field=$2;
17

18
    $CLI volume info $vol | grep "^$field: " | sed 's/.*: //';
19
}
20

21
TEST $CLI volume create $V0 $H0:$B0/brick1 $H0:$B0/brick2;
22
EXPECT 'Created' volinfo_field $V0 'Status';
23

24
TEST $CLI volume start $V0;
25
EXPECT 'Started' volinfo_field $V0 'Status';
26

27
MOUNTDIR=$M0;
28
TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $MOUNTDIR;
29
TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M1;
30

31
TEST touch $M0/testfile;
32
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
33
TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0;
34

35
# open the file with the fd as 4
36
TEST fd=`fd_available`;
37
TEST fd_open $fd 'w' "$M0/testfile";
38

39
# remove the file from the other mount point. If unlink is sent from
40
# $M0 itself, then the file will be actually opened by open-behind which
41
# we dont want for this testcase
42
TEST rm -f $M1/testfile;
43

44
# below command opens the file and writes to the file.
45
# upon open, open-behind unwinds the open call with success.
46
# now when write comes, open-behind actually opens the file
47
# and then sends write on the fd. But before sending open itself,
48
# the file would have been removed from the mount $M1. open() gets error
49
# and the write call which is put into a stub (open had to be sent first)
50
# should unwind with the error received in the open call.
51
TEST ! fd_write $fd data
52

53
TEST fd_close $fd;
54

55
TEST rm -rf $MOUNTDIR/*
56

57
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $MOUNTDIR
58

59
cleanup;
60

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

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

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

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