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

« back to all changes in this revision

Viewing changes to tests/bugs/bug-893378.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
cleanup;
 
5
BRICK_COUNT=3
 
6
 
 
7
function file_has_linkfile()
 
8
{
 
9
        i=0
 
10
        j=0
 
11
        while [ $i -lt $BRICK_COUNT ]
 
12
        do
 
13
                stat=`stat $B0/${V0}$i/$1 2>/dev/null`
 
14
                if [ $? -eq 0 ]
 
15
                then
 
16
                        let j++
 
17
                        let "BRICK${j}=$i"
 
18
 
 
19
                fi
 
20
                let i++
 
21
        done
 
22
        return $j
 
23
}
 
24
 
 
25
function get_cached_brick()
 
26
{
 
27
        i=1
 
28
        while [ $i -lt 3 ]
 
29
        do
 
30
                test=`getfattr -n trusted.glusterfs.dht.linkto -e text $B0/${V0}$BRICK$i 2>&1`
 
31
                if [ $? -eq 1 ]
 
32
                then
 
33
                        cached=$BRICK"$i"
 
34
                        i=$(( $i+3 ))
 
35
                fi
 
36
                let i++
 
37
        done
 
38
 
 
39
        return $cached
 
40
}
 
41
 
 
42
TEST glusterd
 
43
TEST pidof glusterd
 
44
 
 
45
TEST $CLI volume create $V0 $H0:$B0/${V0}0 $H0:$B0/${V0}1 $H0:$B0/${V0}2
 
46
TEST $CLI volume start $V0
 
47
 
 
48
## Mount FUSE
 
49
TEST glusterfs --attribute-timeout=0 --entry-timeout=0 -s $H0 --volfile-id $V0 $M0;
 
50
 
 
51
## create a linkfile on subvolume 0
 
52
TEST touch $M0/1
 
53
TEST mv $M0/1 $M0/2
 
54
 
 
55
file_has_linkfile 2
 
56
has_link=$?
 
57
if [ $has_link -eq 2 ]
 
58
then
 
59
        get_cached_brick
 
60
        CACHED=$?
 
61
        # Kill a brick process
 
62
        kill -9 `cat /var/lib/glusterd/vols/$V0/run/$H0-d-backends-${V0}$CACHED.pid`;
 
63
fi
 
64
 
 
65
## trigger a lookup
 
66
ls -l $M0/2 2>/dev/null
 
67
 
 
68
## fail dd if file exists.
 
69
 
 
70
dd if=/dev/zero of=$M0/2 bs=1 count=1 conv=excl 2>/dev/null
 
71
EXPECT "1" echo $?
 
72
 
 
73
cleanup;