From aa957fac05e649acd870dedcf43c4192d33dc737 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Fri, 9 Sep 2011 18:38:37 +0530 Subject: some nightly sanity scripts --- sanity/nightly_sanity/nightly_sanity_nfs.sh | 85 +++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100755 sanity/nightly_sanity/nightly_sanity_nfs.sh (limited to 'sanity/nightly_sanity/nightly_sanity_nfs.sh') diff --git a/sanity/nightly_sanity/nightly_sanity_nfs.sh b/sanity/nightly_sanity/nightly_sanity_nfs.sh new file mode 100755 index 0000000..cdc0b61 --- /dev/null +++ b/sanity/nightly_sanity/nightly_sanity_nfs.sh @@ -0,0 +1,85 @@ +#!/bin/bash + +#GIT_DIR="/opt/users/nfs_sanity/glusterfs.git" +GIT_DIR="/root/sanity/glusterfs.git" +GIT_FILE="/tmp/git_head_`date +%F`" + +rm /tmp/git_head* + +function update_git () +{ + + cd $GIT_DIR + echo $PWD >> $GIT_FILE + echo "preveious head is at:" + /usr/bin/git describe >> $GIT_FILE + if [ $? -ne 0 ]; then + echo "git describe failed. Exiting" + return 11; + fi + + echo "Doing git reset:" + /usr/bin/git reset --hard >> $GIT_FILE + if [ $? -ne 0 ]; then + echo "git reset failed. Exiting." + return 11; + fi + + echo "Doing git pull:" + /usr/bin/git pull >> $GIT_FILE + if [ $? -ne 0 ]; then + echo "git pull failed" + return 11; + else + echo "git pull succeeded" + fi + + echo "Current head is at:" + /usr/bin/git describe >> $GIT_FILE + if [ $? -ne 0 ]; then + echo "git describe failed, but continuing" + return 0; + else + return 0; + fi +} + +function dht_sanity () +{ + echo "DHT testing" + sleep 1 + /opt/users/nightly_sanity/nightly_updated.sh -t dht -c 1 -m nfs 2>&1 | tee /mnt/runlog.dht + echo "DHT done" + sleep 1 + return 0; +} + +function afr_sanity () +{ + echo "AFR testing" + sleep 1 + /opt/users/nightly_sanity/nightly_updated.sh -t afr -c 1 -m nfs 2>&1 | tee /mnt/runlog.afr + echo "AFR done" + sleep 1 +} + +function stripe_sanity () +{ + echo "stripe testing" + sleep 1 + /opt/users/nightly_sanity/nightly_updated.sh -t stripe -c 1 -m nfs 2>&1 | tee /mnt/runlog.stripe + echo "stripe done" + sleep 1 +} + +function main () +{ + + update_git; + dht_sanity; + #afr_sanity; + #stripe_sanity; + return 0; +} + +main "$@" -- cgit