]> git.proxmox.com Git - mirror_zfs.git/blobdiff - tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_001_pos.ksh
Remove dependency on sharetab file and refactor sharing logic
[mirror_zfs.git] / tests / zfs-tests / tests / functional / cli_root / zfs_share / zfs_share_001_pos.ksh
index a2c06e0b38cf89fe8b844d2e7d3e752a0459cdb7..fefeb1b1cbd5bdef49c10ad0139616b7e2bfc5c7 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2016 by Delphix. All rights reserved.
+# Copyright (c) 2016, 2020 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -71,6 +71,8 @@ function cleanup
        if snapexists "$TESTPOOL/$TESTFS@snapshot"; then
                log_must zfs destroy -f $TESTPOOL/$TESTFS@snapshot
        fi
+
+       log_must zfs share -a
 }
 
 
@@ -138,11 +140,20 @@ done
 #
 log_must zfs share -a
 
+#
+# We need to unset __ZFS_POOL_EXCLUDE so that we include all file systems
+# in the os-specific zfs exports file. This will be reset by the next test.
+#
+unset __ZFS_POOL_EXCLUDE
+
 i=0
 while (( i < ${#fs[*]} )); do
        is_shared ${fs[i]} || \
            log_fail "File system ${fs[i]} is not shared (share -a)"
 
+       is_exported ${fs[i]} || \
+           log_fail "File system ${fs[i]} is not exported (share -a)"
+
        ((i = i + 2))
 done