Print this page
7290 ZFS test suite needs to control what utilities it can run
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
*** 24,34 ****
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
! # Copyright (c) 2013 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
#
--- 24,34 ----
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
! # Copyright (c) 2013, 2016 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
#
*** 51,68 ****
# Collect the currently mounted ZFS filesystems, so that we can repair any
# damage done by the attempted pool destroy. The destroy itself should fail, but
# some filesystems can become unmounted in the process, and aren't automatically
# remounted.
! $MOUNT -p | $AWK '{if ($4 == "zfs") print $1" "$3}' > $tmpfile
! log_mustnot $ZPOOL destroy $rootpool
# Remount any filesystems that the destroy attempt unmounted.
while read ds mntpt; do
! mounted $ds || log_must $MOUNT -Fzfs $ds $mntpt
done < $tmpfile
! $RM -f $tmpfile
! log_mustnot $ZFS destroy $rootpool
log_pass "rootpool can not be destroyed"
--- 51,68 ----
# Collect the currently mounted ZFS filesystems, so that we can repair any
# damage done by the attempted pool destroy. The destroy itself should fail, but
# some filesystems can become unmounted in the process, and aren't automatically
# remounted.
! mount -p | awk '{if ($4 == "zfs") print $1" "$3}' > $tmpfile
! log_mustnot zpool destroy $rootpool
# Remount any filesystems that the destroy attempt unmounted.
while read ds mntpt; do
! mounted $ds || log_must mount -Fzfs $ds $mntpt
done < $tmpfile
! rm -f $tmpfile
! log_mustnot zfs destroy $rootpool
log_pass "rootpool can not be destroyed"