aboutsummaryrefslogtreecommitdiff
path: root/scripts/common.sh.in
diff options
context:
space:
mode:
authorBrian Behlendorf <behlendorf1@llnl.gov>2011-10-11 21:36:42 +0000
committerBrian Behlendorf <behlendorf1@llnl.gov>2011-10-11 21:45:37 +0000
commit5cbf6db937a304c4d2b60878a2405a1e2900abdf (patch)
tree4c5ae26bd32e8a7246c86115327aa1eb88d576cf /scripts/common.sh.in
parent86f35f34f419f6eaff53b25f463c13f72186b103 (diff)
Diffstat (limited to 'scripts/common.sh.in')
-rw-r--r--scripts/common.sh.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/common.sh.in b/scripts/common.sh.in
index 51671ebc0193..56706194ccb7 100644
--- a/scripts/common.sh.in
+++ b/scripts/common.sh.in
@@ -36,6 +36,9 @@ libexecdir=@libexecdir@
pkglibexecdir=${libexecdir}/@PACKAGE@
bindir=@bindir@
sbindir=@sbindir@
+udevdir=@udevdir@
+udevruledir=@udevruledir@
+sysconfdir=@sysconfdir@
ETCDIR=${ETCDIR:-/etc}
DEVDIR=${DEVDIR:-/dev/disk/zpool}
@@ -113,6 +116,19 @@ skip() {
echo -e "${COLOR_BROWN}Skip${COLOR_RESET}"
}
+init() {
+ # Disable the udev rule 90-zfs.rules to prevent the zfs module
+ # stack from being loaded due to the detection of a zfs device.
+ # This is important because the test scripts require full control
+ # over when and how the modules are loaded/unloaded. A trap is
+ # set to ensure the udev rule is correctly replaced on exit.
+ local RULE=${udevruledir}/90-zfs.rules
+ if test -e ${RULE}; then
+ trap "mv ${RULE}.disabled ${RULE}; exit $?" INT TERM EXIT
+ mv ${RULE} ${RULE}.disabled
+ fi
+}
+
spl_dump_log() {
${SYSCTL} -w kernel.spl.debug.dump=1 &>/dev/null
local NAME=`dmesg | tail -n 1 | cut -f5 -d' '`