File: volume.t

package info (click to toggle)
glusterfs 11.2-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 28,240 kB
  • sloc: ansic: 471,238; sh: 45,610; python: 16,893; perl: 3,328; makefile: 2,014; yacc: 487; ruby: 171; lisp: 124; xml: 75; lex: 61
file content (60 lines) | stat: -rw-r--r-- 1,589 bytes parent folder | download | duplicates (3)
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
#!/bin/bash

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

cleanup;

TEST glusterd
TEST pidof glusterd
TEST $CLI volume info;

TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{1,2,3,4,5,6};

EXPECT "$V0" volinfo_field $V0 'Volume Name';
EXPECT 'Created' volinfo_field $V0 'Status';
EXPECT '6' brick_count $V0

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

TEST $CLI volume add-brick $V0 $H0:$B0/${V0}{9,10,11};
EXPECT '9' brick_count $V0

TEST $CLI volume remove-brick $V0 $H0:$B0/${V0}{1,2,3} force;
EXPECT '6' brick_count $V0

TEST $CLI volume top $V0 read-perf bs 4096 count 1000
TEST $CLI volume top $V0 write-perf bs 1048576 count 2

TEST touch $M0/foo

# statedump path should be a directory, setting it to a file path should fail

TEST ! $CLI v set $V0 server.statedump-path $M0/foo;
EXPECT '/var/run/gluster' $CLI v get $V0 server.statedump-path

#set the statedump path to an existing ditectory which should succeed
TEST mkdir $B0/level;
TEST $CLI v set $V0 server.statedump-path $B0/level
EXPECT "$B0/level" volinfo_field $V0 'server.statedump-path'

ret=$(ls $B0/level | wc -l);
TEST [ $ret == 0 ]
TEST $CLI v statedump $V0;
ret=$(ls $B0/level | wc -l);
TEST ! [ $ret == 0 ]

#set the statedump path to a non - existing directory which should fail
TEST ! $CLI v set $V0 server.statedump-path "${B0}/$(uuidgen)"
EXPECT "$B0/level" volinfo_field $V0 'server.statedump-path'

TEST rm -rf $B0/level

TEST $CLI volume stop $V0
EXPECT 'Stopped' volinfo_field $V0 'Status'

TEST $CLI volume delete $V0
TEST ! $CLI volume info $V0

cleanup;