From f17c2e991e45b83f7d21de1b976b59862ea173ab Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Mon, 18 Jan 2016 20:50:24 +0100 Subject: NetBSD regression reliability: properly cleanup loopback devices When a loopback device is configured and we forcibly unmount the filesystem containing the backing store, further vnconfig -l will complain "vnconfig: VNDIOCGET: Bad file descriptor" causing failures. We fix this by iterating on all loopback devices available in /dev, testing for this condition and manually unconfiguring when it happens. BUG: 1129939 Change-Id: I17b956a8ed28a7767f2d0dda83b93c523d3238c2 Signed-off-by: Emmanuel Dreyfus Reviewed-on: http://review.gluster.org/13204 Smoke: Gluster Build System Reviewed-by: Niels de Vos NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System --- tests/include.rc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/include.rc b/tests/include.rc index 76b81875bbc..139bc03ac8c 100644 --- a/tests/include.rc +++ b/tests/include.rc @@ -482,6 +482,12 @@ function cleanup() done ;; NetBSD) + # cleanup loopback device with unmounted backing store + for vnd in /dev/vnd* ; do + vnconfig -l ${vnd} 2>&1 | \ + grep -q 'Bad file descriptor' && vnconfig -u ${vnd} + done + vnd=`vnconfig -l | \ awk '!/not in use/{printf("%s%s:%d ", $1, $2, $5);}'` for l in ${vnd} ; do -- cgit