summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2016-01-18 20:53:22 +0100
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-01-20 02:08:24 -0800
commit57ca7c831cd231f56502d0aa5a4d042a48f5894e (patch)
treeacef4d31ba973c6ddf46944ebbabe0fb656af62d /tests
parent626534e94b4ac07b99a2cc479f004935664a09a2 (diff)
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. Backport of: I17b956a8ed28a7767f2d0dda83b93c523d3238c2 BUG: 1212676 Change-Id: I9d6fdd859572b653e1144c7d9d98a977cc3e255a Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/13205 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/include.rc6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/include.rc b/tests/include.rc
index dd64f4c74f8..8b5dea9b013 100644
--- a/tests/include.rc
+++ b/tests/include.rc
@@ -427,6 +427,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