summaryrefslogtreecommitdiffstats
path: root/tests/include.rc
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2015-05-04 17:49:16 -0400
committerVijay Bellur <vbellur@redhat.com>2015-05-06 02:34:37 -0700
commit0758307635ec429e8d0081df2acea8c14478cc53 (patch)
tree428114cc86aa2d84985a24fd3cbfaf58ba370a14 /tests/include.rc
parent1fa8ac6655bdaf6fbebb27b3f5192d9c0491c6bd (diff)
tests: fix failures due to not unmounting $M2 (/mnt/glusterfs/2)
Our failure to unmount meant that both mkdir and rmdir would fail in cleanup(). Because one of those mkdirs was the last thing cleanup() executed, it would fail, so the test would fail, so the entire regression run would fail. The fix has two parts. (1) Unmount the offending directory. (2) Make sure cleanup() returns success even if that last mkdir failed. That might keep us from consistently blowing up regression runs on the very first tests (basic/afr/data-self-heal.t) that we execute. Change-Id: I7a9761bd28761a5ee2face3db8112e9c3f6c5dc8 BUG: 1163543 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/10536 Reviewed-by: Justin Clift <justin@gluster.org> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-on: http://review.gluster.org/10557 Tested-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests/include.rc')
-rw-r--r--tests/include.rc7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/include.rc b/tests/include.rc
index 569e0db7e03..8875f076ff1 100644
--- a/tests/include.rc
+++ b/tests/include.rc
@@ -463,6 +463,7 @@ function cleanup()
umount $flag /tmp/mnt* 2>/dev/null
umount $flag $M0 2>/dev/null || umount -f $M0 2>/dev/null || true;
umount $flag $M1 2>/dev/null || umount -f $M1 2>/dev/null || true;
+ umount $flag $M2 2>/dev/null || umount -f $M2 2>/dev/null || true;
umount $flag $N0 2>/dev/null || umount -f $N0 2>/dev/null || true;
umount $flag $N1 2>/dev/null || umount -f $N1 2>/dev/null || true;
@@ -486,6 +487,12 @@ function cleanup()
return 1;
fi >&2
mkdir -p $WORKDIRS
+ # This is usually the last thing a test script calls, so our return
+ # value becomes their exit value. While it's not great for the mkdir
+ # above to fail, promoting that into a failure of the whole test (and
+ # thus of an entire regression-test run) seems a bit excessive. Make
+ # sure we return good status anyway.
+ return 0
}
function volinfo_field()