diff options
author | Raghavendra Bhat <raghavendrabhat@gluster.com> | 2012-01-20 01:00:42 +0530 |
---|---|---|
committer | Raghavendra Bhat <raghavendrabhat@gluster.com> | 2012-02-03 16:45:01 +0530 |
commit | 4de9a1a4df6667a59dd36148167d7ea188c69831 (patch) | |
tree | 08f871b24090f8f7cca7191986f68a9506a26d05 /sanity | |
parent | 01a77a1ae18d9add01f893e06e58191b065602e8 (diff) |
nightly_sanity: do not stop the tests if taking statedump fails
Suppose due to some error (or due to the change in the filename
pattern of the statedump files), if statedump files were not copied,
then do not error out. Instead log a message saying statedump was
not taken, and continue with the tests.
Change-Id: I6d7679f78461be7eac2c2ee8c7939c08c734ff1c
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Diffstat (limited to 'sanity')
-rwxr-xr-x | sanity/nightly_sanity/nightly_updated.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sanity/nightly_sanity/nightly_updated.sh b/sanity/nightly_sanity/nightly_updated.sh index 2f7ead1..c9644e5 100755 --- a/sanity/nightly_sanity/nightly_updated.sh +++ b/sanity/nightly_sanity/nightly_updated.sh @@ -792,10 +792,17 @@ function post_run() clean_results; } +# Eventhough statedump is an important information, lets not stop the tests +# because of some failure in statedump. Instead lets just log a message +# saying statedump was not taken and continue with the tests. + function take_statedump () { + set +e; local dir; + local ret_value; + ret_value=0; echo 3 > /proc/sys/vm/drop_caches; sleep 2; @@ -806,6 +813,14 @@ function take_statedump () kill -USR1 $BRICK_PID; sleep 1; mv /tmp/*.$BRICK_PID.dump $dir; + if [ $? -ne 0 ]; then + # probably its on release-3.2 where tests are being run. So search the + # statedump files according to older formats only. + mv /tmp/glusterdump.$BRICK_PID $dir; + if [ $? -ne 0 ]; then + ret_value=1; + fi + fi done for j in $(seq 1 $num_clients) @@ -814,7 +829,18 @@ function take_statedump () kill -USR1 $CLIENT_PID; sleep 1; mv /tmp/*.$CLIENT_PID.dump $dir; + if [ $? -ne 0 ]; then + # probably its on release-3.2 where tests are being run. So search the + # statedump files according to older formats only. + mv /tmp/glusterdump.$CLIENT_PID $dir; + if [ $? -ne 0 ]; then + ret_value=1; + fi + fi done + + set -e; + return $ret_value; } function main() @@ -827,8 +853,14 @@ function main() start_glusterd; start_glusterfs; take_statedump $LOGDIR/old_dump/; + if [ $? -ne 0 ]; then + echo "taking pre run statedump failed." >> /export/tests_failed; + fi run_tests; take_statedump $LOGDIR/new_dump/; + if [ $? -ne 0 ]; then + echo "taking post run statedump failed." >> /export/tests_failed; + fi trap - INT TERM EXIT post_run; } |