From 80972fd5923b05f3bddd57c5b98dc5a53e9d1edf Mon Sep 17 00:00:00 2001 From: Jeff Darcy Date: Mon, 4 May 2015 17:49:16 -0400 Subject: 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 Reviewed-on: http://review.gluster.org/10536 Reviewed-by: Justin Clift Reviewed-by: Kaleb KEITHLEY Tested-by: Gluster Build System --- tests/include.rc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/include.rc b/tests/include.rc index 94e4bc4bb67..92c8c8a2763 100644 --- a/tests/include.rc +++ b/tests/include.rc @@ -461,6 +461,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; @@ -484,6 +485,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() -- cgit