Skip to content

Commit

Permalink
add test case for bug 2369 and use bug id as the volume name in all t…
Browse files Browse the repository at this point in the history
…estcases

Signed-off-by: Vijay Bellur <[email protected]>
  • Loading branch information
raghavendrabhat authored and vbellur committed Mar 17, 2011
1 parent ff62dce commit 7b57d9f
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 7 deletions.
5 changes: 2 additions & 3 deletions dvm/2010/testcase
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

source ./regression_helpers

VOLNAME="vol";
$GLUSTERFSDIR/gluster volume create $VOLNAME $(hostname):$EXPORT_DIR/$global_bug_id/export1 2>/dev/null 1>/dev/null;
$GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/export1 2>/dev/null 1>/dev/null;

$GLUSTERFSDIR/gluster --mode=script volume stop $VOLNAME | grep "started state" 2>/dev/null 1>/dev/null;
$GLUSTERFSDIR/gluster --mode=script volume stop $global_bug_id | grep "started state" 2>/dev/null 1>/dev/null;

exit $?;

Expand Down
3 changes: 1 addition & 2 deletions dvm/2140/testcase
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

source ./regression_helpers

VOLNAME="abcdefg";
$GLUSTERFSDIR/gluster volume delete $VOLNAME --mode=script | grep -i "exist" 2>/dev/null 1>/dev/null
$GLUSTERFSDIR/gluster volume delete $global_bug_id --mode=script | grep -i "exist" 2>/dev/null 1>/dev/null
exit $?;


3 changes: 1 addition & 2 deletions dvm/2294/testcase
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

source ./regression_helpers

VOLNAME="vol";
$GLUSTERFSDIR/gluster volume create $VOLNAME transport tcp,rdma $(hostname):$EXPORT_DIR/$global_bug_id/export1 2>/dev/null 1>/dev/null
$GLUSTERFSDIR/gluster volume create $global_bug_id transport tcp,rdma $(hostname):$EXPORT_DIR/$global_bug_id/export1 2>/dev/null 1>/dev/null
exit $?;


43 changes: 43 additions & 0 deletions dvm/2369/testcase
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

source ./regression_helpers

$GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/export1 2>/dev/null 1>/dev/null;

$GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null;

mount_glusterfs $global_bug_id;

sleep 2;

touch $FUSE_MOUNT/{1..22};
chown 1315:1315 $FUSE_MOUNT/{1..22};

mkdir $EXPORT_DIR/$global_bug_id/export2;

$GLUSTERFSDIR/gluster volume add-brick $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/export2 2>/dev/null 1>/dev/null;

$GLUSTERFSDIR/gluster volume rebalance $global_bug_id start 2>/dev/null 1>/dev/nullx;

status=0;
while [ $status -ne 1 ]
do
status=$($GLUSTERFSDIR/gluster volume rebalance $global_bug_id status | grep "rebalance completed" | wc -l);
sleep 1;
done

ret=0;
for entries in $(ls $EXPORT_DIR/$global_bug_id/export2)
do
if [ $(stat --printf=%u $EXPORT_DIR/$global_bug_id/export2/$entries | grep 1315 | wc -l) -ne 1 ]; then
ret=22;
break;
fi
done

defrag=$(mount | grep /etc/glusterd/mount/$global_bug_id | wc -l);
if [ $defrag -eq 1 ]; then
umount /etc/glusterd/mount/$global_bug_id 2>/dev/null 1>/dev/null;
fi

exit $ret;

0 comments on commit 7b57d9f

Please sign in to comment.