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>

*** 10,20 **** # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # ! # Copyright (c) 2013 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib # --- 10,20 ---- # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # ! # Copyright (c) 2013, 2016 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib #
*** 30,40 **** # 1. Make a list of file systems umountall is known to ignore. # 2. Append all ZFS file systems on this system. # 3. Run umountall -n and verify the file systems it reports are in the list. # ! log_must $ZFS mount -a for fs in 1 2 3 ; do log_must mounted $TESTPOOL/$TESTFS.$fs done # This is the list we check the output of umountall -n against. We seed it --- 30,40 ---- # 1. Make a list of file systems umountall is known to ignore. # 2. Append all ZFS file systems on this system. # 3. Run umountall -n and verify the file systems it reports are in the list. # ! log_must zfs mount -a for fs in 1 2 3 ; do log_must mounted $TESTPOOL/$TESTFS.$fs done # This is the list we check the output of umountall -n against. We seed it
*** 41,56 **** # with these values because umountall will ignore them, and they're possible # (though most are improbable) ZFS filesystem mountpoints. zfs_list="/ /lib /sbin /tmp /usr /var /var/adm /var/run" # Append our ZFS filesystems to the list, not worrying about duplicates. ! for fs in $($MOUNT -p | $AWK '{if ($4 == "zfs") print $3}'); do zfs_list="$zfs_list $fs" done fs='' ! for fs in $($UMOUNTALL -n -F zfs 2>&1 | $AWK '{print $2}'); do for i in $zfs_list; do [[ $fs = $i ]] && continue 2 done log_fail "umountall -n -F zfs tried to unmount $fs" done --- 41,56 ---- # with these values because umountall will ignore them, and they're possible # (though most are improbable) ZFS filesystem mountpoints. zfs_list="/ /lib /sbin /tmp /usr /var /var/adm /var/run" # Append our ZFS filesystems to the list, not worrying about duplicates. ! for fs in $(mount -p | awk '{if ($4 == "zfs") print $3}'); do zfs_list="$zfs_list $fs" done fs='' ! for fs in $(umountall -n -F zfs 2>&1 | awk '{print $2}'); do for i in $zfs_list; do [[ $fs = $i ]] && continue 2 done log_fail "umountall -n -F zfs tried to unmount $fs" done