summaryrefslogtreecommitdiffstats
path: root/sanity
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2011-09-21 12:20:37 +0530
committerRaghavendra Bhat <raghavendrabhat@gluster.com>2011-09-21 12:26:04 +0530
commit3cdb12adb81731153afc2c3bbed3929aad828df4 (patch)
tree32c86081e66bb2b7051120a5541b2015b91b6c80 /sanity
parent4bb465ad38bc1f35d4fd71d5d8e5c28fe7b8e57b (diff)
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.
Diffstat (limited to 'sanity')
-rwxr-xr-xsanity/nightly_sanity/nightly_sanity.sh45
1 files 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