blob: c6e6debc4c1750948a57e1893d9c88779f15493c (
plain)
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
|
#!/bin/bash
source $cwd/regression_helpers
mkdir -p /tmp/$global_bug_id
#create,start and mount
$GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/export1 &>/dev/null ;
$GLUSTERFSDIR/gluster volume start $global_bug_id &>/dev/null;
mount_glusterfs $global_bug_id
mkdir $FUSE_MOUNT/dir
for i in {1..10};do
touch $FUSE_MOUNT/dir/$i.txt
done
sleep 2;
$GLUSTERFSDIR/gluster volume add-brick $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/export2 &>/dev/null
sleep 2;
$GLUSTERFSDIR/gluster volume rebalance $global_bug_id start &> /dev/null
sleep 10;
rm -rf $FUSE_MOUNT/dir/*
sleep 2;
$GLUSTERFSDIR/gluster --mode=script volume remove-brick $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/export2 &>/dev/null
sleep 10;
for i in {1..10}; do
touch $FUSE_MOUNT/dir/$i.txt
done
if [ `ls $FUSE_MOUNT/dir | wc -l` -eq 10 ]; then
rm -rf $FUSE_MOUNT/dir/*;
if [ $? -eq 0 ]; then
exit 0;
else
exit 127;
fi
else
exit 127;
fi
|