mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-27 19:39:35 +03:00
Sanatize zpios-sanity.sh environment
Just like zconfig.sh the zpios-sanity.sh tests should run in a sanatized environment. This ensures they never conflict with an installed /etc/zfs/zpool.cache file. This commit additionally improves the -c cleanup option. It now removes the modules stack if loaded and destroys relevant md devices. This behavior is now identical to zconfig.sh.
This commit is contained in:
parent
608860b6d0
commit
cbc6fab65c
@ -64,6 +64,8 @@ fi
|
|||||||
|
|
||||||
# Perform pre-cleanup is requested
|
# Perform pre-cleanup is requested
|
||||||
if [ ${CLEANUP} ]; then
|
if [ ${CLEANUP} ]; then
|
||||||
|
${ZFS_SH} -u
|
||||||
|
cleanup_md_devices
|
||||||
cleanup_loop_devices
|
cleanup_loop_devices
|
||||||
rm -f /tmp/zpool.cache.*
|
rm -f /tmp/zpool.cache.*
|
||||||
fi
|
fi
|
||||||
@ -148,6 +150,9 @@ DANGEROUS_CONFIGS=( \
|
|||||||
dm0-raid0 \
|
dm0-raid0 \
|
||||||
)
|
)
|
||||||
|
|
||||||
|
TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
|
||||||
|
${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || die "Unable to load modules"
|
||||||
|
|
||||||
for CONFIG in ${SAFE_CONFIGS[*]}; do
|
for CONFIG in ${SAFE_CONFIGS[*]}; do
|
||||||
zpios_test $CONFIG tiny
|
zpios_test $CONFIG tiny
|
||||||
done
|
done
|
||||||
@ -158,4 +163,6 @@ if [ ${DANGEROUS} ]; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
${ZFS_SH} -u
|
||||||
|
|
||||||
exit $FAILS
|
exit $FAILS
|
||||||
|
Loading…
Reference in New Issue
Block a user