glusterfs

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

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

5
cleanup;
6

7
TEST glusterd
8
TEST pidof glusterd
9
TEST $CLI volume info;
10
# Distributed volume with a single brick was chosen solely for the ease of
11
#implementing the test case (to be precise, for the ease of extracting the port number).
12
TEST $CLI volume create $V0 $H0:$B0/brick0;
13

14
TEST $CLI volume start $V0;
15

16
function port_field()
17
{
18
    local vol=$1;
19
    local opt=$2;
20
    if [ $opt -eq '0' ]; then
21
        $CLI volume status $vol | grep "brick0" | awk '{print $3}';
22
    else
23
        $CLI volume status $vol detail | grep "^TCP Port " | awk '{print $4}';
24
    fi
25
}
26

27
function xml_port_field()
28
{
29
    local vol=$1;
30
    local opt=$2;
31
        $CLI --xml volume status $vol $opt | tr -d '\n' |\
32
#Find the first occurrence of the string between <port> and </port>
33
        sed -rn 's/<port>/&###/;s/<\/port>/###&/;s/^.*###(.*)###.*$/\1/p'
34
}
35

36
TEST $CLI volume status $V0;
37
TEST $CLI volume status $V0 detail;
38
TEST $CLI --xml volume status $V0;
39
TEST $CLI --xml volume status $V0 detail;
40

41
# Kill the brick process. After this, port number for the killed (in this case brick) process must be "N/A".
42
kill `cat $GLUSTERD_PIDFILEDIR/vols/$V0/$H0-d-backends-brick0.pid`
43

44
EXPECT "N/A" port_field $V0 '0'; # volume status
45
EXPECT "N/A" port_field $V0 '1'; # volume status detail
46

47
EXPECT "N/A" xml_port_field $V0 '';
48
EXPECT "N/A" xml_port_field $V0 'detail';
49

50
cleanup;
51

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

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

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

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