diff options
author | Raghavendra Bhat <raghavendrabhat@gluster.com> | 2011-03-03 08:41:07 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-03-07 10:06:57 +0530 |
commit | 7ed2ddd37ed29f800567f0cb23c8cd2eea35fdbe (patch) | |
tree | 58974ad1757194fec5f37df1ada7b3fcf475e634 /run.sh | |
parent | 914f0aef201b0b3b5709460c9da0262244f280aa (diff) |
changes for dvm specific testcases
Signed-off-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'run.sh')
-rwxr-xr-x | run.sh | 65 |
1 files changed, 47 insertions, 18 deletions
@@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Copyright (c) 2006-2009 Gluster, Inc. <http://www.gluster.com> # This file is part of GlusterFS. @@ -17,20 +17,49 @@ # along with this program. If not, see # <http://www.gnu.org/licenses/>. -GLUSTERFS=$1 -OLDDIR=`pwd` - -if [ 1 -ne $# ] -then - echo "Usage: run.sh <path_to_glusterfs_binary>" - return; -fi - -for i in `ls | grep "^[0-9]*$"|sort -n` -do - cd $i/regr - if [ -f ./testcase ];then - ./testcase $GLUSTERFS - fi - cd $OLDDIR -done +_init () +{ + [ $# -lt 1 ] && { + echo "#<Usage: $(basename $0) <complete_path_to_glusterd> [bug id]" + exit; + } + + source ./init + source ./regression_helpers + export GLUSTERD=$1 + bug_id=; + if [ $# -eq 2 ]; then + bug_id=$2; + fi + export EXPORT_DIR="/regression/export"; +} + +main () +{ + check_glusterd_running; + if [ $? -ne 0 ]; then + echo "glusterd is already running. Please stop and run the script"; + exit; + fi + + start_glusterd $GLUSTERD; + if [ $? -ne 0 ]; then + return 2; + fi + + create_directory $EXPORT_DIR; + + if [ ! $bug_id ]; then + run_testcase; + else + run_testcase $bug_id; + fi + + final_kill; + + final_cleanup; + + return 0; +} + +_init "$@" && main "$@" |