diff options
author | Raghavendra Bhat <raghavendrabhat@gluster.com> | 2010-08-26 03:53:31 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-08-26 07:30:58 -0700 |
commit | d36c42a35fcc95468d692e5e7dd00fa7ca17b653 (patch) | |
tree | 9a6bc6b03d0acb2ca84a48e43ecc19a61f8fc452 /extras/test/gluster_commands.sh | |
parent | fabb7e5e5dab69689bde255225748f8513a09d84 (diff) |
script for testing basic gluster commands
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1436 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1436
Diffstat (limited to 'extras/test/gluster_commands.sh')
-rwxr-xr-x | extras/test/gluster_commands.sh | 173 |
1 files changed, 173 insertions, 0 deletions
diff --git a/extras/test/gluster_commands.sh b/extras/test/gluster_commands.sh new file mode 100755 index 00000000000..f059bbeb244 --- /dev/null +++ b/extras/test/gluster_commands.sh @@ -0,0 +1,173 @@ +#!/bin/sh + +# Copyright (c) 2006-2010 Gluster, Inc. <http://www.gluster.com> +# This file is part of GlusterFS. + +# GlusterFS is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation; either version 3 of the License, +# or (at your option) any later version. + +# GlusterFS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# <http://www.gnu.org/licenses/>. + + +# This script tests the basics gluster cli commands. + +if [ ! -d "/exports" ]; then + mkdir /exports; + mkdir /exports/exp{1..10}; +else + mkdir /exports/exp{1..10}; +fi + +if [ ! -d "/mnt/client" ]; then + mkdir /mnt/client -p; +fi + + +# create distribute volume and try start, mount, add-brick, replace-brick, remove-brick, stop, unmount, delete + +gluster volume create vol `hostname`:/exports/exp1 +gluster volume info + +gluster volume start vol +gluster volume info +sleep 1 +mount -t glusterfs `hostname`:vol /mnt/client +sleep 1 +df -h + + +gluster volume add-brick vol `hostname`:/exports/exp2 +gluster volume info +sleep 1 +mount -t glusterfs `hostname`:vol /mnt/client +df -h +sleep 1 + +gluster volume replace-brick vol `hostname`:/exports/exp1 `hostname`:/exports/exp3 start +gluster volume replace-brick vol `hostname`:/exports/exp1 `hostname`:/exports/exp3 status +gluster volume replace-brick vol `hostname`:/exports/exp1 `hostname`:/exports/exp3 pause +gluster volume replace-brick vol `hostname`:/exports/exp1 `hostname`:/exports/exp3 abort +gluster volume replace-brick vol `hostname`:/exports/exp1 `hostname`:/exports/exp3 commit +gluster volume info +sleep 1 +df -h +sleep 1 + +gluster volume remove-brick vol `hostname`:/exports/exp2 +gluster volume info +sleep 1 +df -h +sleep 1 + +gluster volume stop vol +gluster volume info +sleep 1 +df -h +umount /mnt/client +df -h + +gluster volume delete vol +gluster volume info +sleep 1 + +# create replicate volume and try start, mount, add-brick, replace-brick, remove-brick, stop, unmount, delete + +gluster volume create mirror replica 2 `hostname`:/exports/exp1 `hostname`:/exports/exp2 +gluster volume info +sleep 1 + +gluster volume start mirror +gluster volume info +sleep 1 +mount -t glusterfs `hostname`:mirror /mnt/client +sleep 1 +df -h +sleep1 + +gluster volume add-brick mirror replica 2 `hostname`:/exports/exp3 `hostname`:/exports/exp4 +gluster volume info +sleep 1 +df -h +sleep 1 + +gluster volume replace-brick mirror `hostname`:/exports/exp1 `hostname`:/exports/exp5 start +gluster volume replace-brick mirror `hostname`:/exports/exp1 `hostname`:/exports/exp5 status +gluster volume replace-brick mirror `hostname`:/exports/exp1 `hostname`:/exports/exp5 pause +gluster volume replace-brick mirror `hostname`:/exports/exp1 `hostname`:/exports/exp5 abort +gluster volume replace-brick mirror `hostname`:/exports/exp1 `hostname`:/exports/exp5 commit +gluster volume info +sleep 1 +df -h +sleep 1 + +gluster volume remove-brick mirror replica 2 `hostname`:/exports/exp3 `hostname`:/exports/exp4 +gluster volume info +sleep 1 +df -h +sleep 1 + +gluster volume stop mirror +gluster volume info +sleep 1 +df -h +umount /mnt/client +df -h + +gluster volume delete mirror +gluster volume info +sleep 1 + +# create stripe volume and try start, mount, add-brick, replace-brick, remove-brick, stop, unmount, delete + +gluster volume create str stripe 2 `hostname`:/exports/exp1 `hostname`:/exports/exp2 +gluster volume info +sleep 1 + +gluster volume start str +gluster volume info +sleep 1 +mount -t glusterfs `hostname`:str /mnt/client +sleep 1 +df -h +sleep 1 + +gluster volume add-brick str stripe 2 `hostname`:/exports/exp3 `hostname`:/exports/exp4 +gluster volume info +sleep 1 +df -h +sleep 1 + +gluster volume replace-brick str `hostname`:/exports/exp1 `hostname`:/exports/exp5 start +gluster volume replace-brick str `hostname`:/exports/exp1 `hostname`:/exports/exp5 status +gluster volume replace-brick str `hostname`:/exports/exp1 `hostname`:/exports/exp5 pause +gluster volume replace-brick str `hostname`:/exports/exp1 `hostname`:/exports/exp5 abort +gluster volume replace-brick str `hostname`:/exports/exp1 `hostname`:/exports/exp5 commit +gluster volume info +sleep 1 +df -h + +gluster volume remove-brick str stripe 2 `hostname`:/exports/exp3 `hostname`:/exports/exp4 +gluster volume info +sleep 1 +df -h +sleep 1 + +gluster volume stop str +gluster volume info +sleep 1 +df -h +sleep 1 +umount /mnt/client +df -h + +gluster volume delete str +gluster volume info |