~ubuntu-branches/debian/sid/glusterfs/sid

« back to all changes in this revision

Viewing changes to tests/bugs/859927/repl.t

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2014-04-22 10:00:41 UTC
  • mfrom: (1.3.25)
  • Revision ID: package-import@ubuntu.com-20140422100041-6mur2ttyvb8zzpfq
Tags: 3.5.0-1
* New upstream release.
  - Rewrite patch 01-spelling-error.
  - Adjust lintian overrides.
  - Install new files.
  - The offical tarball is not properly generated, hack it around.
  - Add symlink from fusermount-glusterfs manpage to mount.glusterfs.
  - Move gsync-sync-gfid from /usr/share to /usr/lib.
  - Add benchmarking directory.
* Remove old versioned build dependencies and build depend on libglib2.0-dev.
* Add lintian override for possible-gpl-code-linked-with-openssl. It is the
  same false positive like with the gluster-server package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
. $(dirname $0)/../../include.rc
 
4
. $(dirname $0)/../../volume.rc
 
5
cleanup;
 
6
 
 
7
TEST glusterd;
 
8
TEST pidof glusterd
 
9
 
 
10
#Tests for data-self-heal-algorithm option
 
11
function create_setup_for_self_heal {
 
12
        file=$1
 
13
        kill_brick $V0 $H0 $B0/${V0}1
 
14
        dd of=$file if=/dev/urandom bs=1M count=1 2>&1 > /dev/null
 
15
        $CLI volume start $V0 force
 
16
}
 
17
 
 
18
function test_write {
 
19
        dd of=$M0/a if=/dev/urandom bs=1k count=1 2>&1 > /dev/null
 
20
}
 
21
 
 
22
TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2};
 
23
TEST $CLI volume set $V0 cluster.self-heal-daemon off
 
24
TEST $CLI volume set $V0 performance.stat-prefetch off
 
25
TEST $CLI volume set $V0 client-log-level DEBUG
 
26
TEST $CLI volume set $V0 cluster.background-self-heal-count 0
 
27
TEST $CLI volume start $V0
 
28
TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id=$V0 $M0;
 
29
 
 
30
touch $M0/a
 
31
 
 
32
TEST $CLI volume set $V0 cluster.data-self-heal-algorithm full
 
33
EXPECT full volume_option $V0 cluster.data-self-heal-algorithm
 
34
create_setup_for_self_heal $M0/a
 
35
EXPECT_WITHIN 20 "1" afr_child_up_status $V0 0
 
36
ls -l $file 2>&1 > /dev/null
 
37
TEST cmp $B0/${V0}1/a $B0/${V0}2/a
 
38
 
 
39
TEST $CLI volume set $V0 cluster.data-self-heal-algorithm diff
 
40
EXPECT diff volume_option $V0 cluster.data-self-heal-algorithm
 
41
create_setup_for_self_heal $M0/a
 
42
EXPECT_WITHIN 20 "1" afr_child_up_status $V0 0
 
43
ls -l $file 2>&1 > /dev/null
 
44
TEST cmp $B0/${V0}1/a $B0/${V0}2/a
 
45
 
 
46
TEST $CLI volume reset $V0 cluster.data-self-heal-algorithm
 
47
create_setup_for_self_heal $M0/a
 
48
EXPECT_WITHIN 20 "1" afr_child_up_status $V0 0
 
49
ls -l $file 2>&1 > /dev/null
 
50
TEST cmp $B0/${V0}1/a $B0/${V0}2/a
 
51
 
 
52
TEST ! $CLI volume set $V0 cluster.data-self-heal-algorithm ""
 
53
 
 
54
#Tests for quorum-type option
 
55
TEST ! $CLI volume set $V0 cluster.quorum-type ""
 
56
TEST $CLI volume set $V0 cluster.quorum-type fixed
 
57
EXPECT fixed volume_option $V0 cluster.quorum-type
 
58
TEST $CLI volume set $V0 cluster.quorum-count 2
 
59
kill_brick $V0 $H0 $B0/${V0}1
 
60
TEST ! test_write
 
61
TEST $CLI volume set $V0 cluster.quorum-type auto
 
62
EXPECT auto volume_option $V0 cluster.quorum-type
 
63
TEST ! test_write
 
64
TEST $CLI volume set $V0 cluster.quorum-type none
 
65
EXPECT none volume_option $V0 cluster.quorum-type
 
66
TEST test_write
 
67
TEST $CLI volume reset $V0 cluster.quorum-type
 
68
TEST test_write
 
69
cleanup;