From 3cdb12adb81731153afc2c3bbed3929aad828df4 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Wed, 21 Sep 2011 12:20:37 +0530 Subject: nightly_sanity/nightly_sanitysh: export the PATH variable Since nightly_sanity script is started by a cron job, the shell environment while this script is being executed may not have the PATH variable set to all the appropriate paths. So update the PATH variable separately in the script. --- sanity/nightly_sanity/nightly_sanity.sh | 45 ++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/sanity/nightly_sanity/nightly_sanity.sh b/sanity/nightly_sanity/nightly_sanity.sh index cb56515..2a76521 100755 --- a/sanity/nightly_sanity/nightly_sanity.sh +++ b/sanity/nightly_sanity/nightly_sanity.sh @@ -1,10 +1,13 @@ #!/bin/bash -#GIT_DIR="/opt/users/nightly_sanity/glusterfs.git" -GIT_DIR="/root/sanity/glusterfs.git" -GIT_FILE="/tmp/git_head_`date +%F`" - -rm /tmp/git_head* +function _init () +{ + #GIT_DIR="/opt/users/nightly_sanity/glusterfs.git" + GIT_DIR="/root/sanity/glusterfs.git"; + GIT_FILE="/tmp/git_head_`date +%F`"; + rm /tmp/git_head*; + export PATH=$PATH:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/qa/tools +} function update_git () { @@ -16,33 +19,33 @@ function update_git () echo "preveious head is at:" $GIT_PATH describe >> $GIT_FILE if [ $? -ne 0 ]; then - echo "git describe failed. Exiting" - return 11; + echo "git describe failed. Exiting" + return 11; fi echo "Doing git reset:" $GIT_PATH reset --hard >> $GIT_FILE if [ $? -ne 0 ]; then - echo "git reset failed. Exiting." - return 11; + echo "git reset failed. Exiting." + return 11; fi echo "Doing git pull:" $GIT_PATH pull >> $GIT_FILE if [ $? -ne 0 ]; then - echo "git pull failed" - return 11; + echo "git pull failed" + return 11; else - echo "git pull succeeded" + echo "git pull succeeded" fi - + echo "Current head is at:" $GIT_PATH describe >> $GIT_FILE if [ $? -ne 0 ]; then - echo "git describe failed, but continuing" - #return 0; + echo "git describe failed, but continuing" + #return 0; #else - #return 0; + #return 0; fi for i in $(ls /root/patches) @@ -51,11 +54,11 @@ function update_git () done echo "========DIFF========"; - $GIT_PATH diff >> $GIT_FILE; + $GIT_PATH diff >> $GIT_FILE; rm -f /root/patches/*; } - + function dht_sanity () { echo "DHT testing" @@ -109,9 +112,9 @@ function main () dht_sanity; afr_sanity; stripe_sanity; -# dist_repl_sanity; -# dist_stripe_sanity; + dist_repl_sanity; + dist_stripe_sanity; return 0; } -main "$@" \ No newline at end of file +_init "$@" && main "$@" \ No newline at end of file -- cgit