diff options
author | Anand Avati <avati@gluster.com> | 2011-08-19 15:19:44 +0530 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-08-19 08:46:34 -0700 |
commit | 71da619ab57bd7913f6fffce3be7e77c5a4db0d2 (patch) | |
tree | d595b92a4538d139b6d617b914ffb36accd7fd16 /smoke.sh | |
parent | 2f53b7857c66a99f5dc626aa2acb99edf5b2e9f4 (diff) |
smoke-test.sh: script used by gerrit as part of pre-commit test
Change-Id: Idc3be3e22cca5fc623b27c2f500f59785cbd332b
BUG: 3234
Reviewed-on: http://review.gluster.com/265
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'smoke.sh')
-rwxr-xr-x | smoke.sh | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/smoke.sh b/smoke.sh new file mode 100755 index 00000000000..3226b74f172 --- /dev/null +++ b/smoke.sh @@ -0,0 +1,83 @@ +#!/bin/bash + +set -e; + +M=/mnt; +P=/build; +H=$(hostname); +T=600; +V=patchy; + + +function cleanup() +{ + killall -15 glusterfs glusterfsd glusterd glusterd 2>&1 || true; + killall -9 glusterfs glusterfsd glusterd glusterd 2>&1 || true; + umount -l $M 2>&1 || true; + rm -rf /etc/glusterd $P/export; +} + +function start_fs() +{ + mkdir -p $P/export; + chmod 0755 $P/export; + + glusterd; + gluster volume create $V replica 2 $H:$P/export/export{1,2,3,4}; + gluster volume start $V; + glusterfs -s $H --volfile-id $V $M; +# mount -t glusterfs $H:/$V $M; +} + + +function run_tests() +{ + cd $M; + + (sleep 1; dbench -x -s -t 60 10 >/dev/null) & + + (sleep 1; /opt/qa/tools/posix_compliance.sh) & + + wait %2 + wait %3 + + rm -rf clients; + + cd -; +} + + +function watchdog () +{ + # insurance against hangs during the test + + sleep $1; + + echo "Kicking in watchdog after $1 secs"; + + cleanup; +} + + +function finish () +{ + cleanup; + kill %1; +} + +function main () +{ + cleanup; + + watchdog $T & + + trap finish EXIT; + + set -x; + + start_fs; + + run_tests; +} + +main "$@"; |