aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/runfiles/bclone.run46
-rw-r--r--tests/runfiles/common.run146
-rw-r--r--tests/runfiles/freebsd.run5
-rw-r--r--tests/runfiles/linux.run48
-rw-r--r--tests/runfiles/sanity.run24
-rwxr-xr-xtests/test-runner/bin/test-runner.py.in97
-rwxr-xr-xtests/test-runner/bin/zts-report.py.in113
-rw-r--r--tests/test-runner/include/logapi.shlib2
-rw-r--r--tests/zfs-tests/Makefile.am6
-rwxr-xr-xtests/zfs-tests/callbacks/zfs_dbgmsg.ksh3
-rwxr-xr-xtests/zfs-tests/callbacks/zfs_dmesg.ksh3
-rwxr-xr-xtests/zfs-tests/callbacks/zfs_mmp.ksh1
-rw-r--r--tests/zfs-tests/cmd/.gitignore6
-rw-r--r--tests/zfs-tests/cmd/Makefile.am11
-rw-r--r--tests/zfs-tests/cmd/badsend.c6
-rw-r--r--tests/zfs-tests/cmd/btree_test.c70
-rw-r--r--tests/zfs-tests/cmd/checksum/blake3_test.c20
-rw-r--r--tests/zfs-tests/cmd/checksum/edonr_test.c89
-rw-r--r--tests/zfs-tests/cmd/checksum/sha2_test.c54
-rw-r--r--tests/zfs-tests/cmd/checksum/skein_test.c16
-rw-r--r--tests/zfs-tests/cmd/chg_usr_exec.c2
-rw-r--r--tests/zfs-tests/cmd/clone_mmap_cached.c146
-rw-r--r--tests/zfs-tests/cmd/clone_mmap_write.c123
-rw-r--r--tests/zfs-tests/cmd/clonefile.c373
-rw-r--r--tests/zfs-tests/cmd/ctime.c17
-rw-r--r--tests/zfs-tests/cmd/devname2devid.c2
-rw-r--r--tests/zfs-tests/cmd/dir_rd_update.c7
-rw-r--r--tests/zfs-tests/cmd/dosmode_readonly_write.c2
-rw-r--r--tests/zfs-tests/cmd/draid.c43
-rw-r--r--tests/zfs-tests/cmd/ereports.c4
-rw-r--r--tests/zfs-tests/cmd/file/file_append.c2
-rw-r--r--tests/zfs-tests/cmd/file/file_check.c2
-rw-r--r--tests/zfs-tests/cmd/file/file_common.h2
-rw-r--r--tests/zfs-tests/cmd/file/file_fadvise.c101
-rw-r--r--tests/zfs-tests/cmd/file/file_trunc.c6
-rw-r--r--tests/zfs-tests/cmd/file/file_write.c2
-rw-r--r--tests/zfs-tests/cmd/file/largest_file.c4
-rw-r--r--tests/zfs-tests/cmd/file/randfree_file.c2
-rw-r--r--tests/zfs-tests/cmd/file/randwritecomp.c5
-rw-r--r--tests/zfs-tests/cmd/get_diff.c2
-rw-r--r--tests/zfs-tests/cmd/idmap_util.c808
-rw-r--r--tests/zfs-tests/cmd/libzfs_input_check.c24
-rw-r--r--tests/zfs-tests/cmd/mkbusy.c8
-rw-r--r--tests/zfs-tests/cmd/mkfile.c6
-rw-r--r--tests/zfs-tests/cmd/mktree.c2
-rw-r--r--tests/zfs-tests/cmd/mmap_exec.c2
-rw-r--r--tests/zfs-tests/cmd/mmap_libaio.c4
-rw-r--r--tests/zfs-tests/cmd/mmap_seek.c2
-rw-r--r--tests/zfs-tests/cmd/mmap_sync.c10
-rw-r--r--tests/zfs-tests/cmd/mmapwrite.c34
-rw-r--r--tests/zfs-tests/cmd/nvlist_to_lua.c7
-rw-r--r--tests/zfs-tests/cmd/readmmap.c7
-rw-r--r--tests/zfs-tests/cmd/rename_dir.c2
-rw-r--r--tests/zfs-tests/cmd/renameat2.c128
-rw-r--r--tests/zfs-tests/cmd/rm_lnkcnt_zero_file.c2
-rw-r--r--tests/zfs-tests/cmd/send_doall.c2
-rw-r--r--tests/zfs-tests/cmd/stride_dd.c4
-rw-r--r--tests/zfs-tests/cmd/suid_write_to_file.c2
-rw-r--r--tests/zfs-tests/cmd/threadsappend.c2
-rw-r--r--tests/zfs-tests/cmd/user_ns_exec.c3
-rw-r--r--tests/zfs-tests/cmd/xattrtest.c2
-rw-r--r--tests/zfs-tests/cmd/zed_fd_spill-zedlet.c15
-rw-r--r--tests/zfs-tests/cmd/zfs_diff-socket.c3
-rw-r--r--tests/zfs-tests/include/blkdev.shlib2
-rw-r--r--tests/zfs-tests/include/commands.cfg20
-rw-r--r--tests/zfs-tests/include/default.cfg.in6
-rw-r--r--tests/zfs-tests/include/libtest.shlib102
-rw-r--r--tests/zfs-tests/include/math.shlib20
-rw-r--r--tests/zfs-tests/include/properties.shlib3
-rw-r--r--tests/zfs-tests/include/tunables.cfg7
-rw-r--r--tests/zfs-tests/tests/Makefile.am146
-rw-r--r--tests/zfs-tests/tests/functional/acl/acl.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/acl/acl_common.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/acl/off/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/acl/off/dosmode.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/acl/off/posixmode.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/acl/off/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/acl/posix-sa/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/acl/posix-sa/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/acl/posix/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/acl/posix/posix_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/acl/posix/posix_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/acl/posix/posix_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/acl/posix/posix_004_pos.ksh5
-rwxr-xr-xtests/zfs-tests/tests/functional/acl/posix/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/alloc_class/alloc_class_014_neg.ksh38
-rwxr-xr-xtests/zfs-tests/tests/functional/alloc_class/alloc_class_015_pos.ksh45
-rwxr-xr-xtests/zfs-tests/tests/functional/append/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/append/file_append.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/append/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/append/threadsappend_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/arc/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/arc/dbufstats_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/arc/dbufstats_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/arc/dbufstats_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/arc/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/atime/atime.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/atime/atime_001_pos.ksh8
-rwxr-xr-xtests/zfs-tests/tests/functional/atime/atime_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/atime/atime_003_pos.ksh3
-rw-r--r--tests/zfs-tests/tests/functional/atime/atime_common.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/atime/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/atime/root_atime_off.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/atime/root_atime_on.ksh9
-rwxr-xr-xtests/zfs-tests/tests/functional/atime/root_relatime_on.ksh3
-rwxr-xr-xtests/zfs-tests/tests/functional/atime/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/bclone/TODO4
-rw-r--r--tests/zfs-tests/tests/functional/bclone/bclone.cfg32
-rw-r--r--tests/zfs-tests/tests/functional/bclone/bclone_common.kshlib291
-rw-r--r--tests/zfs-tests/tests/functional/bclone/bclone_corner_cases.kshlib325
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/bclone_crossfs_corner_cases.ksh45
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/bclone_crossfs_corner_cases_limited.ksh45
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/bclone_crossfs_data.ksh46
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/bclone_crossfs_embedded.ksh50
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/bclone_crossfs_hole.ksh45
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/bclone_diffprops_all.ksh86
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/bclone_diffprops_checksum.ksh62
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/bclone_diffprops_compress.ksh59
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/bclone_diffprops_copies.ksh59
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/bclone_diffprops_recordsize.ksh65
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/bclone_prop_sync.ksh66
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/bclone_samefs_corner_cases.ksh42
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/bclone_samefs_corner_cases_limited.ksh42
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/bclone_samefs_data.ksh44
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/bclone_samefs_embedded.ksh48
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/bclone_samefs_hole.ksh44
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/cleanup.ksh (renamed from tests/zfs-tests/tests/functional/raidz/raidz_003_pos.ksh)29
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/setup.ksh50
-rw-r--r--tests/zfs-tests/tests/functional/block_cloning/block_cloning.kshlib58
-rwxr-xr-xtests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_cached.ksh86
-rwxr-xr-xtests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_write.ksh79
-rwxr-xr-xtests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange.ksh60
-rwxr-xr-xtests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_cross_dataset.ksh64
-rwxr-xr-xtests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_fallback.ksh86
-rwxr-xr-xtests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_fallback_same_txg.ksh68
-rwxr-xr-xtests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_partial.ksh68
-rwxr-xr-xtests/zfs-tests/tests/functional/block_cloning/block_cloning_cross_enc_dataset.ksh169
-rwxr-xr-xtests/zfs-tests/tests/functional/block_cloning/block_cloning_disabled_copyfilerange.ksh60
-rwxr-xr-xtests/zfs-tests/tests/functional/block_cloning/block_cloning_disabled_ficlone.ksh50
-rwxr-xr-xtests/zfs-tests/tests/functional/block_cloning/block_cloning_disabled_ficlonerange.ksh50
-rwxr-xr-xtests/zfs-tests/tests/functional/block_cloning/block_cloning_ficlone.ksh56
-rwxr-xr-xtests/zfs-tests/tests/functional/block_cloning/block_cloning_ficlonerange.ksh56
-rwxr-xr-xtests/zfs-tests/tests/functional/block_cloning/block_cloning_ficlonerange_partial.ksh64
-rwxr-xr-xtests/zfs-tests/tests/functional/block_cloning/block_cloning_lwb_buffer_overflow.ksh90
-rwxr-xr-xtests/zfs-tests/tests/functional/block_cloning/block_cloning_replay.ksh132
-rwxr-xr-xtests/zfs-tests/tests/functional/block_cloning/block_cloning_replay_encrypted.ksh134
-rwxr-xr-xtests/zfs-tests/tests/functional/block_cloning/cleanup.ksh38
-rwxr-xr-xtests/zfs-tests/tests/functional/block_cloning/setup.ksh44
-rwxr-xr-xtests/zfs-tests/tests/functional/bootfs/bootfs_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/bootfs/bootfs_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/bootfs/bootfs_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/bootfs/bootfs_004_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/bootfs/bootfs_005_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/bootfs/bootfs_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/bootfs/bootfs_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/bootfs/bootfs_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/bootfs/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/bootfs/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cache/cache.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/cache/cache.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/cache/cache_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cache/cache_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cache/cache_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cache/cache_004_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cache/cache_005_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cache/cache_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cache/cache_007_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cache/cache_008_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cache/cache_009_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cache/cache_010_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cache/cache_011_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cache/cache_012_pos.ksh27
-rwxr-xr-xtests/zfs-tests/tests/functional/cache/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cache/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cachefile/cachefile.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/cachefile/cachefile.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/cachefile/cachefile_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cachefile/cachefile_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cachefile/cachefile_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cachefile/cachefile_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cachefile/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cachefile/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/channel_program/synctask_core/tst.snapshot_rename.ksh41
-rw-r--r--tests/zfs-tests/tests/functional/channel_program/synctask_core/tst.snapshot_rename.zcp27
-rwxr-xr-xtests/zfs-tests/tests/functional/chattr/chattr_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/chattr/chattr_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/chattr/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/chattr/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/checksum/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/checksum/default.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/checksum/filetest_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/checksum/filetest_002_pos.ksh4
-rwxr-xr-xtests/zfs-tests/tests/functional/checksum/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/clean_mirror/clean_mirror_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/clean_mirror/clean_mirror_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/clean_mirror/clean_mirror_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/clean_mirror/clean_mirror_004_pos.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_common.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/clean_mirror/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/clean_mirror/default.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/clean_mirror/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/cli_common.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zdb/zdb_args_neg.ksh6
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zdb/zdb_args_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zdb/zdb_backup.ksh55
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zdb/zdb_block_size_histogram.ksh8
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zdb/zdb_encrypted.ksh69
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs/zfs_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs/zfs_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs/zfs_003_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_bookmark/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_bookmark/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_bookmark/zfs_bookmark_cliargs.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_change-key/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_change-key/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_clone/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_clone/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_008_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_009_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_copies/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_copies/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_004_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_005_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_create/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_create/properties.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_create/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_008_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_009_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_010_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_011_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_012_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_013_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_014_pos.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_common.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_destroy/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_destroy/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_006_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_007_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_009_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_010_pos.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_common.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_get/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_get/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_005_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_006_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_007_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_009_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_010_neg.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_common.kshlib2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_list_d.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_ids_to_path/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_ids_to_path/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_ids_to_path/zfs_ids_to_path_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_inherit/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_inherit/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_jail/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_jail/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_jail/zfs_jail_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_load-key/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_load-key/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_load-key/zfs_load-key_common.kshlib5
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_mount/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_mount/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount.cfg3
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_006_pos.ksh4
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_008_pos.ksh6
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_009_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_010_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_011_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_012_pos.ksh15
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_all_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_recursive.ksh146
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_remount.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_program/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_program/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_program/zfs_program_json.ksh4
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_promote/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_promote/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_006_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_007_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_property/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_property/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_property/zfs_written_property_001_pos.ksh1
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_receive/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_receive/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_-wR-encrypted-mix.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_004_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_005_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_007_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_009_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_010_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_compressed_corrective.ksh193
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_corrective.ksh209
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_large_block_corrective.ksh194
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_to_encrypted.ksh45
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rename/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rename/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_004_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_005_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_009_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_010_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_011_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_012_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_013_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_014_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_reservation/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_reservation/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_reservation/zfs_reservation_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_reservation/zfs_reservation_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rollback/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rollback/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_003_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_004_neg.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_common.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_send/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_send/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_004_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_006_pos.ksh32
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_skip_missing.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/cache_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/cache_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/checksum_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/compression_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_002_pos.ksh14
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/onoffs_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/property_alias_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/readonly_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/reservation_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/ro_props_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/share_mount_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/snapdir_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_003_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/version_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_003_neg.ksh12
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_feature_activation.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_nomount.ksh103
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_share/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_share/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_007_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_008_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_009_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_010_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_011_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_012_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_013_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_after_mount.ksh62
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_concurrent_shares.ksh41
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_snapshot/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_snapshot/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_003_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_004_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_005_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_007_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_008_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_sysfs/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_sysfs/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfeature_set_unsupported.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfs_get_unsupported.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfs_set_unsupported.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfs_sysfs_live.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zpool_get_unsupported.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zpool_set_unsupported.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unload-key/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unload-key/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unmount/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unmount/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_007_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_008_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_009_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_all_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_unload_keys.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unshare/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_004_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_005_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_upgrade/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_upgrade/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_006_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_007_neg.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zhack/library.kshlib361
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_checksum.ksh64
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_repair_001.ksh30
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_repair_002.ksh31
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_repair_003.ksh33
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_repair_004.ksh30
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zinject/zinject_args.ksh62
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool/zpool_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool/zpool_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool/zpool_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_add/add-o_ashift.ksh30
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_add/add_nested_replacing_spare.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_add/add_prop_ashift.ksh22
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_add/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_add/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add--allow-ashift-mismatch.ksh0
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_002_pos.ksh13
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_004_pos.ksh8
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_005_pos.ksh4
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_007_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_008_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_009_neg.ksh4
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_010_pos.ksh4
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_dryrun_output.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_attach/attach-o_ashift.ksh36
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_attach/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_attach/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_attach/zpool_attach_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_clear/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_clear/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_003_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_readonly.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/create-o_ashift.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create.shlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_007_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_009_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_010_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_011_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_012_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_014_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_015_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_016_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_017_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_018_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_019_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_020_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_021_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_022_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_023_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_024_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_dryrun_output.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_004_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_007_pos.ksh12
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_009_pos.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_003_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_detach/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_detach/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_detach/zpool_detach_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear_retained.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_errors.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_expand/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_expand/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_001_pos.ksh103
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_003_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_export/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_export/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_003_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_get/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_get/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_get/vdev_get.cfg75
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_get/vdev_get_001_pos.ksh62
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get.cfg9
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_004_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_005_pos.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_parsable.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_history/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_history/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_history/zpool_history_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_history/zpool_history_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/import_log_missing.ksh75
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import.cfg7
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import.kshlib1
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_009_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_010_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_011_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_012_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_013_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_014_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_016_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_017_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_all_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_features_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_features_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_features_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_hostid_changed.ksh59
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_hostid_changed_cachefile.ksh65
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_hostid_changed_cachefile_unclean_export.ksh75
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_hostid_changed_unclean_export.ksh70
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_missing_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_missing_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_missing_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_parallel_admin.ksh165
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_parallel_neg.ksh130
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_parallel_pos.ksh137
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_rename_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_status.ksh132
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_initialize/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_attach_detach_add_remove.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_import_export.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_offline_export_import_online.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_online_offline.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_split.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_start_and_cancel_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_start_and_cancel_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_suspend_resume.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_uninit.ksh141
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_unsupported_vdevs.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_verify_checksums.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_verify_initialized.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_offline/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_offline/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_offline/zpool_offline_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_offline/zpool_offline_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_offline/zpool_offline_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_online/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_online/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_online/zpool_online_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_online/zpool_online_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_remove/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_remove/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_replace/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_replace/replace-o_ashift.ksh38
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_replace/replace_prop_ashift.ksh30
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_replace/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_replace/zpool_replace_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_resilver/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_resilver/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_resilver/zpool_resilver.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_resilver/zpool_resilver_bad_args.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_resilver/zpool_resilver_concurrent.ksh101
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_resilver/zpool_resilver_restart.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_scrub/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_scrub/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_001_pos.ksh79
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_002_pos.ksh99
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_003_pos.ksh109
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_004_pos.ksh54
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_offline_device.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_print_repairing.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_set/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_set/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_001_pos.ksh89
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_002_neg.ksh88
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_set/vdev_set_001_pos.ksh52
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_003_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_ashift.ksh6
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_common.kshlib178
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_dryrun_output.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_status/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_status/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_002_pos.ksh6
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_003_pos.ksh7
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_004_pos.ksh3
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_005_pos.ksh90
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_006_pos.ksh97
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_007_pos.ksh111
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_008_pos.ksh104
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_features_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_sync/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_sync/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_partial.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_verify_trimmed.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_upgrade/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_upgrade/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_005_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_006_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_009_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_features_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/arc_summary_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/arc_summary_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/arcstat_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_user/misc/misc.cfg6
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zdb_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_allow_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_clone_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_create_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_destroy_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_get_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_inherit_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_mount_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_promote_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_receive_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_rename_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_rollback_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_send_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_set_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_share_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_snapshot_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_unallow_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_unmount_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_unshare_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zfs_upgrade_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zilstat_001_pos.ksh37
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_add_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_attach_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_clear_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_create_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_destroy_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_detach_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_export_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_get_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_history_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_import_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_import_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_offline_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_online_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_remove_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_replace_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_scrub_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_set_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_status_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/misc/zpool_upgrade_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zfs_list/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zfs_list/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_004_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_008_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_iostat/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_iostat/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_-c_disable.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_-c_homedir.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_-c_searchpath.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_003_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_list/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_list/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_list/zpool_list_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_list/zpool_list_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_status/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_status/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_disable.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_homedir.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_searchpath.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/compression/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/compression/compress.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/compression/compress_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/compression/compress_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/compression/compress_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/compression/compress_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/compression/compress_zstd_bswap.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/compression/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/cp_files/.gitignore1
-rwxr-xr-xtests/zfs-tests/tests/functional/cp_files/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cp_files/cp_files_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/cp_files/cp_files_002_pos.ksh161
-rwxr-xr-xtests/zfs-tests/tests/functional/cp_files/cp_stress.ksh73
-rw-r--r--tests/zfs-tests/tests/functional/cp_files/seekflood.c180
-rwxr-xr-xtests/zfs-tests/tests/functional/cp_files/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/crtime/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/crtime/crtime_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/crtime/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/ctime/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/ctime/ctime_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/ctime/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/deadman/deadman.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/deadman/deadman_ratelimit.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/deadman/deadman_sync.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/deadman/deadman_zio.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/delegate/delegate.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/delegate/delegate_common.kshlib6
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_allow_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_allow_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_allow_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_allow_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_allow_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_allow_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_allow_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_allow_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_allow_009_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_allow_010_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_allow_011_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_allow_012_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_unallow_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_unallow_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_unallow_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_unallow_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_unallow_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_unallow_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_unallow_007_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/zfs_unallow_008_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/devices/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/devices/devices.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/devices/devices_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/devices/devices_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/devices/devices_003_pos.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/devices/devices_common.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/devices/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/dos_attributes/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/dos_attributes/read_dos_attrs_001.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/dos_attributes/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/dos_attributes/write_dos_attrs_001.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/events/cleanup.ksh6
-rw-r--r--tests/zfs-tests/tests/functional/events/events.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/events/events_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/events/events_002_pos.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/events/events_common.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/events/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/events/zed_cksum_config.ksh158
-rwxr-xr-xtests/zfs-tests/tests/functional/events/zed_cksum_reported.ksh124
-rwxr-xr-xtests/zfs-tests/tests/functional/events/zed_fd_spill.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/events/zed_io_config.ksh150
-rwxr-xr-xtests/zfs-tests/tests/functional/events/zed_rc_filter.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/events/zed_slow_io.ksh205
-rwxr-xr-xtests/zfs-tests/tests/functional/events/zed_slow_io_many_vdevs.ksh177
-rwxr-xr-xtests/zfs-tests/tests/functional/exec/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/exec/exec_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/exec/exec_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/exec/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/fadvise/cleanup.ksh28
-rwxr-xr-xtests/zfs-tests/tests/functional/fadvise/fadvise_sequential.ksh80
-rwxr-xr-xtests/zfs-tests/tests/functional/fadvise/setup.ksh30
-rwxr-xr-xtests/zfs-tests/tests/functional/fallocate/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/fallocate/fallocate_prealloc.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/fallocate/fallocate_punch-hole.ksh62
-rwxr-xr-xtests/zfs-tests/tests/functional/fallocate/fallocate_zero-range.ksh67
-rwxr-xr-xtests/zfs-tests/tests/functional/fallocate/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/fault/auto_offline_001_pos.ksh32
-rwxr-xr-xtests/zfs-tests/tests/functional/fault/auto_online_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/fault/auto_online_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/fault/auto_replace_001_pos.ksh48
-rwxr-xr-xtests/zfs-tests/tests/functional/fault/auto_replace_002_pos.ksh192
-rwxr-xr-xtests/zfs-tests/tests/functional/fault/auto_spare_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/fault/cleanup.ksh3
-rw-r--r--tests/zfs-tests/tests/functional/fault/fault.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/fault/setup.ksh3
-rwxr-xr-xtests/zfs-tests/tests/functional/fault/zpool_status_-s.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/features/async_destroy/async_destroy_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/features/async_destroy/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/features/async_destroy/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/features/large_dnode/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/features/large_dnode/large_dnode_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/features/large_dnode/large_dnode_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/features/large_dnode/large_dnode_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/features/large_dnode/large_dnode_004_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/features/large_dnode/large_dnode_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/features/large_dnode/large_dnode_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/features/large_dnode/large_dnode_007_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/features/large_dnode/large_dnode_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/features/large_dnode/large_dnode_009_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/features/large_dnode/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/grow/grow.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/grow/grow_pool_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/grow/grow_replicas_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/history/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/history/history.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/history/history_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/history/history_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/history/history_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/history/history_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/history/history_005_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/history/history_006_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/history/history_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/history/history_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/history/history_009_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/history/history_010_pos.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/history/history_common.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/history/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/idmap_mount/cleanup.ksh25
-rw-r--r--tests/zfs-tests/tests/functional/idmap_mount/idmap_mount.cfg25
-rwxr-xr-xtests/zfs-tests/tests/functional/idmap_mount/idmap_mount_001.ksh76
-rwxr-xr-xtests/zfs-tests/tests/functional/idmap_mount/idmap_mount_002.ksh97
-rwxr-xr-xtests/zfs-tests/tests/functional/idmap_mount/idmap_mount_003.ksh121
-rwxr-xr-xtests/zfs-tests/tests/functional/idmap_mount/idmap_mount_004.ksh106
-rwxr-xr-xtests/zfs-tests/tests/functional/idmap_mount/idmap_mount_005.ksh138
-rw-r--r--tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_common.kshlib23
-rwxr-xr-xtests/zfs-tests/tests/functional/idmap_mount/setup.ksh30
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/README.config2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/README.state2
-rwxr-xr-xtests/zfs-tests/tests/functional/inheritance/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config001.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config002.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config003.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config004.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config005.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config006.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config007.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config008.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config009.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config010.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config011.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config012.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config013.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config014.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config015.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config016.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config017.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config018.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config019.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config020.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config021.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config022.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config023.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/config024.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/inherit.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/inheritance/inherit_001_pos.ksh14
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state001.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state002.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state003.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state004.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state005.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state006.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state007.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state008.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state009.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state010.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state011.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state012.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state013.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state014.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state015.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state016.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state017.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state018.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state019.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state020.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state021.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state022.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state023.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inheritance/state024.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/inuse/inuse.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/inuse/inuse_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/inuse/inuse_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/inuse/inuse_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/inuse/inuse_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/inuse/inuse_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/inuse/inuse_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/inuse/inuse_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/inuse/inuse_009_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/inuse/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/io/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/io/io_uring.ksh11
-rwxr-xr-xtests/zfs-tests/tests/functional/io/libaio.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/io/mmap.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/io/posixaio.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/io/psync.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/io/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/io/sync.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/l2arc/l2arc_mfuonly_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/l2arc/persist_l2arc_001_pos.ksh19
-rwxr-xr-xtests/zfs-tests/tests/functional/large_files/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/large_files/large_files_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/large_files/large_files_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/large_files/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/largest_pool/largest_pool.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/largest_pool/largest_pool_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/libzfs/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/libzfs/many_fds.c2
-rwxr-xr-xtests/zfs-tests/tests/functional/libzfs/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/link_count/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/link_count/link_count_001.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/link_count/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/migration/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/migration/migration.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/migration/migration.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/migration/migration_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/migration/migration_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/migration/migration_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/migration/migration_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/migration/migration_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/migration/migration_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/migration/migration_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/migration/migration_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/migration/migration_009_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/migration/migration_010_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/migration/migration_011_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/migration/migration_012_pos.ksh6
-rwxr-xr-xtests/zfs-tests/tests/functional/migration/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/mmap/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/mmap/mmap.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/mmap/mmap_libaio_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/mmap/mmap_mixed.ksh86
-rwxr-xr-xtests/zfs-tests/tests/functional/mmap/mmap_read_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/mmap/mmap_seek_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/mmap/mmap_write_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/mmap/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/mmp/mmp.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/mmp/mmp_write_slow_disk.ksh97
-rwxr-xr-xtests/zfs-tests/tests/functional/mount/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/mount/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/mount/umount_001.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/mv_files/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/mv_files/mv_files.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/mv_files/mv_files_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/mv_files/mv_files_002_pos.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/mv_files/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/nestedfs/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/nestedfs/nestedfs_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/nestedfs/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/no_space/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/no_space/enospc.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/no_space/enospc_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/no_space/enospc_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/no_space/enospc_ganging.ksh86
-rwxr-xr-xtests/zfs-tests/tests/functional/no_space/enospc_rm.ksh12
-rwxr-xr-xtests/zfs-tests/tests/functional/no_space/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/nopwrite/nopwrite.shlib8
-rwxr-xr-xtests/zfs-tests/tests/functional/online_offline/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/online_offline/online_offline.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/online_offline/online_offline_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/online_offline/online_offline_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/online_offline/online_offline_003_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/online_offline/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/pam/cleanup.ksh3
-rwxr-xr-xtests/zfs-tests/tests/functional/pam/pam_basic.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/pam/pam_change_unmounted.ksh55
-rwxr-xr-xtests/zfs-tests/tests/functional/pam/pam_nounmount.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/pam/pam_recursive.ksh72
-rwxr-xr-xtests/zfs-tests/tests/functional/pam/pam_short_password.ksh4
-rwxr-xr-xtests/zfs-tests/tests/functional/pam/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/pam/utilities.kshlib.in2
-rwxr-xr-xtests/zfs-tests/tests/functional/pool_checkpoint/checkpoint_discard_busy.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/pool_names/pool_names_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/pool_names/pool_names_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/poolversion/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/poolversion/poolversion_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/poolversion/poolversion_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/poolversion/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/privilege/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/privilege/privilege_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/privilege/privilege_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/privilege/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/procfs/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/procfs/pool_state.ksh8
-rwxr-xr-xtests/zfs-tests/tests/functional/procfs/procfs_list_basic.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/procfs/procfs_list_concurrent_readers.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/procfs/procfs_list_stale_read.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/procfs/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/projectid_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/projectid_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/projectid_003_pos.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/projectquota/projectquota.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/projectquota_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/projectquota_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/projectquota_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/projectquota_004_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/projectquota_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/projectquota_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/projectquota_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/projectquota_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/projectquota_009_pos.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/projectquota/projectquota_common.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/projectspace_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/projectspace_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/projectspace_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/projectspace_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/projecttree_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/projecttree_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/projecttree_003_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/projectquota/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/pyzfs/pyzfs_unittest.ksh.in16
-rwxr-xr-xtests/zfs-tests/tests/functional/quota/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/quota/quota.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/quota/quota.kshlib9
-rwxr-xr-xtests/zfs-tests/tests/functional/quota/quota_001_pos.ksh4
-rwxr-xr-xtests/zfs-tests/tests/functional/quota/quota_002_pos.ksh4
-rwxr-xr-xtests/zfs-tests/tests/functional/quota/quota_003_pos.ksh4
-rwxr-xr-xtests/zfs-tests/tests/functional/quota/quota_004_pos.ksh4
-rwxr-xr-xtests/zfs-tests/tests/functional/quota/quota_005_pos.ksh11
-rwxr-xr-xtests/zfs-tests/tests/functional/quota/quota_006_neg.ksh4
-rwxr-xr-xtests/zfs-tests/tests/functional/quota/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/raidz/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/raidz/raidz_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/raidz/raidz_002_pos.ksh36
-rwxr-xr-xtests/zfs-tests/tests/functional/raidz/raidz_expand_001_pos.ksh215
-rwxr-xr-xtests/zfs-tests/tests/functional/raidz/raidz_expand_002_pos.ksh115
-rwxr-xr-xtests/zfs-tests/tests/functional/raidz/raidz_expand_003_neg.ksh102
-rwxr-xr-xtests/zfs-tests/tests/functional/raidz/raidz_expand_003_pos.ksh141
-rwxr-xr-xtests/zfs-tests/tests/functional/raidz/raidz_expand_004_pos.ksh121
-rwxr-xr-xtests/zfs-tests/tests/functional/raidz/raidz_expand_005_pos.ksh177
-rwxr-xr-xtests/zfs-tests/tests/functional/raidz/raidz_expand_006_neg.ksh78
-rwxr-xr-xtests/zfs-tests/tests/functional/raidz/raidz_expand_007_neg.ksh86
-rwxr-xr-xtests/zfs-tests/tests/functional/raidz/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/redacted_send/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/redacted_send/redacted.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/redacted_send/redacted.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/redacted_send/redacted_many_clones.ksh12
-rwxr-xr-xtests/zfs-tests/tests/functional/redacted_send/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/redundancy/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/redundancy/redundancy.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/redundancy/redundancy.kshlib24
-rwxr-xr-xtests/zfs-tests/tests/functional/redundancy/redundancy_draid.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/redundancy/redundancy_draid1.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/redundancy/redundancy_draid2.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/redundancy/redundancy_draid3.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/redundancy/redundancy_draid_damaged1.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/redundancy/redundancy_draid_damaged2.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/redundancy/redundancy_mirror.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/redundancy/redundancy_raidz.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/redundancy/redundancy_raidz1.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/redundancy/redundancy_raidz2.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/redundancy/redundancy_raidz3.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/redundancy/redundancy_stripe.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/redundancy/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/refquota/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/refquota/refquota_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/refquota/refquota_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/refquota/refquota_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/refquota/refquota_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/refquota/refquota_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/refquota/refquota_006_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/refquota/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/refreserv/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/refreserv/refreserv.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/refreserv/refreserv_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/refreserv/refreserv_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/refreserv/refreserv_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/refreserv/refreserv_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/refreserv/refreserv_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/refreserv/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/removal/removal_nopwrite.ksh45
-rwxr-xr-xtests/zfs-tests/tests/functional/removal/removal_with_indirect.ksh57
-rwxr-xr-xtests/zfs-tests/tests/functional/removal/remove_mirror.ksh3
-rwxr-xr-xtests/zfs-tests/tests/functional/rename_dirs/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rename_dirs/rename_dirs_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rename_dirs/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/renameat2/cleanup.ksh (renamed from tests/zfs-tests/tests/functional/raidz/raidz_004_pos.ksh)19
-rwxr-xr-xtests/zfs-tests/tests/functional/renameat2/renameat2_exchange.ksh61
-rwxr-xr-xtests/zfs-tests/tests/functional/renameat2/renameat2_noreplace.ksh51
-rwxr-xr-xtests/zfs-tests/tests/functional/renameat2/renameat2_whiteout.ksh50
-rwxr-xr-xtests/zfs-tests/tests/functional/renameat2/setup.ksh37
-rwxr-xr-xtests/zfs-tests/tests/functional/replacement/attach_rebuild.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/replacement/attach_resilver.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/replacement/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/replacement/detach.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/replacement/replace_rebuild.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/replacement/replace_resilver.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/replacement/replacement.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/replacement/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/reservation/reservation.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/reservation/reservation.shlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/reservation_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/reservation_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/reservation_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/reservation_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/reservation_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/reservation_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/reservation_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/reservation_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/reservation_009_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/reservation_010_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/reservation_011_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/reservation_012_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/reservation_013_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/reservation_014_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/reservation_015_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/reservation_016_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/reservation_017_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/reservation_018_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/reservation/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rootpool/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rootpool/rootpool_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rootpool/rootpool_003_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rootpool/rootpool_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rootpool/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/rsend/rsend.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/rsend/rsend.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_009_pos.ksh45
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_010_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_011_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_013_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_025_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_026_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_027_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_028_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_029_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_030_pos.ksh66
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/rsend_031_pos.ksh63
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/send-c_volume.ksh9
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/send-c_zstream_recompress.ksh58
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/send_encrypted_freeobjects.ksh87
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/send_encrypted_incremental.ksh93
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/send_encrypted_props.ksh8
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/send_hole_birth.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/send_raw_ashift.ksh4
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/send_raw_large_blocks.ksh78
-rwxr-xr-xtests/zfs-tests/tests/functional/rsend/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/scrub_mirror/cleanup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/scrub_mirror/default.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_004_pos.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_common.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/scrub_mirror/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/simd/simd_supported.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/slog/slog.cfg2
-rw-r--r--tests/zfs-tests/tests/functional/slog/slog.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_008_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_009_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_010_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_011_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_012_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_013_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_014_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_016_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_replay_fs_001.ksh25
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_replay_fs_002.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/slog/slog_replay_volume.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/clone_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/rollback_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/rollback_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/rollback_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/snapshot/snapshot.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/snapshot_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/snapshot_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/snapshot_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/snapshot_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/snapshot_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/snapshot_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/snapshot_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/snapshot_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/snapshot_009_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/snapshot_010_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/snapshot_011_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/snapshot_012_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/snapshot_013_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/snapshot_014_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/snapshot_015_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/snapshot_016_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/snapshot_017_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/snapshot_018_pos.ksh127
-rwxr-xr-xtests/zfs-tests/tests/functional/snapused/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapused/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/snapused/snapused.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapused/snapused_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapused/snapused_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapused/snapused_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapused/snapused_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/snapused/snapused_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/sparse/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/sparse/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/sparse/sparse.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/sparse/sparse_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/stat/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/stat/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/stat/stat_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/suid/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/suid/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/suid/suid_write_to_none.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/suid/suid_write_to_sgid.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/suid/suid_write_to_suid.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/suid/suid_write_to_suid_sgid.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/suid/suid_write_zil_replay.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/tmpfile/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/tmpfile/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/tmpfile/tmpfile_002_pos.c7
-rw-r--r--tests/zfs-tests/tests/functional/tmpfile/tmpfile_stat_mode.c32
-rwxr-xr-xtests/zfs-tests/tests/functional/trim/autotrim_config.ksh3
-rwxr-xr-xtests/zfs-tests/tests/functional/trim/autotrim_integrity.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/trim/autotrim_trim_integrity.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/trim/trim.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/trim/trim_config.ksh3
-rwxr-xr-xtests/zfs-tests/tests/functional/trim/trim_integrity.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/trim/trim_l2arc.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/truncate/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/truncate/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/truncate/truncate.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/truncate/truncate_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/truncate/truncate_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/upgrade/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/upgrade/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/upgrade/upgrade_common.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/upgrade/upgrade_projectquota_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/upgrade/upgrade_userobj_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/user_namespace/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/user_namespace/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/user_namespace/user_namespace.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/user_namespace/user_namespace_001.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/user_namespace/user_namespace_002.ksh4
-rwxr-xr-xtests/zfs-tests/tests/functional/user_namespace/user_namespace_003.ksh4
-rwxr-xr-xtests/zfs-tests/tests/functional/user_namespace/user_namespace_004.ksh6
-rw-r--r--tests/zfs-tests/tests/functional/user_namespace/user_namespace_common.kshlib2
-rw-r--r--tests/zfs-tests/tests/functional/userquota/13709_reproducer.bz2bin0 -> 135829 bytes
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/groupspace_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/groupspace_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/groupspace_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/userquota/userquota.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/userquota_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/userquota_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/userquota_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/userquota_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/userquota_005_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/userquota_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/userquota_007_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/userquota_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/userquota_009_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/userquota_010_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/userquota_011_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/userquota_012_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/userquota_013_pos.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/userquota/userquota_common.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/userspace_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/userspace_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/userspace_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/userquota/userspace_encrypted_13709.ksh45
-rw-r--r--tests/zfs-tests/tests/functional/vdev_disk/.gitignore1
-rw-r--r--tests/zfs-tests/tests/functional/vdev_disk/page_alignment.c413
-rw-r--r--tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps.kshlib13
-rwxr-xr-xtests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_001_pos.ksh3
-rwxr-xr-xtests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_002_pos.ksh1
-rwxr-xr-xtests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_003_pos.ksh1
-rwxr-xr-xtests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_004_pos.ksh1
-rwxr-xr-xtests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_005_pos.ksh1
-rwxr-xr-xtests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_006_pos.ksh1
-rwxr-xr-xtests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_007_pos.ksh1
-rwxr-xr-xtests/zfs-tests/tests/functional/write_dirs/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/write_dirs/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/write_dirs/write_dirs_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/write_dirs/write_dirs_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/xattr/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/xattr/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/xattr/xattr.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/xattr/xattr_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/xattr/xattr_002_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/xattr/xattr_003_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/xattr/xattr_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/xattr/xattr_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/xattr/xattr_006_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/xattr/xattr_007_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/xattr/xattr_008_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/xattr/xattr_009_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/xattr/xattr_010_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/xattr/xattr_011_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/xattr/xattr_012_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/xattr/xattr_013_pos.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/xattr/xattr_common.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/xattr/xattr_compat.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zap_shrink/cleanup.ksh34
-rwxr-xr-xtests/zfs-tests/tests/functional/zap_shrink/setup.ksh35
-rwxr-xr-xtests/zfs-tests/tests/functional/zap_shrink/zap_shrink_001_pos.ksh81
-rw-r--r--tests/zfs-tests/tests/functional/zvol/zvol.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/zvol_ENOSPC.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/zvol_ENOSPC_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_cli/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_cli/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli_003_neg.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/zvol/zvol_common.shlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_misc/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_misc/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_001_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_003_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_005_neg.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_006_pos.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_common.kshlib2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_fua.ksh11
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_snapdev.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_trim.ksh17
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_volmode.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_zil.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_stress/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_stress/setup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_stress/zvol_stress.ksh3
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_swap/cleanup.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_swap/setup.ksh2
-rw-r--r--tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_001_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_002_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_003_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_004_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_005_pos.ksh2
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_006_pos.ksh2
-rw-r--r--tests/zfs-tests/tests/perf/perf.shlib1
-rwxr-xr-xtests/zfs-tests/tests/perf/regression/random_readwrite.ksh2
1495 files changed, 16956 insertions, 2154 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2e633041ab59..12e9c9f9daf2 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -16,6 +16,7 @@ dist_scripts_test_runner_include_DATA = \
scripts_runfilesdir = $(datadir)/$(PACKAGE)/runfiles
dist_scripts_runfiles_DATA = \
+ %D%/runfiles/bclone.run \
%D%/runfiles/common.run \
%D%/runfiles/freebsd.run \
%D%/runfiles/linux.run \
diff --git a/tests/runfiles/bclone.run b/tests/runfiles/bclone.run
new file mode 100644
index 000000000000..3d0f545d9226
--- /dev/null
+++ b/tests/runfiles/bclone.run
@@ -0,0 +1,46 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+# This run file contains all of the common functional tests. When
+# adding a new test consider also adding it to the sanity.run file
+# if the new test runs to completion in only a few seconds.
+#
+# Approximate run time: 5 hours
+#
+
+[DEFAULT]
+pre = setup
+quiet = False
+pre_user = root
+user = root
+timeout = 28800
+post_user = root
+post = cleanup
+failsafe_user = root
+failsafe = callbacks/zfs_failsafe
+outputdir = /var/tmp/test_results
+tags = ['bclone']
+
+[tests/functional/bclone]
+tests = ['bclone_crossfs_corner_cases',
+ 'bclone_crossfs_data',
+ 'bclone_crossfs_embedded',
+ 'bclone_crossfs_hole',
+ 'bclone_diffprops_all',
+ 'bclone_diffprops_checksum',
+ 'bclone_diffprops_compress',
+ 'bclone_diffprops_copies',
+ 'bclone_diffprops_recordsize',
+ 'bclone_prop_sync',
+ 'bclone_samefs_corner_cases',
+ 'bclone_samefs_data',
+ 'bclone_samefs_embedded',
+ 'bclone_samefs_hole']
+tags = ['bclone']
diff --git a/tests/runfiles/common.run b/tests/runfiles/common.run
index a4ec27a368ac..5e7fdf359a75 100644
--- a/tests/runfiles/common.run
+++ b/tests/runfiles/common.run
@@ -37,7 +37,7 @@ tests = ['alloc_class_001_pos', 'alloc_class_002_neg', 'alloc_class_003_pos',
'alloc_class_004_pos', 'alloc_class_005_pos', 'alloc_class_006_pos',
'alloc_class_007_pos', 'alloc_class_008_pos', 'alloc_class_009_pos',
'alloc_class_010_pos', 'alloc_class_011_neg', 'alloc_class_012_pos',
- 'alloc_class_013_pos']
+ 'alloc_class_013_pos', 'alloc_class_014_neg', 'alloc_class_015_pos']
tags = ['functional', 'alloc_class']
[tests/functional/append]
@@ -53,6 +53,37 @@ tags = ['functional', 'arc']
tests = ['atime_001_pos', 'atime_002_neg', 'root_atime_off', 'root_atime_on']
tags = ['functional', 'atime']
+[tests/functional/bclone]
+tests = ['bclone_crossfs_corner_cases_limited',
+ 'bclone_crossfs_data',
+ 'bclone_crossfs_embedded',
+ 'bclone_crossfs_hole',
+ 'bclone_diffprops_all',
+ 'bclone_diffprops_checksum',
+ 'bclone_diffprops_compress',
+ 'bclone_diffprops_copies',
+ 'bclone_diffprops_recordsize',
+ 'bclone_prop_sync',
+ 'bclone_samefs_corner_cases_limited',
+ 'bclone_samefs_data',
+ 'bclone_samefs_embedded',
+ 'bclone_samefs_hole']
+tags = ['functional', 'bclone']
+timeout = 7200
+
+[tests/functional/block_cloning]
+tests = ['block_cloning_clone_mmap_cached',
+ 'block_cloning_copyfilerange',
+ 'block_cloning_copyfilerange_partial',
+ 'block_cloning_copyfilerange_fallback',
+ 'block_cloning_disabled_copyfilerange',
+ 'block_cloning_copyfilerange_cross_dataset',
+ 'block_cloning_cross_enc_dataset',
+ 'block_cloning_copyfilerange_fallback_same_txg',
+ 'block_cloning_replay', 'block_cloning_replay_encrypted',
+ 'block_cloning_lwb_buffer_overflow', 'block_cloning_clone_mmap_write']
+tags = ['functional', 'block_cloning']
+
[tests/functional/bootfs]
tests = ['bootfs_001_pos', 'bootfs_002_neg', 'bootfs_003_pos',
'bootfs_004_neg', 'bootfs_005_neg', 'bootfs_006_pos', 'bootfs_007_pos',
@@ -106,7 +137,7 @@ tests = ['tst.destroy_fs', 'tst.destroy_snap', 'tst.get_count_and_limit',
'tst.list_user_props', 'tst.parse_args_neg','tst.promote_conflict',
'tst.promote_multiple', 'tst.promote_simple', 'tst.rollback_mult',
'tst.rollback_one', 'tst.set_props', 'tst.snapshot_destroy', 'tst.snapshot_neg',
- 'tst.snapshot_recursive', 'tst.snapshot_simple',
+ 'tst.snapshot_recursive', 'tst.snapshot_rename', 'tst.snapshot_simple',
'tst.bookmark.create', 'tst.bookmark.copy',
'tst.terminate_by_signal'
]
@@ -122,16 +153,23 @@ tests = [ 'clean_mirror_001_pos', 'clean_mirror_002_pos',
'clean_mirror_003_pos', 'clean_mirror_004_pos']
tags = ['functional', 'clean_mirror']
+[tests/functional/cli_root/zinject]
+tests = ['zinject_args']
+pre =
+post =
+tags = ['functional', 'cli_root', 'zinject']
+
[tests/functional/cli_root/zdb]
tests = ['zdb_002_pos', 'zdb_003_pos', 'zdb_004_pos', 'zdb_005_pos',
'zdb_006_pos', 'zdb_args_neg', 'zdb_args_pos',
'zdb_block_size_histogram', 'zdb_checksum', 'zdb_decompress',
- 'zdb_display_block', 'zdb_label_checksum', 'zdb_object_range_neg',
- 'zdb_object_range_pos', 'zdb_objset_id', 'zdb_decompress_zstd',
- 'zdb_recover', 'zdb_recover_2']
+ 'zdb_display_block', 'zdb_encrypted', 'zdb_label_checksum',
+ 'zdb_object_range_neg', 'zdb_object_range_pos', 'zdb_objset_id',
+ 'zdb_decompress_zstd', 'zdb_recover', 'zdb_recover_2', 'zdb_backup']
pre =
post =
tags = ['functional', 'cli_root', 'zdb']
+timeout = 1200
[tests/functional/cli_root/zfs]
tests = ['zfs_001_neg', 'zfs_002_pos']
@@ -151,7 +189,8 @@ tags = ['functional', 'cli_root', 'zfs_change-key']
tests = ['zfs_clone_001_neg', 'zfs_clone_002_pos', 'zfs_clone_003_pos',
'zfs_clone_004_pos', 'zfs_clone_005_pos', 'zfs_clone_006_pos',
'zfs_clone_007_pos', 'zfs_clone_008_neg', 'zfs_clone_009_neg',
- 'zfs_clone_010_pos', 'zfs_clone_encrypted', 'zfs_clone_deeply_nested']
+ 'zfs_clone_010_pos', 'zfs_clone_encrypted', 'zfs_clone_deeply_nested',
+ 'zfs_clone_rm_nested']
tags = ['functional', 'cli_root', 'zfs_clone']
[tests/functional/cli_root/zfs_copies]
@@ -213,7 +252,7 @@ tests = ['zfs_mount_001_pos', 'zfs_mount_002_pos', 'zfs_mount_003_pos',
'zfs_mount_009_neg', 'zfs_mount_010_neg', 'zfs_mount_011_neg',
'zfs_mount_012_pos', 'zfs_mount_all_001_pos', 'zfs_mount_encrypted',
'zfs_mount_remount', 'zfs_mount_all_fail', 'zfs_mount_all_mountpoints',
- 'zfs_mount_test_race']
+ 'zfs_mount_test_race', 'zfs_mount_recursive']
tags = ['functional', 'cli_root', 'zfs_mount']
[tests/functional/cli_root/zfs_program]
@@ -241,7 +280,8 @@ tests = ['zfs_receive_001_pos', 'zfs_receive_002_pos', 'zfs_receive_003_pos',
'zfs_receive_from_encrypted', 'zfs_receive_to_encrypted',
'zfs_receive_raw', 'zfs_receive_raw_incremental', 'zfs_receive_-e',
'zfs_receive_raw_-d', 'zfs_receive_from_zstd', 'zfs_receive_new_props',
- 'zfs_receive_-wR-encrypted-mix']
+ 'zfs_receive_-wR-encrypted-mix', 'zfs_receive_corrective',
+ 'zfs_receive_compressed_corrective', 'zfs_receive_large_block_corrective']
tags = ['functional', 'cli_root', 'zfs_receive']
[tests/functional/cli_root/zfs_rename]
@@ -265,8 +305,8 @@ tags = ['functional', 'cli_root', 'zfs_rollback']
[tests/functional/cli_root/zfs_send]
tests = ['zfs_send_001_pos', 'zfs_send_002_pos', 'zfs_send_003_pos',
'zfs_send_004_neg', 'zfs_send_005_pos', 'zfs_send_006_pos',
- 'zfs_send_007_pos', 'zfs_send_encrypted', 'zfs_send_raw',
- 'zfs_send_sparse', 'zfs_send-b', 'zfs_send_skip_missing']
+ 'zfs_send_007_pos', 'zfs_send_encrypted', 'zfs_send_encrypted_unloaded',
+ 'zfs_send_raw', 'zfs_send_sparse', 'zfs_send-b', 'zfs_send_skip_missing']
tags = ['functional', 'cli_root', 'zfs_send']
[tests/functional/cli_root/zfs_set]
@@ -279,13 +319,14 @@ tests = ['cache_001_pos', 'cache_002_neg', 'canmount_001_pos',
'user_property_004_pos', 'version_001_neg', 'zfs_set_001_neg',
'zfs_set_002_neg', 'zfs_set_003_neg', 'property_alias_001_pos',
'mountpoint_003_pos', 'ro_props_001_pos', 'zfs_set_keylocation',
- 'zfs_set_feature_activation']
+ 'zfs_set_feature_activation', 'zfs_set_nomount']
tags = ['functional', 'cli_root', 'zfs_set']
[tests/functional/cli_root/zfs_share]
tests = ['zfs_share_001_pos', 'zfs_share_002_pos', 'zfs_share_003_pos',
'zfs_share_004_pos', 'zfs_share_006_pos', 'zfs_share_008_neg',
- 'zfs_share_010_neg', 'zfs_share_011_pos', 'zfs_share_concurrent_shares']
+ 'zfs_share_010_neg', 'zfs_share_011_pos', 'zfs_share_concurrent_shares',
+ 'zfs_share_after_mount']
tags = ['functional', 'cli_root', 'zfs_share']
[tests/functional/cli_root/zfs_snapshot]
@@ -309,7 +350,7 @@ tags = ['functional', 'cli_root', 'zfs_unmount']
[tests/functional/cli_root/zfs_unshare]
tests = ['zfs_unshare_001_pos', 'zfs_unshare_002_pos', 'zfs_unshare_003_pos',
'zfs_unshare_004_neg', 'zfs_unshare_005_neg', 'zfs_unshare_006_pos',
- 'zfs_unshare_007_pos', 'zfs_unshare_008_pos']
+ 'zfs_unshare_007_pos']
tags = ['functional', 'cli_root', 'zfs_unshare']
[tests/functional/cli_root/zfs_upgrade]
@@ -323,7 +364,8 @@ tests = ['zfs_wait_deleteq', 'zfs_wait_getsubopt']
tags = ['functional', 'cli_root', 'zfs_wait']
[tests/functional/cli_root/zhack]
-tests = ['zhack_label_checksum']
+tests = ['zhack_label_repair_001', 'zhack_label_repair_002',
+ 'zhack_label_repair_003', 'zhack_label_repair_004']
pre =
post =
tags = ['functional', 'cli_root', 'zhack']
@@ -336,7 +378,8 @@ tags = ['functional', 'cli_root', 'zpool']
tests = ['zpool_add_001_pos', 'zpool_add_002_pos', 'zpool_add_003_pos',
'zpool_add_004_pos', 'zpool_add_006_pos', 'zpool_add_007_neg',
'zpool_add_008_neg', 'zpool_add_009_neg', 'zpool_add_010_pos',
- 'add-o_ashift', 'add_prop_ashift', 'zpool_add_dryrun_output']
+ 'add-o_ashift', 'add_prop_ashift', 'zpool_add_dryrun_output',
+ 'zpool_add--allow-ashift-mismatch']
tags = ['functional', 'cli_root', 'zpool_add']
[tests/functional/cli_root/zpool_attach]
@@ -392,7 +435,7 @@ tags = ['functional', 'cli_root', 'zpool_export']
[tests/functional/cli_root/zpool_get]
tests = ['zpool_get_001_pos', 'zpool_get_002_pos', 'zpool_get_003_pos',
- 'zpool_get_004_neg', 'zpool_get_005_pos']
+ 'zpool_get_004_neg', 'zpool_get_005_pos', 'vdev_get_001_pos']
tags = ['functional', 'cli_root', 'zpool_get']
[tests/functional/cli_root/zpool_history]
@@ -419,10 +462,12 @@ tests = ['zpool_import_001_pos', 'zpool_import_002_pos',
'import_cachefile_mirror_detached',
'import_cachefile_paths_changed',
'import_cachefile_shared_device',
- 'import_devices_missing',
+ 'import_devices_missing', 'import_log_missing',
'import_paths_changed',
'import_rewind_config_changed',
- 'import_rewind_device_replaced']
+ 'import_rewind_device_replaced',
+ 'zpool_import_status', 'zpool_import_parallel_pos',
+ 'zpool_import_parallel_neg', 'zpool_import_parallel_admin']
tags = ['functional', 'cli_root', 'zpool_import']
timeout = 1200
@@ -443,6 +488,7 @@ tests = ['zpool_initialize_attach_detach_add_remove',
'zpool_initialize_start_and_cancel_neg',
'zpool_initialize_start_and_cancel_pos',
'zpool_initialize_suspend_resume',
+ 'zpool_initialize_uninit',
'zpool_initialize_unsupported_vdevs',
'zpool_initialize_verify_checksums',
'zpool_initialize_verify_initialized']
@@ -468,19 +514,23 @@ tests = ['zpool_replace_001_neg', 'replace-o_ashift', 'replace_prop_ashift']
tags = ['functional', 'cli_root', 'zpool_replace']
[tests/functional/cli_root/zpool_resilver]
-tests = ['zpool_resilver_bad_args', 'zpool_resilver_restart']
+tests = ['zpool_resilver_bad_args', 'zpool_resilver_restart',
+ 'zpool_resilver_concurrent']
tags = ['functional', 'cli_root', 'zpool_resilver']
[tests/functional/cli_root/zpool_scrub]
tests = ['zpool_scrub_001_neg', 'zpool_scrub_002_pos', 'zpool_scrub_003_pos',
'zpool_scrub_004_pos', 'zpool_scrub_005_pos',
'zpool_scrub_encrypted_unloaded', 'zpool_scrub_print_repairing',
- 'zpool_scrub_offline_device', 'zpool_scrub_multiple_copies']
+ 'zpool_scrub_offline_device', 'zpool_scrub_multiple_copies',
+ 'zpool_error_scrub_001_pos', 'zpool_error_scrub_002_pos',
+ 'zpool_error_scrub_003_pos', 'zpool_error_scrub_004_pos']
tags = ['functional', 'cli_root', 'zpool_scrub']
[tests/functional/cli_root/zpool_set]
tests = ['zpool_set_001_pos', 'zpool_set_002_neg', 'zpool_set_003_neg',
- 'zpool_set_ashift', 'zpool_set_features']
+ 'zpool_set_ashift', 'zpool_set_features', 'vdev_set_001_pos',
+ 'user_property_001_pos', 'user_property_002_neg']
tags = ['functional', 'cli_root', 'zpool_set']
[tests/functional/cli_root/zpool_split]
@@ -493,6 +543,8 @@ tags = ['functional', 'cli_root', 'zpool_split']
[tests/functional/cli_root/zpool_status]
tests = ['zpool_status_001_pos', 'zpool_status_002_pos',
'zpool_status_003_pos', 'zpool_status_004_pos',
+ 'zpool_status_005_pos', 'zpool_status_006_pos',
+ 'zpool_status_007_pos', 'zpool_status_008_pos',
'zpool_status_features_001_pos']
tags = ['functional', 'cli_root', 'zpool_status']
@@ -550,7 +602,8 @@ tests = ['zdb_001_neg', 'zfs_001_neg', 'zfs_allow_001_neg',
'zpool_offline_001_neg', 'zpool_online_001_neg', 'zpool_remove_001_neg',
'zpool_replace_001_neg', 'zpool_scrub_001_neg', 'zpool_set_001_neg',
'zpool_status_001_neg', 'zpool_upgrade_001_neg', 'arcstat_001_pos',
- 'arc_summary_001_pos', 'arc_summary_002_neg', 'zpool_wait_privilege']
+ 'arc_summary_001_pos', 'arc_summary_002_neg', 'zpool_wait_privilege',
+ 'zilstat_001_pos']
user =
tags = ['functional', 'cli_user', 'misc']
@@ -587,9 +640,13 @@ tests = ['compress_001_pos', 'compress_002_pos', 'compress_003_pos',
tags = ['functional', 'compression']
[tests/functional/cp_files]
-tests = ['cp_files_001_pos']
+tests = ['cp_files_001_pos', 'cp_files_002_pos', 'cp_stress']
tags = ['functional', 'cp_files']
+[tests/functional/zap_shrink]
+tests = ['zap_shrink_001_pos']
+tags = ['functional', 'zap_shrink']
+
[tests/functional/crtime]
tests = ['crtime_001_pos' ]
tags = ['functional', 'crtime']
@@ -685,7 +742,8 @@ tests = ['migration_001_pos', 'migration_002_pos', 'migration_003_pos',
tags = ['functional', 'migration']
[tests/functional/mmap]
-tests = ['mmap_write_001_pos', 'mmap_read_001_pos', 'mmap_seek_001_pos', 'mmap_sync_001_pos']
+tests = ['mmap_mixed', 'mmap_read_001_pos', 'mmap_seek_001_pos',
+ 'mmap_sync_001_pos', 'mmap_write_001_pos']
tags = ['functional', 'mmap']
[tests/functional/mount]
@@ -702,7 +760,7 @@ tags = ['functional', 'nestedfs']
[tests/functional/no_space]
tests = ['enospc_001_pos', 'enospc_002_pos', 'enospc_003_pos',
- 'enospc_df', 'enospc_rm']
+ 'enospc_df', 'enospc_ganging', 'enospc_rm']
tags = ['functional', 'no_space']
[tests/functional/nopwrite]
@@ -758,8 +816,12 @@ tests = ['redacted_compressed', 'redacted_contents', 'redacted_deleted',
tags = ['functional', 'redacted_send']
[tests/functional/raidz]
-tests = ['raidz_001_neg', 'raidz_002_pos', 'raidz_003_pos', 'raidz_004_pos']
+tests = ['raidz_001_neg', 'raidz_002_pos', 'raidz_expand_001_pos',
+ 'raidz_expand_002_pos', 'raidz_expand_003_neg', 'raidz_expand_003_pos',
+ 'raidz_expand_004_pos', 'raidz_expand_005_pos', 'raidz_expand_006_neg',
+ 'raidz_expand_007_neg']
tags = ['functional', 'raidz']
+timeout = 1200
[tests/functional/redundancy]
tests = ['redundancy_draid', 'redundancy_draid1', 'redundancy_draid2',
@@ -790,13 +852,13 @@ tests = ['removal_all_vdev', 'removal_cancel', 'removal_check_space',
'removal_nopwrite', 'removal_remap_deadlists',
'removal_resume_export', 'removal_sanity', 'removal_with_add',
'removal_with_create_fs', 'removal_with_dedup',
- 'removal_with_errors', 'removal_with_export',
+ 'removal_with_errors', 'removal_with_export', 'removal_with_indirect',
'removal_with_ganging', 'removal_with_faulted',
'removal_with_remove', 'removal_with_scrub', 'removal_with_send',
'removal_with_send_recv', 'removal_with_snapshot',
'removal_with_write', 'removal_with_zdb', 'remove_expanded',
'remove_mirror', 'remove_mirror_sanity', 'remove_raidz',
- 'remove_indirect', 'remove_attach_mirror']
+ 'remove_indirect', 'remove_attach_mirror', 'removal_reservation']
tags = ['functional', 'removal']
[tests/functional/rename_dirs]
@@ -834,18 +896,20 @@ tests = ['recv_dedup', 'recv_dedup_encrypted_zvol', 'rsend_001_pos',
'rsend_014_pos', 'rsend_016_neg', 'rsend_019_pos', 'rsend_020_pos',
'rsend_021_pos', 'rsend_022_pos', 'rsend_024_pos', 'rsend_025_pos',
'rsend_026_neg', 'rsend_027_pos', 'rsend_028_neg', 'rsend_029_neg',
- 'send-c_verify_ratio', 'send-c_verify_contents', 'send-c_props',
- 'send-c_incremental', 'send-c_volume', 'send-c_zstreamdump',
+ 'rsend_030_pos', 'rsend_031_pos', 'send-c_verify_ratio',
+ 'send-c_verify_contents', 'send-c_props', 'send-c_incremental',
+ 'send-c_volume', 'send-c_zstream_recompress', 'send-c_zstreamdump',
'send-c_lz4_disabled', 'send-c_recv_lz4_disabled',
'send-c_mixed_compression', 'send-c_stream_size_estimate',
'send-c_embedded_blocks', 'send-c_resume', 'send-cpL_varied_recsize',
- 'send-c_recv_dedup', 'send-L_toggle', 'send_encrypted_hierarchy',
+ 'send-c_recv_dedup', 'send-L_toggle', 'send_encrypted_incremental',
+ 'send_encrypted_freeobjects', 'send_encrypted_hierarchy',
'send_encrypted_props', 'send_encrypted_truncated_files',
- 'send_freeobjects', 'send_realloc_files',
- 'send_realloc_encrypted_files', 'send_spill_block', 'send_holds',
- 'send_hole_birth', 'send_mixed_raw', 'send-wR_encrypted_zvol',
- 'send_partial_dataset', 'send_invalid', 'send_doall',
- 'send_raw_spill_block', 'send_raw_ashift']
+ 'send_freeobjects', 'send_realloc_files', 'send_realloc_encrypted_files',
+ 'send_spill_block', 'send_holds', 'send_hole_birth', 'send_mixed_raw',
+ 'send-wR_encrypted_zvol', 'send_partial_dataset', 'send_invalid',
+ 'send_doall', 'send_raw_spill_block', 'send_raw_ashift',
+ 'send_raw_large_blocks']
tags = ['functional', 'rsend']
[tests/functional/scrub_mirror]
@@ -868,7 +932,7 @@ tests = ['clone_001_pos', 'rollback_001_pos', 'rollback_002_pos',
'snapshot_006_pos', 'snapshot_007_pos', 'snapshot_008_pos',
'snapshot_009_pos', 'snapshot_010_pos', 'snapshot_011_pos',
'snapshot_012_pos', 'snapshot_013_pos', 'snapshot_014_pos',
- 'snapshot_017_pos']
+ 'snapshot_017_pos', 'snapshot_018_pos']
tags = ['functional', 'snapshot']
[tests/functional/snapused]
@@ -909,9 +973,15 @@ tests = [
'userquota_007_pos', 'userquota_008_pos', 'userquota_009_pos',
'userquota_010_pos', 'userquota_011_pos', 'userquota_012_neg',
'userspace_001_pos', 'userspace_002_pos', 'userspace_encrypted',
- 'userspace_send_encrypted']
+ 'userspace_send_encrypted', 'userspace_encrypted_13709']
tags = ['functional', 'userquota']
+[tests/functional/vdev_disk:Linux]
+pre =
+post =
+tests = ['page_alignment']
+tags = ['functional', 'vdev_disk']
+
[tests/functional/vdev_zaps]
tests = ['vdev_zaps_001_pos', 'vdev_zaps_002_pos', 'vdev_zaps_003_pos',
'vdev_zaps_004_pos', 'vdev_zaps_005_pos', 'vdev_zaps_006_pos',
diff --git a/tests/runfiles/freebsd.run b/tests/runfiles/freebsd.run
index c7ca1d769fc3..13696d645850 100644
--- a/tests/runfiles/freebsd.run
+++ b/tests/runfiles/freebsd.run
@@ -25,3 +25,8 @@ tags = ['functional']
[tests/functional/cli_root/zfs_jail:FreeBSD]
tests = ['zfs_jail_001_pos']
tags = ['functional', 'cli_root', 'zfs_jail']
+
+[tests/functional/pam:FreeBSD]
+tests = ['pam_basic', 'pam_change_unmounted', 'pam_nounmount', 'pam_recursive',
+ 'pam_short_password']
+tags = ['functional', 'pam']
diff --git a/tests/runfiles/linux.run b/tests/runfiles/linux.run
index 9b32e73afb1e..92ce09ec6fcb 100644
--- a/tests/runfiles/linux.run
+++ b/tests/runfiles/linux.run
@@ -34,6 +34,12 @@ tags = ['functional', 'acl', 'posix-sa']
tests = ['atime_003_pos', 'root_relatime_on']
tags = ['functional', 'atime']
+[tests/functional/block_cloning:Linux]
+tests = ['block_cloning_ficlone', 'block_cloning_ficlonerange',
+ 'block_cloning_ficlonerange_partial', 'block_cloning_disabled_ficlone',
+ 'block_cloning_disabled_ficlonerange']
+tags = ['functional', 'block_cloning']
+
[tests/functional/chattr:Linux]
tests = ['chattr_001_pos', 'chattr_002_neg']
tags = ['functional', 'chattr']
@@ -52,6 +58,10 @@ tests = ['zfs_share_005_pos', 'zfs_share_007_neg', 'zfs_share_009_neg',
'zfs_share_012_pos', 'zfs_share_013_pos']
tags = ['functional', 'cli_root', 'zfs_share']
+[tests/functional/cli_root/zfs_unshare:Linux]
+tests = ['zfs_unshare_008_pos']
+tags = ['functional', 'cli_root', 'zfs_unshare']
+
[tests/functional/cli_root/zfs_sysfs:Linux]
tests = ['zfeature_set_unsupported', 'zfs_get_unsupported',
'zfs_set_unsupported', 'zfs_sysfs_live', 'zpool_get_unsupported',
@@ -67,6 +77,13 @@ tests = ['zpool_expand_001_pos', 'zpool_expand_002_pos',
'zpool_expand_003_neg', 'zpool_expand_004_pos', 'zpool_expand_005_pos']
tags = ['functional', 'cli_root', 'zpool_expand']
+[tests/functional/cli_root/zpool_import:Linux]
+tests = ['zpool_import_hostid_changed',
+ 'zpool_import_hostid_changed_unclean_export',
+ 'zpool_import_hostid_changed_cachefile',
+ 'zpool_import_hostid_changed_cachefile_unclean_export']
+tags = ['functional', 'cli_root', 'zpool_import']
+
[tests/functional/cli_root/zpool_reopen:Linux]
tests = ['zpool_reopen_001_pos', 'zpool_reopen_002_pos',
'zpool_reopen_003_pos', 'zpool_reopen_004_pos', 'zpool_reopen_005_pos',
@@ -86,19 +103,25 @@ tests = ['devices_001_pos', 'devices_002_neg', 'devices_003_pos']
tags = ['functional', 'devices']
[tests/functional/events:Linux]
-tests = ['events_001_pos', 'events_002_pos', 'zed_rc_filter', 'zed_fd_spill']
+tests = ['events_001_pos', 'events_002_pos', 'zed_rc_filter', 'zed_fd_spill',
+ 'zed_cksum_reported', 'zed_cksum_config', 'zed_io_config',
+ 'zed_slow_io', 'zed_slow_io_many_vdevs']
tags = ['functional', 'events']
+[tests/functional/fadvise:Linux]
+tests = ['fadvise_sequential']
+tags = ['functional', 'fadvise']
+
[tests/functional/fallocate:Linux]
tests = ['fallocate_prealloc', 'fallocate_zero-range']
tags = ['functional', 'fallocate']
[tests/functional/fault:Linux]
tests = ['auto_offline_001_pos', 'auto_online_001_pos', 'auto_online_002_pos',
- 'auto_replace_001_pos', 'auto_spare_001_pos', 'auto_spare_002_pos',
- 'auto_spare_multiple', 'auto_spare_ashift', 'auto_spare_shared',
- 'decrypt_fault', 'decompress_fault', 'scrub_after_resilver',
- 'zpool_status_-s']
+ 'auto_replace_001_pos', 'auto_replace_002_pos', 'auto_spare_001_pos',
+ 'auto_spare_002_pos', 'auto_spare_multiple', 'auto_spare_ashift',
+ 'auto_spare_shared', 'decrypt_fault', 'decompress_fault',
+ 'scrub_after_resilver', 'zpool_status_-s']
tags = ['functional', 'fault']
[tests/functional/features/large_dnode:Linux]
@@ -116,14 +139,14 @@ post =
tags = ['functional', 'largest_pool']
[tests/functional/mmap:Linux]
-tests = ['mmap_libaio_001_pos']
+tests = ['mmap_libaio_001_pos', 'mmap_sync_001_pos']
tags = ['functional', 'mmap']
[tests/functional/mmp:Linux]
tests = ['mmp_on_thread', 'mmp_on_uberblocks', 'mmp_on_off', 'mmp_interval',
'mmp_active_import', 'mmp_inactive_import', 'mmp_exported_import',
'mmp_write_uberblocks', 'mmp_reset_interval', 'multihost_history',
- 'mmp_on_zdb', 'mmp_write_distribution', 'mmp_hostid']
+ 'mmp_on_zdb', 'mmp_write_distribution', 'mmp_hostid', 'mmp_write_slow_disk']
tags = ['functional', 'mmp']
[tests/functional/mount:Linux]
@@ -131,7 +154,8 @@ tests = ['umount_unlinked_drain']
tags = ['functional', 'mount']
[tests/functional/pam:Linux]
-tests = ['pam_basic', 'pam_nounmount', 'pam_short_password']
+tests = ['pam_basic', 'pam_change_unmounted', 'pam_nounmount', 'pam_recursive',
+ 'pam_short_password']
tags = ['functional', 'pam']
[tests/functional/procfs:Linux]
@@ -153,6 +177,10 @@ tags = ['functional', 'projectquota']
tests = ['read_dos_attrs_001', 'write_dos_attrs_001']
tags = ['functional', 'dos_attributes']
+[tests/functional/renameat2:Linux]
+tests = ['renameat2_noreplace', 'renameat2_exchange', 'renameat2_whiteout']
+tags = ['functional', 'renameat2']
+
[tests/functional/rsend:Linux]
tests = ['send_realloc_dnode_size', 'send_encrypted_files']
tags = ['functional', 'rsend']
@@ -190,3 +218,7 @@ tags = ['functional', 'userquota']
tests = ['zvol_misc_fua']
tags = ['functional', 'zvol', 'zvol_misc']
+[tests/functional/idmap_mount:Linux]
+tests = ['idmap_mount_001', 'idmap_mount_002', 'idmap_mount_003',
+ 'idmap_mount_004', 'idmap_mount_005']
+tags = ['functional', 'idmap_mount']
diff --git a/tests/runfiles/sanity.run b/tests/runfiles/sanity.run
index f5dcfa5be4b7..d6a791e3375d 100644
--- a/tests/runfiles/sanity.run
+++ b/tests/runfiles/sanity.run
@@ -155,7 +155,8 @@ tests = ['zfs_mount_001_pos', 'zfs_mount_002_pos', 'zfs_mount_003_pos',
'zfs_mount_004_pos', 'zfs_mount_005_pos', 'zfs_mount_007_pos',
'zfs_mount_009_neg', 'zfs_mount_010_neg', 'zfs_mount_011_neg',
'zfs_mount_012_pos', 'zfs_mount_encrypted', 'zfs_mount_remount',
- 'zfs_mount_all_fail', 'zfs_mount_all_mountpoints', 'zfs_mount_test_race']
+ 'zfs_mount_all_fail', 'zfs_mount_all_mountpoints',
+ 'zfs_mount_test_race', 'zfs_mount_recursive']
tags = ['functional', 'cli_root', 'zfs_mount']
[tests/functional/cli_root/zfs_program]
@@ -212,7 +213,7 @@ tests = ['cache_001_pos', 'cache_002_neg', 'canmount_001_pos',
'user_property_001_pos', 'user_property_003_neg', 'readonly_001_pos',
'user_property_004_pos', 'version_001_neg',
'zfs_set_003_neg', 'property_alias_001_pos',
- 'zfs_set_keylocation', 'zfs_set_feature_activation']
+ 'zfs_set_keylocation', 'zfs_set_feature_activation', 'zfs_set_nomount']
tags = ['functional', 'cli_root', 'zfs_set']
[tests/functional/cli_root/zfs_snapshot]
@@ -396,7 +397,8 @@ tests = ['zdb_001_neg', 'zfs_001_neg', 'zfs_allow_001_neg',
'zpool_history_001_neg', 'zpool_offline_001_neg', 'zpool_online_001_neg',
'zpool_remove_001_neg', 'zpool_scrub_001_neg', 'zpool_set_001_neg',
'zpool_status_001_neg', 'zpool_upgrade_001_neg', 'arcstat_001_pos',
- 'arc_summary_001_pos', 'arc_summary_002_neg', 'zpool_wait_privilege']
+ 'arc_summary_001_pos', 'arc_summary_002_neg', 'zpool_wait_privilege',
+ 'zilstat_001_pos']
user =
tags = ['functional', 'cli_user', 'misc']
@@ -549,6 +551,7 @@ tests = ['recv_dedup', 'recv_dedup_encrypted_zvol', 'rsend_001_pos',
'rsend_014_pos', 'rsend_016_neg', 'send-c_verify_contents',
'send-c_volume', 'send-c_zstreamdump', 'send-c_recv_dedup',
'send-L_toggle', 'send_encrypted_hierarchy', 'send_encrypted_props',
+ 'send_encrypted_freeobjects',
'send_encrypted_truncated_files', 'send_freeobjects', 'send_holds',
'send_mixed_raw', 'send-wR_encrypted_zvol', 'send_partial_dataset',
'send_invalid']
@@ -568,7 +571,8 @@ tests = ['clone_001_pos', 'rollback_001_pos', 'rollback_002_pos',
'snapshot_004_pos', 'snapshot_005_pos', 'snapshot_006_pos',
'snapshot_007_pos', 'snapshot_008_pos', 'snapshot_009_pos',
'snapshot_010_pos', 'snapshot_011_pos', 'snapshot_012_pos',
- 'snapshot_013_pos', 'snapshot_014_pos', 'snapshot_017_pos']
+ 'snapshot_013_pos', 'snapshot_014_pos', 'snapshot_017_pos',
+ 'snapshot_018_pos']
tags = ['functional', 'snapshot']
[tests/functional/snapused]
@@ -596,6 +600,12 @@ tags = ['functional', 'truncate']
tests = ['upgrade_userobj_001_pos', 'upgrade_readonly_pool']
tags = ['functional', 'upgrade']
+[tests/functional/vdev_disk:Linux]
+pre =
+post =
+tests = ['page_alignment']
+tags = ['functional', 'vdev_disk']
+
[tests/functional/vdev_zaps]
tests = ['vdev_zaps_001_pos', 'vdev_zaps_003_pos', 'vdev_zaps_004_pos',
'vdev_zaps_005_pos', 'vdev_zaps_006_pos']
@@ -622,3 +632,9 @@ tags = ['functional', 'zvol', 'zvol_swap']
[tests/functional/zpool_influxdb]
tests = ['zpool_influxdb']
tags = ['functional', 'zpool_influxdb']
+
+[tests/functional/pyzfs]
+tests = ['pyzfs_unittest']
+pre =
+post =
+tags = ['functional', 'pyzfs']
diff --git a/tests/test-runner/bin/test-runner.py.in b/tests/test-runner/bin/test-runner.py.in
index cb453b266f3c..65247f4f06fc 100755
--- a/tests/test-runner/bin/test-runner.py.in
+++ b/tests/test-runner/bin/test-runner.py.in
@@ -47,25 +47,25 @@ LOG_OUT = 'LOG_OUT'
LOG_ERR = 'LOG_ERR'
LOG_FILE_OBJ = None
+try:
+ from time import monotonic as monotonic_time
+except ImportError:
+ class timespec(ctypes.Structure):
+ _fields_ = [
+ ('tv_sec', ctypes.c_long),
+ ('tv_nsec', ctypes.c_long)
+ ]
-class timespec(ctypes.Structure):
- _fields_ = [
- ('tv_sec', ctypes.c_long),
- ('tv_nsec', ctypes.c_long)
- ]
-
-
-librt = ctypes.CDLL('librt.so.1', use_errno=True)
-clock_gettime = librt.clock_gettime
-clock_gettime.argtypes = [ctypes.c_int, ctypes.POINTER(timespec)]
-
+ librt = ctypes.CDLL('librt.so.1', use_errno=True)
+ clock_gettime = librt.clock_gettime
+ clock_gettime.argtypes = [ctypes.c_int, ctypes.POINTER(timespec)]
-def monotonic_time():
- t = timespec()
- if clock_gettime(CLOCK_MONOTONIC, ctypes.pointer(t)) != 0:
- errno_ = ctypes.get_errno()
- raise OSError(errno_, os.strerror(errno_))
- return t.tv_sec + t.tv_nsec * 1e-9
+ def monotonic_time():
+ t = timespec()
+ if clock_gettime(CLOCK_MONOTONIC, ctypes.pointer(t)) != 0:
+ errno_ = ctypes.get_errno()
+ raise OSError(errno_, os.strerror(errno_))
+ return t.tv_sec + t.tv_nsec * 1e-9
class Result(object):
@@ -113,8 +113,9 @@ class Output(object):
This class is a slightly modified version of the 'Stream' class found
here: http://goo.gl/aSGfv
"""
- def __init__(self, stream):
+ def __init__(self, stream, debug=False):
self.stream = stream
+ self.debug = debug
self._buf = b''
self.lines = []
@@ -140,6 +141,8 @@ class Output(object):
buf = os.read(fd, 4096)
if not buf:
return None
+ if self.debug:
+ os.write(sys.stderr.fileno(), buf)
if b'\n' not in buf:
self._buf += buf
return []
@@ -181,7 +184,7 @@ Timeout: %d
User: %s
''' % (self.pathname, self.identifier, self.outputdir, self.timeout, self.user)
- def kill_cmd(self, proc, keyboard_interrupt=False):
+ def kill_cmd(self, proc, options, kmemleak, keyboard_interrupt=False):
"""
Kill a running command due to timeout, or ^C from the keyboard. If
sudo is required, this user was verified previously.
@@ -211,7 +214,7 @@ User: %s
if int(self.timeout) > runtime:
self.killed = False
self.reran = False
- self.run(False)
+ self.run(options, dryrun=False, kmemleak=kmemleak)
self.reran = True
def update_cmd_privs(self, cmd, user):
@@ -238,14 +241,14 @@ User: %s
ret = '%s -E -u %s %s' % (SUDO, user, cmd)
return ret.split(' ')
- def collect_output(self, proc):
+ def collect_output(self, proc, debug=False):
"""
Read from stdout/stderr as data becomes available, until the
process is no longer running. Return the lines from the stdout and
stderr Output objects.
"""
- out = Output(proc.stdout)
- err = Output(proc.stderr)
+ out = Output(proc.stdout, debug)
+ err = Output(proc.stderr, debug)
res = []
while proc.returncode is None:
proc.poll()
@@ -257,15 +260,19 @@ User: %s
return out.lines, err.lines
- def run(self, dryrun, kmemleak, kmsg):
+ def run(self, options, dryrun=None, kmemleak=None):
"""
This is the main function that runs each individual test.
Determine whether or not the command requires sudo, and modify it
if needed. Run the command, and update the result object.
"""
+ if dryrun is None:
+ dryrun = options.dryrun
if dryrun is True:
print(self)
return
+ if kmemleak is None:
+ kmemleak = options.kmemleak
privcmd = self.update_cmd_privs(self.pathname, self.user)
try:
@@ -280,7 +287,7 @@ User: %s
Log each test we run to /dev/kmsg (on Linux), so if there's a kernel
warning we'll be able to match it up to a particular test.
"""
- if kmsg is True and exists("/dev/kmsg"):
+ if options.kmsg is True and exists("/dev/kmsg"):
try:
kp = Popen([SUDO, "sh", "-c",
f"echo ZTS run {self.pathname} > /dev/kmsg"])
@@ -297,12 +304,17 @@ User: %s
proc = Popen(privcmd, stdout=PIPE, stderr=PIPE)
# Allow a special timeout value of 0 to mean infinity
if int(self.timeout) == 0:
- self.timeout = sys.maxsize
- t = Timer(int(self.timeout), self.kill_cmd, [proc])
+ self.timeout = sys.maxsize / (10 ** 9)
+ t = Timer(
+ int(self.timeout), self.kill_cmd, [proc, options, kmemleak]
+ )
try:
t.start()
- self.result.stdout, self.result.stderr = self.collect_output(proc)
+
+ out, err = self.collect_output(proc, options.debug)
+ self.result.stdout = out
+ self.result.stderr = err
if kmemleak:
cmd = f'{SUDO} sh -c "echo scan > {KMEMLEAK_FILE}"'
@@ -310,7 +322,7 @@ User: %s
cmd = f'{SUDO} cat {KMEMLEAK_FILE}'
self.result.kmemleak = check_output(cmd, shell=True)
except KeyboardInterrupt:
- self.kill_cmd(proc, True)
+ self.kill_cmd(proc, options, kmemleak, True)
fail('\nRun terminated at user request.')
finally:
t.cancel()
@@ -450,7 +462,7 @@ Tags: %s
return True
- def run(self, options):
+ def run(self, options, dryrun=None, kmemleak=None):
"""
Create Cmd instances for the pre/post/failsafe scripts. If the pre
script doesn't pass, skip this Test. Run the post script regardless.
@@ -472,14 +484,14 @@ Tags: %s
cont = True
if len(pretest.pathname):
- pretest.run(options.dryrun, False, options.kmsg)
+ pretest.run(options, kmemleak=False)
cont = pretest.result.result == 'PASS'
pretest.log(options)
if cont:
- test.run(options.dryrun, options.kmemleak, options.kmsg)
+ test.run(options, kmemleak=kmemleak)
if test.result.result == 'KILLED' and len(failsafe.pathname):
- failsafe.run(options.dryrun, False, options.kmsg)
+ failsafe.run(options, kmemleak=False)
failsafe.log(options, suppress_console=True)
else:
test.skip()
@@ -487,7 +499,7 @@ Tags: %s
test.log(options)
if len(posttest.pathname):
- posttest.run(options.dryrun, False, options.kmsg)
+ posttest.run(options, kmemleak=False)
posttest.log(options)
@@ -571,7 +583,7 @@ Tags: %s
return len(self.tests) != 0
- def run(self, options):
+ def run(self, options, dryrun=None, kmemleak=None):
"""
Create Cmd instances for the pre/post/failsafe scripts. If the pre
script doesn't pass, skip all the tests in this TestGroup. Run the
@@ -590,7 +602,7 @@ Tags: %s
cont = True
if len(pretest.pathname):
- pretest.run(options.dryrun, False, options.kmsg)
+ pretest.run(options, dryrun=dryrun, kmemleak=False)
cont = pretest.result.result == 'PASS'
pretest.log(options)
@@ -603,9 +615,9 @@ Tags: %s
failsafe = Cmd(self.failsafe, outputdir=odir, timeout=self.timeout,
user=self.failsafe_user, identifier=self.identifier)
if cont:
- test.run(options.dryrun, options.kmemleak, options.kmsg)
+ test.run(options, dryrun=dryrun, kmemleak=kmemleak)
if test.result.result == 'KILLED' and len(failsafe.pathname):
- failsafe.run(options.dryrun, False, options.kmsg)
+ failsafe.run(options, dryrun=dryrun, kmemleak=False)
failsafe.log(options, suppress_console=True)
else:
test.skip()
@@ -613,12 +625,12 @@ Tags: %s
test.log(options)
if len(posttest.pathname):
- posttest.run(options.dryrun, False, options.kmsg)
+ posttest.run(options, dryrun=dryrun, kmemleak=False)
posttest.log(options)
class TestRun(object):
- props = ['quiet', 'outputdir']
+ props = ['quiet', 'outputdir', 'debug']
def __init__(self, options):
self.tests = {}
@@ -638,7 +650,8 @@ class TestRun(object):
('post_user', ''),
('failsafe', ''),
('failsafe_user', ''),
- ('tags', [])
+ ('tags', []),
+ ('debug', False)
]
def __str__(self):
@@ -1061,6 +1074,8 @@ def parse_args():
help='Specify tests to run via config files.')
parser.add_option('-d', action='store_true', default=False, dest='dryrun',
help='Dry run. Print tests, but take no other action.')
+ parser.add_option('-D', action='store_true', default=False, dest='debug',
+ help='Write all test output to stdout as it arrives.')
parser.add_option('-l', action='callback', callback=options_cb,
default=None, dest='logfile', metavar='logfile',
type='string',
diff --git a/tests/test-runner/bin/zts-report.py.in b/tests/test-runner/bin/zts-report.py.in
index bf7cf22b61fc..ecc50f487152 100755
--- a/tests/test-runner/bin/zts-report.py.in
+++ b/tests/test-runner/bin/zts-report.py.in
@@ -62,12 +62,9 @@ known_reason = 'Known issue'
exec_reason = 'Test user execute permissions required for utilities'
#
-# Some tests require a minimum python version of 3.6 and will be skipped when
-# the default system version is too old. There may also be tests which require
-# additional python modules be installed, for example python3-cffi is required
-# by the pyzfs tests.
+# Some tests require that the kernel supports renameat2 syscall.
#
-python_deps_reason = 'Python modules missing: python3-cffi'
+renameat2_reason = 'Kernel renameat2 support required'
#
# Some tests require the O_TMPFILE flag which was first introduced in the
@@ -132,6 +129,20 @@ na_reason = "Not applicable"
#
ci_reason = 'CI runner doesn\'t have all requirements'
+#
+# Idmapped mount is only supported in kernel version >= 5.12
+#
+idmap_reason = 'Idmapped mount needs kernel 5.12+'
+
+#
+# copy_file_range() is not supported by all kernels
+#
+cfr_reason = 'Kernel copy_file_range support required'
+
+if sys.platform.startswith('freebsd'):
+ cfr_cross_reason = 'copy_file_range(2) cross-filesystem needs FreeBSD 14+'
+else:
+ cfr_cross_reason = 'copy_file_range(2) cross-filesystem needs kernel 5.3+'
#
# These tests are known to fail, thus we use this list to prevent these
@@ -151,6 +162,7 @@ known = {
['FAIL', rewind_reason],
'cli_user/misc/zfs_share_001_neg': ['SKIP', na_reason],
'cli_user/misc/zfs_unshare_001_neg': ['SKIP', na_reason],
+ 'pool_checkpoint/checkpoint_discard_busy': ['SKIP', 12053],
'privilege/setup': ['SKIP', na_reason],
'refreserv/refreserv_004_pos': ['FAIL', known_reason],
'rootpool/setup': ['SKIP', na_reason],
@@ -162,13 +174,17 @@ if sys.platform.startswith('freebsd'):
known.update({
'cli_root/zfs_receive/receive-o-x_props_override':
['FAIL', known_reason],
+ 'cli_root/zpool_resilver/zpool_resilver_concurrent':
+ ['SKIP', na_reason],
'cli_root/zpool_wait/zpool_wait_trim_basic': ['SKIP', trim_reason],
'cli_root/zpool_wait/zpool_wait_trim_cancel': ['SKIP', trim_reason],
'cli_root/zpool_wait/zpool_wait_trim_flag': ['SKIP', trim_reason],
'cli_root/zfs_unshare/zfs_unshare_008_pos': ['SKIP', na_reason],
+ 'cp_files/cp_files_002_pos': ['SKIP', na_reason],
'link_count/link_count_001': ['SKIP', na_reason],
'casenorm/mixed_create_failure': ['FAIL', 13215],
'mmap/mmap_sync_001_pos': ['SKIP', na_reason],
+ 'rsend/send_raw_ashift': ['SKIP', 14961],
})
elif sys.platform.startswith('linux'):
known.update({
@@ -193,6 +209,7 @@ elif sys.platform.startswith('linux'):
# reasons listed above can be used.
#
maybe = {
+ 'append/threadsappend_001_pos': ['FAIL', 6136],
'chattr/setup': ['SKIP', exec_reason],
'crtime/crtime_001_pos': ['SKIP', statx_reason],
'cli_root/zdb/zdb_006_pos': ['FAIL', known_reason],
@@ -202,6 +219,7 @@ maybe = {
'cli_root/zfs_get/zfs_get_009_pos': ['SKIP', 5479],
'cli_root/zfs_rollback/zfs_rollback_001_pos': ['FAIL', known_reason],
'cli_root/zfs_rollback/zfs_rollback_002_pos': ['FAIL', known_reason],
+ 'cli_root/zfs_share/zfs_share_concurrent_shares': ['FAIL', known_reason],
'cli_root/zfs_snapshot/zfs_snapshot_002_neg': ['FAIL', known_reason],
'cli_root/zfs_unshare/zfs_unshare_006_pos': ['SKIP', na_reason],
'cli_root/zpool_add/zpool_add_004_pos': ['FAIL', known_reason],
@@ -223,10 +241,11 @@ maybe = {
'io/mmap': ['SKIP', fio_reason],
'largest_pool/largest_pool_001_pos': ['FAIL', known_reason],
'mmp/mmp_on_uberblocks': ['FAIL', known_reason],
- 'pyzfs/pyzfs_unittest': ['SKIP', python_deps_reason],
+ 'pam/setup': ['SKIP', "pamtester might be not available"],
'pool_checkpoint/checkpoint_discard_busy': ['FAIL', 11946],
'projectquota/setup': ['SKIP', exec_reason],
'removal/removal_condense_export': ['FAIL', known_reason],
+ 'renameat2/setup': ['SKIP', renameat2_reason],
'reservation/reservation_008_pos': ['FAIL', 7741],
'reservation/reservation_018_pos': ['FAIL', 5642],
'snapshot/clone_001_pos': ['FAIL', known_reason],
@@ -234,45 +253,110 @@ maybe = {
'snapshot/snapshot_010_pos': ['FAIL', 7961],
'snapused/snapused_004_pos': ['FAIL', 5513],
'tmpfile/setup': ['SKIP', tmpfile_reason],
- 'append/threadsappend_001_pos': ['FAIL', 6136],
'trim/setup': ['SKIP', trim_reason],
'upgrade/upgrade_projectquota_001_pos': ['SKIP', project_id_reason],
'user_namespace/setup': ['SKIP', user_ns_reason],
'userquota/setup': ['SKIP', exec_reason],
+ 'vdev_zaps/vdev_zaps_004_pos': ['FAIL', known_reason],
'zvol/zvol_ENOSPC/zvol_ENOSPC_001_pos': ['FAIL', 5848],
- 'pam/setup': ['SKIP', "pamtester might be not available"],
}
if sys.platform.startswith('freebsd'):
maybe.update({
'cli_root/zfs_copies/zfs_copies_002_pos': ['FAIL', known_reason],
'cli_root/zfs_inherit/zfs_inherit_001_neg': ['FAIL', known_reason],
- 'cli_root/zfs_share/zfs_share_concurrent_shares':
- ['FAIL', known_reason],
'cli_root/zpool_import/zpool_import_012_pos': ['FAIL', known_reason],
'delegate/zfs_allow_003_pos': ['FAIL', known_reason],
'inheritance/inherit_001_pos': ['FAIL', 11829],
- 'resilver/resilver_restart_001': ['FAIL', known_reason],
'pool_checkpoint/checkpoint_big_rewind': ['FAIL', 12622],
'pool_checkpoint/checkpoint_indirect': ['FAIL', 12623],
+ 'resilver/resilver_restart_001': ['FAIL', known_reason],
+ 'snapshot/snapshot_002_pos': ['FAIL', '14831'],
+ 'bclone/bclone_crossfs_corner_cases': ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_crossfs_corner_cases_limited':
+ ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_crossfs_data': ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_crossfs_embedded': ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_crossfs_hole': ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_diffprops_all': ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_diffprops_checksum': ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_diffprops_compress': ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_diffprops_copies': ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_diffprops_recordsize': ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_prop_sync': ['SKIP', cfr_cross_reason],
+ 'block_cloning/block_cloning_cross_enc_dataset':
+ ['SKIP', cfr_cross_reason],
+ 'block_cloning/block_cloning_copyfilerange_cross_dataset':
+ ['SKIP', cfr_cross_reason]
})
elif sys.platform.startswith('linux'):
maybe.update({
+ 'bclone/bclone_crossfs_corner_cases': ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_crossfs_corner_cases_limited':
+ ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_crossfs_data': ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_crossfs_embedded': ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_crossfs_hole': ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_diffprops_all': ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_diffprops_checksum': ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_diffprops_compress': ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_diffprops_copies': ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_diffprops_recordsize': ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_prop_sync': ['SKIP', cfr_cross_reason],
+ 'bclone/bclone_samefs_corner_cases': ['SKIP', cfr_reason],
+ 'bclone/bclone_samefs_corner_cases_limited': ['SKIP', cfr_reason],
+ 'bclone/bclone_samefs_data': ['SKIP', cfr_reason],
+ 'bclone/bclone_samefs_embedded': ['SKIP', cfr_reason],
+ 'bclone/bclone_samefs_hole': ['SKIP', cfr_reason],
+ 'block_cloning/block_cloning_clone_mmap_cached': ['SKIP', cfr_reason],
+ 'block_cloning/block_cloning_clone_mmap_write':
+ ['SKIP', cfr_reason],
+ 'block_cloning/block_cloning_copyfilerange':
+ ['SKIP', cfr_reason],
+ 'block_cloning/block_cloning_copyfilerange_cross_dataset':
+ ['SKIP', cfr_cross_reason],
+ 'block_cloning/block_cloning_copyfilerange_fallback':
+ ['SKIP', cfr_reason],
+ 'block_cloning/block_cloning_copyfilerange_fallback_same_txg':
+ ['SKIP', cfr_cross_reason],
+ 'block_cloning/block_cloning_copyfilerange_partial':
+ ['SKIP', cfr_reason],
+ 'block_cloning/block_cloning_cross_enc_dataset':
+ ['SKIP', cfr_cross_reason],
+ 'block_cloning/block_cloning_disabled_copyfilerange':
+ ['SKIP', cfr_reason],
+ 'block_cloning/block_cloning_lwb_buffer_overflow':
+ ['SKIP', cfr_reason],
+ 'block_cloning/block_cloning_replay':
+ ['SKIP', cfr_reason],
+ 'block_cloning/block_cloning_replay_encrypted':
+ ['SKIP', cfr_reason],
'cli_root/zfs_rename/zfs_rename_002_pos': ['FAIL', known_reason],
'cli_root/zpool_reopen/zpool_reopen_003_pos': ['FAIL', known_reason],
- 'fault/auto_spare_shared': ['FAIL', 11889],
+ 'cp_files/cp_files_002_pos': ['SKIP', cfr_reason],
+ 'fault/auto_online_002_pos': ['FAIL', 11889],
+ 'fault/auto_replace_001_pos': ['FAIL', 14851],
+ 'fault/auto_spare_002_pos': ['FAIL', 11889],
'fault/auto_spare_multiple': ['FAIL', 11889],
+ 'fault/auto_spare_shared': ['FAIL', 11889],
+ 'fault/decompress_fault': ['FAIL', 11889],
+ 'idmap_mount/idmap_mount_001': ['SKIP', idmap_reason],
+ 'idmap_mount/idmap_mount_002': ['SKIP', idmap_reason],
+ 'idmap_mount/idmap_mount_003': ['SKIP', idmap_reason],
+ 'idmap_mount/idmap_mount_004': ['SKIP', idmap_reason],
+ 'idmap_mount/idmap_mount_005': ['SKIP', idmap_reason],
'io/io_uring': ['SKIP', 'io_uring support required'],
'limits/filesystem_limit': ['SKIP', known_reason],
'limits/snapshot_limit': ['SKIP', known_reason],
'mmp/mmp_active_import': ['FAIL', known_reason],
'mmp/mmp_exported_import': ['FAIL', known_reason],
'mmp/mmp_inactive_import': ['FAIL', known_reason],
+ 'zvol/zvol_misc/zvol_misc_fua': ['SKIP', 14872],
'zvol/zvol_misc/zvol_misc_snapdev': ['FAIL', 12621],
+ 'zvol/zvol_misc/zvol_misc_trim': ['SKIP', 14872],
'zvol/zvol_misc/zvol_misc_volmode': ['FAIL', known_reason],
})
-
# Not all Github actions runners have scsi_debug module, so we may skip
# some tests which use it.
if os.environ.get('CI') == 'true':
@@ -293,6 +377,7 @@ if os.environ.get('CI') == 'true':
'fault/auto_online_001_pos': ['SKIP', ci_reason],
'fault/auto_online_002_pos': ['SKIP', ci_reason],
'fault/auto_replace_001_pos': ['SKIP', ci_reason],
+ 'fault/auto_replace_002_pos': ['SKIP', ci_reason],
'fault/auto_spare_ashift': ['SKIP', ci_reason],
'fault/auto_spare_shared': ['SKIP', ci_reason],
'procfs/pool_state': ['SKIP', ci_reason],
@@ -310,7 +395,7 @@ def process_results(pathname):
print('Error opening file:', e)
sys.exit(1)
- prefix = '/zfs-tests/tests/functional/'
+ prefix = '/zfs-tests/tests/(?:functional|perf/regression)/'
pattern = \
r'^Test(?:\s+\(\S+\))?:' + \
rf'\s*\S*{prefix}(\S+)' + \
diff --git a/tests/test-runner/include/logapi.shlib b/tests/test-runner/include/logapi.shlib
index 094e8cb21a33..8a9ca3e87caf 100644
--- a/tests/test-runner/include/logapi.shlib
+++ b/tests/test-runner/include/logapi.shlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/Makefile.am b/tests/zfs-tests/Makefile.am
index f8166352489e..40a361d582a2 100644
--- a/tests/zfs-tests/Makefile.am
+++ b/tests/zfs-tests/Makefile.am
@@ -13,6 +13,12 @@ scripts_zfs_tests_functional_hkdf_PROGRAMS = %D%/tests/functional/hkdf/hkdf_test
%C%_tests_functional_hkdf_hkdf_test_LDADD = \
libzpool.la
+scripts_zfs_tests_functional_vdev_diskdir = $(datadir)/$(PACKAGE)/zfs-tests/tests/functional/vdev_disk
+scripts_zfs_tests_functional_vdev_disk_PROGRAMS = %D%/tests/functional/vdev_disk/page_alignment
+
+scripts_zfs_tests_functional_cp_filesdir = $(datadir)/$(PACKAGE)/zfs-tests/tests/functional/cp_files
+scripts_zfs_tests_functional_cp_files_PROGRAMS = %D%/tests/functional/cp_files/seekflood
+
if BUILD_LINUX
scripts_zfs_tests_functional_tmpfiledir = $(datadir)/$(PACKAGE)/zfs-tests/tests/functional/tmpfile
scripts_zfs_tests_functional_tmpfile_PROGRAMS = \
diff --git a/tests/zfs-tests/callbacks/zfs_dbgmsg.ksh b/tests/zfs-tests/callbacks/zfs_dbgmsg.ksh
index be001ad9daf7..114bc5a0cce7 100755
--- a/tests/zfs-tests/callbacks/zfs_dbgmsg.ksh
+++ b/tests/zfs-tests/callbacks/zfs_dbgmsg.ksh
@@ -24,6 +24,9 @@ echo "================================================================="
sudo tail -n $lines /proc/spl/kstat/zfs/dbgmsg
+# reset dbgmsg
+sudo bash -c "echo > /proc/spl/kstat/zfs/dbgmsg"
+
echo "================================================================="
echo " End of zfs_dbgmsg log"
echo "================================================================="
diff --git a/tests/zfs-tests/callbacks/zfs_dmesg.ksh b/tests/zfs-tests/callbacks/zfs_dmesg.ksh
index 3d8191de57a0..9fee4b044958 100755
--- a/tests/zfs-tests/callbacks/zfs_dmesg.ksh
+++ b/tests/zfs-tests/callbacks/zfs_dmesg.ksh
@@ -23,7 +23,8 @@ echo "================================================================="
echo " Tailing last $lines lines of dmesg log"
echo "================================================================="
-sudo dmesg | tail -n $lines
+# report and reset afterwards
+sudo dmesg -c | tail -n $lines
echo "================================================================="
echo " End of dmesg log"
diff --git a/tests/zfs-tests/callbacks/zfs_mmp.ksh b/tests/zfs-tests/callbacks/zfs_mmp.ksh
index 402e0b03f618..d57061438c54 100755
--- a/tests/zfs-tests/callbacks/zfs_mmp.ksh
+++ b/tests/zfs-tests/callbacks/zfs_mmp.ksh
@@ -30,6 +30,7 @@ for f in /proc/spl/kstat/zfs/*/multihost; do
echo "================================================================="
sudo tail -n $lines $f
+ sudo bash -c "echo > $f"
done
echo "================================================================="
diff --git a/tests/zfs-tests/cmd/.gitignore b/tests/zfs-tests/cmd/.gitignore
index 20d1382532bd..0ed0a69eb013 100644
--- a/tests/zfs-tests/cmd/.gitignore
+++ b/tests/zfs-tests/cmd/.gitignore
@@ -1,9 +1,13 @@
/badsend
/btree_test
/chg_usr_exec
+/clonefile
+/clone_mmap_cached
+/clone_mmap_write
/devname2devid
/dir_rd_update
/draid
+/file_fadvise
/file_append
/file_check
/file_trunc
@@ -26,6 +30,7 @@
/randwritecomp
/read_dos_attributes
/readmmap
+/renameat2
/rename_dir
/rm_lnkcnt_zero_file
/send_doall
@@ -46,3 +51,4 @@
/edonr_test
/skein_test
/sha2_test
+/idmap_util
diff --git a/tests/zfs-tests/cmd/Makefile.am b/tests/zfs-tests/cmd/Makefile.am
index 3c8faf5afbbb..23848a82ffbd 100644
--- a/tests/zfs-tests/cmd/Makefile.am
+++ b/tests/zfs-tests/cmd/Makefile.am
@@ -2,6 +2,9 @@ scripts_zfs_tests_bindir = $(datadir)/$(PACKAGE)/zfs-tests/bin
scripts_zfs_tests_bin_PROGRAMS = %D%/chg_usr_exec
+scripts_zfs_tests_bin_PROGRAMS += %D%/clonefile
+scripts_zfs_tests_bin_PROGRAMS += %D%/clone_mmap_cached
+scripts_zfs_tests_bin_PROGRAMS += %D%/clone_mmap_write
scripts_zfs_tests_bin_PROGRAMS += %D%/cp_files
scripts_zfs_tests_bin_PROGRAMS += %D%/ctime
scripts_zfs_tests_bin_PROGRAMS += %D%/dir_rd_update
@@ -112,20 +115,24 @@ scripts_zfs_tests_bin_PROGRAMS += %D%/edonr_test %D%/skein_test \
%C%_edonr_test_LDADD = $(%C%_skein_test_LDADD)
%C%_blake3_test_LDADD = $(%C%_skein_test_LDADD)
-
if BUILD_LINUX
scripts_zfs_tests_bin_PROGRAMS += %D%/getversion
scripts_zfs_tests_bin_PROGRAMS += %D%/user_ns_exec
+scripts_zfs_tests_bin_PROGRAMS += %D%/renameat2
scripts_zfs_tests_bin_PROGRAMS += %D%/xattrtest
scripts_zfs_tests_bin_PROGRAMS += %D%/zed_fd_spill-zedlet
+scripts_zfs_tests_bin_PROGRAMS += %D%/idmap_util
+%C%_idmap_util_LDADD = libspl.la
dist_noinst_DATA += %D%/linux_dos_attributes/dos_attributes.h
scripts_zfs_tests_bin_PROGRAMS += %D%/read_dos_attributes %D%/write_dos_attributes
%C%_read_dos_attributes_SOURCES = %D%/linux_dos_attributes/read_dos_attributes.c
%C%_write_dos_attributes_SOURCES = %D%/linux_dos_attributes/write_dos_attributes.c
-
scripts_zfs_tests_bin_PROGRAMS += %D%/randfree_file
%C%_randfree_file_SOURCES = %D%/file/randfree_file.c
+
+scripts_zfs_tests_bin_PROGRAMS += %D%/file_fadvise
+%C%_file_fadvise_SOURCES = %D%/file/file_fadvise.c
endif
diff --git a/tests/zfs-tests/cmd/badsend.c b/tests/zfs-tests/cmd/badsend.c
index af17bc7255b4..7a54532fb28d 100644
--- a/tests/zfs-tests/cmd/badsend.c
+++ b/tests/zfs-tests/cmd/badsend.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
@@ -76,6 +76,10 @@ main(int argc, char const * const argv[])
tosnap = p + 1;
fsname = strndup(tofull, p - tofull);
+ if (fsname == NULL) {
+ perror("strndup");
+ exit(EXIT_FAILURE);
+ }
if (strncmp(fsname, fromfull, p - tofull) != 0)
usage(argv[0]);
diff --git a/tests/zfs-tests/cmd/btree_test.c b/tests/zfs-tests/cmd/btree_test.c
index aaad4e47e464..fda9229915ce 100644
--- a/tests/zfs-tests/cmd/btree_test.c
+++ b/tests/zfs-tests/cmd/btree_test.c
@@ -15,6 +15,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <sys/avl.h>
#include <sys/btree.h>
#include <sys/time.h>
@@ -22,11 +23,11 @@
#define BUFSIZE 256
-int seed = 0;
-int stress_timeout = 180;
-int contents_frequency = 100;
-int tree_limit = 64 * 1024;
-boolean_t stress_only = B_FALSE;
+static int seed = 0;
+static int stress_timeout = 180;
+static int contents_frequency = 100;
+static int tree_limit = 64 * 1024;
+static boolean_t stress_only = B_FALSE;
static void
usage(int exit_value)
@@ -164,7 +165,7 @@ find_without_index(zfs_btree_t *bt, char *why)
zfs_btree_add(bt, &i);
if ((p = (u_longlong_t *)zfs_btree_find(bt, &i, NULL)) == NULL ||
*p != i) {
- snprintf(why, BUFSIZE, "Unexpectedly found %llu\n",
+ (void) snprintf(why, BUFSIZE, "Unexpectedly found %llu\n",
p == NULL ? 0 : *p);
return (1);
}
@@ -172,7 +173,7 @@ find_without_index(zfs_btree_t *bt, char *why)
i++;
if ((p = (u_longlong_t *)zfs_btree_find(bt, &i, NULL)) != NULL) {
- snprintf(why, BUFSIZE, "Found bad value: %llu\n", *p);
+ (void) snprintf(why, BUFSIZE, "Found bad value: %llu\n", *p);
return (1);
}
@@ -189,10 +190,10 @@ insert_find_remove(zfs_btree_t *bt, char *why)
/* Insert 'i' into the tree, and attempt to find it again. */
zfs_btree_add(bt, &i);
if ((p = (u_longlong_t *)zfs_btree_find(bt, &i, &bt_idx)) == NULL) {
- snprintf(why, BUFSIZE, "Didn't find value in tree\n");
+ (void) snprintf(why, BUFSIZE, "Didn't find value in tree\n");
return (1);
} else if (*p != i) {
- snprintf(why, BUFSIZE, "Found (%llu) in tree\n", *p);
+ (void) snprintf(why, BUFSIZE, "Found (%llu) in tree\n", *p);
return (1);
}
ASSERT3S(zfs_btree_numnodes(bt), ==, 1);
@@ -201,7 +202,8 @@ insert_find_remove(zfs_btree_t *bt, char *why)
/* Remove 'i' from the tree, and verify it is not found. */
zfs_btree_remove(bt, &i);
if ((p = (u_longlong_t *)zfs_btree_find(bt, &i, &bt_idx)) != NULL) {
- snprintf(why, BUFSIZE, "Found removed value (%llu)\n", *p);
+ (void) snprintf(why, BUFSIZE,
+ "Found removed value (%llu)\n", *p);
return (1);
}
ASSERT3S(zfs_btree_numnodes(bt), ==, 0);
@@ -218,7 +220,6 @@ insert_find_remove(zfs_btree_t *bt, char *why)
static int
drain_tree(zfs_btree_t *bt, char *why)
{
- uint64_t *p;
avl_tree_t avl;
int i = 0;
int_node_t *node;
@@ -230,19 +231,22 @@ drain_tree(zfs_btree_t *bt, char *why)
/* Fill both trees with the same data */
for (i = 0; i < 64 * 1024; i++) {
- void *ret;
-
u_longlong_t randval = random();
- node = malloc(sizeof (int_node_t));
- if ((p = (uint64_t *)zfs_btree_find(bt, &randval, &bt_idx)) !=
- NULL) {
+ if (zfs_btree_find(bt, &randval, &bt_idx) != NULL) {
continue;
}
zfs_btree_add_idx(bt, &randval, &bt_idx);
+ node = malloc(sizeof (int_node_t));
+ if (node == NULL) {
+ perror("malloc");
+ exit(EXIT_FAILURE);
+ }
+
node->data = randval;
- if ((ret = avl_find(&avl, node, &avl_idx)) != NULL) {
- snprintf(why, BUFSIZE, "Found in avl: %llu\n", randval);
+ if (avl_find(&avl, node, &avl_idx) != NULL) {
+ (void) snprintf(why, BUFSIZE,
+ "Found in avl: %llu\n", randval);
return (1);
}
avl_insert(&avl, node, avl_idx);
@@ -314,6 +318,10 @@ stress_tree(zfs_btree_t *bt, char *why)
uint64_t randval = random() % tree_limit;
node = malloc(sizeof (*node));
+ if (node == NULL) {
+ perror("malloc");
+ exit(EXIT_FAILURE);
+ }
node->data = randval;
max = randval > max ? randval : max;
@@ -360,9 +368,7 @@ stress_tree(zfs_btree_t *bt, char *why)
if (stress_only) {
zfs_btree_index_t *idx = NULL;
- uint64_t *rv;
-
- while ((rv = zfs_btree_destroy_nodes(bt, &idx)) != NULL)
+ while (zfs_btree_destroy_nodes(bt, &idx) != NULL)
;
zfs_btree_verify(bt);
}
@@ -377,15 +383,15 @@ stress_tree(zfs_btree_t *bt, char *why)
static int
insert_duplicate(zfs_btree_t *bt)
{
- uint64_t *p, i = 23456;
+ uint64_t i = 23456;
zfs_btree_index_t bt_idx = {0};
- if ((p = (uint64_t *)zfs_btree_find(bt, &i, &bt_idx)) != NULL) {
+ if (zfs_btree_find(bt, &i, &bt_idx) != NULL) {
fprintf(stderr, "Found value in empty tree.\n");
return (0);
}
zfs_btree_add_idx(bt, &i, &bt_idx);
- if ((p = (uint64_t *)zfs_btree_find(bt, &i, &bt_idx)) == NULL) {
+ if (zfs_btree_find(bt, &i, &bt_idx) == NULL) {
fprintf(stderr, "Did not find expected value.\n");
return (0);
}
@@ -403,10 +409,10 @@ insert_duplicate(zfs_btree_t *bt)
static int
remove_missing(zfs_btree_t *bt)
{
- uint64_t *p, i = 23456;
+ uint64_t i = 23456;
zfs_btree_index_t bt_idx = {0};
- if ((p = (uint64_t *)zfs_btree_find(bt, &i, &bt_idx)) != NULL) {
+ if (zfs_btree_find(bt, &i, &bt_idx) != NULL) {
fprintf(stderr, "Found value in empty tree.\n");
return (0);
}
@@ -422,7 +428,8 @@ do_negative_test(zfs_btree_t *bt, char *test_name)
{
int rval = 0;
struct rlimit rlim = {0};
- setrlimit(RLIMIT_CORE, &rlim);
+
+ (void) setrlimit(RLIMIT_CORE, &rlim);
if (strcmp(test_name, "insert_duplicate") == 0) {
rval = insert_duplicate(bt);
@@ -486,10 +493,6 @@ main(int argc, char *argv[])
break;
}
}
- argc -= optind;
- argv += optind;
- optind = 1;
-
if (seed == 0) {
(void) gettimeofday(&tp, NULL);
@@ -498,7 +501,7 @@ main(int argc, char *argv[])
srandom(seed);
zfs_btree_init();
- zfs_btree_create(&bt, zfs_btree_compare, sizeof (uint64_t));
+ zfs_btree_create(&bt, zfs_btree_compare, NULL, sizeof (uint64_t));
/*
* This runs the named negative test. None of them should
@@ -523,7 +526,6 @@ main(int argc, char *argv[])
btree_test_t *test = &test_table[0];
while (test->name) {
int retval;
- uint64_t *rv;
char why[BUFSIZE] = {0};
zfs_btree_index_t *idx = NULL;
@@ -541,7 +543,7 @@ main(int argc, char *argv[])
}
/* Remove all the elements and re-verify the tree */
- while ((rv = zfs_btree_destroy_nodes(&bt, &idx)) != NULL)
+ while (zfs_btree_destroy_nodes(&bt, &idx) != NULL)
;
zfs_btree_verify(&bt);
diff --git a/tests/zfs-tests/cmd/checksum/blake3_test.c b/tests/zfs-tests/cmd/checksum/blake3_test.c
index 55d268f5f8b7..aebe0363cc6e 100644
--- a/tests/zfs-tests/cmd/checksum/blake3_test.c
+++ b/tests/zfs-tests/cmd/checksum/blake3_test.c
@@ -7,7 +7,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
@@ -31,6 +31,8 @@
#include <sys/time.h>
#include <sys/blake3.h>
+#include <sys/zfs_impl.h>
+
/*
* set it to a define for debugging
*/
@@ -485,10 +487,14 @@ main(int argc, char *argv[])
uint8_t buffer[102400];
uint64_t cpu_mhz = 0;
int id, i, j;
+ const zfs_impl_t *blake3 = zfs_impl_get_ops("blake3");
if (argc == 2)
cpu_mhz = atoi(argv[1]);
+ if (!blake3)
+ return (1);
+
/* fill test message */
for (i = 0, j = 0; i < sizeof (buffer); i++, j++) {
if (j == 251)
@@ -497,9 +503,9 @@ main(int argc, char *argv[])
}
(void) printf("Running algorithm correctness tests:\n");
- for (id = 0; id < blake3_get_impl_count(); id++) {
- blake3_set_impl_id(id);
- const char *name = blake3_get_impl_name();
+ for (id = 0; id < blake3->getcnt(); id++) {
+ blake3->setid(id);
+ const char *name = blake3->getname();
dprintf("Result for BLAKE3-%s:\n", name);
for (i = 0; TestArray[i].hash; i++) {
blake3_test_t *cur = &TestArray[i];
@@ -565,9 +571,9 @@ main(int argc, char *argv[])
} while (0)
printf("Running performance tests (hashing 1024 MiB of data):\n");
- for (id = 0; id < blake3_get_impl_count(); id++) {
- blake3_set_impl_id(id);
- const char *name = blake3_get_impl_name();
+ for (id = 0; id < blake3->getcnt(); id++) {
+ blake3->setid(id);
+ const char *name = blake3->getname();
BLAKE3_PERF_TEST(name, 256);
}
diff --git a/tests/zfs-tests/cmd/checksum/edonr_test.c b/tests/zfs-tests/cmd/checksum/edonr_test.c
index 3a0a48533c53..1204f4c9d017 100644
--- a/tests/zfs-tests/cmd/checksum/edonr_test.c
+++ b/tests/zfs-tests/cmd/checksum/edonr_test.c
@@ -40,77 +40,11 @@
* Test messages from:
* http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA_All.pdf
*/
-const char *test_msg0 = "abc";
-const char *test_msg1 = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmn"
- "lmnomnopnopq";
-const char *test_msg2 = "abcdefghbcdefghicdefghijdefghijkefghijklfghi"
- "jklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu";
+static const char *test_msg0 = "abc";
+static const char *test_msg1 = "abcdefghbcdefghicdefghijdefghijkefghijklfgh"
+ "ijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu";
-/*
- * Test digests computed by hand. There's no formal standard or spec for edonr.
- */
-const uint8_t edonr_224_test_digests[][28] = {
- {
- /* for test_msg0 */
- 0x56, 0x63, 0xc4, 0x93, 0x95, 0x20, 0xfa, 0xf6,
- 0x12, 0x31, 0x65, 0xa4, 0x66, 0xf2, 0x56, 0x01,
- 0x95, 0x2e, 0xa9, 0xe4, 0x24, 0xdd, 0xc9, 0x6b,
- 0xef, 0xd0, 0x40, 0x94
- },
- {
- /* for test_msg1 */
- 0xd0, 0x13, 0xe4, 0x87, 0x4d, 0x06, 0x8d, 0xca,
- 0x4e, 0x14, 0xb9, 0x37, 0x2f, 0xce, 0x12, 0x20,
- 0x60, 0xf8, 0x5c, 0x0a, 0xfd, 0x7a, 0x7d, 0x97,
- 0x88, 0x2b, 0x05, 0x75
- }
- /* no test vector for test_msg2 */
-};
-
-const uint8_t edonr_256_test_digests[][32] = {
- {
- /* for test_msg0 */
- 0x54, 0xd7, 0x8b, 0x13, 0xc7, 0x4e, 0xda, 0x5a,
- 0xed, 0xc2, 0x71, 0xcc, 0x88, 0x1f, 0xb2, 0x2f,
- 0x83, 0x99, 0xaf, 0xd3, 0x04, 0x0b, 0x6a, 0x39,
- 0x2d, 0x73, 0x94, 0x05, 0x50, 0x8d, 0xd8, 0x51
- },
- {
- /* for test_msg1 */
- 0x49, 0x2d, 0x0b, 0x19, 0xab, 0x1e, 0xde, 0x3a,
- 0xea, 0x9b, 0xf2, 0x39, 0x3a, 0xb1, 0x21, 0xde,
- 0x21, 0xf6, 0x80, 0x1f, 0xad, 0xbe, 0x8b, 0x07,
- 0xc7, 0xfb, 0xe6, 0x99, 0x0e, 0x4d, 0x73, 0x63
- }
- /* no test vectorfor test_msg2 */
-};
-
-const uint8_t edonr_384_test_digests[][48] = {
- {
- /* for test_msg0 */
- 0x0e, 0x7c, 0xd7, 0x85, 0x78, 0x77, 0xe0, 0x89,
- 0x5b, 0x1c, 0xdf, 0x49, 0xf4, 0x1d, 0x20, 0x9c,
- 0x72, 0x7d, 0x2e, 0x57, 0x9b, 0x9b, 0x9a, 0xdc,
- 0x60, 0x27, 0x97, 0x82, 0xb9, 0x90, 0x72, 0xec,
- 0x7e, 0xce, 0xd3, 0x16, 0x5f, 0x47, 0x75, 0x48,
- 0xfa, 0x60, 0x72, 0x7e, 0x01, 0xc7, 0x7c, 0xc6
- },
- {
- /* no test vector for test_msg1 */
- 0
- },
- {
- /* for test_msg2 */
- 0xe2, 0x34, 0xa1, 0x02, 0x83, 0x76, 0xae, 0xe6,
- 0x82, 0xd9, 0x38, 0x32, 0x0e, 0x00, 0x78, 0xd2,
- 0x34, 0xdb, 0xb9, 0xbd, 0xf0, 0x08, 0xa8, 0x0f,
- 0x63, 0x1c, 0x3d, 0x4a, 0xfd, 0x0a, 0xe9, 0x59,
- 0xdc, 0xd4, 0xce, 0xcd, 0x8d, 0x67, 0x6c, 0xea,
- 0xbb, 0x1a, 0x32, 0xed, 0x5c, 0x6b, 0xf1, 0x7f
- }
-};
-
-const uint8_t edonr_512_test_digests[][64] = {
+static const uint8_t edonr_512_test_digests[][64] = {
{
/* for test_msg0 */
0x1b, 0x14, 0xdb, 0x15, 0x5f, 0x1d, 0x40, 0x65,
@@ -127,7 +61,7 @@ const uint8_t edonr_512_test_digests[][64] = {
0
},
{
- /* for test_msg2 */
+ /* for test_msg1 */
0x53, 0x51, 0x07, 0x0d, 0xc5, 0x1c, 0x3b, 0x2b,
0xac, 0xa5, 0xa6, 0x0d, 0x02, 0x52, 0xcc, 0xb4,
0xe4, 0x92, 0x1a, 0x96, 0xfe, 0x5a, 0x69, 0xe7,
@@ -152,7 +86,7 @@ main(int argc, char *argv[])
do { \
EdonRState ctx; \
uint8_t digest[mode / 8]; \
- EdonRInit(&ctx, mode); \
+ EdonRInit(&ctx); \
EdonRUpdate(&ctx, (const uint8_t *) _m, strlen(_m) * 8);\
EdonRFinal(&ctx, digest); \
(void) printf("Edon-R-%-6sMessage: " #_m \
@@ -176,7 +110,7 @@ main(int argc, char *argv[])
struct timeval start, end; \
memset(block, 0, sizeof (block)); \
(void) gettimeofday(&start, NULL); \
- EdonRInit(&ctx, mode); \
+ EdonRInit(&ctx); \
for (i = 0; i < 8192; i++) \
EdonRUpdate(&ctx, block, sizeof (block) * 8); \
EdonRFinal(&ctx, digest); \
@@ -192,20 +126,13 @@ main(int argc, char *argv[])
} while (0)
(void) printf("Running algorithm correctness tests:\n");
- EDONR_ALGO_TEST(test_msg0, 224, edonr_224_test_digests[0]);
- EDONR_ALGO_TEST(test_msg1, 224, edonr_224_test_digests[1]);
- EDONR_ALGO_TEST(test_msg0, 256, edonr_256_test_digests[0]);
- EDONR_ALGO_TEST(test_msg1, 256, edonr_256_test_digests[1]);
- EDONR_ALGO_TEST(test_msg0, 384, edonr_384_test_digests[0]);
- EDONR_ALGO_TEST(test_msg2, 384, edonr_384_test_digests[2]);
EDONR_ALGO_TEST(test_msg0, 512, edonr_512_test_digests[0]);
- EDONR_ALGO_TEST(test_msg2, 512, edonr_512_test_digests[2]);
+ EDONR_ALGO_TEST(test_msg1, 512, edonr_512_test_digests[2]);
if (failed)
return (1);
(void) printf("Running performance tests (hashing 1024 MiB of "
"data):\n");
- EDONR_PERF_TEST(256);
EDONR_PERF_TEST(512);
return (0);
diff --git a/tests/zfs-tests/cmd/checksum/sha2_test.c b/tests/zfs-tests/cmd/checksum/sha2_test.c
index bb355311091e..efcf812d7749 100644
--- a/tests/zfs-tests/cmd/checksum/sha2_test.c
+++ b/tests/zfs-tests/cmd/checksum/sha2_test.c
@@ -33,28 +33,28 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+
#include <sys/time.h>
-#define _SHA2_IMPL
#include <sys/sha2.h>
#include <sys/stdtypes.h>
-
+#include <sys/zfs_impl.h>
/*
* Test messages from:
* http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA_All.pdf
*/
-const char *test_msg0 = "abc";
-const char *test_msg1 = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmn"
- "lmnomnopnopq";
-const char *test_msg2 = "abcdefghbcdefghicdefghijdefghijkefghijklfghi"
- "jklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu";
+static const char *test_msg0 = "abc";
+static const char *test_msg1 = "abcdbcdecdefdefgefghfghighijhijkijkljklmklm"
+ "nlmnomnopnopq";
+static const char *test_msg2 = "abcdefghbcdefghicdefghijdefghijkefghijklfgh"
+ "ijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu";
/*
* Test digests from:
* http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA_All.pdf
*/
-const uint8_t sha256_test_digests[][32] = {
+static const uint8_t sha256_test_digests[][32] = {
{
/* for test_msg0 */
0xBA, 0x78, 0x16, 0xBF, 0x8F, 0x01, 0xCF, 0xEA,
@@ -72,7 +72,7 @@ const uint8_t sha256_test_digests[][32] = {
/* no test vector for test_msg2 */
};
-const uint8_t sha384_test_digests[][48] = {
+static const uint8_t sha384_test_digests[][48] = {
{
/* for test_msg0 */
0xCB, 0x00, 0x75, 0x3F, 0x45, 0xA3, 0x5E, 0x8B,
@@ -97,7 +97,7 @@ const uint8_t sha384_test_digests[][48] = {
}
};
-const uint8_t sha512_test_digests[][64] = {
+static const uint8_t sha512_test_digests[][64] = {
{
/* for test_msg0 */
0xDD, 0xAF, 0x35, 0xA1, 0x93, 0x61, 0x7A, 0xBA,
@@ -126,7 +126,7 @@ const uint8_t sha512_test_digests[][64] = {
}
};
-const uint8_t sha512_224_test_digests[][28] = {
+static const uint8_t sha512_224_test_digests[][28] = {
{
/* for test_msg0 */
0x46, 0x34, 0x27, 0x0F, 0x70, 0x7B, 0x6A, 0x54,
@@ -147,7 +147,7 @@ const uint8_t sha512_224_test_digests[][28] = {
}
};
-const uint8_t sha512_256_test_digests[][32] = {
+static const uint8_t sha512_256_test_digests[][32] = {
{
/* for test_msg0 */
0x53, 0x04, 0x8E, 0x26, 0x81, 0x94, 0x1E, 0xF9,
@@ -174,9 +174,19 @@ main(int argc, char *argv[])
boolean_t failed = B_FALSE;
uint64_t cpu_mhz = 0;
+ const zfs_impl_t *sha256 = zfs_impl_get_ops("sha256");
+ const zfs_impl_t *sha512 = zfs_impl_get_ops("sha512");
+ uint32_t id;
+
if (argc == 2)
cpu_mhz = atoi(argv[1]);
+ if (!sha256)
+ return (1);
+
+ if (!sha512)
+ return (1);
+
#define SHA2_ALGO_TEST(_m, mode, diglen, testdigest) \
do { \
SHA2_CTX ctx; \
@@ -194,7 +204,7 @@ main(int argc, char *argv[])
} \
} while (0)
-#define SHA2_PERF_TEST(mode, diglen) \
+#define SHA2_PERF_TEST(mode, diglen, name) \
do { \
SHA2_CTX ctx; \
uint8_t digest[diglen / 8]; \
@@ -216,8 +226,8 @@ main(int argc, char *argv[])
cpb = (cpu_mhz * 1e6 * ((double)delta / \
1000000)) / (8192 * 128 * 1024); \
} \
- (void) printf("SHA%-9s%llu us (%.02f CPB)\n", #mode, \
- (u_longlong_t)delta, cpb); \
+ (void) printf("sha%s-%-9s%7llu us (%.02f CPB)\n", #mode,\
+ name, (u_longlong_t)delta, cpb); \
} while (0)
(void) printf("Running algorithm correctness tests:\n");
@@ -237,8 +247,18 @@ main(int argc, char *argv[])
(void) printf("Running performance tests (hashing 1024 MiB of "
"data):\n");
- SHA2_PERF_TEST(256, 256);
- SHA2_PERF_TEST(512, 512);
+
+ for (id = 0; id < sha256->getcnt(); id++) {
+ sha256->setid(id);
+ const char *name = sha256->getname();
+ SHA2_PERF_TEST(256, 256, name);
+ }
+
+ for (id = 0; id < sha512->getcnt(); id++) {
+ sha512->setid(id);
+ const char *name = sha512->getname();
+ SHA2_PERF_TEST(512, 512, name);
+ }
return (0);
}
diff --git a/tests/zfs-tests/cmd/checksum/skein_test.c b/tests/zfs-tests/cmd/checksum/skein_test.c
index 13611c860c42..20eb36d3e883 100644
--- a/tests/zfs-tests/cmd/checksum/skein_test.c
+++ b/tests/zfs-tests/cmd/checksum/skein_test.c
@@ -44,18 +44,18 @@
/*
* Test messages from the Skein spec, Appendix C.
*/
-const uint8_t test_msg0[] = {
+static const uint8_t test_msg0[] = {
0xFF
};
-const uint8_t test_msg1[] = {
+static const uint8_t test_msg1[] = {
0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8,
0xF7, 0xF6, 0xF5, 0xF4, 0xF3, 0xF2, 0xF1, 0xF0,
0xEF, 0xEE, 0xED, 0xEC, 0xEB, 0xEA, 0xE9, 0xE8,
0xE7, 0xE6, 0xE5, 0xE4, 0xE3, 0xE2, 0xE1, 0xE0
};
-const uint8_t test_msg2[] = {
+static const uint8_t test_msg2[] = {
0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8,
0xF7, 0xF6, 0xF5, 0xF4, 0xF3, 0xF2, 0xF1, 0xF0,
0xEF, 0xEE, 0xED, 0xEC, 0xEB, 0xEA, 0xE9, 0xE8,
@@ -66,7 +66,7 @@ const uint8_t test_msg2[] = {
0xC7, 0xC6, 0xC5, 0xC4, 0xC3, 0xC2, 0xC1, 0xC0
};
-const uint8_t test_msg3[] = {
+static const uint8_t test_msg3[] = {
0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8,
0xF7, 0xF6, 0xF5, 0xF4, 0xF3, 0xF2, 0xF1, 0xF0,
0xEF, 0xEE, 0xED, 0xEC, 0xEB, 0xEA, 0xE9, 0xE8,
@@ -85,7 +85,7 @@ const uint8_t test_msg3[] = {
0x87, 0x86, 0x85, 0x84, 0x83, 0x82, 0x81, 0x80
};
-const uint8_t test_msg4[] = {
+static const uint8_t test_msg4[] = {
0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8,
0xF7, 0xF6, 0xF5, 0xF4, 0xF3, 0xF2, 0xF1, 0xF0,
0xEF, 0xEE, 0xED, 0xEC, 0xEB, 0xEA, 0xE9, 0xE8,
@@ -123,7 +123,7 @@ const uint8_t test_msg4[] = {
/*
* Test digests from the Skein spec, Appendix C.
*/
-const uint8_t skein_256_test_digests[][32] = {
+static const uint8_t skein_256_test_digests[][32] = {
{
/* for test_msg0 */
0x0B, 0x98, 0xDC, 0xD1, 0x98, 0xEA, 0x0E, 0x50,
@@ -148,7 +148,7 @@ const uint8_t skein_256_test_digests[][32] = {
/* no test digests for test_msg3 and test_msg4 */
};
-const uint8_t skein_512_test_digests[][64] = {
+static const uint8_t skein_512_test_digests[][64] = {
{
/* for test_msg0 */
0x71, 0xB7, 0xBC, 0xE6, 0xFE, 0x64, 0x52, 0x22,
@@ -189,7 +189,7 @@ const uint8_t skein_512_test_digests[][64] = {
/* no test digests for test_msg4 */
};
-const uint8_t skein_1024_test_digests[][128] = {
+static const uint8_t skein_1024_test_digests[][128] = {
{
/* for test_msg0 */
0xE6, 0x2C, 0x05, 0x80, 0x2E, 0xA0, 0x15, 0x24,
diff --git a/tests/zfs-tests/cmd/chg_usr_exec.c b/tests/zfs-tests/cmd/chg_usr_exec.c
index 1fa9e88a6fde..911c907b38ac 100644
--- a/tests/zfs-tests/cmd/chg_usr_exec.c
+++ b/tests/zfs-tests/cmd/chg_usr_exec.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
diff --git a/tests/zfs-tests/cmd/clone_mmap_cached.c b/tests/zfs-tests/cmd/clone_mmap_cached.c
new file mode 100644
index 000000000000..c1cdf796cfb4
--- /dev/null
+++ b/tests/zfs-tests/cmd/clone_mmap_cached.c
@@ -0,0 +1,146 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or https://opensource.org/licenses/CDDL-1.0.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2024 by Pawel Jakub Dawidek
+ */
+
+#include <sys/mman.h>
+#include <sys/stat.h>
+
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#ifdef __FreeBSD__
+#define loff_t off_t
+#endif
+
+ssize_t
+copy_file_range(int, loff_t *, int, loff_t *, size_t, unsigned int)
+ __attribute__((weak));
+
+static void *
+mmap_file(int fd, size_t size)
+{
+ void *p;
+
+ p = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
+ if (p == MAP_FAILED) {
+ (void) fprintf(stderr, "mmap failed: %s\n", strerror(errno));
+ exit(2);
+ }
+
+ return (p);
+}
+
+static void
+usage(const char *progname)
+{
+
+ /*
+ * -i cache input before copy_file_range(2).
+ * -o cache input before copy_file_range(2).
+ */
+ (void) fprintf(stderr, "usage: %s [-io] <input> <output>\n", progname);
+ exit(3);
+}
+
+int
+main(int argc, char *argv[])
+{
+ int dfd, sfd;
+ size_t dsize, ssize;
+ void *dmem, *smem, *ptr;
+ off_t doff, soff;
+ struct stat sb;
+ bool cache_input, cache_output;
+ const char *progname;
+ int c;
+
+ progname = argv[0];
+ cache_input = cache_output = false;
+
+ while ((c = getopt(argc, argv, "io")) != -1) {
+ switch (c) {
+ case 'i':
+ cache_input = true;
+ break;
+ case 'o':
+ cache_output = true;
+ break;
+ default:
+ usage(progname);
+ }
+ }
+ argc -= optind;
+ argv += optind;
+
+ if (argc != 2) {
+ usage(progname);
+ }
+
+ sfd = open(argv[0], O_RDONLY);
+ if (fstat(sfd, &sb) == -1) {
+ (void) fprintf(stderr, "fstat failed: %s\n", strerror(errno));
+ exit(2);
+ }
+ ssize = sb.st_size;
+ smem = mmap_file(sfd, ssize);
+
+ dfd = open(argv[1], O_RDWR);
+ if (fstat(dfd, &sb) == -1) {
+ (void) fprintf(stderr, "fstat failed: %s\n", strerror(errno));
+ exit(2);
+ }
+ dsize = sb.st_size;
+ dmem = mmap_file(dfd, dsize);
+
+ /*
+ * Hopefully it won't be compiled out.
+ */
+ if (cache_input) {
+ ptr = malloc(ssize);
+ assert(ptr != NULL);
+ memcpy(ptr, smem, ssize);
+ free(ptr);
+ }
+ if (cache_output) {
+ ptr = malloc(ssize);
+ assert(ptr != NULL);
+ memcpy(ptr, dmem, dsize);
+ free(ptr);
+ }
+
+ soff = doff = 0;
+ if (copy_file_range(sfd, &soff, dfd, &doff, ssize, 0) < 0) {
+ (void) fprintf(stderr, "copy_file_range failed: %s\n",
+ strerror(errno));
+ exit(2);
+ }
+
+ exit(memcmp(smem, dmem, ssize) == 0 ? 0 : 1);
+}
diff --git a/tests/zfs-tests/cmd/clone_mmap_write.c b/tests/zfs-tests/cmd/clone_mmap_write.c
new file mode 100644
index 000000000000..6a5cd8721c57
--- /dev/null
+++ b/tests/zfs-tests/cmd/clone_mmap_write.c
@@ -0,0 +1,123 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or https://opensource.org/licenses/CDDL-1.0.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * This program clones the file, mmap it, and writes from the map into
+ * file. This scenario triggers a panic on Linux in dbuf_redirty(),
+ * which is fixed under PR#15656. On FreeBSD, the same test causes data
+ * corruption, which is fixed by PR#15665.
+ *
+ * It would be good to test for this scenario in ZTS. This program and
+ * issue was initially produced by @robn.
+ */
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+
+#ifdef __FreeBSD__
+#define loff_t off_t
+#endif
+
+ssize_t
+copy_file_range(int, loff_t *, int, loff_t *, size_t, unsigned int)
+ __attribute__((weak));
+
+static int
+open_file(const char *source)
+{
+ int fd;
+ if ((fd = open(source, O_RDWR | O_APPEND)) < 0) {
+ (void) fprintf(stderr, "Error opening %s\n", source);
+ exit(1);
+ }
+ sync();
+ return (fd);
+}
+
+static int
+clone_file(int sfd, long long size, const char *dest)
+{
+ int dfd;
+
+ if ((dfd = open(dest, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR)) < 0) {
+ (void) fprintf(stderr, "Error opening %s\n", dest);
+ exit(1);
+ }
+
+ if (copy_file_range(sfd, 0, dfd, 0, size, 0) < 0) {
+ (void) fprintf(stderr, "copy_file_range failed\n");
+ exit(1);
+ }
+
+ return (dfd);
+}
+
+static void *
+map_file(int fd, long long size)
+{
+ void *p = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
+ if (p == MAP_FAILED) {
+ (void) fprintf(stderr, "mmap failed\n");
+ exit(1);
+ }
+
+ return (p);
+}
+
+static void
+map_write(void *p, int fd)
+{
+ if (pwrite(fd, p, 1024*128, 0) < 0) {
+ (void) fprintf(stderr, "write failed\n");
+ exit(1);
+ }
+}
+
+int
+main(int argc, char **argv)
+{
+ int sfd, dfd;
+ void *p;
+ struct stat sb;
+ if (argc != 3) {
+ (void) printf("usage: %s <input source file> "
+ "<clone destination file>\n", argv[0]);
+ exit(1);
+ }
+ sfd = open_file(argv[1]);
+ if (fstat(sfd, &sb) == -1) {
+ (void) fprintf(stderr, "fstat failed\n");
+ exit(1);
+ }
+ dfd = clone_file(sfd, sb.st_size, argv[2]);
+ p = map_file(dfd, sb.st_size);
+ map_write(p, dfd);
+ return (0);
+}
diff --git a/tests/zfs-tests/cmd/clonefile.c b/tests/zfs-tests/cmd/clonefile.c
new file mode 100644
index 000000000000..bc30bb7798e9
--- /dev/null
+++ b/tests/zfs-tests/cmd/clonefile.c
@@ -0,0 +1,373 @@
+/*
+ * SPDX-License-Identifier: MIT
+ *
+ * Copyright (c) 2023, Rob Norris <robn@despairlabs.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/*
+ * This program is to test the availability and behaviour of copy_file_range,
+ * FICLONE, FICLONERANGE and FIDEDUPERANGE in the Linux kernel. It should
+ * compile and run even if these features aren't exposed through the libc.
+ */
+
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#ifndef __NR_copy_file_range
+#if defined(__x86_64__)
+#define __NR_copy_file_range (326)
+#elif defined(__i386__)
+#define __NR_copy_file_range (377)
+#elif defined(__s390__)
+#define __NR_copy_file_range (375)
+#elif defined(__arm__)
+#define __NR_copy_file_range (391)
+#elif defined(__aarch64__)
+#define __NR_copy_file_range (285)
+#elif defined(__powerpc__)
+#define __NR_copy_file_range (379)
+#else
+#error "no definition of __NR_copy_file_range for this platform"
+#endif
+#endif /* __NR_copy_file_range */
+
+#ifdef __FreeBSD__
+#define loff_t off_t
+#endif
+
+ssize_t
+copy_file_range(int, loff_t *, int, loff_t *, size_t, unsigned int)
+ __attribute__((weak));
+
+static inline ssize_t
+cf_copy_file_range(int sfd, loff_t *soff, int dfd, loff_t *doff,
+ size_t len, unsigned int flags)
+{
+ if (copy_file_range)
+ return (copy_file_range(sfd, soff, dfd, doff, len, flags));
+ return (
+ syscall(__NR_copy_file_range, sfd, soff, dfd, doff, len, flags));
+}
+
+/* Define missing FICLONE */
+#ifdef FICLONE
+#define CF_FICLONE FICLONE
+#else
+#define CF_FICLONE _IOW(0x94, 9, int)
+#endif
+
+/* Define missing FICLONERANGE and support structs */
+#ifdef FICLONERANGE
+#define CF_FICLONERANGE FICLONERANGE
+typedef struct file_clone_range cf_file_clone_range_t;
+#else
+typedef struct {
+ int64_t src_fd;
+ uint64_t src_offset;
+ uint64_t src_length;
+ uint64_t dest_offset;
+} cf_file_clone_range_t;
+#define CF_FICLONERANGE _IOW(0x94, 13, cf_file_clone_range_t)
+#endif
+
+/* Define missing FIDEDUPERANGE and support structs */
+#ifdef FIDEDUPERANGE
+#define CF_FIDEDUPERANGE FIDEDUPERANGE
+#define CF_FILE_DEDUPE_RANGE_SAME FILE_DEDUPE_RANGE_SAME
+#define CF_FILE_DEDUPE_RANGE_DIFFERS FILE_DEDUPE_RANGE_DIFFERS
+typedef struct file_dedupe_range_info cf_file_dedupe_range_info_t;
+typedef struct file_dedupe_range cf_file_dedupe_range_t;
+#else
+typedef struct {
+ int64_t dest_fd;
+ uint64_t dest_offset;
+ uint64_t bytes_deduped;
+ int32_t status;
+ uint32_t reserved;
+} cf_file_dedupe_range_info_t;
+typedef struct {
+ uint64_t src_offset;
+ uint64_t src_length;
+ uint16_t dest_count;
+ uint16_t reserved1;
+ uint32_t reserved2;
+ cf_file_dedupe_range_info_t info[0];
+} cf_file_dedupe_range_t;
+#define CF_FIDEDUPERANGE _IOWR(0x94, 54, cf_file_dedupe_range_t)
+#define CF_FILE_DEDUPE_RANGE_SAME (0)
+#define CF_FILE_DEDUPE_RANGE_DIFFERS (1)
+#endif
+
+typedef enum {
+ CF_MODE_NONE,
+ CF_MODE_CLONE,
+ CF_MODE_CLONERANGE,
+ CF_MODE_COPYFILERANGE,
+ CF_MODE_DEDUPERANGE,
+} cf_mode_t;
+
+static int
+usage(void)
+{
+ printf(
+ "usage:\n"
+ " FICLONE:\n"
+ " clonefile -c <src> <dst>\n"
+ " FICLONERANGE:\n"
+ " clonefile -r <src> <dst> <soff> <doff> <len>\n"
+ " copy_file_range:\n"
+ " clonefile -f <src> <dst> [<soff> <doff> <len | \"all\">]\n"
+ " FIDEDUPERANGE:\n"
+ " clonefile -d <src> <dst> <soff> <doff> <len>\n");
+ return (1);
+}
+
+int do_clone(int sfd, int dfd);
+int do_clonerange(int sfd, int dfd, loff_t soff, loff_t doff, size_t len);
+int do_copyfilerange(int sfd, int dfd, loff_t soff, loff_t doff, size_t len);
+int do_deduperange(int sfd, int dfd, loff_t soff, loff_t doff, size_t len);
+
+int quiet = 0;
+
+int
+main(int argc, char **argv)
+{
+ cf_mode_t mode = CF_MODE_NONE;
+
+ int c;
+ while ((c = getopt(argc, argv, "crfdq")) != -1) {
+ switch (c) {
+ case 'c':
+ mode = CF_MODE_CLONE;
+ break;
+ case 'r':
+ mode = CF_MODE_CLONERANGE;
+ break;
+ case 'f':
+ mode = CF_MODE_COPYFILERANGE;
+ break;
+ case 'd':
+ mode = CF_MODE_DEDUPERANGE;
+ break;
+ case 'q':
+ quiet = 1;
+ break;
+ }
+ }
+
+ switch (mode) {
+ case CF_MODE_NONE:
+ return (usage());
+ case CF_MODE_CLONE:
+ if ((argc-optind) != 2)
+ return (usage());
+ break;
+ case CF_MODE_CLONERANGE:
+ case CF_MODE_DEDUPERANGE:
+ if ((argc-optind) != 5)
+ return (usage());
+ break;
+ case CF_MODE_COPYFILERANGE:
+ if ((argc-optind) != 2 && (argc-optind) != 5)
+ return (usage());
+ break;
+ default:
+ abort();
+ }
+
+ loff_t soff = 0, doff = 0;
+ size_t len = SSIZE_MAX;
+ if ((argc-optind) == 5) {
+ soff = strtoull(argv[optind+2], NULL, 10);
+ if (soff == ULLONG_MAX) {
+ fprintf(stderr, "invalid source offset");
+ return (1);
+ }
+ doff = strtoull(argv[optind+3], NULL, 10);
+ if (doff == ULLONG_MAX) {
+ fprintf(stderr, "invalid dest offset");
+ return (1);
+ }
+ if (mode == CF_MODE_COPYFILERANGE &&
+ strcmp(argv[optind+4], "all") == 0) {
+ len = SSIZE_MAX;
+ } else {
+ len = strtoull(argv[optind+4], NULL, 10);
+ if (len == ULLONG_MAX) {
+ fprintf(stderr, "invalid length");
+ return (1);
+ }
+ }
+ }
+
+ int sfd = open(argv[optind], O_RDONLY);
+ if (sfd < 0) {
+ fprintf(stderr, "open: %s: %s\n",
+ argv[optind], strerror(errno));
+ return (1);
+ }
+
+ int dfd = open(argv[optind+1], O_WRONLY|O_CREAT,
+ S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
+ if (dfd < 0) {
+ fprintf(stderr, "open: %s: %s\n",
+ argv[optind+1], strerror(errno));
+ close(sfd);
+ return (1);
+ }
+
+ int err;
+ switch (mode) {
+ case CF_MODE_CLONE:
+ err = do_clone(sfd, dfd);
+ break;
+ case CF_MODE_CLONERANGE:
+ err = do_clonerange(sfd, dfd, soff, doff, len);
+ break;
+ case CF_MODE_COPYFILERANGE:
+ err = do_copyfilerange(sfd, dfd, soff, doff, len);
+ break;
+ case CF_MODE_DEDUPERANGE:
+ err = do_deduperange(sfd, dfd, soff, doff, len);
+ break;
+ default:
+ abort();
+ }
+
+ if (!quiet) {
+ off_t spos = lseek(sfd, 0, SEEK_CUR);
+ off_t slen = lseek(sfd, 0, SEEK_END);
+ off_t dpos = lseek(dfd, 0, SEEK_CUR);
+ off_t dlen = lseek(dfd, 0, SEEK_END);
+
+ fprintf(stderr, "file offsets: src=%lu/%lu; dst=%lu/%lu\n",
+ spos, slen, dpos, dlen);
+ }
+
+ close(dfd);
+ close(sfd);
+
+ return (err == 0 ? 0 : 1);
+}
+
+int
+do_clone(int sfd, int dfd)
+{
+ if (!quiet)
+ fprintf(stderr, "using FICLONE\n");
+ int err = ioctl(dfd, CF_FICLONE, sfd);
+ if (err < 0) {
+ fprintf(stderr, "ioctl(FICLONE): %s\n", strerror(errno));
+ return (err);
+ }
+ return (0);
+}
+
+int
+do_clonerange(int sfd, int dfd, loff_t soff, loff_t doff, size_t len)
+{
+ if (!quiet)
+ fprintf(stderr, "using FICLONERANGE\n");
+ cf_file_clone_range_t fcr = {
+ .src_fd = sfd,
+ .src_offset = soff,
+ .src_length = len,
+ .dest_offset = doff,
+ };
+ int err = ioctl(dfd, CF_FICLONERANGE, &fcr);
+ if (err < 0) {
+ fprintf(stderr, "ioctl(FICLONERANGE): %s\n", strerror(errno));
+ return (err);
+ }
+ return (0);
+}
+
+int
+do_copyfilerange(int sfd, int dfd, loff_t soff, loff_t doff, size_t len)
+{
+ if (!quiet)
+ fprintf(stderr, "using copy_file_range\n");
+ ssize_t copied = cf_copy_file_range(sfd, &soff, dfd, &doff, len, 0);
+ if (copied < 0) {
+ fprintf(stderr, "copy_file_range: %s\n", strerror(errno));
+ return (1);
+ }
+ if (len == SSIZE_MAX) {
+ struct stat sb;
+
+ if (fstat(sfd, &sb) < 0) {
+ fprintf(stderr, "fstat(sfd): %s\n", strerror(errno));
+ return (1);
+ }
+ len = sb.st_size;
+ }
+ if (copied != len) {
+ fprintf(stderr, "copy_file_range: copied less than requested: "
+ "requested=%lu; copied=%lu\n", len, copied);
+ return (1);
+ }
+ return (0);
+}
+
+int
+do_deduperange(int sfd, int dfd, loff_t soff, loff_t doff, size_t len)
+{
+ if (!quiet)
+ fprintf(stderr, "using FIDEDUPERANGE\n");
+
+ char buf[sizeof (cf_file_dedupe_range_t)+
+ sizeof (cf_file_dedupe_range_info_t)] = {0};
+ cf_file_dedupe_range_t *fdr = (cf_file_dedupe_range_t *)&buf[0];
+ cf_file_dedupe_range_info_t *fdri =
+ (cf_file_dedupe_range_info_t *)
+ &buf[sizeof (cf_file_dedupe_range_t)];
+
+ fdr->src_offset = soff;
+ fdr->src_length = len;
+ fdr->dest_count = 1;
+
+ fdri->dest_fd = dfd;
+ fdri->dest_offset = doff;
+
+ int err = ioctl(sfd, CF_FIDEDUPERANGE, fdr);
+ if (err != 0)
+ fprintf(stderr, "ioctl(FIDEDUPERANGE): %s\n", strerror(errno));
+
+ if (fdri->status < 0) {
+ fprintf(stderr, "dedup failed: %s\n", strerror(-fdri->status));
+ err = -1;
+ } else if (fdri->status == CF_FILE_DEDUPE_RANGE_DIFFERS) {
+ fprintf(stderr, "dedup failed: range differs\n");
+ err = -1;
+ }
+
+ return (err);
+}
diff --git a/tests/zfs-tests/cmd/ctime.c b/tests/zfs-tests/cmd/ctime.c
index 6d9cf9608969..5ff1cea8a869 100644
--- a/tests/zfs-tests/cmd/ctime.c
+++ b/tests/zfs-tests/cmd/ctime.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
@@ -327,7 +327,6 @@ main(void)
if (access(tfile, F_OK) == 0) {
(void) unlink(tfile);
}
- ret = 0;
if ((fd = open(tfile, O_WRONLY | O_CREAT | O_TRUNC, ALL_MODE)) == -1) {
(void) fprintf(stderr, "open(%s) failed: %d\n", tfile, errno);
return (1);
@@ -363,12 +362,20 @@ main(void)
return (1);
}
- if (t1 == t2) {
- (void) fprintf(stderr, "%s: t1(%ld) == t2(%ld)\n",
+
+ /*
+ * Ideally, time change would be exactly two seconds, but allow
+ * a little slack in case of scheduling delays or similar.
+ */
+ long delta = (long)t2 - (long)t1;
+ if (delta < 2 || delta > 4) {
+ (void) fprintf(stderr,
+ "%s: BAD time change: t1(%ld), t2(%ld)\n",
timetest_table[i].name, (long)t1, (long)t2);
return (1);
} else {
- (void) fprintf(stderr, "%s: t1(%ld) != t2(%ld)\n",
+ (void) fprintf(stderr,
+ "%s: good time change: t1(%ld), t2(%ld)\n",
timetest_table[i].name, (long)t1, (long)t2);
}
}
diff --git a/tests/zfs-tests/cmd/devname2devid.c b/tests/zfs-tests/cmd/devname2devid.c
index 91e59c589fd5..0f3655be7143 100644
--- a/tests/zfs-tests/cmd/devname2devid.c
+++ b/tests/zfs-tests/cmd/devname2devid.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
diff --git a/tests/zfs-tests/cmd/dir_rd_update.c b/tests/zfs-tests/cmd/dir_rd_update.c
index 0f460fbecdc2..c0d283105a92 100644
--- a/tests/zfs-tests/cmd/dir_rd_update.c
+++ b/tests/zfs-tests/cmd/dir_rd_update.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
@@ -63,13 +63,12 @@ main(int argc, char **argv)
}
cp1 = argv[1];
- if (strlen(cp1) >= (sizeof (dirpath) - strlen("TMP_DIR"))) {
+ if (strlen(cp1) >= (sizeof (dirpath) - strlen("/TMP_DIR"))) {
(void) printf("The string length of mount point is "
"too large\n");
exit(-1);
}
- (void) strcpy(&dirpath[0], (const char *)cp1);
- (void) strcat(&dirpath[strlen(dirpath)], "TMP_DIR");
+ (void) snprintf(dirpath, sizeof (dirpath), "%s/TMP_DIR", cp1);
ret = mkdir(dirpath, 0777);
if (ret != 0) {
diff --git a/tests/zfs-tests/cmd/dosmode_readonly_write.c b/tests/zfs-tests/cmd/dosmode_readonly_write.c
index 0441d1c7b472..b45602d80651 100644
--- a/tests/zfs-tests/cmd/dosmode_readonly_write.c
+++ b/tests/zfs-tests/cmd/dosmode_readonly_write.c
@@ -1,5 +1,5 @@
/*
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2021 iXsystems, Inc.
*
diff --git a/tests/zfs-tests/cmd/draid.c b/tests/zfs-tests/cmd/draid.c
index d1183b4388a3..fdcec7bc6958 100644
--- a/tests/zfs-tests/cmd/draid.c
+++ b/tests/zfs-tests/cmd/draid.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
@@ -93,8 +93,8 @@ read_map(const char *filename, nvlist_t **allcfgs)
rc = gzread(fp, buf + bytes, block_size);
if ((rc < 0) || (rc == 0 && !gzeof(fp))) {
free(buf);
- (void) gzclose(fp);
(void) gzerror(fp, &error);
+ (void) gzclose(fp);
return (error);
} else {
bytes += rc;
@@ -139,7 +139,7 @@ read_map_key(const char *filename, const char *key, nvlist_t **cfg)
if (error != 0)
return (error);
- nvlist_lookup_nvlist(allcfgs, key, &foundcfg);
+ (void) nvlist_lookup_nvlist(allcfgs, key, &foundcfg);
if (foundcfg != NULL) {
nvlist_dup(foundcfg, cfg, KM_SLEEP);
error = 0;
@@ -375,7 +375,7 @@ dump_map_nv(const char *key, nvlist_t *cfg, int verbose)
map.dm_checksum = fnvlist_lookup_uint64(cfg, MAP_CHECKSUM);
map.dm_children = fnvlist_lookup_uint64(cfg, MAP_CHILDREN);
map.dm_nperms = fnvlist_lookup_uint64(cfg, MAP_NPERMS);
- nvlist_lookup_uint8_array(cfg, MAP_PERMS, &map.dm_perms, &c);
+ map.dm_perms = fnvlist_lookup_uint8_array(cfg, MAP_PERMS, &c);
dump_map(&map, key, (double)worst_ratio / 1000.0,
avg_ratio / 1000.0, verbose);
@@ -505,6 +505,8 @@ eval_resilver(draid_map_t *map, uint64_t groupwidth, uint64_t nspares,
int *ios = calloc(map->dm_children, sizeof (uint64_t));
+ ASSERT3P(ios, !=, NULL);
+
/* Resilver all rows */
for (int i = 0; i < map->dm_nperms; i++) {
uint8_t *row = &map->dm_perms[i * map->dm_children];
@@ -720,8 +722,11 @@ eval_maps(uint64_t children, int passes, uint64_t *map_seed,
*/
error = alloc_new_map(children, MAP_ROWS_DEFAULT,
vdev_draid_rand(map_seed), &map);
- if (error)
+ if (error) {
+ if (best_map != NULL)
+ free_map(best_map);
return (error);
+ }
/*
* Consider maps with a lower worst_ratio to be of higher
@@ -767,7 +772,7 @@ static int
draid_generate(int argc, char *argv[])
{
char filename[MAXPATHLEN] = {0};
- uint64_t map_seed;
+ uint64_t map_seed[2];
int c, fd, error, verbose = 0, passes = 1, continuous = 0;
int min_children = VDEV_DRAID_MIN_CHILDREN;
int max_children = VDEV_DRAID_MAX_CHILDREN;
@@ -825,7 +830,7 @@ draid_generate(int argc, char *argv[])
}
if (argc > optind)
- strncpy(filename, argv[optind], MAXPATHLEN - 1);
+ strlcpy(filename, argv[optind], sizeof (filename));
else {
(void) fprintf(stderr, "A FILE must be specified.\n");
return (1);
@@ -844,11 +849,12 @@ restart:
ssize_t bytes_read = 0;
while (bytes_read < bytes) {
- ssize_t rc = read(fd, ((char *)&map_seed) + bytes_read,
+ ssize_t rc = read(fd, ((char *)map_seed) + bytes_read,
bytes - bytes_read);
if (rc < 0) {
printf("Unable to read /dev/urandom: %s\n:",
strerror(errno));
+ close(fd);
return (1);
}
bytes_read += rc;
@@ -872,7 +878,7 @@ restart:
double worst_ratio = 1000.0;
double avg_ratio = 1000.0;
- error = eval_maps(children, passes, &map_seed, &map,
+ error = eval_maps(children, passes, map_seed, &map,
&worst_ratio, &avg_ratio);
if (error) {
printf("Error eval_maps(): %s\n", strerror(error));
@@ -956,9 +962,9 @@ draid_verify(int argc, char *argv[])
return (ENOMEM);
if (realpath(argv[optind], abspath) != NULL)
- strncpy(filename, abspath, MAXPATHLEN - 1);
+ strlcpy(filename, abspath, sizeof (filename));
else
- strncpy(filename, argv[optind], MAXPATHLEN - 1);
+ strlcpy(filename, argv[optind], sizeof (filename));
free(abspath);
} else {
@@ -1165,7 +1171,7 @@ draid_dump(int argc, char *argv[])
}
if (argc > optind)
- strncpy(filename, argv[optind], MAXPATHLEN - 1);
+ strlcpy(filename, argv[optind], sizeof (filename));
else {
(void) fprintf(stderr, "A FILE must be specified.\n");
return (1);
@@ -1202,7 +1208,7 @@ draid_table(int argc, char *argv[])
int error;
if (argc > optind)
- strncpy(filename, argv[optind], MAXPATHLEN - 1);
+ strlcpy(filename, argv[optind], sizeof (filename));
else {
(void) fprintf(stderr, "A FILE must be specified.\n");
return (1);
@@ -1261,7 +1267,7 @@ draid_merge_impl(nvlist_t *allcfgs, const char *srcfilename, int *mergedp)
uint64_t nv_worst_ratio;
uint64_t allcfg_worst_ratio;
nvlist_t *cfg, *allcfg;
- char *key;
+ const char *key;
switch (nvpair_type(elem)) {
case DATA_TYPE_NVLIST:
@@ -1279,12 +1285,11 @@ draid_merge_impl(nvlist_t *allcfgs, const char *srcfilename, int *mergedp)
if (nv_worst_ratio < allcfg_worst_ratio) {
fnvlist_remove(allcfgs, key);
- error = nvlist_add_nvlist(allcfgs,
- key, cfg);
+ fnvlist_add_nvlist(allcfgs, key, cfg);
merged++;
}
} else if (error == ENOENT) {
- error = nvlist_add_nvlist(allcfgs, key, cfg);
+ fnvlist_add_nvlist(allcfgs, key, cfg);
merged++;
} else {
return (error);
@@ -1336,7 +1341,7 @@ draid_merge(int argc, char *argv[])
return (1);
}
- strncpy(filename, argv[optind], MAXPATHLEN - 1);
+ strlcpy(filename, argv[optind], sizeof (filename));
optind++;
error = read_map(filename, &allcfgs);
@@ -1351,7 +1356,7 @@ draid_merge(int argc, char *argv[])
char srcfilename[MAXPATHLEN] = {0};
int merged = 0;
- strncpy(srcfilename, argv[optind], MAXPATHLEN - 1);
+ strlcpy(srcfilename, argv[optind], sizeof (srcfilename));
error = draid_merge_impl(allcfgs, srcfilename, &merged);
if (error) {
diff --git a/tests/zfs-tests/cmd/ereports.c b/tests/zfs-tests/cmd/ereports.c
index 392f5952d27a..42168997c0a8 100644
--- a/tests/zfs-tests/cmd/ereports.c
+++ b/tests/zfs-tests/cmd/ereports.c
@@ -62,7 +62,7 @@ static const char *const criteria_name[] = {
static void
print_ereport_line(nvlist_t *nvl)
{
- char *class;
+ const char *class;
int last = CRITERIA_NAMES_COUNT - 1;
/*
@@ -81,7 +81,7 @@ print_ereport_line(nvlist_t *nvl)
nvpair_t *nvp;
uint32_t i32 = 0;
uint64_t i64 = 0;
- char *str = NULL;
+ const char *str = NULL;
if (nvlist_lookup_nvpair(nvl, criteria_name[i], &nvp) != 0) {
/* print a proxy for optional criteria */
diff --git a/tests/zfs-tests/cmd/file/file_append.c b/tests/zfs-tests/cmd/file/file_append.c
index 32433e4fa2f6..3c2e196121e1 100644
--- a/tests/zfs-tests/cmd/file/file_append.c
+++ b/tests/zfs-tests/cmd/file/file_append.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
diff --git a/tests/zfs-tests/cmd/file/file_check.c b/tests/zfs-tests/cmd/file/file_check.c
index c93b56f45bba..1976beffaf28 100644
--- a/tests/zfs-tests/cmd/file/file_check.c
+++ b/tests/zfs-tests/cmd/file/file_check.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
diff --git a/tests/zfs-tests/cmd/file/file_common.h b/tests/zfs-tests/cmd/file/file_common.h
index f0c0e32b5f4e..2aedf2905aef 100644
--- a/tests/zfs-tests/cmd/file/file_common.h
+++ b/tests/zfs-tests/cmd/file/file_common.h
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
diff --git a/tests/zfs-tests/cmd/file/file_fadvise.c b/tests/zfs-tests/cmd/file/file_fadvise.c
new file mode 100644
index 000000000000..d64e2dea3696
--- /dev/null
+++ b/tests/zfs-tests/cmd/file/file_fadvise.c
@@ -0,0 +1,101 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or https://opensource.org/licenses/CDDL-1.0.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Copyright (c) 2022 by Information2 Software, Inc. All rights reserved.
+ */
+
+#include "file_common.h"
+#include <sys/types.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+
+/*
+ * Call fadvise to prefetch data
+ */
+static const char *execname = "file_fadvise";
+
+static void
+usage(void)
+{
+ (void) fprintf(stderr,
+ "usage: %s -f filename -a advise \n", execname);
+}
+
+int
+main(int argc, char *argv[])
+{
+ char *filename = NULL;
+ int advise = 0;
+ int fd, ch;
+ int err = 0;
+
+ while ((ch = getopt(argc, argv, "a:f:")) != EOF) {
+ switch (ch) {
+ case 'a':
+ advise = atoll(optarg);
+ break;
+ case 'f':
+ filename = optarg;
+ break;
+ case '?':
+ (void) printf("unknown arg %c\n", optopt);
+ usage();
+ break;
+ }
+ }
+
+ if (!filename) {
+ (void) printf("Filename not specified (-f <file>)\n");
+ err++;
+ }
+
+ if (advise < POSIX_FADV_NORMAL || advise > POSIX_FADV_NOREUSE) {
+ (void) printf("advise is invalid\n");
+ err++;
+ }
+
+ if (err) {
+ usage(); /* no return */
+ return (1);
+ }
+
+ if ((fd = open(filename, O_RDWR, 0666)) < 0) {
+ perror("open");
+ return (1);
+ }
+
+ if (posix_fadvise(fd, 0, 0, advise) != 0) {
+ perror("posix_fadvise");
+ close(fd);
+ return (1);
+ }
+
+ close(fd);
+
+ return (0);
+}
diff --git a/tests/zfs-tests/cmd/file/file_trunc.c b/tests/zfs-tests/cmd/file/file_trunc.c
index 69096752efa2..9e3bba24afdf 100644
--- a/tests/zfs-tests/cmd/file/file_trunc.c
+++ b/tests/zfs-tests/cmd/file/file_trunc.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
@@ -53,7 +53,7 @@ static long fsize = FSIZE;
static size_t bsize = BSIZE;
static int count = 0;
static int rflag = 0;
-static int seed = 0;
+static uint_t seed = 0;
static int vflag = 0;
static int errflag = 0;
static off_t offset = 0;
@@ -105,7 +105,7 @@ parse_options(int argc, char *argv[])
extern int optind, optopt;
count = fsize / bsize;
- seed = time(NULL);
+ seed = (uint_t)time(NULL);
while ((c = getopt(argc, argv, "b:c:f:o:rs:v")) != -1) {
switch (c) {
case 'b':
diff --git a/tests/zfs-tests/cmd/file/file_write.c b/tests/zfs-tests/cmd/file/file_write.c
index 8791c151f66f..ce1fa5d9bc02 100644
--- a/tests/zfs-tests/cmd/file/file_write.c
+++ b/tests/zfs-tests/cmd/file/file_write.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
diff --git a/tests/zfs-tests/cmd/file/largest_file.c b/tests/zfs-tests/cmd/file/largest_file.c
index 5acb5f1db87d..d7252556b3cf 100644
--- a/tests/zfs-tests/cmd/file/largest_file.c
+++ b/tests/zfs-tests/cmd/file/largest_file.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
@@ -78,6 +78,8 @@ main(int argc, char **argv)
return (errno);
testfile = strdup(argv[1]);
+ if (testfile == NULL)
+ return (errno);
fd = open(testfile, O_CREAT | O_RDWR, mode);
if (fd < 0) {
diff --git a/tests/zfs-tests/cmd/file/randfree_file.c b/tests/zfs-tests/cmd/file/randfree_file.c
index e00780cd2e81..1bb897881830 100644
--- a/tests/zfs-tests/cmd/file/randfree_file.c
+++ b/tests/zfs-tests/cmd/file/randfree_file.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
diff --git a/tests/zfs-tests/cmd/file/randwritecomp.c b/tests/zfs-tests/cmd/file/randwritecomp.c
index cc70d1212f84..2d5c0ec8643c 100644
--- a/tests/zfs-tests/cmd/file/randwritecomp.c
+++ b/tests/zfs-tests/cmd/file/randwritecomp.c
@@ -152,6 +152,11 @@ main(int argc, char *argv[])
n = strtoull(argv[0], NULL, 0);
fd = open(filename, O_RDWR|O_CREAT, 0666);
+ if (fd == -1) {
+ (void) fprintf(stderr, "open(%s) failed: %s\n", filename,
+ strerror(errno));
+ exit(EXIT_FAILURE);
+ }
err = fstat(fd, &ss);
if (err != 0) {
(void) fprintf(stderr,
diff --git a/tests/zfs-tests/cmd/get_diff.c b/tests/zfs-tests/cmd/get_diff.c
index 3f8fe787f7b9..61467f25014c 100644
--- a/tests/zfs-tests/cmd/get_diff.c
+++ b/tests/zfs-tests/cmd/get_diff.c
@@ -96,7 +96,7 @@ main(int argc, char *argv[])
off += bytes;
}
- if (diff_len != 0 && diff_len != 0) {
+ if (diff_len != 0) {
(void) fprintf(stdout, "%lld,%lld\n", (long long)diff_off,
(long long)diff_len);
}
diff --git a/tests/zfs-tests/cmd/idmap_util.c b/tests/zfs-tests/cmd/idmap_util.c
new file mode 100644
index 000000000000..49483cbaa421
--- /dev/null
+++ b/tests/zfs-tests/cmd/idmap_util.c
@@ -0,0 +1,808 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or https://opensource.org/licenses/CDDL-1.0.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <string.h>
+#include <linux/types.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+#include <sys/mount.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sched.h>
+#include <syscall.h>
+#include <sys/socket.h>
+
+#include <sys/list.h>
+
+#ifndef UINT_MAX
+#define UINT_MAX 4294967295U
+#endif
+
+#ifndef __NR_Linux
+#if defined __alpha__
+#define __NR_Linux 110
+#elif defined _MIPS_SIM
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+#define __NR_Linux 4000
+#endif
+#if _MIPS_SIM == _MIPS_SIM_NABI32
+#define __NR_Linux 6000
+#endif
+#if _MIPS_SIM == _MIPS_SIM_ABI64
+#define __NR_Linux 5000
+#endif
+#elif defined __ia64__
+#define __NR_Linux 1024
+#else
+#define __NR_Linux 0
+#endif
+#endif
+
+#ifndef __NR_mount_setattr
+#define __NR_mount_setattr (442 + __NR_Linux)
+#endif
+
+#ifndef __NR_open_tree
+#define __NR_open_tree (428 + __NR_Linux)
+#endif
+
+#ifndef __NR_move_mount
+#define __NR_move_mount (429 + __NR_Linux)
+#endif
+
+#ifndef MNT_DETACH
+#define MNT_DETACH 2
+#endif
+
+#ifndef MOVE_MOUNT_F_EMPTY_PATH
+#define MOVE_MOUNT_F_EMPTY_PATH 0x00000004
+#endif
+
+#ifndef MOUNT_ATTR_IDMAP
+#define MOUNT_ATTR_IDMAP 0x00100000
+#endif
+
+#ifndef OPEN_TREE_CLONE
+#define OPEN_TREE_CLONE 1
+#endif
+
+#ifndef OPEN_TREE_CLOEXEC
+#define OPEN_TREE_CLOEXEC O_CLOEXEC
+#endif
+
+#ifndef AT_RECURSIVE
+#define AT_RECURSIVE 0x8000
+#endif
+
+typedef struct {
+ __u64 attr_set;
+ __u64 attr_clr;
+ __u64 propagation;
+ __u64 userns_fd;
+} mount_attr_t;
+
+static inline int
+sys_mount_setattr(int dfd, const char *path, unsigned int flags,
+ mount_attr_t *attr, size_t size)
+{
+ return (syscall(__NR_mount_setattr, dfd, path, flags, attr, size));
+}
+
+static inline int
+sys_open_tree(int dfd, const char *filename, unsigned int flags)
+{
+ return (syscall(__NR_open_tree, dfd, filename, flags));
+}
+
+static inline int sys_move_mount(int from_dfd, const char *from_pathname,
+ int to_dfd, const char *to_pathname, unsigned int flags)
+{
+ return (syscall(__NR_move_mount, from_dfd, from_pathname, to_dfd,
+ to_pathname, flags));
+}
+
+typedef enum idmap_type_t {
+ TYPE_UID,
+ TYPE_GID,
+ TYPE_BOTH
+} idmap_type_t;
+
+struct idmap_entry {
+ __u32 first;
+ __u32 lower_first;
+ __u32 count;
+ idmap_type_t type;
+ list_node_t node;
+};
+
+static void
+log_msg(const char *msg, ...)
+{
+ va_list ap;
+
+ va_start(ap, msg);
+ vfprintf(stderr, msg, ap);
+ fputc('\n', stderr);
+ va_end(ap);
+}
+
+#define log_errno(msg, args...) \
+ do { \
+ log_msg("%s:%d:%s: [%m] " msg, __FILE__, __LINE__,\
+ __FUNCTION__, ##args); \
+ } while (0)
+
+/*
+ * Parse the idmapping in the following format
+ * and add to the list:
+ *
+ * u:nsid_first:hostid_first:count
+ * g:nsid_first:hostid_first:count
+ * b:nsid_first:hostid_first:count
+ *
+ * The delimiter can be : or space character.
+ *
+ * Return:
+ * 0 if success
+ * ENOMEM if out of memory
+ * EINVAL if wrong arg or input
+ */
+static int
+parse_idmap_entry(list_t *head, char *input)
+{
+ char *token, *savedptr = NULL;
+ struct idmap_entry *entry;
+ unsigned long ul;
+ char *delimiter = (char *)": ";
+ char c;
+
+ if (!input || !head)
+ return (EINVAL);
+ entry = malloc(sizeof (*entry));
+ if (!entry)
+ return (ENOMEM);
+
+ token = strtok_r(input, delimiter, &savedptr);
+ if (token)
+ c = token[0];
+ if (!token || (c != 'b' && c != 'u' && c != 'g'))
+ goto errout;
+ entry->type = (c == 'b') ? TYPE_BOTH :
+ ((c == 'u') ? TYPE_UID : TYPE_GID);
+
+ token = strtok_r(NULL, delimiter, &savedptr);
+ if (!token)
+ goto errout;
+ ul = strtoul(token, NULL, 10);
+ if (ul > UINT_MAX || errno != 0)
+ goto errout;
+ entry->first = (__u32)ul;
+
+ token = strtok_r(NULL, delimiter, &savedptr);
+ if (!token)
+ goto errout;
+ ul = strtoul(token, NULL, 10);
+ if (ul > UINT_MAX || errno != 0)
+ goto errout;
+ entry->lower_first = (__u32)ul;
+
+ token = strtok_r(NULL, delimiter, &savedptr);
+ if (!token)
+ goto errout;
+ ul = strtoul(token, NULL, 10);
+ if (ul > UINT_MAX || errno != 0)
+ goto errout;
+ entry->count = (__u32)ul;
+
+ list_insert_tail(head, entry);
+
+ return (0);
+
+errout:
+ free(entry);
+ return (EINVAL);
+}
+
+/*
+ * Release all the entries in the list
+ */
+static void
+free_idmap(list_t *head)
+{
+ struct idmap_entry *entry;
+
+ while ((entry = list_remove_head(head)) != NULL)
+ free(entry);
+ /* list_destroy() to be done by the caller */
+}
+
+/*
+ * Write all bytes in the buffer to fd
+ */
+static ssize_t
+write_buf(int fd, const char *buf, size_t buf_size)
+{
+ ssize_t written, total_written = 0;
+ size_t remaining = buf_size;
+ char *position = (char *)buf;
+
+ for (;;) {
+ written = write(fd, position, remaining);
+ if (written < 0 && errno == EINTR)
+ continue;
+ if (written < 0) {
+ log_errno("write");
+ return (written);
+ }
+ total_written += written;
+ if (total_written == buf_size)
+ break;
+ remaining -= written;
+ position += written;
+ }
+
+ return (total_written);
+}
+
+/*
+ * Read data from file into buffer
+ */
+static ssize_t
+read_buf(int fd, char *buf, size_t buf_size)
+{
+ int ret;
+ for (;;) {
+ ret = read(fd, buf, buf_size);
+ if (ret < 0 && errno == EINTR)
+ continue;
+ break;
+ }
+ if (ret < 0)
+ log_errno("read");
+ return (ret);
+}
+
+/*
+ * Write idmap of the given type in the buffer to the
+ * process' uid_map or gid_map proc file.
+ *
+ * Return:
+ * 0 if success
+ * errno if there's any error
+ */
+static int
+write_idmap(pid_t pid, char *buf, size_t buf_size, idmap_type_t type)
+{
+ char path[PATH_MAX];
+ int fd = -EBADF;
+ int ret;
+
+ (void) snprintf(path, sizeof (path), "/proc/%d/%cid_map",
+ pid, type == TYPE_UID ? 'u' : 'g');
+ fd = open(path, O_WRONLY | O_CLOEXEC);
+ if (fd < 0) {
+ ret = errno;
+ log_errno("open(%s)", path);
+ goto out;
+ }
+ ret = write_buf(fd, buf, buf_size);
+ if (ret < 0)
+ ret = errno;
+ else
+ ret = 0;
+out:
+ if (fd >= 0)
+ close(fd);
+ return (ret);
+}
+
+/*
+ * Write idmap info in the list to the process
+ * user namespace, i.e. its /proc/<pid>/uid_map
+ * and /proc/<pid>/gid_map file.
+ *
+ * Return:
+ * 0 if success
+ * errno if it fails
+ */
+static int
+write_pid_idmaps(pid_t pid, list_t *head)
+{
+ char *buf_uids, *buf_gids;
+ char *curr_bufu, *curr_bufg;
+ /* max 4k to be allowed for each map */
+ int size_buf_uids = 4096, size_buf_gids = 4096;
+ struct idmap_entry *entry;
+ int uid_filled, gid_filled;
+ int ret = 0;
+ int has_uids = 0, has_gids = 0;
+ size_t buf_size;
+
+ buf_uids = malloc(size_buf_uids);
+ if (!buf_uids)
+ return (ENOMEM);
+ buf_gids = malloc(size_buf_gids);
+ if (!buf_gids) {
+ free(buf_uids);
+ return (ENOMEM);
+ }
+ curr_bufu = buf_uids;
+ curr_bufg = buf_gids;
+
+ for (entry = list_head(head); entry; entry = list_next(head, entry)) {
+ if (entry->type == TYPE_UID || entry->type == TYPE_BOTH) {
+ uid_filled = snprintf(curr_bufu, size_buf_uids,
+ "%u %u %u\n", entry->first, entry->lower_first,
+ entry->count);
+ if (uid_filled <= 0 || uid_filled >= size_buf_uids) {
+ ret = E2BIG;
+ goto out;
+ }
+ curr_bufu += uid_filled;
+ size_buf_uids -= uid_filled;
+ has_uids = 1;
+ }
+ if (entry->type == TYPE_GID || entry->type == TYPE_BOTH) {
+ gid_filled = snprintf(curr_bufg, size_buf_gids,
+ "%u %u %u\n", entry->first, entry->lower_first,
+ entry->count);
+ if (gid_filled <= 0 || gid_filled >= size_buf_gids) {
+ ret = E2BIG;
+ goto out;
+ }
+ curr_bufg += gid_filled;
+ size_buf_gids -= gid_filled;
+ has_gids = 1;
+ }
+ }
+ if (has_uids) {
+ buf_size = curr_bufu - buf_uids;
+ ret = write_idmap(pid, buf_uids, buf_size, TYPE_UID);
+ if (ret)
+ goto out;
+ }
+ if (has_gids) {
+ buf_size = curr_bufg - buf_gids;
+ ret = write_idmap(pid, buf_gids, buf_size, TYPE_GID);
+ }
+
+out:
+ free(buf_uids);
+ free(buf_gids);
+ return (ret);
+}
+
+/*
+ * Wait for the child process to exit
+ * and reap it.
+ *
+ * Return:
+ * process exit code if available
+ */
+static int
+wait_for_pid(pid_t pid)
+{
+ int status;
+ int ret;
+
+ for (;;) {
+ ret = waitpid(pid, &status, 0);
+ if (ret < 0) {
+ if (errno == EINTR)
+ continue;
+ return (EXIT_FAILURE);
+ }
+ break;
+ }
+ if (!WIFEXITED(status))
+ return (EXIT_FAILURE);
+ return (WEXITSTATUS(status));
+}
+
+/*
+ * Get the file descriptor of the process user namespace
+ * given its pid.
+ *
+ * Return:
+ * fd if success
+ * -1 if it fails
+ */
+static int
+userns_fd_from_pid(pid_t pid)
+{
+ int fd;
+ char path[PATH_MAX];
+
+ (void) snprintf(path, sizeof (path), "/proc/%d/ns/user", pid);
+ fd = open(path, O_RDONLY | O_CLOEXEC);
+ if (fd < 0)
+ log_errno("open(%s)", path);
+ return (fd);
+}
+
+/*
+ * Get the user namespace file descriptor given a list
+ * of idmap info.
+ *
+ * Return:
+ * fd if success
+ * -errno if it fails
+ */
+static int
+userns_fd_from_idmap(list_t *head)
+{
+ pid_t pid;
+ int ret, fd;
+ int fds[2];
+ char c;
+ int saved_errno = 0;
+
+ /* socketpair for bidirectional communication */
+ ret = socketpair(AF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0, fds);
+ if (ret) {
+ log_errno("socketpair");
+ return (-errno);
+ }
+
+ pid = fork();
+ if (pid < 0) {
+ log_errno("fork");
+ fd = -errno;
+ goto out;
+ }
+
+ if (pid == 0) {
+ /* child process */
+ ret = unshare(CLONE_NEWUSER);
+ if (ret == 0) {
+ /* notify the parent of success */
+ ret = write_buf(fds[1], "1", 1);
+ if (ret < 0)
+ saved_errno = errno;
+ else {
+ /*
+ * Until the parent has written to idmap,
+ * we cannot exit, otherwise the defunct
+ * process is owned by the real root, writing
+ * to its idmap ends up with EPERM in the
+ * context of a user ns
+ */
+ ret = read_buf(fds[1], &c, 1);
+ if (ret < 0)
+ saved_errno = errno;
+ }
+ } else {
+ saved_errno = errno;
+ log_errno("unshare");
+ ret = write_buf(fds[1], "0", 1);
+ if (ret < 0)
+ saved_errno = errno;
+ }
+ exit(saved_errno);
+ }
+
+ /* parent process */
+ ret = read_buf(fds[0], &c, 1);
+ if (ret == 1 && c == '1') {
+ ret = write_pid_idmaps(pid, head);
+ if (!ret) {
+ fd = userns_fd_from_pid(pid);
+ if (fd < 0)
+ fd = -errno;
+ } else {
+ fd = -ret;
+ }
+ /* Let child know it can exit */
+ (void) write_buf(fds[0], "1", 1);
+ } else {
+ fd = -EBADF;
+ }
+ (void) wait_for_pid(pid);
+out:
+ close(fds[0]);
+ close(fds[1]);
+ return (fd);
+}
+
+/*
+ * Check if the operating system supports idmapped mount on the
+ * given path or not.
+ *
+ * Return:
+ * true if supported
+ * false if not supported
+ */
+static bool
+is_idmap_supported(char *path)
+{
+ list_t head;
+ int ret;
+ int tree_fd = -EBADF, path_fd = -EBADF;
+ mount_attr_t attr = {
+ .attr_set = MOUNT_ATTR_IDMAP,
+ .userns_fd = -EBADF,
+ };
+
+ /* strtok_r() won't be happy with a const string */
+ /* To check if idmapped mount can be done in a user ns, map 0 to 0 */
+ char *input = strdup("b:0:0:1");
+
+ if (!input) {
+ errno = ENOMEM;
+ log_errno("strdup");
+ return (false);
+ }
+
+ list_create(&head, sizeof (struct idmap_entry),
+ offsetof(struct idmap_entry, node));
+ ret = parse_idmap_entry(&head, input);
+ if (ret) {
+ errno = ret;
+ log_errno("parse_idmap_entry(%s)", input);
+ goto out1;
+ }
+ ret = userns_fd_from_idmap(&head);
+ if (ret < 0)
+ goto out1;
+ attr.userns_fd = ret;
+ ret = openat(-EBADF, path, O_DIRECTORY | O_CLOEXEC);
+ if (ret < 0) {
+ log_errno("openat(%s)", path);
+ goto out;
+ }
+ path_fd = ret;
+ ret = sys_open_tree(path_fd, "", AT_EMPTY_PATH | AT_NO_AUTOMOUNT |
+ AT_SYMLINK_NOFOLLOW | OPEN_TREE_CLOEXEC | OPEN_TREE_CLONE);
+ if (ret < 0) {
+ log_errno("sys_open_tree");
+ goto out;
+ }
+ tree_fd = ret;
+ ret = sys_mount_setattr(tree_fd, "", AT_EMPTY_PATH, &attr,
+ sizeof (attr));
+ if (ret < 0) {
+ log_errno("sys_mount_setattr");
+ }
+out:
+ close(attr.userns_fd);
+out1:
+ free_idmap(&head);
+ list_destroy(&head);
+ if (tree_fd >= 0)
+ close(tree_fd);
+ if (path_fd >= 0)
+ close(path_fd);
+ free(input);
+ return (ret == 0);
+}
+
+/*
+ * Check if the given path is a mount point or not.
+ *
+ * Return:
+ * true if it is
+ * false otherwise
+ */
+static bool
+is_mountpoint(char *path)
+{
+ char *parent;
+ struct stat st_me, st_parent;
+ bool ret;
+
+ parent = malloc(strlen(path)+4);
+ if (!parent) {
+ errno = ENOMEM;
+ log_errno("malloc");
+ return (false);
+ }
+ strcat(strcpy(parent, path), "/..");
+ if (lstat(path, &st_me) != 0 ||
+ lstat(parent, &st_parent) != 0)
+ ret = false;
+ else
+ if (st_me.st_dev != st_parent.st_dev ||
+ st_me.st_ino == st_parent.st_ino)
+ ret = true;
+ else
+ ret = false;
+ free(parent);
+ return (ret);
+}
+
+/*
+ * Remount the source on the new target folder with the given
+ * list of idmap info. If target is NULL, the source will be
+ * unmounted and then remounted if it is a mountpoint, otherwise
+ * no unmount is done, the source is simply idmap remounted.
+ *
+ * Return:
+ * 0 if success
+ * -errno otherwise
+ */
+static int
+do_idmap_mount(list_t *idmap, char *source, char *target, int flags)
+{
+ int ret;
+ int tree_fd = -EBADF, source_fd = -EBADF;
+ mount_attr_t attr = {
+ .attr_set = MOUNT_ATTR_IDMAP,
+ .userns_fd = -EBADF,
+ };
+
+ ret = userns_fd_from_idmap(idmap);
+ if (ret < 0)
+ goto out1;
+ attr.userns_fd = ret;
+ ret = openat(-EBADF, source, O_DIRECTORY | O_CLOEXEC);
+ if (ret < 0) {
+ ret = -errno;
+ log_errno("openat(%s)", source);
+ goto out;
+ }
+ source_fd = ret;
+ ret = sys_open_tree(source_fd, "", AT_EMPTY_PATH | AT_NO_AUTOMOUNT |
+ AT_SYMLINK_NOFOLLOW | OPEN_TREE_CLOEXEC | OPEN_TREE_CLONE | flags);
+ if (ret < 0) {
+ ret = -errno;
+ log_errno("sys_open_tree");
+ goto out;
+ }
+ tree_fd = ret;
+ ret = sys_mount_setattr(tree_fd, "", AT_EMPTY_PATH | flags, &attr,
+ sizeof (attr));
+ if (ret < 0) {
+ ret = -errno;
+ log_errno("sys_mount_setattr");
+ goto out;
+ }
+ if (target == NULL && is_mountpoint(source)) {
+ ret = umount2(source, MNT_DETACH);
+ if (ret < 0) {
+ ret = -errno;
+ log_errno("umount2(%s)", source);
+ goto out;
+ }
+ }
+ ret = sys_move_mount(tree_fd, "", -EBADF, target == NULL ?
+ source : target, MOVE_MOUNT_F_EMPTY_PATH);
+ if (ret < 0) {
+ ret = -errno;
+ log_errno("sys_move_mount(%s)", target == NULL ?
+ source : target);
+ }
+out:
+ close(attr.userns_fd);
+out1:
+ if (tree_fd >= 0)
+ close(tree_fd);
+ if (source_fd >= 0)
+ close(source_fd);
+ return (ret);
+}
+
+static void
+print_usage(char *argv[])
+{
+ fprintf(stderr, "Usage: %s [-r] [-c] [-m <idmap1>] [-m <idmap2>]" \
+ " ... [<source>] [<target>]\n", argv[0]);
+ fprintf(stderr, "\n");
+ fprintf(stderr, " -r Recursively do idmapped mount.\n");
+ fprintf(stderr, "\n");
+ fprintf(stderr, " -c Checks if idmapped mount is supported " \
+ "on the <source> by the operating system or not.\n");
+ fprintf(stderr, "\n");
+ fprintf(stderr, " -m <idmap> to specify the idmap info, " \
+ "in the following format:\n");
+ fprintf(stderr, " <id_type>:<nsid_first>:<hostid_first>:<count>\n");
+ fprintf(stderr, "\n");
+ fprintf(stderr, " <id_type> can be either of 'b', 'u', and 'g'.\n");
+ fprintf(stderr, "\n");
+ fprintf(stderr, "The <source> folder will be mounted at <target> " \
+ "with the provided idmap information.\nIf no <target> is " \
+ "specified, and <source> is a mount point, " \
+ "then <source> will be unmounted and then remounted.\n");
+}
+
+int
+main(int argc, char *argv[])
+{
+ int opt;
+ list_t idmap_head;
+ int check_supported = 0;
+ int ret = EXIT_SUCCESS;
+ char *source = NULL, *target = NULL;
+ int flags = 0;
+
+ list_create(&idmap_head, sizeof (struct idmap_entry),
+ offsetof(struct idmap_entry, node));
+
+ while ((opt = getopt(argc, argv, "rcm:")) != -1) {
+ switch (opt) {
+ case 'r':
+ flags |= AT_RECURSIVE;
+ break;
+ case 'c':
+ check_supported = 1;
+ break;
+ case 'm':
+ ret = parse_idmap_entry(&idmap_head, optarg);
+ if (ret) {
+ errno = ret;
+ log_errno("parse_idmap_entry(%s)", optarg);
+ ret = EXIT_FAILURE;
+ goto out;
+ }
+ break;
+ default:
+ print_usage(argv);
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (check_supported == 0 && list_is_empty(&idmap_head)) {
+ print_usage(argv);
+ ret = EXIT_FAILURE;
+ goto out;
+ }
+
+ if (optind >= argc) {
+ fprintf(stderr, "Expected to have <source>, <target>.\n");
+ print_usage(argv);
+ ret = EXIT_FAILURE;
+ goto out;
+ }
+
+ source = argv[optind];
+ if (optind < (argc - 1)) {
+ target = argv[optind + 1];
+ }
+
+ if (check_supported) {
+ free_idmap(&idmap_head);
+ list_destroy(&idmap_head);
+ if (is_idmap_supported(source)) {
+ printf("idmapped mount is supported on [%s].\n",
+ source);
+ return (EXIT_SUCCESS);
+ } else {
+ printf("idmapped mount is NOT supported.\n");
+ return (EXIT_FAILURE);
+ }
+ }
+
+ ret = do_idmap_mount(&idmap_head, source, target, flags);
+ if (ret)
+ ret = EXIT_FAILURE;
+out:
+ free_idmap(&idmap_head);
+ list_destroy(&idmap_head);
+
+ exit(ret);
+}
diff --git a/tests/zfs-tests/cmd/libzfs_input_check.c b/tests/zfs-tests/cmd/libzfs_input_check.c
index e84a00273cf8..c661718a296c 100644
--- a/tests/zfs-tests/cmd/libzfs_input_check.c
+++ b/tests/zfs-tests/cmd/libzfs_input_check.c
@@ -27,6 +27,7 @@
#include <sys/vdev_impl.h>
#include <sys/zfs_ioctl.h>
#include <sys/zfs_bootenv.h>
+#include <sys/fs/zfs.h>
/*
* Test the nvpair inputs for the non-legacy zfs ioctl commands.
@@ -528,7 +529,11 @@ test_recv_new(const char *dataset, int fd)
ssize_t count;
int cleanup_fd = open(ZFS_DEV, O_RDWR);
-
+ if (cleanup_fd == -1) {
+ (void) fprintf(stderr, "open(%s) failed: %s\n", ZFS_DEV,
+ strerror(errno));
+ exit(EXIT_FAILURE);
+ }
(void) snprintf(snapshot, sizeof (snapshot), "%s@replicant", dataset);
count = pread(fd, &drr, sizeof (drr), 0);
@@ -545,6 +550,7 @@ test_recv_new(const char *dataset, int fd)
fnvlist_add_string(props, "org.openzfs:launch", "September 17th, 2013");
fnvlist_add_nvlist(optional, "localprops", props);
fnvlist_add_boolean(optional, "force");
+ fnvlist_add_boolean(optional, "heal");
fnvlist_add_int32(optional, "cleanup_fd", cleanup_fd);
/*
@@ -558,7 +564,7 @@ test_recv_new(const char *dataset, int fd)
fnvlist_add_uint64(optional, "action_handle", *action_handle);
#endif
IOC_INPUT_TEST(ZFS_IOC_RECV_NEW, dataset, required, optional,
- ZFS_ERR_STREAM_TRUNCATED);
+ ENOTSUP);
nvlist_free(props);
nvlist_free(optional);
@@ -683,6 +689,17 @@ test_vdev_trim(const char *pool)
nvlist_free(required);
}
+/* Test with invalid values */
+static void
+test_scrub(const char *pool)
+{
+ nvlist_t *required = fnvlist_alloc();
+ fnvlist_add_uint64(required, "scan_type", POOL_SCAN_FUNCS + 1);
+ fnvlist_add_uint64(required, "scan_command", POOL_SCRUB_FLAGS_END + 1);
+ IOC_INPUT_TEST(ZFS_IOC_POOL_SCRUB, pool, required, NULL, EINVAL);
+ nvlist_free(required);
+}
+
static int
zfs_destroy(const char *dataset)
{
@@ -863,6 +880,8 @@ zfs_ioc_input_tests(const char *pool)
test_set_bootenv(pool);
test_get_bootenv(pool);
+ test_scrub(pool);
+
/*
* cleanup
*/
@@ -1017,6 +1036,7 @@ validate_ioc_values(void)
CHECK(ZFS_IOC_BASE + 82 == ZFS_IOC_GET_BOOKMARK_PROPS);
CHECK(ZFS_IOC_BASE + 83 == ZFS_IOC_WAIT);
CHECK(ZFS_IOC_BASE + 84 == ZFS_IOC_WAIT_FS);
+ CHECK(ZFS_IOC_BASE + 87 == ZFS_IOC_POOL_SCRUB);
CHECK(ZFS_IOC_PLATFORM_BASE + 1 == ZFS_IOC_EVENTS_NEXT);
CHECK(ZFS_IOC_PLATFORM_BASE + 2 == ZFS_IOC_EVENTS_CLEAR);
CHECK(ZFS_IOC_PLATFORM_BASE + 3 == ZFS_IOC_EVENTS_SEEK);
diff --git a/tests/zfs-tests/cmd/mkbusy.c b/tests/zfs-tests/cmd/mkbusy.c
index cc4a6cfcb98c..78860381d880 100644
--- a/tests/zfs-tests/cmd/mkbusy.c
+++ b/tests/zfs-tests/cmd/mkbusy.c
@@ -148,14 +148,10 @@ main(int argc, char *argv[])
}
if (!isdir) {
- int fd;
-
- if ((fd = open(fpath, O_CREAT | O_RDWR, 0600)) < 0)
+ if (open(fpath, O_CREAT | O_RDWR, 0600) < 0)
fail("open");
} else {
- DIR *dp;
-
- if ((dp = opendir(fpath)) == NULL)
+ if (opendir(fpath) == NULL)
fail("opendir");
}
free(fpath);
diff --git a/tests/zfs-tests/cmd/mkfile.c b/tests/zfs-tests/cmd/mkfile.c
index ede05a1220af..3b61deed6bf5 100644
--- a/tests/zfs-tests/cmd/mkfile.c
+++ b/tests/zfs-tests/cmd/mkfile.c
@@ -7,7 +7,7 @@
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
@@ -276,5 +276,9 @@ main(int argc, char **argv)
argv++;
argc--;
}
+
+ if (buf)
+ free(buf);
+
return (errors);
}
diff --git a/tests/zfs-tests/cmd/mktree.c b/tests/zfs-tests/cmd/mktree.c
index 8ee86e5a01f0..8ab38ee83aa8 100644
--- a/tests/zfs-tests/cmd/mktree.c
+++ b/tests/zfs-tests/cmd/mktree.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
diff --git a/tests/zfs-tests/cmd/mmap_exec.c b/tests/zfs-tests/cmd/mmap_exec.c
index db90adbdca10..462f985398b6 100644
--- a/tests/zfs-tests/cmd/mmap_exec.c
+++ b/tests/zfs-tests/cmd/mmap_exec.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
diff --git a/tests/zfs-tests/cmd/mmap_libaio.c b/tests/zfs-tests/cmd/mmap_libaio.c
index a02f46d91b30..5ee1f600a737 100644
--- a/tests/zfs-tests/cmd/mmap_libaio.c
+++ b/tests/zfs-tests/cmd/mmap_libaio.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
@@ -33,7 +33,7 @@
#include <libaio.h>
#include <err.h>
-io_context_t io_ctx;
+static io_context_t io_ctx;
static void
do_sync_io(struct iocb *iocb)
diff --git a/tests/zfs-tests/cmd/mmap_seek.c b/tests/zfs-tests/cmd/mmap_seek.c
index bb36527aafee..7be92d109565 100644
--- a/tests/zfs-tests/cmd/mmap_seek.c
+++ b/tests/zfs-tests/cmd/mmap_seek.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
diff --git a/tests/zfs-tests/cmd/mmap_sync.c b/tests/zfs-tests/cmd/mmap_sync.c
index 0e4bba37d7be..226e71be2f57 100644
--- a/tests/zfs-tests/cmd/mmap_sync.c
+++ b/tests/zfs-tests/cmd/mmap_sync.c
@@ -32,7 +32,7 @@
static void
cleanup(char *file)
{
- remove(file);
+ (void) remove(file);
}
int
@@ -59,7 +59,7 @@ main(int argc, char *argv[])
return (1);
}
- int run_time_mins = 5;
+ int run_time_mins = 1;
if (argc >= 2) {
run_time_mins = atoi(argv[1]);
}
@@ -73,8 +73,7 @@ main(int argc, char *argv[])
filepath[0] = '\0';
char *file = &filepath[0];
- strcat(file, testdir);
- strcat(file, "/msync_file");
+ (void) snprintf(file, 512, "%s/msync_file", testdir);
const int LEN = 8;
cleanup(file);
@@ -125,7 +124,8 @@ main(int argc, char *argv[])
elapsed += ((t2.tv_usec - t1.tv_usec) / 1000.0);
if (elapsed > max_msync_time_ms) {
fprintf(stderr, "slow msync: %f ms\n", elapsed);
- munmap(ptr, LEN);
+ if (munmap(ptr, LEN) != 0)
+ perror("munmap");
cleanup(file);
return (1);
}
diff --git a/tests/zfs-tests/cmd/mmapwrite.c b/tests/zfs-tests/cmd/mmapwrite.c
index 1f344534d53e..20a50085a227 100644
--- a/tests/zfs-tests/cmd/mmapwrite.c
+++ b/tests/zfs-tests/cmd/mmapwrite.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
@@ -52,6 +52,7 @@
*/
#define NORMAL_WRITE_TH_NUM 2
+#define MAX_WRITE_BYTES 262144000
static void *
normal_writer(void *filename)
@@ -66,15 +67,26 @@ normal_writer(void *filename)
err(1, "failed to open %s", file_path);
}
- char buf;
- while (1) {
+ char buf = 'z';
+ off_t bytes_written = 0;
+
+ while (bytes_written < MAX_WRITE_BYTES) {
write_num = write(fd, &buf, 1);
if (write_num == 0) {
err(1, "write failed!");
break;
}
- lseek(fd, page_size, SEEK_CUR);
+ if ((bytes_written = lseek(fd, page_size, SEEK_CUR)) == -1) {
+ err(1, "lseek failed on %s: %s", file_path,
+ strerror(errno));
+ break;
+ }
}
+
+ if (close(fd) != 0)
+ err(1, "failed to close file");
+
+ return (NULL);
}
static void *
@@ -84,29 +96,21 @@ map_writer(void *filename)
int ret = 0;
char *buf = NULL;
int page_size = getpagesize();
- int op_errno = 0;
char *file_path = filename;
while (1) {
- ret = access(file_path, F_OK);
- if (ret) {
- op_errno = errno;
- if (op_errno == ENOENT) {
+ fd = open(file_path, O_RDWR);
+ if (fd == -1) {
+ if (errno == ENOENT) {
fd = open(file_path, O_RDWR | O_CREAT, 0777);
if (fd == -1) {
err(1, "open file failed");
}
-
ret = ftruncate(fd, page_size);
if (ret == -1) {
err(1, "truncate file failed");
}
} else {
- err(1, "access file failed!");
- }
- } else {
- fd = open(file_path, O_RDWR, 0777);
- if (fd == -1) {
err(1, "open file failed");
}
}
diff --git a/tests/zfs-tests/cmd/nvlist_to_lua.c b/tests/zfs-tests/cmd/nvlist_to_lua.c
index b65b3fd269d9..57a8f51e1cc0 100644
--- a/tests/zfs-tests/cmd/nvlist_to_lua.c
+++ b/tests/zfs-tests/cmd/nvlist_to_lua.c
@@ -39,7 +39,7 @@ nvlist_equal(nvlist_t *nvla, nvlist_t *nvlb)
*/
for (nvpair_t *pair = nvlist_next_nvpair(nvla, NULL);
pair != NULL; pair = nvlist_next_nvpair(nvla, pair)) {
- char *key = nvpair_name(pair);
+ const char *key = nvpair_name(pair);
if (!nvlist_exists(nvlb, key))
return (B_FALSE);
@@ -129,6 +129,11 @@ run_tests(void)
/* Note: maximum nvlist key length is 32KB */
int len = 1024 * 31;
char *bigstring = malloc(len);
+ if (bigstring == NULL) {
+ perror("malloc");
+ exit(EXIT_FAILURE);
+ }
+
for (int i = 0; i < len; i++)
bigstring[i] = 'a' + i % 26;
bigstring[len - 1] = '\0';
diff --git a/tests/zfs-tests/cmd/readmmap.c b/tests/zfs-tests/cmd/readmmap.c
index f119e114d71e..a5c8079d0e46 100644
--- a/tests/zfs-tests/cmd/readmmap.c
+++ b/tests/zfs-tests/cmd/readmmap.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
@@ -44,6 +44,7 @@
#include <fcntl.h>
#include <errno.h>
#include <sys/mman.h>
+#include <sys/types.h>
#include <time.h>
int
@@ -55,7 +56,7 @@ main(int argc, char **argv)
char *buf = NULL;
char *map = NULL;
int fd = -1, bytes, retval = 0;
- unsigned seed;
+ uint_t seed;
if (argc < 2 || optind == argc) {
(void) fprintf(stderr,
@@ -92,7 +93,7 @@ main(int argc, char **argv)
retval = 1;
goto end;
}
- seed = time(NULL);
+ seed = (uint_t)time(NULL);
srandom(seed);
idx = random() % size;
diff --git a/tests/zfs-tests/cmd/rename_dir.c b/tests/zfs-tests/cmd/rename_dir.c
index 3c3f45146e16..568cbfe720b9 100644
--- a/tests/zfs-tests/cmd/rename_dir.c
+++ b/tests/zfs-tests/cmd/rename_dir.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
diff --git a/tests/zfs-tests/cmd/renameat2.c b/tests/zfs-tests/cmd/renameat2.c
new file mode 100644
index 000000000000..ddd10ffc3ac7
--- /dev/null
+++ b/tests/zfs-tests/cmd/renameat2.c
@@ -0,0 +1,128 @@
+/* SPDX-License-Identifier: CDDL-1.0 OR MPL-2.0 */
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or https://opensource.org/licenses/CDDL-1.0.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (C) 2019 Aleksa Sarai <cyphar@cyphar.com>
+ * Copyright (C) 2019 SUSE LLC
+ */
+
+/*
+ * mv(1) doesn't currently support RENAME_{EXCHANGE,WHITEOUT} so this is a very
+ * simple renameat2(2) wrapper for the OpenZFS self-tests.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/syscall.h>
+
+#ifndef SYS_renameat2
+#ifdef __NR_renameat2
+#define SYS_renameat2 __NR_renameat2
+#elif defined(__x86_64__)
+#define SYS_renameat2 316
+#elif defined(__i386__)
+#define SYS_renameat2 353
+#elif defined(__arm__) || defined(__aarch64__)
+#define SYS_renameat2 382
+#else
+#error "SYS_renameat2 not known for this architecture."
+#endif
+#endif
+
+#ifndef RENAME_NOREPLACE
+#define RENAME_NOREPLACE (1 << 0) /* Don't overwrite target */
+#endif
+#ifndef RENAME_EXCHANGE
+#define RENAME_EXCHANGE (1 << 1) /* Exchange source and dest */
+#endif
+#ifndef RENAME_WHITEOUT
+#define RENAME_WHITEOUT (1 << 2) /* Whiteout source */
+#endif
+
+/* glibc doesn't provide renameat2 wrapper, let's use our own */
+static int
+sys_renameat2(int olddirfd, const char *oldpath,
+ int newdirfd, const char *newpath, unsigned int flags)
+{
+ int ret = syscall(SYS_renameat2, olddirfd, oldpath, newdirfd, newpath,
+ flags);
+ return ((ret < 0) ? -errno : ret);
+}
+
+static void
+usage(void)
+{
+ fprintf(stderr, "usage: renameat2 [-Cnwx] src dst\n");
+ exit(1);
+}
+
+static void
+check(void)
+{
+ int err = sys_renameat2(AT_FDCWD, ".", AT_FDCWD, ".", RENAME_EXCHANGE);
+ exit(err == -ENOSYS);
+}
+
+int
+main(int argc, char **argv)
+{
+ char *src, *dst;
+ int ch, err;
+ unsigned int flags = 0;
+
+ while ((ch = getopt(argc, argv, "Cnwx")) >= 0) {
+ switch (ch) {
+ case 'C':
+ check();
+ break;
+ case 'n':
+ flags |= RENAME_NOREPLACE;
+ break;
+ case 'w':
+ flags |= RENAME_WHITEOUT;
+ break;
+ case 'x':
+ flags |= RENAME_EXCHANGE;
+ break;
+ default:
+ usage();
+ break;
+ }
+ }
+
+ argc -= optind;
+ argv += optind;
+
+ if (argc != 2)
+ usage();
+ src = argv[0];
+ dst = argv[1];
+
+ err = sys_renameat2(AT_FDCWD, src, AT_FDCWD, dst, flags);
+ if (err < 0)
+ fprintf(stderr, "renameat2: %s", strerror(-err));
+ return (err != 0);
+}
diff --git a/tests/zfs-tests/cmd/rm_lnkcnt_zero_file.c b/tests/zfs-tests/cmd/rm_lnkcnt_zero_file.c
index 9aeabb08e02f..0bf3b54cc090 100644
--- a/tests/zfs-tests/cmd/rm_lnkcnt_zero_file.c
+++ b/tests/zfs-tests/cmd/rm_lnkcnt_zero_file.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
diff --git a/tests/zfs-tests/cmd/send_doall.c b/tests/zfs-tests/cmd/send_doall.c
index 6f47df047478..e0ab6c41812c 100644
--- a/tests/zfs-tests/cmd/send_doall.c
+++ b/tests/zfs-tests/cmd/send_doall.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
diff --git a/tests/zfs-tests/cmd/stride_dd.c b/tests/zfs-tests/cmd/stride_dd.c
index 732ac9f47268..a20b26131650 100644
--- a/tests/zfs-tests/cmd/stride_dd.c
+++ b/tests/zfs-tests/cmd/stride_dd.c
@@ -25,8 +25,8 @@ static int bsize = 0;
static int count = 0;
static char *ifile = NULL;
static char *ofile = NULL;
-static int stride = 0;
-static int seek = 0;
+static off_t stride = 0;
+static off_t seek = 0;
static const char *execname = "stride_dd";
static void usage(void);
diff --git a/tests/zfs-tests/cmd/suid_write_to_file.c b/tests/zfs-tests/cmd/suid_write_to_file.c
index f3febb903b59..1a8157aa564f 100644
--- a/tests/zfs-tests/cmd/suid_write_to_file.c
+++ b/tests/zfs-tests/cmd/suid_write_to_file.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
diff --git a/tests/zfs-tests/cmd/threadsappend.c b/tests/zfs-tests/cmd/threadsappend.c
index 25710a3c12ef..b0ccd0ff6c42 100644
--- a/tests/zfs-tests/cmd/threadsappend.c
+++ b/tests/zfs-tests/cmd/threadsappend.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
diff --git a/tests/zfs-tests/cmd/user_ns_exec.c b/tests/zfs-tests/cmd/user_ns_exec.c
index cd46738bd0bd..d781301473a9 100644
--- a/tests/zfs-tests/cmd/user_ns_exec.c
+++ b/tests/zfs-tests/cmd/user_ns_exec.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
@@ -97,7 +97,6 @@ set_idmap(pid_t pid, const char *file)
mapfd = open(path, O_WRONLY);
if (mapfd < 0) {
- result = errno;
perror("open");
return (errno);
}
diff --git a/tests/zfs-tests/cmd/xattrtest.c b/tests/zfs-tests/cmd/xattrtest.c
index 4f82facb0682..4e72e9182b60 100644
--- a/tests/zfs-tests/cmd/xattrtest.c
+++ b/tests/zfs-tests/cmd/xattrtest.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
diff --git a/tests/zfs-tests/cmd/zed_fd_spill-zedlet.c b/tests/zfs-tests/cmd/zed_fd_spill-zedlet.c
index c072f906d23e..b248579abb7c 100644
--- a/tests/zfs-tests/cmd/zed_fd_spill-zedlet.c
+++ b/tests/zfs-tests/cmd/zed_fd_spill-zedlet.c
@@ -13,6 +13,7 @@
#include <sys/types.h>
#include <sys/wait.h>
+#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
@@ -28,7 +29,19 @@ int main(void) {
char buf[64];
sprintf(buf, "/tmp/zts-zed_fd_spill-logdir/%d", getppid());
- dup2(creat(buf, 0644), STDOUT_FILENO);
+ int fd = creat(buf, 0644);
+ if (fd == -1) {
+ (void) fprintf(stderr, "creat(%s) failed: %s\n", buf,
+ strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+
+ if (dup2(fd, STDOUT_FILENO) == -1) {
+ close(fd);
+ (void) fprintf(stderr, "dup2(%s, STDOUT_FILENO) failed: %s\n",
+ buf, strerror(errno));
+ exit(EXIT_FAILURE);
+ }
snprintf(buf, sizeof (buf), "/proc/%d/fd", getppid());
execlp("ls", "ls", buf, NULL);
diff --git a/tests/zfs-tests/cmd/zfs_diff-socket.c b/tests/zfs-tests/cmd/zfs_diff-socket.c
index be4bf31dde9f..3ebc95799fe3 100644
--- a/tests/zfs-tests/cmd/zfs_diff-socket.c
+++ b/tests/zfs-tests/cmd/zfs_diff-socket.c
@@ -37,8 +37,7 @@ main(int argc, char *argv[])
}
path = argv[1];
size = sizeof (sock.sun_path);
- strncpy(sock.sun_path, (char *)path, size - 1);
- sock.sun_path[size - 1] = '\0';
+ (void) snprintf(sock.sun_path, size, "%s", path);
sock.sun_family = AF_UNIX;
if ((fd = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1) {
diff --git a/tests/zfs-tests/include/blkdev.shlib b/tests/zfs-tests/include/blkdev.shlib
index 6b83b10d604d..51eff3023e73 100644
--- a/tests/zfs-tests/include/blkdev.shlib
+++ b/tests/zfs-tests/include/blkdev.shlib
@@ -289,7 +289,7 @@ function get_persistent_disk_name #device
if is_linux; then
if is_real_device $device; then
udevadm info -q all -n $DEV_DSKDIR/$device \
- | awk '/disk\/by-id/ {print $2; exit}' | cut -d/ -f3
+ | awk '/disk\/by-id/ {print $2; exit}' | cut -d/ -f3-
elif is_mpath_device $device; then
udevadm info -q all -n $DEV_DSKDIR/$device \
| awk '/disk\/by-id\/dm-uuid/ {print $2; exit}' \
diff --git a/tests/zfs-tests/include/commands.cfg b/tests/zfs-tests/include/commands.cfg
index 47357dca57fb..daa794551682 100644
--- a/tests/zfs-tests/include/commands.cfg
+++ b/tests/zfs-tests/include/commands.cfg
@@ -98,7 +98,8 @@ export SYSTEM_FILES_COMMON='awk
uname
uniq
vmstat
- wc'
+ wc
+ xargs'
export SYSTEM_FILES_FREEBSD='chflags
compress
@@ -130,12 +131,14 @@ export SYSTEM_FILES_LINUX='attr
chattr
exportfs
fallocate
+ flock
free
getfattr
groupadd
groupdel
groupmod
hostid
+ logger
losetup
lsattr
lsblk
@@ -145,20 +148,20 @@ export SYSTEM_FILES_LINUX='attr
md5sum
mkswap
modprobe
+ mountpoint
mpstat
nsenter
parted
perf
setfattr
+ setpriv
sha256sum
udevadm
unshare
useradd
userdel
usermod
-
- flock
- logger'
+ wipefs'
export ZFS_FILES='zdb
zfs
@@ -169,6 +172,7 @@ export ZFS_FILES='zdb
raidz_test
arc_summary
arcstat
+ zilstat
dbufstat
mount.zfs
zed
@@ -180,9 +184,13 @@ export ZFS_FILES='zdb
export ZFSTEST_FILES='badsend
btree_test
chg_usr_exec
+ clonefile
+ clone_mmap_cached
+ clone_mmap_write
devname2devid
dir_rd_update
draid
+ file_fadvise
file_append
file_check
file_trunc
@@ -205,6 +213,7 @@ export ZFSTEST_FILES='badsend
randwritecomp
readmmap
read_dos_attributes
+ renameat2
rename_dir
rm_lnkcnt_zero_file
send_doall
@@ -224,4 +233,5 @@ export ZFSTEST_FILES='badsend
truncate_test
ereports
zfs_diff-socket
- dosmode_readonly_write'
+ dosmode_readonly_write
+ idmap_util'
diff --git a/tests/zfs-tests/include/default.cfg.in b/tests/zfs-tests/include/default.cfg.in
index a9a17de34ae7..db70a02a7828 100644
--- a/tests/zfs-tests/include/default.cfg.in
+++ b/tests/zfs-tests/include/default.cfg.in
@@ -8,7 +8,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -80,7 +80,7 @@ export TESTPOOL=testpool
export TESTPOOL1=testpool1
export TESTPOOL2=testpool2
export TESTPOOL3=testpool3
-export PERFPOOL=perfpool
+export PERFPOOL=${PERFPOOL:-perfpool}
# some test file system names
export TESTFS=testfs
@@ -156,7 +156,7 @@ done
export MAX_PARTITIONS=8
if [ "@ASAN_ENABLED@" = "yes" ]; then
- export ASAN_OPTIONS=abort_on_error=true:halt_on_error=true:allocator_may_return_null=true:disable_coredump=false:detect_stack_use_after_return=true
+ export ASAN_OPTIONS=abort_on_error=true:halt_on_error=true:allocator_may_return_null=true:disable_coredump=false:detect_stack_use_after_return=true:detect_odr_violation=1
# TODO
# disable memory leaks detection
diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib
index cb20318f44c5..dfab48d2cdaf 100644
--- a/tests/zfs-tests/include/libtest.shlib
+++ b/tests/zfs-tests/include/libtest.shlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -37,6 +37,12 @@
. ${STF_SUITE}/include/math.shlib
. ${STF_SUITE}/include/blkdev.shlib
+# On AlmaLinux 9 we will see $PWD = '.' instead of the full path. This causes
+# some tests to fail. Fix it up here.
+if [ "$PWD" = "." ] ; then
+ PWD="$(readlink -f $PWD)"
+fi
+
#
# Apply constrained path when available. This is required since the
# PATH may have been modified by sudo's secure_path behavior.
@@ -55,13 +61,8 @@ function compare_version_gte
[ "$(printf "$1\n$2" | sort -V | tail -n1)" = "$1" ]
}
-# Linux kernel version comparison function
-#
-# $1 Linux version ("4.10", "2.6.32") or blank for installed Linux version
-#
-# Used for comparison: if [ $(linux_version) -ge $(linux_version "2.6.32") ]
-#
-function linux_version
+# Helper function used by linux_version() and freebsd_version()
+function kernel_version
{
typeset ver="$1"
@@ -77,6 +78,24 @@ function linux_version
echo $((version * 100000 + major * 1000 + minor))
}
+# Linux kernel version comparison function
+#
+# $1 Linux version ("4.10", "2.6.32") or blank for installed Linux version
+#
+# Used for comparison: if [ $(linux_version) -ge $(linux_version "2.6.32") ]
+function linux_version {
+ kernel_version "$1"
+}
+
+# FreeBSD version comparison function
+#
+# $1 FreeBSD version ("13.2", "14.0") or blank for installed FreeBSD version
+#
+# Used for comparison: if [ $(freebsd_version) -ge $(freebsd_version "13.2") ]
+function freebsd_version {
+ kernel_version "$1"
+}
+
# Determine if this is a Linux test system
#
# Return 0 if platform Linux, 1 if otherwise
@@ -1265,7 +1284,7 @@ function is_shared_smb
datasetexists "$fs" || return
if is_linux; then
- net usershare list | grep -xFq "${fs//\//_}"
+ net usershare list | grep -xFq "${fs//[-\/]/_}"
else
log_note "SMB on $UNAME currently unsupported by the test framework"
return 1
@@ -1884,7 +1903,7 @@ function wait_hotspare_state # pool disk state timeout
#
# Return 0 is pool/disk matches expected state, 1 otherwise
#
-function check_vdev_state # pool disk state{online,offline,unavail}
+function check_vdev_state # pool disk state{online,offline,unavail,removed}
{
typeset pool=$1
typeset disk=${2#*$DEV_DSKDIR/}
@@ -1951,6 +1970,7 @@ function check_pool_status # pool token keyword <verbose>
# is_pool_removing - to check if the pool removing is a vdev
# is_pool_removed - to check if the pool remove is completed
# is_pool_discarding - to check if the pool checkpoint is being discarded
+# is_pool_replacing - to check if the pool is performing a replacement
#
function is_pool_resilvering #pool <verbose>
{
@@ -1968,6 +1988,12 @@ function is_pool_scrubbing #pool <verbose>
check_pool_status "$1" "scan" "scrub in progress since " $2
}
+function is_pool_error_scrubbing #pool <verbose>
+{
+ check_pool_status "$1" "scrub" "error scrub in progress since " $2
+ return $?
+}
+
function is_pool_scrubbed #pool <verbose>
{
check_pool_status "$1" "scan" "scrub repaired" $2
@@ -1978,11 +2004,23 @@ function is_pool_scrub_stopped #pool <verbose>
check_pool_status "$1" "scan" "scrub canceled" $2
}
+function is_pool_error_scrub_stopped #pool <verbose>
+{
+ check_pool_status "$1" "scrub" "error scrub canceled on " $2
+ return $?
+}
+
function is_pool_scrub_paused #pool <verbose>
{
check_pool_status "$1" "scan" "scrub paused since " $2
}
+function is_pool_error_scrub_paused #pool <verbose>
+{
+ check_pool_status "$1" "scrub" "error scrub paused since " $2
+ return $?
+}
+
function is_pool_removing #pool
{
check_pool_status "$1" "remove" "in progress since "
@@ -1997,6 +2035,10 @@ function is_pool_discarding #pool
{
check_pool_status "$1" "checkpoint" "discarding"
}
+function is_pool_replacing #pool
+{
+ zpool status "$1" | grep -qE 'replacing-[0-9]+'
+}
function wait_for_degraded
{
@@ -2983,12 +3025,15 @@ function wait_freeing #pool
# Wait for every device replace operation to complete
#
# $1 pool name
+# $2 timeout
#
-function wait_replacing #pool
+function wait_replacing #pool timeout
{
+ typeset timeout=${2:-300}
typeset pool=${1:-$TESTPOOL}
- while zpool status $pool | grep -qE 'replacing-[0-9]+'; do
- log_must sleep 1
+ for (( timer = 0; timer < $timeout; timer++ )); do
+ is_pool_replacing $pool || break;
+ sleep 1;
done
}
@@ -3308,6 +3353,21 @@ function set_tunable_impl
esac
}
+function save_tunable
+{
+ [[ ! -d $TEST_BASE_DIR ]] && return 1
+ [[ -e $TEST_BASE_DIR/tunable-$1 ]] && return 2
+ echo "$(get_tunable """$1""")" > "$TEST_BASE_DIR"/tunable-"$1"
+}
+
+function restore_tunable
+{
+ [[ ! -e $TEST_BASE_DIR/tunable-$1 ]] && return 1
+ val="$(cat $TEST_BASE_DIR/tunable-"""$1""")"
+ set_tunable64 "$1" "$val"
+ rm $TEST_BASE_DIR/tunable-$1
+}
+
#
# Get a global system tunable
#
@@ -3432,6 +3492,20 @@ function stat_size #<path>
esac
}
+function stat_mtime #<path>
+{
+ typeset path=$1
+
+ case "$UNAME" in
+ FreeBSD)
+ stat -f %m "$path"
+ ;;
+ *)
+ stat -c %Y "$path"
+ ;;
+ esac
+}
+
function stat_ctime #<path>
{
typeset path=$1
@@ -3666,7 +3740,7 @@ function arcstat_quiescence # stat echo
while $do_once || [ $stat1 -ne $stat2 ] || [ $stat2 -eq 0 ]; do
typeset stat1=$(get_arcstat $stat)
- sleep 2
+ sleep 0.5
typeset stat2=$(get_arcstat $stat)
do_once=false
done
diff --git a/tests/zfs-tests/include/math.shlib b/tests/zfs-tests/include/math.shlib
index 38d9fecea7cf..2b5e60180f59 100644
--- a/tests/zfs-tests/include/math.shlib
+++ b/tests/zfs-tests/include/math.shlib
@@ -118,22 +118,26 @@ function verify_ne # <a> <b> <type>
# A simple function to get a random number between two bounds (inclusive)
#
-# Probably not the most efficient for large ranges, but it's okay.
-#
-# Note since we're using $RANDOM, 32767 is the largest number we
+# Note since we're using $RANDOM, $min+32767 is the largest number we
# can accept as the upper bound.
#
# $1 lower bound
# $2 upper bound
+# [$3 how many]
function random_int_between
{
typeset -i min=$1
typeset -i max=$2
- typeset -i rand=0
+ typeset -i count
+ typeset -i i
- while [[ $rand -lt $min ]] ; do
- rand=$(( $RANDOM % $max + 1))
- done
+ if [[ -z "$3" ]]; then
+ count=1
+ else
+ count=$3
+ fi
- echo $rand
+ for (( i = 0; i < $count; i++ )); do
+ echo $(( (RANDOM % (max - min + 1)) + min ))
+ done
}
diff --git a/tests/zfs-tests/include/properties.shlib b/tests/zfs-tests/include/properties.shlib
index 14b3f4415b7d..3dfb295a40df 100644
--- a/tests/zfs-tests/include/properties.shlib
+++ b/tests/zfs-tests/include/properties.shlib
@@ -11,6 +11,7 @@
#
# Copyright (c) 2012, 2016, Delphix. All rights reserved.
+# Copyright (c) 2022 Hewlett Packard Enterprise Development LP.
#
. $STF_SUITE/include/libtest.shlib
@@ -27,7 +28,7 @@ typeset -a canmount_prop_vals=('on' 'off' 'noauto')
typeset -a copies_prop_vals=('1' '2' '3')
typeset -a logbias_prop_vals=('latency' 'throughput')
typeset -a primarycache_prop_vals=('all' 'none' 'metadata')
-typeset -a redundant_metadata_prop_vals=('all' 'most')
+typeset -a redundant_metadata_prop_vals=('all' 'most' 'some' 'none')
typeset -a secondarycache_prop_vals=('all' 'none' 'metadata')
typeset -a snapdir_prop_vals=('hidden' 'visible')
typeset -a sync_prop_vals=('standard' 'always' 'disabled')
diff --git a/tests/zfs-tests/include/tunables.cfg b/tests/zfs-tests/include/tunables.cfg
index d6a2fe5db7c6..a619b846dd11 100644
--- a/tests/zfs-tests/include/tunables.cfg
+++ b/tests/zfs-tests/include/tunables.cfg
@@ -34,6 +34,7 @@ DEADMAN_SYNCTIME_MS deadman.synctime_ms zfs_deadman_synctime_ms
DEADMAN_ZIOTIME_MS deadman.ziotime_ms zfs_deadman_ziotime_ms
DISABLE_IVSET_GUID_CHECK disable_ivset_guid_check zfs_disable_ivset_guid_check
DMU_OFFSET_NEXT_SYNC dmu_offset_next_sync zfs_dmu_offset_next_sync
+EMBEDDED_SLOG_MIN_MS embedded_slog_min_ms zfs_embedded_slog_min_ms
INITIALIZE_CHUNK_SIZE initialize_chunk_size zfs_initialize_chunk_size
INITIALIZE_VALUE initialize_value zfs_initialize_value
KEEP_LOG_SPACEMAPS_AT_EXPORT keep_log_spacemaps_at_export zfs_keep_log_spacemaps_at_export
@@ -62,6 +63,7 @@ MULTIHOST_IMPORT_INTERVALS multihost.import_intervals zfs_multihost_import_inter
MULTIHOST_INTERVAL multihost.interval zfs_multihost_interval
OVERRIDE_ESTIMATE_RECORDSIZE send.override_estimate_recordsize zfs_override_estimate_recordsize
PREFETCH_DISABLE prefetch.disable zfs_prefetch_disable
+RAIDZ_EXPAND_MAX_REFLOW_BYTES vdev.expand_max_reflow_bytes raidz_expand_max_reflow_bytes
REBUILD_SCRUB_ENABLED rebuild_scrub_enabled zfs_rebuild_scrub_enabled
REMOVAL_SUSPEND_PROGRESS removal_suspend_progress zfs_removal_suspend_progress
REMOVE_MAX_SEGMENT remove_max_segment zfs_remove_max_segment
@@ -69,6 +71,7 @@ RESILVER_MIN_TIME_MS resilver_min_time_ms zfs_resilver_min_time_ms
SCAN_LEGACY scan_legacy zfs_scan_legacy
SCAN_SUSPEND_PROGRESS scan_suspend_progress zfs_scan_suspend_progress
SCAN_VDEV_LIMIT scan_vdev_limit zfs_scan_vdev_limit
+SCRUB_AFTER_EXPAND scrub_after_expand zfs_scrub_after_expand
SEND_HOLES_WITHOUT_BIRTH_TIME send_holes_without_birth_time send_holes_without_birth_time
SLOW_IO_EVENTS_PER_SECOND slow_io_events_per_second zfs_slow_io_events_per_second
SPA_ASIZE_INFLATION spa.asize_inflation spa_asize_inflation
@@ -81,13 +84,17 @@ TRIM_TXG_BATCH trim.txg_batch zfs_trim_txg_batch
TXG_HISTORY txg.history zfs_txg_history
TXG_TIMEOUT txg.timeout zfs_txg_timeout
UNLINK_SUSPEND_PROGRESS UNSUPPORTED zfs_unlink_suspend_progress
+VDEV_FILE_LOGICAL_ASHIFT vdev.file.logical_ashift vdev_file_logical_ashift
VDEV_FILE_PHYSICAL_ASHIFT vdev.file.physical_ashift vdev_file_physical_ashift
+VDEV_MAX_AUTO_ASHIFT vdev.max_auto_ashift zfs_vdev_max_auto_ashift
VDEV_MIN_MS_COUNT vdev.min_ms_count zfs_vdev_min_ms_count
VDEV_VALIDATE_SKIP vdev.validate_skip vdev_validate_skip
VOL_INHIBIT_DEV UNSUPPORTED zvol_inhibit_dev
VOL_MODE vol.mode zvol_volmode
VOL_RECURSIVE vol.recursive UNSUPPORTED
VOL_USE_BLK_MQ UNSUPPORTED zvol_use_blk_mq
+BCLONE_ENABLED zfs_bclone_enabled zfs_bclone_enabled
+BCLONE_WAIT_DIRTY zfs_bclone_wait_dirty zfs_bclone_wait_dirty
XATTR_COMPAT xattr_compat zfs_xattr_compat
ZEVENT_LEN_MAX zevent.len_max zfs_zevent_len_max
ZEVENT_RETAIN_MAX zevent.retain_max zfs_zevent_retain_max
diff --git a/tests/zfs-tests/tests/Makefile.am b/tests/zfs-tests/tests/Makefile.am
index 4c5b1121293e..d625c040b819 100644
--- a/tests/zfs-tests/tests/Makefile.am
+++ b/tests/zfs-tests/tests/Makefile.am
@@ -90,6 +90,10 @@ nobase_dist_datadir_zfs_tests_tests_DATA += \
functional/alloc_class/alloc_class.kshlib \
functional/atime/atime.cfg \
functional/atime/atime_common.kshlib \
+ functional/bclone/bclone.cfg \
+ functional/bclone/bclone_common.kshlib \
+ functional/bclone/bclone_corner_cases.kshlib \
+ functional/block_cloning/block_cloning.kshlib \
functional/cache/cache.cfg \
functional/cache/cache.kshlib \
functional/cachefile/cachefile.cfg \
@@ -129,6 +133,7 @@ nobase_dist_datadir_zfs_tests_tests_DATA += \
functional/channel_program/synctask_core/tst.snapshot_destroy.zcp \
functional/channel_program/synctask_core/tst.snapshot_neg.zcp \
functional/channel_program/synctask_core/tst.snapshot_recursive.zcp \
+ functional/channel_program/synctask_core/tst.snapshot_rename.zcp \
functional/channel_program/synctask_core/tst.snapshot_simple.zcp \
functional/checksum/default.cfg \
functional/clean_mirror/clean_mirror_common.kshlib \
@@ -177,6 +182,7 @@ nobase_dist_datadir_zfs_tests_tests_DATA += \
functional/cli_root/zpool_expand/zpool_expand.cfg \
functional/cli_root/zpool_export/zpool_export.cfg \
functional/cli_root/zpool_export/zpool_export.kshlib \
+ functional/cli_root/zpool_get/vdev_get.cfg \
functional/cli_root/zpool_get/zpool_get.cfg \
functional/cli_root/zpool_get/zpool_get_parsable.cfg \
functional/cli_root/zpool_import/blockfiles/cryptv0.dat.bz2 \
@@ -248,6 +254,7 @@ nobase_dist_datadir_zfs_tests_tests_DATA += \
functional/cli_root/zpool_upgrade/zpool_upgrade.cfg \
functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib \
functional/cli_root/zpool_wait/zpool_wait.kshlib \
+ functional/cli_root/zhack/library.kshlib \
functional/cli_user/misc/misc.cfg \
functional/cli_user/zfs_list/zfs_list.cfg \
functional/cli_user/zfs_list/zfs_list.kshlib \
@@ -367,6 +374,7 @@ nobase_dist_datadir_zfs_tests_tests_DATA += \
functional/upgrade/upgrade_common.kshlib \
functional/user_namespace/user_namespace.cfg \
functional/user_namespace/user_namespace_common.kshlib \
+ functional/userquota/13709_reproducer.bz2 \
functional/userquota/userquota.cfg \
functional/userquota/userquota_common.kshlib \
functional/vdev_zaps/vdev_zaps.kshlib \
@@ -377,7 +385,9 @@ nobase_dist_datadir_zfs_tests_tests_DATA += \
functional/zvol/zvol_common.shlib \
functional/zvol/zvol_ENOSPC/zvol_ENOSPC.cfg \
functional/zvol/zvol_misc/zvol_misc_common.kshlib \
- functional/zvol/zvol_swap/zvol_swap.cfg
+ functional/zvol/zvol_swap/zvol_swap.cfg \
+ functional/idmap_mount/idmap_mount.cfg \
+ functional/idmap_mount/idmap_mount_common.kshlib
nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/acl/off/cleanup.ksh \
@@ -409,6 +419,8 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/alloc_class/alloc_class_011_neg.ksh \
functional/alloc_class/alloc_class_012_pos.ksh \
functional/alloc_class/alloc_class_013_pos.ksh \
+ functional/alloc_class/alloc_class_014_neg.ksh \
+ functional/alloc_class/alloc_class_015_pos.ksh \
functional/alloc_class/cleanup.ksh \
functional/alloc_class/setup.ksh \
functional/append/file_append.ksh \
@@ -429,6 +441,43 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/atime/root_atime_on.ksh \
functional/atime/root_relatime_on.ksh \
functional/atime/setup.ksh \
+ functional/bclone/bclone_crossfs_corner_cases.ksh \
+ functional/bclone/bclone_crossfs_corner_cases_limited.ksh \
+ functional/bclone/bclone_crossfs_data.ksh \
+ functional/bclone/bclone_crossfs_embedded.ksh \
+ functional/bclone/bclone_crossfs_hole.ksh \
+ functional/bclone/bclone_diffprops_all.ksh \
+ functional/bclone/bclone_diffprops_checksum.ksh \
+ functional/bclone/bclone_diffprops_compress.ksh \
+ functional/bclone/bclone_diffprops_copies.ksh \
+ functional/bclone/bclone_diffprops_recordsize.ksh \
+ functional/bclone/bclone_prop_sync.ksh \
+ functional/bclone/bclone_samefs_corner_cases.ksh \
+ functional/bclone/bclone_samefs_corner_cases_limited.ksh \
+ functional/bclone/bclone_samefs_data.ksh \
+ functional/bclone/bclone_samefs_embedded.ksh \
+ functional/bclone/bclone_samefs_hole.ksh \
+ functional/bclone/cleanup.ksh \
+ functional/bclone/setup.ksh \
+ functional/block_cloning/cleanup.ksh \
+ functional/block_cloning/setup.ksh \
+ functional/block_cloning/block_cloning_clone_mmap_cached.ksh \
+ functional/block_cloning/block_cloning_clone_mmap_write.ksh \
+ functional/block_cloning/block_cloning_copyfilerange_cross_dataset.ksh \
+ functional/block_cloning/block_cloning_copyfilerange_fallback.ksh \
+ functional/block_cloning/block_cloning_copyfilerange_fallback_same_txg.ksh \
+ functional/block_cloning/block_cloning_copyfilerange.ksh \
+ functional/block_cloning/block_cloning_copyfilerange_partial.ksh \
+ functional/block_cloning/block_cloning_disabled_copyfilerange.ksh \
+ functional/block_cloning/block_cloning_disabled_ficlone.ksh \
+ functional/block_cloning/block_cloning_disabled_ficlonerange.ksh \
+ functional/block_cloning/block_cloning_ficlone.ksh \
+ functional/block_cloning/block_cloning_ficlonerange.ksh \
+ functional/block_cloning/block_cloning_ficlonerange_partial.ksh \
+ functional/block_cloning/block_cloning_cross_enc_dataset.ksh \
+ functional/block_cloning/block_cloning_replay.ksh \
+ functional/block_cloning/block_cloning_replay_encrypted.ksh \
+ functional/block_cloning/block_cloning_lwb_buffer_overflow.ksh \
functional/bootfs/bootfs_001_pos.ksh \
functional/bootfs/bootfs_002_neg.ksh \
functional/bootfs/bootfs_003_pos.ksh \
@@ -536,6 +585,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/channel_program/synctask_core/tst.snapshot_destroy.ksh \
functional/channel_program/synctask_core/tst.snapshot_neg.ksh \
functional/channel_program/synctask_core/tst.snapshot_recursive.ksh \
+ functional/channel_program/synctask_core/tst.snapshot_rename.ksh \
functional/channel_program/synctask_core/tst.snapshot_simple.ksh \
functional/channel_program/synctask_core/tst.terminate_by_signal.ksh \
functional/chattr/chattr_001_pos.ksh \
@@ -556,6 +606,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/clean_mirror/clean_mirror_004_pos.ksh \
functional/clean_mirror/cleanup.ksh \
functional/clean_mirror/setup.ksh \
+ functional/cli_root/zinject/zinject_args.ksh \
functional/cli_root/zdb/zdb_002_pos.ksh \
functional/cli_root/zdb/zdb_003_pos.ksh \
functional/cli_root/zdb/zdb_004_pos.ksh \
@@ -563,11 +614,13 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/cli_root/zdb/zdb_006_pos.ksh \
functional/cli_root/zdb/zdb_args_neg.ksh \
functional/cli_root/zdb/zdb_args_pos.ksh \
+ functional/cli_root/zdb/zdb_backup.ksh \
functional/cli_root/zdb/zdb_block_size_histogram.ksh \
functional/cli_root/zdb/zdb_checksum.ksh \
functional/cli_root/zdb/zdb_decompress.ksh \
functional/cli_root/zdb/zdb_decompress_zstd.ksh \
functional/cli_root/zdb/zdb_display_block.ksh \
+ functional/cli_root/zdb/zdb_encrypted.ksh \
functional/cli_root/zdb/zdb_label_checksum.ksh \
functional/cli_root/zdb/zdb_object_range_neg.ksh \
functional/cli_root/zdb/zdb_object_range_pos.ksh \
@@ -717,6 +770,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/cli_root/zfs_mount/zfs_mount_all_fail.ksh \
functional/cli_root/zfs_mount/zfs_mount_all_mountpoints.ksh \
functional/cli_root/zfs_mount/zfs_mount_encrypted.ksh \
+ functional/cli_root/zfs_mount/zfs_mount_recursive.ksh \
functional/cli_root/zfs_mount/zfs_mount_remount.ksh \
functional/cli_root/zfs_mount/zfs_mount_test_race.ksh \
functional/cli_root/zfs_mount/zfs_multi_mount.ksh \
@@ -766,6 +820,9 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/cli_root/zfs_receive/zfs_receive_raw.ksh \
functional/cli_root/zfs_receive/zfs_receive_to_encrypted.ksh \
functional/cli_root/zfs_receive/zfs_receive_-wR-encrypted-mix.ksh \
+ functional/cli_root/zfs_receive/zfs_receive_corrective.ksh \
+ functional/cli_root/zfs_receive/zfs_receive_compressed_corrective.ksh \
+ functional/cli_root/zfs_receive/zfs_receive_large_block_corrective.ksh \
functional/cli_root/zfs_rename/cleanup.ksh \
functional/cli_root/zfs_rename/setup.ksh \
functional/cli_root/zfs_rename/zfs_rename_001_pos.ksh \
@@ -842,6 +899,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/cli_root/zfs_set/zfs_set_003_neg.ksh \
functional/cli_root/zfs_set/zfs_set_feature_activation.ksh \
functional/cli_root/zfs_set/zfs_set_keylocation.ksh \
+ functional/cli_root/zfs_set/zfs_set_nomount.ksh \
functional/cli_root/zfs_share/cleanup.ksh \
functional/cli_root/zfs_share/setup.ksh \
functional/cli_root/zfs_share/zfs_share_001_pos.ksh \
@@ -858,6 +916,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/cli_root/zfs_share/zfs_share_012_pos.ksh \
functional/cli_root/zfs_share/zfs_share_013_pos.ksh \
functional/cli_root/zfs_share/zfs_share_concurrent_shares.ksh \
+ functional/cli_root/zfs_share/zfs_share_after_mount.ksh \
functional/cli_root/zfs_snapshot/cleanup.ksh \
functional/cli_root/zfs_snapshot/setup.ksh \
functional/cli_root/zfs_snapshot/zfs_snapshot_001_neg.ksh \
@@ -922,12 +981,16 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/cli_root/zfs/zfs_001_neg.ksh \
functional/cli_root/zfs/zfs_002_pos.ksh \
functional/cli_root/zfs/zfs_003_neg.ksh \
- functional/cli_root/zhack/zhack_label_checksum.ksh \
+ functional/cli_root/zhack/zhack_label_repair_001.ksh \
+ functional/cli_root/zhack/zhack_label_repair_002.ksh \
+ functional/cli_root/zhack/zhack_label_repair_003.ksh \
+ functional/cli_root/zhack/zhack_label_repair_004.ksh \
functional/cli_root/zpool_add/add_nested_replacing_spare.ksh \
functional/cli_root/zpool_add/add-o_ashift.ksh \
functional/cli_root/zpool_add/add_prop_ashift.ksh \
functional/cli_root/zpool_add/cleanup.ksh \
functional/cli_root/zpool_add/setup.ksh \
+ functional/cli_root/zpool_add/zpool_add--allow-ashift-mismatch.ksh \
functional/cli_root/zpool_add/zpool_add_001_pos.ksh \
functional/cli_root/zpool_add/zpool_add_002_pos.ksh \
functional/cli_root/zpool_add/zpool_add_003_pos.ksh \
@@ -1023,6 +1086,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/cli_root/zpool_export/zpool_export_004_pos.ksh \
functional/cli_root/zpool_get/cleanup.ksh \
functional/cli_root/zpool_get/setup.ksh \
+ functional/cli_root/zpool_get/vdev_get_001_pos.ksh \
functional/cli_root/zpool_get/zpool_get_001_pos.ksh \
functional/cli_root/zpool_get/zpool_get_002_pos.ksh \
functional/cli_root/zpool_get/zpool_get_003_pos.ksh \
@@ -1041,6 +1105,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/cli_root/zpool_import/import_cachefile_paths_changed.ksh \
functional/cli_root/zpool_import/import_cachefile_shared_device.ksh \
functional/cli_root/zpool_import/import_devices_missing.ksh \
+ functional/cli_root/zpool_import/import_log_missing.ksh \
functional/cli_root/zpool_import/import_paths_changed.ksh \
functional/cli_root/zpool_import/import_rewind_config_changed.ksh \
functional/cli_root/zpool_import/import_rewind_device_replaced.ksh \
@@ -1070,10 +1135,18 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/cli_root/zpool_import/zpool_import_features_001_pos.ksh \
functional/cli_root/zpool_import/zpool_import_features_002_neg.ksh \
functional/cli_root/zpool_import/zpool_import_features_003_pos.ksh \
+ functional/cli_root/zpool_import/zpool_import_hostid_changed.ksh \
+ functional/cli_root/zpool_import/zpool_import_hostid_changed_unclean_export.ksh \
+ functional/cli_root/zpool_import/zpool_import_hostid_changed_cachefile.ksh \
+ functional/cli_root/zpool_import/zpool_import_hostid_changed_cachefile_unclean_export.ksh \
functional/cli_root/zpool_import/zpool_import_missing_001_pos.ksh \
functional/cli_root/zpool_import/zpool_import_missing_002_pos.ksh \
functional/cli_root/zpool_import/zpool_import_missing_003_pos.ksh \
functional/cli_root/zpool_import/zpool_import_rename_001_pos.ksh \
+ functional/cli_root/zpool_import/zpool_import_status.ksh \
+ functional/cli_root/zpool_import/zpool_import_parallel_admin.ksh \
+ functional/cli_root/zpool_import/zpool_import_parallel_neg.ksh \
+ functional/cli_root/zpool_import/zpool_import_parallel_pos.ksh \
functional/cli_root/zpool_initialize/cleanup.ksh \
functional/cli_root/zpool_initialize/zpool_initialize_attach_detach_add_remove.ksh \
functional/cli_root/zpool_initialize/zpool_initialize_fault_export_import_online.ksh \
@@ -1084,6 +1157,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/cli_root/zpool_initialize/zpool_initialize_start_and_cancel_neg.ksh \
functional/cli_root/zpool_initialize/zpool_initialize_start_and_cancel_pos.ksh \
functional/cli_root/zpool_initialize/zpool_initialize_suspend_resume.ksh \
+ functional/cli_root/zpool_initialize/zpool_initialize_uninit.ksh \
functional/cli_root/zpool_initialize/zpool_initialize_unsupported_vdevs.ksh \
functional/cli_root/zpool_initialize/zpool_initialize_verify_checksums.ksh \
functional/cli_root/zpool_initialize/zpool_initialize_verify_initialized.ksh \
@@ -1123,6 +1197,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/cli_root/zpool_resilver/setup.ksh \
functional/cli_root/zpool_resilver/zpool_resilver_bad_args.ksh \
functional/cli_root/zpool_resilver/zpool_resilver_restart.ksh \
+ functional/cli_root/zpool_resilver/zpool_resilver_concurrent.ksh \
functional/cli_root/zpool_scrub/cleanup.ksh \
functional/cli_root/zpool_scrub/setup.ksh \
functional/cli_root/zpool_scrub/zpool_scrub_001_neg.ksh \
@@ -1134,13 +1209,21 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/cli_root/zpool_scrub/zpool_scrub_multiple_copies.ksh \
functional/cli_root/zpool_scrub/zpool_scrub_offline_device.ksh \
functional/cli_root/zpool_scrub/zpool_scrub_print_repairing.ksh \
+ functional/cli_root/zpool_scrub/zpool_error_scrub_001_pos.ksh \
+ functional/cli_root/zpool_scrub/zpool_error_scrub_002_pos.ksh \
+ functional/cli_root/zpool_scrub/zpool_error_scrub_003_pos.ksh \
+ functional/cli_root/zpool_scrub/zpool_error_scrub_004_pos.ksh \
functional/cli_root/zpool_set/cleanup.ksh \
functional/cli_root/zpool_set/setup.ksh \
functional/cli_root/zpool/setup.ksh \
+ functional/cli_root/zpool_set/vdev_set_001_pos.ksh \
+ functional/cli_root/zpool_set/zpool_set_common.kshlib \
functional/cli_root/zpool_set/zpool_set_001_pos.ksh \
functional/cli_root/zpool_set/zpool_set_002_neg.ksh \
functional/cli_root/zpool_set/zpool_set_003_neg.ksh \
functional/cli_root/zpool_set/zpool_set_ashift.ksh \
+ functional/cli_root/zpool_set/user_property_001_pos.ksh \
+ functional/cli_root/zpool_set/user_property_002_neg.ksh \
functional/cli_root/zpool_set/zpool_set_features.ksh \
functional/cli_root/zpool_split/cleanup.ksh \
functional/cli_root/zpool_split/setup.ksh \
@@ -1159,6 +1242,10 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/cli_root/zpool_status/zpool_status_002_pos.ksh \
functional/cli_root/zpool_status/zpool_status_003_pos.ksh \
functional/cli_root/zpool_status/zpool_status_004_pos.ksh \
+ functional/cli_root/zpool_status/zpool_status_005_pos.ksh \
+ functional/cli_root/zpool_status/zpool_status_006_pos.ksh \
+ functional/cli_root/zpool_status/zpool_status_007_pos.ksh \
+ functional/cli_root/zpool_status/zpool_status_008_pos.ksh \
functional/cli_root/zpool_status/zpool_status_features_001_pos.ksh \
functional/cli_root/zpool_sync/cleanup.ksh \
functional/cli_root/zpool_sync/setup.ksh \
@@ -1227,6 +1314,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/cli_user/misc/arcstat_001_pos.ksh \
functional/cli_user/misc/arc_summary_001_pos.ksh \
functional/cli_user/misc/arc_summary_002_neg.ksh \
+ functional/cli_user/misc/zilstat_001_pos.ksh \
functional/cli_user/misc/cleanup.ksh \
functional/cli_user/misc/setup.ksh \
functional/cli_user/misc/zdb_001_neg.ksh \
@@ -1313,6 +1401,8 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/compression/setup.ksh \
functional/cp_files/cleanup.ksh \
functional/cp_files/cp_files_001_pos.ksh \
+ functional/cp_files/cp_files_002_pos.ksh \
+ functional/cp_files/cp_stress.ksh \
functional/cp_files/setup.ksh \
functional/crtime/cleanup.ksh \
functional/crtime/crtime_001_pos.ksh \
@@ -1358,12 +1448,20 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/events/events_001_pos.ksh \
functional/events/events_002_pos.ksh \
functional/events/setup.ksh \
+ functional/events/zed_cksum_config.ksh \
+ functional/events/zed_cksum_reported.ksh \
functional/events/zed_fd_spill.ksh \
+ functional/events/zed_io_config.ksh \
functional/events/zed_rc_filter.ksh \
+ functional/events/zed_slow_io.ksh \
+ functional/events/zed_slow_io_many_vdevs.ksh \
functional/exec/cleanup.ksh \
functional/exec/exec_001_pos.ksh \
functional/exec/exec_002_neg.ksh \
functional/exec/setup.ksh \
+ functional/fadvise/cleanup.ksh \
+ functional/fadvise/fadvise_sequential.ksh \
+ functional/fadvise/setup.ksh \
functional/fallocate/cleanup.ksh \
functional/fallocate/fallocate_prealloc.ksh \
functional/fallocate/fallocate_punch-hole.ksh \
@@ -1373,6 +1471,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/fault/auto_online_001_pos.ksh \
functional/fault/auto_online_002_pos.ksh \
functional/fault/auto_replace_001_pos.ksh \
+ functional/fault/auto_replace_002_pos.ksh \
functional/fault/auto_spare_001_pos.ksh \
functional/fault/auto_spare_002_pos.ksh \
functional/fault/auto_spare_ashift.ksh \
@@ -1476,6 +1575,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/migration/setup.ksh \
functional/mmap/cleanup.ksh \
functional/mmap/mmap_libaio_001_pos.ksh \
+ functional/mmap/mmap_mixed.ksh \
functional/mmap/mmap_read_001_pos.ksh \
functional/mmap/mmap_seek_001_pos.ksh \
functional/mmap/mmap_sync_001_pos.ksh \
@@ -1493,6 +1593,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/mmp/mmp_on_zdb.ksh \
functional/mmp/mmp_reset_interval.ksh \
functional/mmp/mmp_write_distribution.ksh \
+ functional/mmp/mmp_write_slow_disk.ksh \
functional/mmp/mmp_write_uberblocks.ksh \
functional/mmp/multihost_history.ksh \
functional/mmp/setup.ksh \
@@ -1524,6 +1625,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/no_space/enospc_002_pos.ksh \
functional/no_space/enospc_003_pos.ksh \
functional/no_space/enospc_df.ksh \
+ functional/no_space/enospc_ganging.ksh \
functional/no_space/enospc_rm.ksh \
functional/no_space/setup.ksh \
functional/online_offline/cleanup.ksh \
@@ -1533,7 +1635,9 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/online_offline/setup.ksh \
functional/pam/cleanup.ksh \
functional/pam/pam_basic.ksh \
+ functional/pam/pam_change_unmounted.ksh \
functional/pam/pam_nounmount.ksh \
+ functional/pam/pam_recursive.ksh \
functional/pam/pam_short_password.ksh \
functional/pam/setup.ksh \
functional/pool_checkpoint/checkpoint_after_rewind.ksh \
@@ -1605,8 +1709,14 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/raidz/cleanup.ksh \
functional/raidz/raidz_001_neg.ksh \
functional/raidz/raidz_002_pos.ksh \
- functional/raidz/raidz_003_pos.ksh \
- functional/raidz/raidz_004_pos.ksh \
+ functional/raidz/raidz_expand_001_pos.ksh \
+ functional/raidz/raidz_expand_002_pos.ksh \
+ functional/raidz/raidz_expand_003_neg.ksh \
+ functional/raidz/raidz_expand_003_pos.ksh \
+ functional/raidz/raidz_expand_004_pos.ksh \
+ functional/raidz/raidz_expand_005_pos.ksh \
+ functional/raidz/raidz_expand_006_neg.ksh \
+ functional/raidz/raidz_expand_007_neg.ksh \
functional/raidz/setup.ksh \
functional/redacted_send/cleanup.ksh \
functional/redacted_send/redacted_compressed.ksh \
@@ -1682,6 +1792,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/removal/removal_with_export.ksh \
functional/removal/removal_with_faulted.ksh \
functional/removal/removal_with_ganging.ksh \
+ functional/removal/removal_with_indirect.ksh \
functional/removal/removal_with_remove.ksh \
functional/removal/removal_with_scrub.ksh \
functional/removal/removal_with_send.ksh \
@@ -1698,6 +1809,11 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/rename_dirs/cleanup.ksh \
functional/rename_dirs/rename_dirs_001_pos.ksh \
functional/rename_dirs/setup.ksh \
+ functional/renameat2/cleanup.ksh \
+ functional/renameat2/setup.ksh \
+ functional/renameat2/renameat2_exchange.ksh \
+ functional/renameat2/renameat2_noreplace.ksh \
+ functional/renameat2/renameat2_whiteout.ksh \
functional/replacement/attach_import.ksh \
functional/replacement/attach_multiple.ksh \
functional/replacement/attach_rebuild.ksh \
@@ -1771,11 +1887,12 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/rsend/rsend_027_pos.ksh \
functional/rsend/rsend_028_neg.ksh \
functional/rsend/rsend_029_neg.ksh \
+ functional/rsend/rsend_030_pos.ksh \
+ functional/rsend/rsend_031_pos.ksh \
functional/rsend/send-c_embedded_blocks.ksh \
functional/rsend/send-c_incremental.ksh \
functional/rsend/send-c_lz4_disabled.ksh \
functional/rsend/send-c_mixed_compression.ksh \
- functional/rsend/send-cpL_varied_recsize.ksh \
functional/rsend/send-c_props.ksh \
functional/rsend/send-c_recv_dedup.ksh \
functional/rsend/send-c_recv_lz4_disabled.ksh \
@@ -1784,9 +1901,13 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/rsend/send-c_verify_contents.ksh \
functional/rsend/send-c_verify_ratio.ksh \
functional/rsend/send-c_volume.ksh \
+ functional/rsend/send-c_zstream_recompress.ksh \
functional/rsend/send-c_zstreamdump.ksh \
+ functional/rsend/send-cpL_varied_recsize.ksh \
functional/rsend/send_doall.ksh \
+ functional/rsend/send_encrypted_incremental.ksh \
functional/rsend/send_encrypted_files.ksh \
+ functional/rsend/send_encrypted_freeobjects.ksh \
functional/rsend/send_encrypted_hierarchy.ksh \
functional/rsend/send_encrypted_props.ksh \
functional/rsend/send_encrypted_truncated_files.ksh \
@@ -1799,6 +1920,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/rsend/send_partial_dataset.ksh \
functional/rsend/send_raw_ashift.ksh \
functional/rsend/send_raw_spill_block.ksh \
+ functional/rsend/send_raw_large_blocks.ksh \
functional/rsend/send_realloc_dnode_size.ksh \
functional/rsend/send_realloc_encrypted_files.ksh \
functional/rsend/send_realloc_files.ksh \
@@ -1855,6 +1977,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/snapshot/snapshot_015_pos.ksh \
functional/snapshot/snapshot_016_pos.ksh \
functional/snapshot/snapshot_017_pos.ksh \
+ functional/snapshot/snapshot_018_pos.ksh \
functional/snapused/cleanup.ksh \
functional/snapused/setup.ksh \
functional/snapused/snapused_001_pos.ksh \
@@ -1922,6 +2045,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/userquota/userspace_003_pos.ksh \
functional/userquota/userspace_encrypted.ksh \
functional/userquota/userspace_send_encrypted.ksh \
+ functional/userquota/userspace_encrypted_13709.ksh \
functional/vdev_zaps/cleanup.ksh \
functional/vdev_zaps/setup.ksh \
functional/vdev_zaps/vdev_zaps_001_pos.ksh \
@@ -1951,6 +2075,9 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/xattr/xattr_012_pos.ksh \
functional/xattr/xattr_013_pos.ksh \
functional/xattr/xattr_compat.ksh \
+ functional/zap_shrink/cleanup.ksh \
+ functional/zap_shrink/zap_shrink_001_pos.ksh \
+ functional/zap_shrink/setup.ksh \
functional/zpool_influxdb/cleanup.ksh \
functional/zpool_influxdb/setup.ksh \
functional/zpool_influxdb/zpool_influxdb.ksh \
@@ -1987,4 +2114,11 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/zvol/zvol_swap/zvol_swap_003_pos.ksh \
functional/zvol/zvol_swap/zvol_swap_004_pos.ksh \
functional/zvol/zvol_swap/zvol_swap_005_pos.ksh \
- functional/zvol/zvol_swap/zvol_swap_006_pos.ksh
+ functional/zvol/zvol_swap/zvol_swap_006_pos.ksh \
+ functional/idmap_mount/cleanup.ksh \
+ functional/idmap_mount/setup.ksh \
+ functional/idmap_mount/idmap_mount_001.ksh \
+ functional/idmap_mount/idmap_mount_002.ksh \
+ functional/idmap_mount/idmap_mount_003.ksh \
+ functional/idmap_mount/idmap_mount_004.ksh \
+ functional/idmap_mount/idmap_mount_005.ksh
diff --git a/tests/zfs-tests/tests/functional/acl/acl.cfg b/tests/zfs-tests/tests/functional/acl/acl.cfg
index 8fa85d673bb7..e350f18469d6 100644
--- a/tests/zfs-tests/tests/functional/acl/acl.cfg
+++ b/tests/zfs-tests/tests/functional/acl/acl.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/acl/acl_common.kshlib b/tests/zfs-tests/tests/functional/acl/acl_common.kshlib
index 5f4f91485e8e..2844f5dc13dc 100644
--- a/tests/zfs-tests/tests/functional/acl/acl_common.kshlib
+++ b/tests/zfs-tests/tests/functional/acl/acl_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/acl/off/cleanup.ksh b/tests/zfs-tests/tests/functional/acl/off/cleanup.ksh
index bb58a8cf2e7b..58ce22d547a2 100755
--- a/tests/zfs-tests/tests/functional/acl/off/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/acl/off/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/acl/off/dosmode.ksh b/tests/zfs-tests/tests/functional/acl/off/dosmode.ksh
index bab2109b9d58..fa304aeb917d 100755
--- a/tests/zfs-tests/tests/functional/acl/off/dosmode.ksh
+++ b/tests/zfs-tests/tests/functional/acl/off/dosmode.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/acl/off/posixmode.ksh b/tests/zfs-tests/tests/functional/acl/off/posixmode.ksh
index 63870caa3234..df278ae2366c 100755
--- a/tests/zfs-tests/tests/functional/acl/off/posixmode.ksh
+++ b/tests/zfs-tests/tests/functional/acl/off/posixmode.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/acl/off/setup.ksh b/tests/zfs-tests/tests/functional/acl/off/setup.ksh
index 9a5b598a59d7..9a0b949ad938 100755
--- a/tests/zfs-tests/tests/functional/acl/off/setup.ksh
+++ b/tests/zfs-tests/tests/functional/acl/off/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/acl/posix-sa/cleanup.ksh b/tests/zfs-tests/tests/functional/acl/posix-sa/cleanup.ksh
index bb58a8cf2e7b..58ce22d547a2 100755
--- a/tests/zfs-tests/tests/functional/acl/posix-sa/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/acl/posix-sa/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/acl/posix-sa/setup.ksh b/tests/zfs-tests/tests/functional/acl/posix-sa/setup.ksh
index d8bf8a638e7b..3bb3760507ca 100755
--- a/tests/zfs-tests/tests/functional/acl/posix-sa/setup.ksh
+++ b/tests/zfs-tests/tests/functional/acl/posix-sa/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/acl/posix/cleanup.ksh b/tests/zfs-tests/tests/functional/acl/posix/cleanup.ksh
index bb58a8cf2e7b..58ce22d547a2 100755
--- a/tests/zfs-tests/tests/functional/acl/posix/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/acl/posix/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/acl/posix/posix_001_pos.ksh b/tests/zfs-tests/tests/functional/acl/posix/posix_001_pos.ksh
index 65c15388cf20..803c7816fedc 100755
--- a/tests/zfs-tests/tests/functional/acl/posix/posix_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/acl/posix/posix_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/acl/posix/posix_002_pos.ksh b/tests/zfs-tests/tests/functional/acl/posix/posix_002_pos.ksh
index ac718ec58897..4c0bc372b78b 100755
--- a/tests/zfs-tests/tests/functional/acl/posix/posix_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/acl/posix/posix_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/acl/posix/posix_003_pos.ksh b/tests/zfs-tests/tests/functional/acl/posix/posix_003_pos.ksh
index bdd77bd37603..2a9c173ccb2c 100755
--- a/tests/zfs-tests/tests/functional/acl/posix/posix_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/acl/posix/posix_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/acl/posix/posix_004_pos.ksh b/tests/zfs-tests/tests/functional/acl/posix/posix_004_pos.ksh
index 6c6b592fbb9e..ffb5b4db71b4 100755
--- a/tests/zfs-tests/tests/functional/acl/posix/posix_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/acl/posix/posix_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -35,6 +35,7 @@
# STRATEGY:
# 1. Prepare an appropriate ACL on the test directory
# 2. Change the owner of the directory
+# 3. Reset and set the ACLs for test directory owned by the user
#
verify_runnable "both"
@@ -44,6 +45,8 @@ log_must setfacl -d -m u:$ZFS_ACL_STAFF1:rwx $TESTDIR
log_must setfacl -b $TESTDIR
log_must chown $ZFS_ACL_STAFF1 $TESTDIR
+log_must setfacl -b $TESTDIR
+log_must setfacl -d -m u:$ZFS_ACL_STAFF1:rwx $TESTDIR
log_must chown 0 $TESTDIR
log_pass "chown works with POSIX ACLs"
diff --git a/tests/zfs-tests/tests/functional/acl/posix/setup.ksh b/tests/zfs-tests/tests/functional/acl/posix/setup.ksh
index 526c78e17f1a..8ed9ab7e471e 100755
--- a/tests/zfs-tests/tests/functional/acl/posix/setup.ksh
+++ b/tests/zfs-tests/tests/functional/acl/posix/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/alloc_class/alloc_class_014_neg.ksh b/tests/zfs-tests/tests/functional/alloc_class/alloc_class_014_neg.ksh
new file mode 100755
index 000000000000..1b52014fd2d9
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/alloc_class/alloc_class_014_neg.ksh
@@ -0,0 +1,38 @@
+#!/bin/ksh -p
+
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+. $STF_SUITE/tests/functional/alloc_class/alloc_class.kshlib
+
+#
+# DESCRIPTION:
+# Setting the special_small_blocks property greater than recordsize fails.
+#
+
+verify_runnable "global"
+
+claim="Setting the special_small_blocks property greater than recordsize fails"
+
+log_assert $claim
+log_onexit cleanup
+log_must disk_setup
+
+for size in 512 4096 32768 131072 524288 1048576
+do
+ let bigger=$size*2
+ log_mustnot zpool create -O recordsize=$size \
+ -O special_small_blocks=$bigger \
+ $TESTPOOL raidz $ZPOOL_DISKS special mirror \
+ $CLASS_DISK0 $CLASS_DISK1
+done
+
+log_pass $claim
diff --git a/tests/zfs-tests/tests/functional/alloc_class/alloc_class_015_pos.ksh b/tests/zfs-tests/tests/functional/alloc_class/alloc_class_015_pos.ksh
new file mode 100755
index 000000000000..49c468af6702
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/alloc_class/alloc_class_015_pos.ksh
@@ -0,0 +1,45 @@
+#!/bin/ksh -p
+
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+. $STF_SUITE/tests/functional/alloc_class/alloc_class.kshlib
+
+#
+# DESCRIPTION:
+# Can set special_small_blocks property less than or equal to recordsize.
+#
+
+verify_runnable "global"
+
+claim="Can set special_small_blocks property less than or equal to recordsize"
+
+log_assert $claim
+log_onexit cleanup
+log_must disk_setup
+
+for size in 8192 32768 131072 524288 1048576
+do
+ let smaller=$size/2
+ log_must zpool create -O recordsize=$size \
+ -O special_small_blocks=$smaller \
+ $TESTPOOL raidz $ZPOOL_DISKS special mirror \
+ $CLASS_DISK0 $CLASS_DISK1
+ log_must zpool destroy -f "$TESTPOOL"
+
+ log_must zpool create -O recordsize=$size \
+ -O special_small_blocks=$size \
+ $TESTPOOL raidz $ZPOOL_DISKS special mirror \
+ $CLASS_DISK0 $CLASS_DISK1
+ log_must zpool destroy -f "$TESTPOOL"
+done
+
+log_pass $claim
diff --git a/tests/zfs-tests/tests/functional/append/cleanup.ksh b/tests/zfs-tests/tests/functional/append/cleanup.ksh
index 307feabd17c6..7d8f3aafb771 100755
--- a/tests/zfs-tests/tests/functional/append/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/append/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/append/file_append.ksh b/tests/zfs-tests/tests/functional/append/file_append.ksh
index b40d10c05edb..52c3aff17b79 100755
--- a/tests/zfs-tests/tests/functional/append/file_append.ksh
+++ b/tests/zfs-tests/tests/functional/append/file_append.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/append/setup.ksh b/tests/zfs-tests/tests/functional/append/setup.ksh
index e692d7b1bc0c..4642f3a1925c 100755
--- a/tests/zfs-tests/tests/functional/append/setup.ksh
+++ b/tests/zfs-tests/tests/functional/append/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/append/threadsappend_001_pos.ksh b/tests/zfs-tests/tests/functional/append/threadsappend_001_pos.ksh
index 8154214a0ca7..8ce79c12a04a 100755
--- a/tests/zfs-tests/tests/functional/append/threadsappend_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/append/threadsappend_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/arc/cleanup.ksh b/tests/zfs-tests/tests/functional/arc/cleanup.ksh
index 63a47ba7daf3..72a091d25157 100755
--- a/tests/zfs-tests/tests/functional/arc/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/arc/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/arc/dbufstats_001_pos.ksh b/tests/zfs-tests/tests/functional/arc/dbufstats_001_pos.ksh
index aaab800b60ab..e51cf179d8ef 100755
--- a/tests/zfs-tests/tests/functional/arc/dbufstats_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/arc/dbufstats_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/arc/dbufstats_002_pos.ksh b/tests/zfs-tests/tests/functional/arc/dbufstats_002_pos.ksh
index e253553f07c0..2908895d0c6a 100755
--- a/tests/zfs-tests/tests/functional/arc/dbufstats_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/arc/dbufstats_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/arc/dbufstats_003_pos.ksh b/tests/zfs-tests/tests/functional/arc/dbufstats_003_pos.ksh
index 91cec74881a6..7be57bc9f255 100755
--- a/tests/zfs-tests/tests/functional/arc/dbufstats_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/arc/dbufstats_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/arc/setup.ksh b/tests/zfs-tests/tests/functional/arc/setup.ksh
index 60699d365eb5..a499d7415077 100755
--- a/tests/zfs-tests/tests/functional/arc/setup.ksh
+++ b/tests/zfs-tests/tests/functional/arc/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/atime/atime.cfg b/tests/zfs-tests/tests/functional/atime/atime.cfg
index c1532eb47fd3..eece764248cd 100644
--- a/tests/zfs-tests/tests/functional/atime/atime.cfg
+++ b/tests/zfs-tests/tests/functional/atime/atime.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/atime/atime_001_pos.ksh b/tests/zfs-tests/tests/functional/atime/atime_001_pos.ksh
index 274a4da0dcb9..9006afbeed97 100755
--- a/tests/zfs-tests/tests/functional/atime/atime_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/atime/atime_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -62,11 +62,9 @@ do
mtpt=$(snapshot_mountpoint $dst)
log_mustnot check_atime_updated $mtpt/$TESTFILE
else
- if is_linux; then
- log_must zfs set relatime=off $dst
- fi
-
log_must zfs set atime=on $dst
+ log_must zfs set relatime=off $dst
+
log_must check_atime_updated $mtpt/$TESTFILE
log_must check_atime_updated $mtpt/$TESTFILE
fi
diff --git a/tests/zfs-tests/tests/functional/atime/atime_002_neg.ksh b/tests/zfs-tests/tests/functional/atime/atime_002_neg.ksh
index c8579337c053..8fde4f23455c 100755
--- a/tests/zfs-tests/tests/functional/atime/atime_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/atime/atime_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/atime/atime_003_pos.ksh b/tests/zfs-tests/tests/functional/atime/atime_003_pos.ksh
index d3eec92effbc..28d973c71f83 100755
--- a/tests/zfs-tests/tests/functional/atime/atime_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/atime/atime_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -62,6 +62,7 @@ do
else
log_must zfs set atime=on $dst
log_must zfs set relatime=on $dst
+
log_must check_atime_updated $mtpt/$TESTFILE
log_mustnot check_atime_updated $mtpt/$TESTFILE
fi
diff --git a/tests/zfs-tests/tests/functional/atime/atime_common.kshlib b/tests/zfs-tests/tests/functional/atime/atime_common.kshlib
index fce85c379865..1755f0b49732 100644
--- a/tests/zfs-tests/tests/functional/atime/atime_common.kshlib
+++ b/tests/zfs-tests/tests/functional/atime/atime_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/atime/cleanup.ksh b/tests/zfs-tests/tests/functional/atime/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/atime/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/atime/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/atime/root_atime_off.ksh b/tests/zfs-tests/tests/functional/atime/root_atime_off.ksh
index 7eb2ed937287..9c1bf3150570 100755
--- a/tests/zfs-tests/tests/functional/atime/root_atime_off.ksh
+++ b/tests/zfs-tests/tests/functional/atime/root_atime_off.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/atime/root_atime_on.ksh b/tests/zfs-tests/tests/functional/atime/root_atime_on.ksh
index 44d471a2128f..3b6a0d9004ce 100755
--- a/tests/zfs-tests/tests/functional/atime/root_atime_on.ksh
+++ b/tests/zfs-tests/tests/functional/atime/root_atime_on.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -65,11 +65,10 @@ do
mtpt=$(snapshot_mountpoint $dst)
log_mustnot check_atime_updated $mtpt/$TESTFILE
else
- if is_linux; then
- log_must zfs set relatime=off $(dirname $dst)
- fi
-
log_must zfs set atime=on $(dirname $dst)
+ # inherited relatime won't apply because of mount option, set explicitly
+ log_must zfs set relatime=off $dst
+
log_must check_atime_updated $mtpt/$TESTFILE
log_must check_atime_updated $mtpt/$TESTFILE
fi
diff --git a/tests/zfs-tests/tests/functional/atime/root_relatime_on.ksh b/tests/zfs-tests/tests/functional/atime/root_relatime_on.ksh
index 120129425afa..062325938ef2 100755
--- a/tests/zfs-tests/tests/functional/atime/root_relatime_on.ksh
+++ b/tests/zfs-tests/tests/functional/atime/root_relatime_on.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -68,6 +68,7 @@ do
else
log_must zfs set atime=on $(dirname $dst)
log_must zfs set relatime=on $(dirname $dst)
+
log_must check_atime_updated $mtpt/$TESTFILE
log_mustnot check_atime_updated $mtpt/$TESTFILE
fi
diff --git a/tests/zfs-tests/tests/functional/atime/setup.ksh b/tests/zfs-tests/tests/functional/atime/setup.ksh
index 3720e7521cc2..f662bffbc374 100755
--- a/tests/zfs-tests/tests/functional/atime/setup.ksh
+++ b/tests/zfs-tests/tests/functional/atime/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/bclone/TODO b/tests/zfs-tests/tests/functional/bclone/TODO
new file mode 100644
index 000000000000..7cd4ee898fc4
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/TODO
@@ -0,0 +1,4 @@
+- If dedup enabled, block_cloning uses dedup.
+- check when block cloning doesn't suppose to work
+- check block cloning between two different pools
+- block cloning from a snapshot
diff --git a/tests/zfs-tests/tests/functional/bclone/bclone.cfg b/tests/zfs-tests/tests/functional/bclone/bclone.cfg
new file mode 100644
index 000000000000..f72d17c1beca
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/bclone.cfg
@@ -0,0 +1,32 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+# TODO: We should calculate that based on ashift.
+export MINBLOCKSIZE=512
+
+export TESTSRCFS="$TESTPOOL/$TESTFS/src"
+export TESTDSTFS="$TESTPOOL/$TESTFS/dst"
+export TESTSRCDIR="$TESTDIR/src"
+export TESTDSTDIR="$TESTDIR/dst"
diff --git a/tests/zfs-tests/tests/functional/bclone/bclone_common.kshlib b/tests/zfs-tests/tests/functional/bclone/bclone_common.kshlib
new file mode 100644
index 000000000000..84b92b4dcdc9
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/bclone_common.kshlib
@@ -0,0 +1,291 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+. $STF_SUITE/tests/functional/bclone/bclone.cfg
+
+export RECORDSIZE=$(zfs get -Hp -o value recordsize $TESTPOOL/$TESTFS)
+
+MINBLKSIZE1=512
+MINBLKSIZE2=1024
+
+function verify_block_cloning
+{
+ if is_linux && [[ $(linux_version) -lt $(linux_version "4.5") ]]; then
+ log_unsupported "copy_file_range not available before Linux 4.5"
+ fi
+}
+
+function verify_crossfs_block_cloning
+{
+ if is_linux && [[ $(linux_version) -lt $(linux_version "5.3") ]]; then
+ log_unsupported "copy_file_range can't copy cross-filesystem before Linux 5.3"
+ fi
+
+ # Cross dataset block cloning only supported on FreeBSD 14+
+ # https://github.com/freebsd/freebsd-src/commit/969071be938c
+ if is_freebsd && [ $(freebsd_version) -lt $(freebsd_version 14.0) ] ; then
+ log_unsupported "Cloning across datasets not supported in $(uname -r)"
+ fi
+}
+
+# Unused.
+function size_to_dsize
+{
+ typeset -r size=$1
+ typeset -r dir=$2
+
+ typeset -r dataset=$(df $dir | tail -1 | awk '{print $1}')
+ typeset -r recordsize=$(get_prop recordsize $dataset)
+ typeset -r copies=$(get_prop copies $dataset)
+ typeset dsize
+
+ if [[ $size -le $recordsize ]]; then
+ dsize=$(( ((size - 1) / MINBLOCKSIZE + 1) * MINBLOCKSIZE ))
+ else
+ dsize=$(( ((size - 1) / recordsize + 1) * recordsize ))
+ fi
+ dsize=$((dsize*copies))
+
+ echo $dsize
+}
+
+function test_file_integrity
+{
+ typeset -r original_checksum=$1
+ typeset -r clone=$2
+ typeset -r filesize=$3
+
+ typeset -r clone_checksum=$(sha256digest $clone)
+
+ if [[ $original_checksum != $clone_checksum ]]; then
+ log_fail "Clone $clone is corrupted with file size $filesize"
+ fi
+}
+
+function verify_pool_prop_eq
+{
+ typeset -r prop=$1
+ typeset -r expected=$2
+
+ typeset -r value=$(get_pool_prop $prop $TESTPOOL)
+ if [[ $value != $expected ]]; then
+ log_fail "Pool property $prop is incorrect: expected $expected, got $value"
+ fi
+}
+
+function verify_pool_props
+{
+ typeset -r oused=$1
+ typeset -r osaved=$2
+ typeset dsize=$3
+ typeset ratio=$4
+
+ if [[ $dsize -eq 0 ]]; then
+ ratio=1
+ elif [[ $ratio -eq 1 ]]; then
+ dsize=0
+ fi
+ verify_pool_prop_eq bcloneused $(($oused+$dsize))
+ verify_pool_prop_eq bclonesaved $(($osaved+dsize*(ratio-1)))
+ if [[ $oused -eq 0 ]]; then
+ verify_pool_prop_eq bcloneratio "${ratio}.00"
+ fi
+}
+
+# Function to test file copying and integrity check.
+function bclone_test
+{
+ typeset -r datatype=$1
+ typeset filesize=$2
+ typeset -r embedded=$3
+ typeset -r srcdir=$4
+ typeset -r dstdir=$5
+ typeset dsize
+ typeset oused
+ typeset osaved
+
+ typeset -r original="${srcdir}/original"
+ typeset -r clone="${dstdir}/clone"
+
+ log_note "Testing file copy with datatype $datatype, file size $filesize, embedded $embedded"
+
+ # Save current block cloning stats for later use.
+ sync_pool $TESTPOOL
+ oused=$(get_pool_prop bcloneused $TESTPOOL)
+ osaved=$(get_pool_prop bclonesaved $TESTPOOL)
+
+ # Create a test file with known content.
+ case $datatype in
+ random|text)
+ if [[ $datatype = "random" ]]; then
+ dd if=/dev/urandom of=$original bs=$filesize count=1 2>/dev/null
+ else
+ filesize=$(((filesize/4)*4))
+ dd if=/dev/urandom bs=$(((filesize/4)*3)) count=1 | \
+ openssl base64 -A > $original
+ fi
+ sync_pool $TESTPOOL
+ clonefile -f $original "${clone}-tmp"
+ sync_pool $TESTPOOL
+ # It is hard to predict block sizes that will be used,
+ # so just do one clone and take it from bcloneused.
+ dsize=$(get_pool_prop bcloneused $TESTPOOL)
+ dsize=$(($dsize-$oused))
+ if [[ $embedded = "false" ]]; then
+ log_must test $dsize -gt 0
+ fi
+ rm -f "${clone}-tmp"
+ sync_pool $TESTPOOL
+ ;;
+ hole)
+ log_must truncate_test -s $filesize -f $original
+ dsize=0
+ ;;
+ *)
+ log_fail "Unknown datatype $datatype"
+ ;;
+ esac
+ if [[ $embedded = "true" ]]; then
+ dsize=0
+ fi
+
+ typeset -r original_checksum=$(sha256digest $original)
+
+ sync_pool $TESTPOOL
+
+ # Create a first clone of the entire file.
+ clonefile -f $original "${clone}0"
+ # Try to clone the clone in the same transaction group.
+ clonefile -f "${clone}0" "${clone}2"
+
+ # Clone the original again...
+ clonefile -f $original "${clone}1"
+ # ...and overwrite it in the same transaction group.
+ clonefile -f $original "${clone}1"
+
+ # Clone the clone...
+ clonefile -f "${clone}1" "${clone}3"
+ sync_pool $TESTPOOL
+ # ...and overwrite in the new transaction group.
+ clonefile -f "${clone}1" "${clone}3"
+
+ sync_pool $TESTPOOL
+
+ # Test removal of the pending clones (before they are committed to disk).
+ clonefile -f $original "${clone}4"
+ clonefile -f "${clone}4" "${clone}5"
+ rm -f "${clone}4" "${clone}5"
+
+ # Clone into one file, but remove another file, but with the same data in
+ # the same transaction group.
+ clonefile -f $original "${clone}5"
+ sync_pool $TESTPOOL
+ clonefile -f $original "${clone}4"
+ rm -f "${clone}5"
+ test_file_integrity $original_checksum "${clone}4" $filesize
+ sync_pool $TESTPOOL
+ test_file_integrity $original_checksum "${clone}4" $filesize
+
+ clonefile -f "${clone}4" "${clone}5"
+ # Verify integrity of the cloned file before it is committed to disk.
+ test_file_integrity $original_checksum "${clone}5" $filesize
+
+ sync_pool $TESTPOOL
+
+ # Verify integrity in the new transaction group.
+ test_file_integrity $original_checksum "${clone}0" $filesize
+ test_file_integrity $original_checksum "${clone}1" $filesize
+ test_file_integrity $original_checksum "${clone}2" $filesize
+ test_file_integrity $original_checksum "${clone}3" $filesize
+ test_file_integrity $original_checksum "${clone}4" $filesize
+ test_file_integrity $original_checksum "${clone}5" $filesize
+
+ verify_pool_props $oused $osaved $dsize 7
+
+ # Clear cache and test after fresh import.
+ log_must zpool export $TESTPOOL
+ log_must zpool import $TESTPOOL
+
+ # Cloned uncached file.
+ clonefile -f $original "${clone}6"
+ # Cloned uncached clone.
+ clonefile -f "${clone}6" "${clone}7"
+
+ # Cache the file.
+ cat $original >/dev/null
+ clonefile -f $original "${clone}8"
+ clonefile -f "${clone}8" "${clone}9"
+
+ test_file_integrity $original_checksum "${clone}6" $filesize
+ test_file_integrity $original_checksum "${clone}7" $filesize
+ test_file_integrity $original_checksum "${clone}8" $filesize
+ test_file_integrity $original_checksum "${clone}9" $filesize
+
+ sync_pool $TESTPOOL
+
+ verify_pool_props $oused $osaved $dsize 11
+
+ log_must zpool export $TESTPOOL
+ log_must zpool import $TESTPOOL
+
+ test_file_integrity $original_checksum "${clone}0" $filesize
+ test_file_integrity $original_checksum "${clone}1" $filesize
+ test_file_integrity $original_checksum "${clone}2" $filesize
+ test_file_integrity $original_checksum "${clone}3" $filesize
+ test_file_integrity $original_checksum "${clone}4" $filesize
+ test_file_integrity $original_checksum "${clone}5" $filesize
+ test_file_integrity $original_checksum "${clone}6" $filesize
+ test_file_integrity $original_checksum "${clone}7" $filesize
+ test_file_integrity $original_checksum "${clone}8" $filesize
+ test_file_integrity $original_checksum "${clone}9" $filesize
+
+ rm -f $original
+ rm -f "${clone}1" "${clone}3" "${clone}5" "${clone}7"
+
+ sync_pool $TESTPOOL
+
+ test_file_integrity $original_checksum "${clone}0" $filesize
+ test_file_integrity $original_checksum "${clone}2" $filesize
+ test_file_integrity $original_checksum "${clone}4" $filesize
+ test_file_integrity $original_checksum "${clone}6" $filesize
+ test_file_integrity $original_checksum "${clone}8" $filesize
+ test_file_integrity $original_checksum "${clone}9" $filesize
+
+ verify_pool_props $oused $osaved $dsize 6
+
+ rm -f "${clone}0" "${clone}2" "${clone}4" "${clone}8" "${clone}9"
+
+ sync_pool $TESTPOOL
+
+ test_file_integrity $original_checksum "${clone}6" $filesize
+
+ verify_pool_props $oused $osaved $dsize 1
+
+ rm -f "${clone}6"
+
+ sync_pool $TESTPOOL
+
+ verify_pool_props $oused $osaved $dsize 1
+}
diff --git a/tests/zfs-tests/tests/functional/bclone/bclone_corner_cases.kshlib b/tests/zfs-tests/tests/functional/bclone/bclone_corner_cases.kshlib
new file mode 100644
index 000000000000..aeb8efe91715
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/bclone_corner_cases.kshlib
@@ -0,0 +1,325 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/include/math.shlib
+. $STF_SUITE/tests/functional/bclone/bclone_common.kshlib
+
+function first_half_checksum
+{
+ typeset -r file=$1
+
+ dd if=$file bs=$HALFRECORDSIZE count=1 2>/dev/null | sha256digest
+}
+
+function second_half_checksum
+{
+ typeset -r file=$1
+
+ dd if=$file bs=$HALFRECORDSIZE count=1 skip=1 2>/dev/null | sha256digest
+}
+
+function bclone_corner_cases_init
+{
+ typeset -r srcdir=$1
+ typeset -r dstdir=$2
+
+ export RECORDSIZE=4096
+ export HALFRECORDSIZE=$((RECORDSIZE / 2))
+
+ export CLONE="$dstdir/clone0"
+ export ORIG0="$srcdir/orig0"
+ export ORIG1="$srcdir/orig1"
+ export ORIG2="$srcdir/orig2"
+
+ # Create source files.
+ log_must dd if=/dev/urandom of="$ORIG0" bs=$RECORDSIZE count=1
+ log_must dd if=/dev/urandom of="$ORIG1" bs=$RECORDSIZE count=1
+ log_must dd if=/dev/urandom of="$ORIG2" bs=$RECORDSIZE count=1
+
+ export FIRST_HALF_ORIG0_CHECKSUM=$(first_half_checksum $ORIG0)
+ export FIRST_HALF_ORIG1_CHECKSUM=$(first_half_checksum $ORIG1)
+ export FIRST_HALF_ORIG2_CHECKSUM=$(first_half_checksum $ORIG2)
+ export SECOND_HALF_ORIG0_CHECKSUM=$(second_half_checksum $ORIG0)
+ export SECOND_HALF_ORIG1_CHECKSUM=$(second_half_checksum $ORIG1)
+ export SECOND_HALF_ORIG2_CHECKSUM=$(second_half_checksum $ORIG2)
+ export ZEROS_CHECKSUM=$(dd if=/dev/zero bs=$HALFRECORDSIZE count=1 2>/dev/null | sha256digest)
+ export FIRST_HALF_CHECKSUM=""
+ export SECOND_HALF_CHECKSUM=""
+}
+
+function cache_clone
+{
+ typeset -r cached=$1
+
+ case "$cached" in
+ "cached")
+ dd if=$CLONE of=/dev/null bs=$RECORDSIZE 2>/dev/null
+ ;;
+ "uncached")
+ ;;
+ *)
+ log_fail "invalid cached: $cached"
+ ;;
+ esac
+}
+
+function create_existing
+{
+ typeset -r existing=$1
+
+ case "$existing" in
+ "no")
+ ;;
+ "small empty")
+ log_must truncate_test -s $HALFRECORDSIZE -f $CLONE
+ ;;
+ "full empty")
+ log_must truncate_test -s $RECORDSIZE -f $CLONE
+ ;;
+ "small data")
+ log_must dd if=/dev/urandom of=$CLONE bs=$HALFRECORDSIZE count=1 \
+ 2>/dev/null
+ ;;
+ "full data")
+ log_must dd if=/dev/urandom of=$CLONE bs=$RECORDSIZE count=1 2>/dev/null
+ ;;
+ *)
+ log_fail "invalid existing: $existing"
+ ;;
+ esac
+}
+
+function create_clone
+{
+ typeset -r clone=$1
+ typeset -r file=$2
+
+ case "$clone" in
+ "no")
+ ;;
+ "yes")
+ clonefile -f $file $CLONE
+ case "$file" in
+ $ORIG0)
+ FIRST_HALF_CHECKSUM=$FIRST_HALF_ORIG0_CHECKSUM
+ SECOND_HALF_CHECKSUM=$SECOND_HALF_ORIG0_CHECKSUM
+ ;;
+ $ORIG2)
+ FIRST_HALF_CHECKSUM=$FIRST_HALF_ORIG2_CHECKSUM
+ SECOND_HALF_CHECKSUM=$SECOND_HALF_ORIG2_CHECKSUM
+ ;;
+ *)
+ log_fail "invalid file: $file"
+ ;;
+ esac
+ ;;
+ *)
+ log_fail "invalid clone: $clone"
+ ;;
+ esac
+}
+
+function overwrite_clone
+{
+ typeset -r overwrite=$1
+
+ case "$overwrite" in
+ "no")
+ ;;
+ "free")
+ log_must truncate_test -s 0 -f $CLONE
+ log_must truncate_test -s $RECORDSIZE -f $CLONE
+ FIRST_HALF_CHECKSUM=$ZEROS_CHECKSUM
+ SECOND_HALF_CHECKSUM=$ZEROS_CHECKSUM
+ ;;
+ "full")
+ log_must dd if=$ORIG1 of=$CLONE bs=$RECORDSIZE count=1 2>/dev/null
+ FIRST_HALF_CHECKSUM=$FIRST_HALF_ORIG1_CHECKSUM
+ SECOND_HALF_CHECKSUM=$SECOND_HALF_ORIG1_CHECKSUM
+ ;;
+ "first half")
+ log_must dd if=$ORIG1 of=$CLONE bs=$HALFRECORDSIZE skip=0 seek=0 \
+ count=1 conv=notrunc 2>/dev/null
+ FIRST_HALF_CHECKSUM=$FIRST_HALF_ORIG1_CHECKSUM
+ ;;
+ "second half")
+ log_must dd if=$ORIG1 of=$CLONE bs=$HALFRECORDSIZE skip=1 seek=1 \
+ count=1 conv=notrunc 2>/dev/null
+ SECOND_HALF_CHECKSUM=$SECOND_HALF_ORIG1_CHECKSUM
+ ;;
+ *)
+ log_fail "invalid overwrite: $overwrite"
+ ;;
+ esac
+}
+
+function checksum_compare
+{
+ typeset -r compare=$1
+ typeset first_half_calculated_checksum second_half_calculated_checksum
+
+ case "$compare" in
+ "no")
+ ;;
+ "yes")
+ first_half_calculated_checksum=$(first_half_checksum $CLONE)
+ second_half_calculated_checksum=$(second_half_checksum $CLONE)
+
+ if [[ $first_half_calculated_checksum != $FIRST_HALF_CHECKSUM ]] || \
+ [[ $second_half_calculated_checksum != $SECOND_HALF_CHECKSUM ]]; then
+ return 1
+ fi
+ ;;
+ *)
+ log_fail "invalid compare: $compare"
+ ;;
+ esac
+}
+
+function bclone_corner_cases_test
+{
+ typeset cached existing
+ typeset first_clone first_overwrite
+ typeset read_after read_before
+ typeset second_clone second_overwrite
+ typeset -r srcdir=$1
+ typeset -r dstdir=$2
+ typeset limit=$3
+ typeset -i count=0
+ typeset oused
+ typeset osaved
+
+ if [[ $srcdir != "count" ]]; then
+ if [[ -n "$limit" ]]; then
+ typeset -r total_count=$(bclone_corner_cases_test count)
+ limit=$(random_int_between 1 $total_count $((limit*2)) | sort -nu | head -n $limit | xargs)
+ fi
+ bclone_corner_cases_init $srcdir $dstdir
+
+ # Save current block cloning stats for later use.
+ sync_pool $TESTPOOL
+ oused=$(get_pool_prop bcloneused $TESTPOOL)
+ osaved=$(get_pool_prop bclonesaved $TESTPOOL)
+ fi
+
+ #
+ # (create) / (cache) / (clone) / (overwrite) / (read) / (clone) / (overwrite) / (read) / read next txg
+ #
+ for existing in "no" "small empty" "full empty" "small data" "full data"; do
+ for cached in "uncached" "cached"; do
+ for first_clone in "no" "yes"; do
+ for first_overwrite in "no" "free" "full" "first half" "second half"; do
+ for read_before in "no" "yes"; do
+ for second_clone in "no" "yes"; do
+ for second_overwrite in "no" "free" "full" "first half" "second half"; do
+ for read_after in "no" "yes"; do
+ if [[ $first_clone = "no" ]] && \
+ [[ $second_clone = "no" ]]; then
+ continue
+ fi
+ if [[ $first_clone = "no" ]] && \
+ [[ $read_before = "yes" ]]; then
+ continue
+ fi
+ if [[ $second_clone = "no" ]] && \
+ [[ $read_before = "yes" ]] && \
+ [[ $read_after = "yes" ]]; then
+ continue
+ fi
+
+ count=$((count+1))
+
+ if [[ $srcdir = "count" ]]; then
+ # Just counting.
+ continue
+ fi
+
+ if [[ -n "$limit" ]]; then
+ if ! echo " $limit " | grep -q " $count "; then
+ continue
+ fi
+ fi
+
+ FIRST_HALF_CHECKSUM=""
+ SECOND_HALF_CHECKSUM=""
+
+ log_must zpool export $TESTPOOL
+ log_must zpool import $TESTPOOL
+
+ create_existing "$existing"
+
+ log_must zpool export $TESTPOOL
+ log_must zpool import $TESTPOOL
+
+ cache_clone "$cached"
+
+ create_clone "$first_clone" "$ORIG0"
+
+ overwrite_clone "$first_overwrite"
+
+ if checksum_compare $read_before; then
+ log_note "existing: $existing / cached: $cached / first_clone: $first_clone / first_overwrite: $first_overwrite / read_before: $read_before"
+ else
+ log_fail "FAIL: existing: $existing / cached: $cached / first_clone: $first_clone / first_overwrite: $first_overwrite / read_before: $read_before"
+ fi
+
+ create_clone "$second_clone" "$ORIG2"
+
+ overwrite_clone "$second_overwrite"
+
+ if checksum_compare $read_after; then
+ log_note "existing: $existing / cached: $cached / first_clone: $first_clone / first_overwrite: $first_overwrite / read_before: $read_before / second_clone: $second_clone / second_overwrite: $second_overwrite / read_after: $read_after"
+ else
+ log_fail "FAIL: existing: $existing / cached: $cached / first_clone: $first_clone / first_overwrite: $first_overwrite / read_before: $read_before / second_clone: $second_clone / second_overwrite: $second_overwrite / read_after: $read_after"
+ fi
+
+ log_must zpool export $TESTPOOL
+ log_must zpool import $TESTPOOL
+
+ if checksum_compare "yes"; then
+ log_note "existing: $existing / cached: $cached / first_clone: $first_clone / first_overwrite: $first_overwrite / read_before: $read_before / second_clone: $second_clone / second_overwrite: $second_overwrite / read_after: $read_after / read_next_txg"
+ else
+ log_fail "FAIL: existing: $existing / cached: $cached / first_clone: $first_clone / first_overwrite: $first_overwrite / read_before: $read_before / second_clone: $second_clone / second_overwrite: $second_overwrite / read_after: $read_after / read_next_txg"
+ fi
+
+ rm -f "$CLONE"
+ sync_pool $TESTPOOL
+ verify_pool_prop_eq bcloneused $oused
+ verify_pool_prop_eq bclonesaved $osaved
+ done
+ done
+ done
+ done
+ done
+ done
+ done
+ done
+
+ if [[ $srcdir = "count" ]]; then
+ echo $count
+ fi
+}
diff --git a/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_corner_cases.ksh b/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_corner_cases.ksh
new file mode 100755
index 000000000000..35188cddb063
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_corner_cases.ksh
@@ -0,0 +1,45 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/bclone/bclone_corner_cases.kshlib
+
+verify_runnable "both"
+
+verify_block_cloning
+verify_crossfs_block_cloning
+
+log_assert "Verify various corner cases in block cloning across datasets"
+
+# Disable compression to make sure we won't use embedded blocks.
+log_must zfs set compress=off $TESTSRCFS
+log_must zfs set recordsize=$RECORDSIZE $TESTSRCFS
+log_must zfs set compress=off $TESTDSTFS
+log_must zfs set recordsize=$RECORDSIZE $TESTDSTFS
+
+bclone_corner_cases_test $TESTSRCDIR $TESTDSTDIR
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_corner_cases_limited.ksh b/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_corner_cases_limited.ksh
new file mode 100755
index 000000000000..1fc1bbd07fd9
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_corner_cases_limited.ksh
@@ -0,0 +1,45 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/bclone/bclone_corner_cases.kshlib
+
+verify_runnable "both"
+
+verify_block_cloning
+verify_crossfs_block_cloning
+
+log_assert "Verify various corner cases in block cloning across datasets"
+
+# Disable compression to make sure we won't use embedded blocks.
+log_must zfs set compress=off $TESTSRCFS
+log_must zfs set recordsize=$RECORDSIZE $TESTSRCFS
+log_must zfs set compress=off $TESTDSTFS
+log_must zfs set recordsize=$RECORDSIZE $TESTDSTFS
+
+bclone_corner_cases_test $TESTSRCDIR $TESTDSTDIR 100
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_data.ksh b/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_data.ksh
new file mode 100755
index 000000000000..e2fe25d451dd
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_data.ksh
@@ -0,0 +1,46 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/bclone/bclone_common.kshlib
+
+verify_runnable "both"
+
+verify_block_cloning
+verify_crossfs_block_cloning
+
+log_assert "Verify block cloning properly clones regular files across datasets"
+
+# Disable compression to make sure we won't use embedded blocks.
+log_must zfs set compress=off $TESTSRCFS
+log_must zfs set compress=off $TESTDSTFS
+
+for filesize in 1 107 113 511 512 513 4095 4096 4097 131071 131072 131073 \
+ 1048575 1048576 1048577 4194303 4194304 4194305; do
+ bclone_test random $filesize false $TESTSRCDIR $TESTDSTDIR
+done
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_embedded.ksh b/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_embedded.ksh
new file mode 100755
index 000000000000..6a6fe1d309a9
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_embedded.ksh
@@ -0,0 +1,50 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/bclone/bclone_common.kshlib
+
+verify_runnable "both"
+
+verify_block_cloning
+verify_crossfs_block_cloning
+
+log_assert "Verify block cloning properly clones small files (with embedded blocks) across datasets"
+
+# Enable ZLE compression to make sure what is the maximum amount of data we
+# can store in BP.
+log_must zfs set compress=zle $TESTSRCFS
+log_must zfs set compress=zle $TESTDSTFS
+
+# Test BP_IS_EMBEDDED().
+# Maximum embedded payload size is 112 bytes, but the buffer is extended to
+# 512 bytes first and then compressed. 107 random bytes followed by 405 zeros
+# gives exactly 112 bytes after compression with ZLE.
+for filesize in 1 2 4 8 16 32 64 96 107; do
+ bclone_test random $filesize true $TESTSRCDIR $TESTDSTDIR
+done
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_hole.ksh b/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_hole.ksh
new file mode 100755
index 000000000000..d4c33d6da30f
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_hole.ksh
@@ -0,0 +1,45 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/bclone/bclone_common.kshlib
+
+verify_runnable "both"
+
+verify_block_cloning
+verify_crossfs_block_cloning
+
+log_assert "Verify block cloning properly clones sparse files (files with holes) across datasets"
+
+# Compression doesn't matter here.
+
+# Test BP_IS_HOLE().
+for filesize in 1 511 512 513 4095 4096 4097 131071 131072 131073 \
+ 1048575 1048576 1048577 4194303 4194304 4194305; do
+ bclone_test hole $filesize false $TESTSRCDIR $TESTDSTDIR
+done
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_all.ksh b/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_all.ksh
new file mode 100755
index 000000000000..a5e7282fe6a8
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_all.ksh
@@ -0,0 +1,86 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/include/math.shlib
+. $STF_SUITE/tests/functional/bclone/bclone_common.kshlib
+
+verify_runnable "both"
+
+verify_block_cloning
+verify_crossfs_block_cloning
+
+log_assert "Verify block cloning across datasets with different properties"
+
+log_must zfs set checksum=off $TESTSRCFS
+log_must zfs set compress=off $TESTSRCFS
+log_must zfs set copies=1 $TESTSRCFS
+log_must zfs set recordsize=131072 $TESTSRCFS
+log_must zfs set checksum=fletcher2 $TESTDSTFS
+log_must zfs set compress=lz4 $TESTDSTFS
+log_must zfs set copies=3 $TESTDSTFS
+log_must zfs set recordsize=8192 $TESTDSTFS
+
+FILESIZE=$(random_int_between 2 32767)
+FILESIZE=$((FILESIZE * 64))
+bclone_test text $FILESIZE false $TESTSRCDIR $TESTDSTDIR
+
+log_must zfs set checksum=sha256 $TESTSRCFS
+log_must zfs set compress=zstd $TESTSRCFS
+log_must zfs set copies=2 $TESTSRCFS
+log_must zfs set recordsize=262144 $TESTSRCFS
+log_must zfs set checksum=off $TESTDSTFS
+log_must zfs set compress=off $TESTDSTFS
+log_must zfs set copies=1 $TESTDSTFS
+log_must zfs set recordsize=131072 $TESTDSTFS
+
+FILESIZE=$(random_int_between 2 32767)
+FILESIZE=$((FILESIZE * 64))
+bclone_test text $FILESIZE false $TESTSRCDIR $TESTDSTDIR
+
+log_must zfs set checksum=sha512 $TESTSRCFS
+log_must zfs set compress=gzip $TESTSRCFS
+log_must zfs set copies=2 $TESTSRCFS
+log_must zfs set recordsize=512 $TESTSRCFS
+log_must zfs set checksum=fletcher4 $TESTDSTFS
+log_must zfs set compress=lzjb $TESTDSTFS
+log_must zfs set copies=3 $TESTDSTFS
+log_must zfs set recordsize=16384 $TESTDSTFS
+
+FILESIZE=$(random_int_between 2 32767)
+FILESIZE=$((FILESIZE * 64))
+bclone_test text $FILESIZE false $TESTSRCDIR $TESTDSTDIR
+
+log_must zfs inherit checksum $TESTSRCFS
+log_must zfs inherit compress $TESTSRCFS
+log_must zfs inherit copies $TESTSRCFS
+log_must zfs inherit recordsize $TESTSRCFS
+log_must zfs inherit checksum $TESTDSTFS
+log_must zfs inherit compress $TESTDSTFS
+log_must zfs inherit copies $TESTDSTFS
+log_must zfs inherit recordsize $TESTDSTFS
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_checksum.ksh b/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_checksum.ksh
new file mode 100755
index 000000000000..7e064a0dfd73
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_checksum.ksh
@@ -0,0 +1,62 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/include/math.shlib
+. $STF_SUITE/include/properties.shlib
+. $STF_SUITE/tests/functional/bclone/bclone_common.kshlib
+
+verify_runnable "both"
+
+verify_block_cloning
+verify_crossfs_block_cloning
+
+log_assert "Verify block cloning across datasets with different checksum properties"
+
+log_must zfs set compress=off $TESTSRCFS
+log_must zfs set compress=off $TESTDSTFS
+
+for srcprop in "${checksum_prop_vals[@]}"; do
+ for dstprop in "${checksum_prop_vals[@]}"; do
+ if [[ $srcprop == $dstprop ]]; then
+ continue
+ fi
+ log_must zfs set checksum=$srcprop $TESTSRCFS
+ log_must zfs set checksum=$dstprop $TESTDSTFS
+ # 15*8=120, which is greater than 113, so we are sure the data won't
+ # be embedded into BP.
+ # 32767*8=262136, which is larger than a single default recordsize of
+ # 131072.
+ FILESIZE=$(random_int_between 15 32767)
+ FILESIZE=$((FILESIZE * 8))
+ bclone_test random $FILESIZE false $TESTSRCDIR $TESTDSTDIR
+ done
+done
+
+log_must zfs inherit checksum $TESTSRCFS
+log_must zfs inherit checksum $TESTDSTFS
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_compress.ksh b/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_compress.ksh
new file mode 100755
index 000000000000..e1d6e5949218
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_compress.ksh
@@ -0,0 +1,59 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/include/math.shlib
+. $STF_SUITE/include/properties.shlib
+. $STF_SUITE/tests/functional/bclone/bclone_common.kshlib
+
+verify_runnable "both"
+
+verify_block_cloning
+verify_crossfs_block_cloning
+
+log_assert "Verify block cloning across datasets with different compression properties"
+
+for srcprop in "${compress_prop_vals[@]}"; do
+ for dstprop in "${compress_prop_vals[@]}"; do
+ if [[ $srcprop == $dstprop ]]; then
+ continue
+ fi
+ log_must zfs set compress=$srcprop $TESTSRCFS
+ log_must zfs set compress=$dstprop $TESTDSTFS
+ # 15*8=120, which is greater than 113, so we are sure the data won't
+ # be embedded into BP.
+ # 32767*8=262136, which is larger than a single default recordsize of
+ # 131072.
+ FILESIZE=$(random_int_between 15 32767)
+ FILESIZE=$((FILESIZE * 8))
+ bclone_test text $FILESIZE false $TESTSRCDIR $TESTDSTDIR
+ done
+done
+
+log_must zfs inherit compress $TESTSRCFS
+log_must zfs inherit compress $TESTDSTFS
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_copies.ksh b/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_copies.ksh
new file mode 100755
index 000000000000..ac823e1ec394
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_copies.ksh
@@ -0,0 +1,59 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/include/math.shlib
+. $STF_SUITE/include/properties.shlib
+. $STF_SUITE/tests/functional/bclone/bclone_common.kshlib
+
+verify_runnable "both"
+
+verify_block_cloning
+verify_crossfs_block_cloning
+
+log_assert "Verify block cloning across datasets with different copies properties"
+
+log_must zfs set compress=off $TESTSRCFS
+log_must zfs set compress=off $TESTDSTFS
+
+for srcprop in "${copies_prop_vals[@]}"; do
+ for dstprop in "${copies_prop_vals[@]}"; do
+ log_must zfs set copies=$srcprop $TESTSRCFS
+ log_must zfs set copies=$dstprop $TESTDSTFS
+ # 15*8=120, which is greater than 113, so we are sure the data won't
+ # be embedded into BP.
+ # 32767*8=262136, which is larger than a single default recordsize of
+ # 131072.
+ FILESIZE=$(random_int_between 15 32767)
+ FILESIZE=$((FILESIZE * 8))
+ bclone_test random $FILESIZE false $TESTSRCDIR $TESTDSTDIR
+ done
+done
+
+log_must zfs inherit copies $TESTSRCFS
+log_must zfs inherit copies $TESTDSTFS
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_recordsize.ksh b/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_recordsize.ksh
new file mode 100755
index 000000000000..d833e6123106
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_recordsize.ksh
@@ -0,0 +1,65 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/include/math.shlib
+. $STF_SUITE/include/properties.shlib
+. $STF_SUITE/tests/functional/bclone/bclone_common.kshlib
+
+verify_runnable "both"
+
+verify_block_cloning
+verify_crossfs_block_cloning
+
+log_assert "Verify block cloning across datasets with different recordsize properties"
+
+log_must zfs set compress=off $TESTSRCFS
+log_must zfs set compress=off $TESTDSTFS
+
+# recsize_prop_vals[] array contains too many entries and the tests take too
+# long. Let's use only a subset of them.
+typeset -a bclone_recsize_prop_vals=('512' '4096' '131072' '1048576')
+
+for srcprop in "${bclone_recsize_prop_vals[@]}"; do
+ for dstprop in "${bclone_recsize_prop_vals[@]}"; do
+ if [[ $srcprop == $dstprop ]]; then
+ continue
+ fi
+ log_must zfs set recordsize=$srcprop $TESTSRCFS
+ log_must zfs set recordsize=$dstprop $TESTDSTFS
+ # 2*64=128, which is greater than 113, so we are sure the data won't
+ # be embedded into BP.
+ # 32767*64=2097088, which is larger than the largest recordsize (1MB).
+ FILESIZE=$(random_int_between 2 32767)
+ FILESIZE=$((FILESIZE * 64))
+ bclone_test random $FILESIZE false $TESTSRCDIR $TESTDSTDIR
+ done
+done
+
+log_must zfs inherit recordsize $TESTSRCFS
+log_must zfs inherit recordsize $TESTDSTFS
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/bclone/bclone_prop_sync.ksh b/tests/zfs-tests/tests/functional/bclone/bclone_prop_sync.ksh
new file mode 100755
index 000000000000..f8aa1c875c60
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/bclone_prop_sync.ksh
@@ -0,0 +1,66 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/include/math.shlib
+. $STF_SUITE/include/properties.shlib
+. $STF_SUITE/tests/functional/bclone/bclone_common.kshlib
+
+verify_runnable "both"
+
+verify_block_cloning
+verify_crossfs_block_cloning
+
+log_assert "Verify block cloning with all sync property settings"
+
+log_must zfs set compress=zle $TESTSRCFS
+log_must zfs set compress=zle $TESTDSTFS
+
+for prop in "${sync_prop_vals[@]}"; do
+ log_must zfs set sync=$prop $TESTSRCFS
+ # 32767*8=262136, which is larger than a single default recordsize of
+ # 131072.
+ FILESIZE=$(random_int_between 1 32767)
+ FILESIZE=$((FILESIZE * 8))
+ bclone_test random $FILESIZE false $TESTSRCDIR $TESTSRCDIR
+done
+
+for srcprop in "${sync_prop_vals[@]}"; do
+ log_must zfs set sync=$srcprop $TESTSRCFS
+ for dstprop in "${sync_prop_vals[@]}"; do
+ log_must zfs set sync=$dstprop $TESTDSTFS
+ # 32767*8=262136, which is larger than a single default recordsize of
+ # 131072.
+ FILESIZE=$(random_int_between 1 32767)
+ FILESIZE=$((FILESIZE * 8))
+ bclone_test random $FILESIZE false $TESTSRCDIR $TESTDSTDIR
+ done
+done
+
+log_must zfs inherit sync $TESTSRCFS
+log_must zfs inherit sync $TESTDSTFS
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/bclone/bclone_samefs_corner_cases.ksh b/tests/zfs-tests/tests/functional/bclone/bclone_samefs_corner_cases.ksh
new file mode 100755
index 000000000000..4aa2914da299
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/bclone_samefs_corner_cases.ksh
@@ -0,0 +1,42 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/bclone/bclone_corner_cases.kshlib
+
+verify_runnable "both"
+
+verify_block_cloning
+
+log_assert "Verify various corner cases in block cloning within the same dataset"
+
+# Disable compression to make sure we won't use embedded blocks.
+log_must zfs set compress=off $TESTSRCFS
+log_must zfs set recordsize=$RECORDSIZE $TESTSRCFS
+
+bclone_corner_cases_test $TESTSRCDIR $TESTSRCDIR
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/bclone/bclone_samefs_corner_cases_limited.ksh b/tests/zfs-tests/tests/functional/bclone/bclone_samefs_corner_cases_limited.ksh
new file mode 100755
index 000000000000..b4737700eb7d
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/bclone_samefs_corner_cases_limited.ksh
@@ -0,0 +1,42 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/bclone/bclone_corner_cases.kshlib
+
+verify_runnable "both"
+
+verify_block_cloning
+
+log_assert "Verify various corner cases in block cloning within the same dataset"
+
+# Disable compression to make sure we won't use embedded blocks.
+log_must zfs set compress=off $TESTSRCFS
+log_must zfs set recordsize=$RECORDSIZE $TESTSRCFS
+
+bclone_corner_cases_test $TESTSRCDIR $TESTSRCDIR 100
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/bclone/bclone_samefs_data.ksh b/tests/zfs-tests/tests/functional/bclone/bclone_samefs_data.ksh
new file mode 100755
index 000000000000..e964f7bbf641
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/bclone_samefs_data.ksh
@@ -0,0 +1,44 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/bclone/bclone_common.kshlib
+
+verify_runnable "both"
+
+verify_block_cloning
+
+log_assert "Verify block cloning properly clones regular files within the same dataset"
+
+# Disable compression to make sure we won't use embedded blocks.
+log_must zfs set compress=off $TESTSRCFS
+
+for filesize in 1 107 113 511 512 513 4095 4096 4097 131071 131072 131073 \
+ 1048575 1048576 1048577 4194303 4194304 4194305; do
+ bclone_test random $filesize false $TESTSRCDIR $TESTSRCDIR
+done
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/bclone/bclone_samefs_embedded.ksh b/tests/zfs-tests/tests/functional/bclone/bclone_samefs_embedded.ksh
new file mode 100755
index 000000000000..df393a878015
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/bclone_samefs_embedded.ksh
@@ -0,0 +1,48 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/bclone/bclone_common.kshlib
+
+verify_runnable "both"
+
+verify_block_cloning
+
+log_assert "Verify block cloning properly clones small files (with embedded blocks) within the same dataset"
+
+# Enable ZLE compression to make sure what is the maximum amount of data we
+# can store in BP.
+log_must zfs set compress=zle $TESTSRCFS
+
+# Test BP_IS_EMBEDDED().
+# Maximum embedded payload size is 112 bytes, but the buffer is extended to
+# 512 bytes first and then compressed. 107 random bytes followed by 405 zeros
+# gives exactly 112 bytes after compression with ZLE.
+for filesize in 1 2 4 8 16 32 64 96 107; do
+ bclone_test random $filesize true $TESTSRCDIR $TESTSRCDIR
+done
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/bclone/bclone_samefs_hole.ksh b/tests/zfs-tests/tests/functional/bclone/bclone_samefs_hole.ksh
new file mode 100755
index 000000000000..3c6e345e6e64
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/bclone_samefs_hole.ksh
@@ -0,0 +1,44 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/bclone/bclone_common.kshlib
+
+verify_runnable "both"
+
+verify_block_cloning
+
+log_assert "Verify block cloning properly clones sparse files (files with holes) within the same dataset"
+
+# Compression doesn't matter here.
+
+# Test BP_IS_HOLE().
+for filesize in 1 511 512 513 4095 4096 4097 131071 131072 131073 \
+ 1048575 1048576 1048577 4194303 4194304 4194305; do
+ bclone_test hole $filesize false $TESTSRCDIR $TESTSRCDIR
+done
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/raidz/raidz_003_pos.ksh b/tests/zfs-tests/tests/functional/bclone/cleanup.ksh
index bf22632c7eff..0021ccb57ae0 100755
--- a/tests/zfs-tests/tests/functional/raidz/raidz_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/bclone/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -21,21 +21,24 @@
#
#
-# Copyright (c) 2020 by vStack. All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
#
-. $STF_SUITE/include/libtest.shlib
-
#
-# DESCRIPTION:
-# Call the raidz_test tool with -S and -e to test all supported raidz
-# implementations with expanded map and default reflow offset.
-# This options will test several raidz block geometries and several zio
-# parameters that affect raidz block layout. Data reconstruction performs
-# all combinations of failed disks. Wall time is set to 5min, but actual
-# runtime might be longer.
+# Copyright (c) 2013 by Delphix. All rights reserved.
#
-log_must raidz_test -S -e -t 60
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/bclone/bclone.cfg
+
+log_must zfs destroy $TESTSRCFS
+log_must zfs destroy $TESTDSTFS
+
+default_cleanup_noexit
+
+if tunable_exists BCLONE_ENABLED ; then
+ log_must restore_tunable BCLONE_ENABLED
+fi
-log_pass "raidz_test parameter sweep test with expanded map succeeded."
+log_pass
diff --git a/tests/zfs-tests/tests/functional/bclone/setup.ksh b/tests/zfs-tests/tests/functional/bclone/setup.ksh
new file mode 100755
index 000000000000..9d26088c5a8a
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/bclone/setup.ksh
@@ -0,0 +1,50 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2023 by Pawel Jakub Dawidek
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/bclone/bclone.cfg
+
+if ! command -v clonefile > /dev/null ; then
+ log_unsupported "clonefile program required to test block cloning"
+fi
+
+if tunable_exists BCLONE_ENABLED ; then
+ log_must save_tunable BCLONE_ENABLED
+ log_must set_tunable32 BCLONE_ENABLED 1
+fi
+
+DISK=${DISKS%% *}
+
+default_setup_noexit $DISK "true"
+log_must zpool set feature@block_cloning=enabled $TESTPOOL
+log_must zfs create $TESTSRCFS
+log_must zfs create $TESTDSTFS
+log_pass
diff --git a/tests/zfs-tests/tests/functional/block_cloning/block_cloning.kshlib b/tests/zfs-tests/tests/functional/block_cloning/block_cloning.kshlib
new file mode 100644
index 000000000000..50f3a3d262c0
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/block_cloning.kshlib
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023, Klara Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+function have_same_content
+{
+ typeset hash1=$(md5digest $1)
+ typeset hash2=$(md5digest $2)
+
+ log_must [ "$hash1" = "$hash2" ]
+}
+
+#
+# get_same_blocks dataset1 path/to/file1 dataset2 path/to/file2
+#
+# Returns a space-separated list of the indexes (starting at 0) of the L0
+# blocks that are shared between both files (by first DVA and checksum).
+# Assumes that the two files have the same content, use have_same_content to
+# confirm that.
+#
+function get_same_blocks
+{
+ KEY=$5
+ if [ ${#KEY} -gt 0 ]; then
+ KEY="--key=$KEY"
+ fi
+ typeset zdbout=${TMPDIR:-$TEST_BASE_DIR}/zdbout.$$
+ zdb $KEY -vvvvv $1 -O $2 | \
+ awk '/ L0 / { print l++ " " $3 " " $7 }' > $zdbout.a
+ zdb $KEY -vvvvv $3 -O $4 | \
+ awk '/ L0 / { print l++ " " $3 " " $7 }' > $zdbout.b
+ echo $(sort -n $zdbout.a $zdbout.b | uniq -d | cut -f1 -d' ')
+}
+
diff --git a/tests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_cached.ksh b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_cached.ksh
new file mode 100755
index 000000000000..b0ef8ec99533
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_cached.ksh
@@ -0,0 +1,86 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib
+
+#
+# DESCRIPTION:
+# When the destination file is mmaped and is already cached we need to
+# update mmaped pages after successful clone.
+#
+# STRATEGY:
+# 1. Create a pool.
+# 2. Create a two test files with random content.
+# 3. mmap the files, read them and clone from one to the other using
+# clone_mmap_cached.
+# 4. clone_mmap_cached also verifies if the content of the destination
+# file was updated while reading it from mmaped memory.
+#
+
+verify_runnable "global"
+
+if is_linux && [[ $(linux_version) -lt $(linux_version "4.5") ]]; then
+ log_unsupported "copy_file_range not available before Linux 4.5"
+fi
+
+VDIR=$TEST_BASE_DIR/disk-bclone
+VDEV="$VDIR/a"
+
+function cleanup
+{
+ datasetexists $TESTPOOL && destroy_pool $TESTPOOL
+ rm -rf $VDIR
+}
+
+log_onexit cleanup
+
+log_assert "Test for clone into mmaped and cached file"
+
+log_must rm -rf $VDIR
+log_must mkdir -p $VDIR
+log_must truncate -s 1G $VDEV
+
+log_must zpool create -o feature@block_cloning=enabled $TESTPOOL $VDEV
+log_must zfs create $TESTPOOL/$TESTFS
+
+for opts in "--" "-i" "-o" "-io"
+do
+ log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/src bs=1M count=1
+ log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/dst bs=1M count=1
+
+ # Clear cache.
+ log_must zpool export $TESTPOOL
+ log_must zpool import -d $VDIR $TESTPOOL
+
+ log_must clone_mmap_cached $opts /$TESTPOOL/$TESTFS/src /$TESTPOOL/$TESTFS/dst
+
+ sync_pool $TESTPOOL
+ log_must sync
+
+ log_must have_same_content /$TESTPOOL/$TESTFS/src /$TESTPOOL/$TESTFS/dst
+ blocks=$(get_same_blocks $TESTPOOL/$TESTFS src $TESTPOOL/$TESTFS dst)
+ # FreeBSD's seq(1) leaves a trailing space, remove it with sed(1).
+ log_must [ "$blocks" = "$(seq -s " " 0 7 | sed 's/ $//')" ]
+done
+
+log_pass "Clone properly updates mmapped and cached pages"
diff --git a/tests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_write.ksh b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_write.ksh
new file mode 100755
index 000000000000..6215b3178e7e
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_write.ksh
@@ -0,0 +1,79 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib
+
+#
+# DESCRIPTION:
+# A PANIC is triggered in dbuf_redirty() if we clone a file, mmap it
+# and write from the map into the file. PR#15656 fixes this scenario.
+# This scenario also causes data corruption on FreeBSD, which is fixed
+# by PR#15665.
+#
+# STRATEGY:
+# 1. Create a pool
+# 2. Create a test file
+# 3. Clone, mmap and write to the file using clone_mmap_write
+# 5. Synchronize cached writes
+# 6. Verfiy data is correctly written to the disk
+#
+
+verify_runnable "global"
+
+if is_linux && [[ $(linux_version) -lt $(linux_version "4.5") ]]; then
+ log_unsupported "copy_file_range not available before Linux 4.5"
+fi
+
+VDIR=$TEST_BASE_DIR/disk-bclone
+VDEV="$VDIR/a"
+
+function cleanup
+{
+ datasetexists $TESTPOOL && destroy_pool $TESTPOOL
+ rm -rf $VDIR
+}
+
+log_onexit cleanup
+
+log_assert "Test for clone, mmap and write scenario"
+
+log_must rm -rf $VDIR
+log_must mkdir -p $VDIR
+log_must truncate -s 1G $VDEV
+
+log_must zpool create -o feature@block_cloning=enabled $TESTPOOL $VDEV
+log_must zfs create $TESTPOOL/$TESTFS
+
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/file bs=1M count=512
+log_must clone_mmap_write /$TESTPOOL/$TESTFS/file /$TESTPOOL/$TESTFS/clone
+
+sync_pool $TESTPOOL
+log_must sync
+
+log_must have_same_content /$TESTPOOL/$TESTFS/file /$TESTPOOL/$TESTFS/clone
+blocks=$(get_same_blocks $TESTPOOL/$TESTFS file $TESTPOOL/$TESTFS clone)
+# FreeBSD's seq(1) leaves a trailing space, remove it with sed(1).
+log_must [ "$blocks" = "$(seq -s " " 1 4095 | sed 's/ $//')" ]
+
+log_pass "Clone, mmap and write does not cause data corruption or " \
+ "trigger panic"
diff --git a/tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange.ksh b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange.ksh
new file mode 100755
index 000000000000..0599739abee6
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange.ksh
@@ -0,0 +1,60 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023, Klara Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib
+
+verify_runnable "global"
+
+if is_linux && [[ $(linux_version) -lt $(linux_version "4.5") ]]; then
+ log_unsupported "copy_file_range not available before Linux 4.5"
+fi
+
+claim="The copy_file_range syscall can clone whole files."
+
+log_assert $claim
+
+function cleanup
+{
+ datasetexists $TESTPOOL && destroy_pool $TESTPOOL
+}
+
+log_onexit cleanup
+
+log_must zpool create -o feature@block_cloning=enabled $TESTPOOL $DISKS
+
+log_must dd if=/dev/urandom of=/$TESTPOOL/file1 bs=128K count=4
+log_must sync_pool $TESTPOOL
+
+log_must clonefile -f /$TESTPOOL/file1 /$TESTPOOL/file2 0 0 524288
+log_must sync_pool $TESTPOOL
+
+log_must have_same_content /$TESTPOOL/file1 /$TESTPOOL/file2
+
+typeset blocks=$(get_same_blocks $TESTPOOL file1 $TESTPOOL file2)
+log_must [ "$blocks" = "0 1 2 3" ]
+
+log_pass $claim
diff --git a/tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_cross_dataset.ksh b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_cross_dataset.ksh
new file mode 100755
index 000000000000..ad83d30291ac
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_cross_dataset.ksh
@@ -0,0 +1,64 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023, Klara Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib
+. $STF_SUITE/tests/functional/bclone/bclone_common.kshlib
+
+verify_runnable "global"
+
+verify_crossfs_block_cloning
+
+claim="The copy_file_range syscall can clone across datasets."
+
+log_assert $claim
+
+function cleanup
+{
+ datasetexists $TESTPOOL && destroy_pool $TESTPOOL
+}
+
+log_onexit cleanup
+
+log_must zpool create -o feature@block_cloning=enabled $TESTPOOL $DISKS
+
+log_must zfs create $TESTPOOL/$TESTFS1
+log_must zfs create $TESTPOOL/$TESTFS2
+
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS1/file1 bs=128K count=4
+log_must sync_pool $TESTPOOL
+
+log_must \
+ clonefile -f /$TESTPOOL/$TESTFS1/file1 /$TESTPOOL/$TESTFS2/file2 0 0 524288
+log_must sync_pool $TESTPOOL
+
+log_must have_same_content /$TESTPOOL/$TESTFS1/file1 /$TESTPOOL/$TESTFS2/file2
+
+typeset blocks=$(get_same_blocks \
+ $TESTPOOL/$TESTFS1 file1 $TESTPOOL/$TESTFS2 file2)
+log_must [ "$blocks" = "0 1 2 3" ]
+
+log_pass $claim
diff --git a/tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_fallback.ksh b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_fallback.ksh
new file mode 100755
index 000000000000..475910be7478
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_fallback.ksh
@@ -0,0 +1,86 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023, Klara Inc.
+# Copyright (c) 2023, Rob Norris <robn@despairlabs.com>
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib
+
+verify_runnable "global"
+
+if is_linux && [[ $(linux_version) -lt $(linux_version "4.5") ]]; then
+ log_unsupported "copy_file_range not available before Linux 4.5"
+fi
+
+claim="copy_file_range will fall back to copy when cloning not possible."
+
+log_assert $claim
+
+function cleanup
+{
+ datasetexists $TESTPOOL && destroy_pool $TESTPOOL
+}
+
+log_onexit cleanup
+
+log_must zpool create -o feature@block_cloning=enabled $TESTPOOL $DISKS
+
+log_must dd if=/dev/urandom of=/$TESTPOOL/file bs=128K count=4
+log_must sync_pool $TESTPOOL
+
+
+log_note "Copying entire file with copy_file_range"
+
+log_must clonefile -f /$TESTPOOL/file /$TESTPOOL/clone 0 0 524288
+log_must sync_pool $TESTPOOL
+
+log_must have_same_content /$TESTPOOL/file /$TESTPOOL/clone
+
+typeset blocks=$(get_same_blocks $TESTPOOL file $TESTPOOL clone)
+log_must [ "$blocks" = "0 1 2 3" ]
+
+
+log_note "Copying within a block with copy_file_range"
+
+log_must clonefile -f /$TESTPOOL/file /$TESTPOOL/clone 32768 32768 65536
+log_must sync_pool $TESTPOOL
+
+log_must have_same_content /$TESTPOOL/file /$TESTPOOL/clone
+
+typeset blocks=$(get_same_blocks $TESTPOOL file $TESTPOOL clone)
+log_must [ "$blocks" = "1 2 3" ]
+
+
+log_note "Copying across a block with copy_file_range"
+
+log_must clonefile -f /$TESTPOOL/file /$TESTPOOL/clone 327680 327680 131072
+log_must sync_pool $TESTPOOL
+
+log_must have_same_content /$TESTPOOL/file /$TESTPOOL/clone
+
+typeset blocks=$(get_same_blocks $TESTPOOL file $TESTPOOL clone)
+log_must [ "$blocks" = "1" ]
+
+log_pass $claim
diff --git a/tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_fallback_same_txg.ksh b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_fallback_same_txg.ksh
new file mode 100755
index 000000000000..00982f68db86
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_fallback_same_txg.ksh
@@ -0,0 +1,68 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023, Klara Inc.
+# Copyright (c) 2023, Rob Norris <robn@despairlabs.com>
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib
+
+verify_runnable "global"
+
+if is_linux && [[ $(linux_version) -lt $(linux_version "4.5") ]]; then
+ log_unsupported "copy_file_range not available before Linux 4.5"
+fi
+
+claim="copy_file_range will fall back to copy when cloning on same txg"
+
+log_assert $claim
+
+typeset timeout=$(get_tunable TXG_TIMEOUT)
+
+function cleanup
+{
+ datasetexists $TESTPOOL && destroy_pool $TESTPOOL
+ set_tunable64 TXG_TIMEOUT $timeout
+}
+
+log_onexit cleanup
+
+log_must set_tunable64 TXG_TIMEOUT 5000
+
+log_must zpool create -o feature@block_cloning=enabled $TESTPOOL $DISKS
+
+log_must sync_pool $TESTPOOL true
+
+log_must dd if=/dev/urandom of=/$TESTPOOL/file bs=128K count=4
+log_must clonefile -f /$TESTPOOL/file /$TESTPOOL/clone 0 0 524288
+
+log_must sync_pool $TESTPOOL
+
+log_must have_same_content /$TESTPOOL/file /$TESTPOOL/clone
+
+typeset blocks=$(get_same_blocks $TESTPOOL file $TESTPOOL clone)
+log_must [ "$blocks" = "" ]
+
+log_pass $claim
+
diff --git a/tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_partial.ksh b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_partial.ksh
new file mode 100755
index 000000000000..38c46e4741cb
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_partial.ksh
@@ -0,0 +1,68 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023, Klara Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib
+
+verify_runnable "global"
+
+if is_linux && [[ $(linux_version) -lt $(linux_version "4.5") ]]; then
+ log_unsupported "copy_file_range not available before Linux 4.5"
+fi
+
+claim="The copy_file_range syscall can clone parts of a file."
+
+log_assert $claim
+
+function cleanup
+{
+ datasetexists $TESTPOOL && destroy_pool $TESTPOOL
+}
+
+log_onexit cleanup
+
+log_must zpool create -o feature@block_cloning=enabled $TESTPOOL $DISKS
+
+log_must dd if=/dev/urandom of=/$TESTPOOL/file1 bs=128K count=4
+log_must sync_pool $TESTPOOL
+
+log_must dd if=/$TESTPOOL/file1 of=/$TESTPOOL/file2 bs=128K count=4
+log_must sync_pool $TESTPOOL
+
+log_must have_same_content /$TESTPOOL/file1 /$TESTPOOL/file2
+
+typeset blocks=$(get_same_blocks $TESTPOOL file1 $TESTPOOL file2)
+log_must [ "$blocks" = "" ]
+
+log_must clonefile -f /$TESTPOOL/file1 /$TESTPOOL/file2 131072 131072 262144
+log_must sync_pool $TESTPOOL
+
+log_must have_same_content /$TESTPOOL/file1 /$TESTPOOL/file2
+
+typeset blocks=$(get_same_blocks $TESTPOOL file1 $TESTPOOL file2)
+log_must [ "$blocks" = "1 2" ]
+
+log_pass $claim
diff --git a/tests/zfs-tests/tests/functional/block_cloning/block_cloning_cross_enc_dataset.ksh b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_cross_enc_dataset.ksh
new file mode 100755
index 000000000000..702e23267f7e
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_cross_enc_dataset.ksh
@@ -0,0 +1,169 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023, Kay Pedersen <mail@mkwg.de>
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib
+. $STF_SUITE/tests/functional/bclone/bclone_common.kshlib
+
+verify_runnable "global"
+
+verify_crossfs_block_cloning
+
+claim="Block cloning across encrypted datasets."
+
+log_assert $claim
+
+DS1="$TESTPOOL/encrypted1"
+DS2="$TESTPOOL/encrypted2"
+DS1_NC="$TESTPOOL/notcrypted1"
+PASSPHRASE="top_secret"
+
+function prepare_enc
+{
+ log_must zpool create -o feature@block_cloning=enabled $TESTPOOL $DISKS
+ log_must eval "echo $PASSPHRASE | zfs create -o encryption=on" \
+ "-o keyformat=passphrase -o keylocation=prompt $DS1"
+ log_must eval "echo $PASSPHRASE | zfs create -o encryption=on" \
+ "-o keyformat=passphrase -o keylocation=prompt $DS2"
+ log_must zfs create $DS1/child1
+ log_must zfs create $DS1/child2
+ log_must zfs create $DS1_NC
+
+ log_note "Create test file"
+ # we must wait until the src file txg is written to the disk otherwise we
+ # will fallback to normal copy. See "dmu_read_l0_bps" in
+ # "zfs/module/zfs/dmu.c" and "zfs_clone_range" in
+ # "zfs/module/zfs/zfs_vnops.c"
+ log_must dd if=/dev/urandom of=/$DS1/file bs=128K count=4
+ log_must dd if=/dev/urandom of=/$DS1/child1/file bs=128K count=4
+ log_must dd if=/dev/urandom of=/$DS1_NC/file bs=128K count=4
+ log_must sync_pool $TESTPOOL
+}
+
+function cleanup_enc
+{
+ datasetexists $TESTPOOL && destroy_pool $TESTPOOL
+}
+
+function clone_and_check
+{
+ I_FILE="$1"
+ O_FILE=$2
+ I_DS=$3
+ O_DS=$4
+ SAME_BLOCKS=$5
+ # the CLONE option provides a choice between copy_file_range
+ # which should clone and a dd which is a copy no matter what
+ CLONE=$6
+ SNAPSHOT=$7
+ if [ ${#SNAPSHOT} -gt 0 ]; then
+ I_FILE=".zfs/snapshot/$SNAPSHOT/$1"
+ fi
+ if [ $CLONE ]; then
+ log_must clonefile -f "/$I_DS/$I_FILE" "/$O_DS/$O_FILE" 0 0 524288
+ else
+ log_must dd if="/$I_DS/$I_FILE" of="/$O_DS/$O_FILE" bs=128K
+ fi
+ log_must sync_pool $TESTPOOL
+
+ log_must have_same_content "/$I_DS/$I_FILE" "/$O_DS/$O_FILE"
+
+ if [ ${#SNAPSHOT} -gt 0 ]; then
+ I_DS="$I_DS@$SNAPSHOT"
+ I_FILE="$1"
+ fi
+ typeset blocks=$(get_same_blocks \
+ $I_DS $I_FILE $O_DS $O_FILE $PASSPHRASE)
+ log_must [ "$blocks" = "$SAME_BLOCKS" ]
+}
+
+log_onexit cleanup_enc
+
+prepare_enc
+
+log_note "Cloning entire file with copy_file_range across different enc" \
+ "roots, should fallback"
+# we are expecting no same block map.
+clone_and_check "file" "clone" $DS1 $DS2 "" true
+log_note "check if the file is still readable and the same after" \
+ "unmount and key unload, shouldn't fail"
+typeset hash1=$(md5digest "/$DS1/file")
+log_must zfs umount $DS1 && zfs unload-key $DS1
+typeset hash2=$(md5digest "/$DS2/clone")
+log_must [ "$hash1" = "$hash2" ]
+
+cleanup_enc
+prepare_enc
+
+log_note "Cloning entire file with copy_file_range across different child datasets"
+# clone shouldn't work because of deriving a new master key for the child
+# we are expecting no same block map.
+clone_and_check "file" "clone" $DS1 "$DS1/child1" "" true
+clone_and_check "file" "clone" "$DS1/child1" "$DS1/child2" "" true
+
+cleanup_enc
+prepare_enc
+
+log_note "Copying entire file with copy_file_range across same snapshot"
+log_must zfs snapshot -r $DS1@s1
+log_must sync_pool $TESTPOOL
+log_must rm -f "/$DS1/file"
+log_must sync_pool $TESTPOOL
+clone_and_check "file" "clone" "$DS1" "$DS1" "0 1 2 3" true "s1"
+
+cleanup_enc
+prepare_enc
+
+log_note "Copying entire file with copy_file_range across different snapshot"
+clone_and_check "file" "file" $DS1 $DS2 "" true
+log_must zfs snapshot -r $DS2@s1
+log_must sync_pool $TESTPOOL
+log_must rm -f "/$DS1/file" "/$DS2/file"
+log_must sync_pool $TESTPOOL
+clone_and_check "file" "clone" "$DS2" "$DS1" "" true "s1"
+typeset hash1=$(md5digest "/$DS1/.zfs/snapshot/s1/file")
+log_note "destroy the snapshot and check if the file is still readable and" \
+ "has the same content"
+log_must zfs destroy -r $DS2@s1
+log_must sync_pool $TESTPOOL
+typeset hash2=$(md5digest "/$DS1/file")
+log_must [ "$hash1" = "$hash2" ]
+
+cleanup_enc
+prepare_enc
+
+log_note "Copying with copy_file_range from non encrypted to encrypted"
+clone_and_check "file" "copy" $DS1_NC $DS1 "" true
+
+cleanup_enc
+prepare_enc
+
+log_note "Copying with copy_file_range from encrypted to non encrypted"
+clone_and_check "file" "copy" $DS1 $DS1_NC "" true
+
+log_must sync_pool $TESTPOOL
+
+log_pass $claim
diff --git a/tests/zfs-tests/tests/functional/block_cloning/block_cloning_disabled_copyfilerange.ksh b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_disabled_copyfilerange.ksh
new file mode 100755
index 000000000000..3d916ab92165
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_disabled_copyfilerange.ksh
@@ -0,0 +1,60 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023, Klara Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib
+
+verify_runnable "global"
+
+if is_linux && [[ $(linux_version) -lt $(linux_version "4.5") ]]; then
+ log_unsupported "copy_file_range not available before Linux 4.5"
+fi
+
+claim="The copy_file_range syscall copies files when block cloning is disabled."
+
+log_assert $claim
+
+function cleanup
+{
+ datasetexists $TESTPOOL && destroy_pool $TESTPOOL
+}
+
+log_onexit cleanup
+
+log_must zpool create -o feature@block_cloning=disabled $TESTPOOL $DISKS
+
+log_must dd if=/dev/urandom of=/$TESTPOOL/file1 bs=128K count=4
+log_must sync_pool $TESTPOOL
+
+log_must clonefile -f /$TESTPOOL/file1 /$TESTPOOL/file2 0 0 524288
+log_must sync_pool $TESTPOOL
+
+log_must have_same_content /$TESTPOOL/file1 /$TESTPOOL/file2
+
+typeset blocks=$(get_same_blocks $TESTPOOL file1 $TESTPOOL file2)
+log_must [ "$blocks" = "" ]
+
+log_pass $claim
diff --git a/tests/zfs-tests/tests/functional/block_cloning/block_cloning_disabled_ficlone.ksh b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_disabled_ficlone.ksh
new file mode 100755
index 000000000000..10a2715ea253
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_disabled_ficlone.ksh
@@ -0,0 +1,50 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023, Klara Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib
+
+verify_runnable "global"
+
+claim="The FICLONE ioctl fails when block cloning is disabled."
+
+log_assert $claim
+
+function cleanup
+{
+ datasetexists $TESTPOOL && destroy_pool $TESTPOOL
+}
+
+log_onexit cleanup
+
+log_must zpool create -o feature@block_cloning=disabled $TESTPOOL $DISKS
+
+log_must dd if=/dev/urandom of=/$TESTPOOL/file1 bs=128K count=4
+log_must sync_pool $TESTPOOL
+
+log_mustnot clonefile -c /$TESTPOOL/file1 /$TESTPOOL/file2
+
+log_pass $claim
diff --git a/tests/zfs-tests/tests/functional/block_cloning/block_cloning_disabled_ficlonerange.ksh b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_disabled_ficlonerange.ksh
new file mode 100755
index 000000000000..e8461e6d3c38
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_disabled_ficlonerange.ksh
@@ -0,0 +1,50 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023, Klara Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib
+
+verify_runnable "global"
+
+claim="The FICLONERANGE ioctl fails when block cloning is disabled."
+
+log_assert $claim
+
+function cleanup
+{
+ datasetexists $TESTPOOL && destroy_pool $TESTPOOL
+}
+
+log_onexit cleanup
+
+log_must zpool create -o feature@block_cloning=disabled $TESTPOOL $DISKS
+
+log_must dd if=/dev/urandom of=/$TESTPOOL/file1 bs=128K count=4
+log_must sync_pool $TESTPOOL
+
+log_mustnot clonefile -r /$TESTPOOL/file1 /$TESTPOOL/file2 0 0 524288
+
+log_pass $claim
diff --git a/tests/zfs-tests/tests/functional/block_cloning/block_cloning_ficlone.ksh b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_ficlone.ksh
new file mode 100755
index 000000000000..3f227fb68ee3
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_ficlone.ksh
@@ -0,0 +1,56 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023, Klara Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib
+
+verify_runnable "global"
+
+claim="The FICLONE ioctl can clone files."
+
+log_assert $claim
+
+function cleanup
+{
+ datasetexists $TESTPOOL && destroy_pool $TESTPOOL
+}
+
+log_onexit cleanup
+
+log_must zpool create -o feature@block_cloning=enabled $TESTPOOL $DISKS
+
+log_must dd if=/dev/urandom of=/$TESTPOOL/file1 bs=128K count=4
+log_must sync_pool $TESTPOOL
+
+log_must clonefile -c /$TESTPOOL/file1 /$TESTPOOL/file2
+log_must sync_pool $TESTPOOL
+
+log_must have_same_content /$TESTPOOL/file1 /$TESTPOOL/file2
+
+typeset blocks=$(get_same_blocks $TESTPOOL file1 $TESTPOOL file2)
+log_must [ "$blocks" = "0 1 2 3" ]
+
+log_pass $claim
diff --git a/tests/zfs-tests/tests/functional/block_cloning/block_cloning_ficlonerange.ksh b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_ficlonerange.ksh
new file mode 100755
index 000000000000..cefc4336aefd
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_ficlonerange.ksh
@@ -0,0 +1,56 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023, Klara Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib
+
+verify_runnable "global"
+
+claim="The FICLONERANGE ioctl can clone whole files."
+
+log_assert $claim
+
+function cleanup
+{
+ datasetexists $TESTPOOL && destroy_pool $TESTPOOL
+}
+
+log_onexit cleanup
+
+log_must zpool create -o feature@block_cloning=enabled $TESTPOOL $DISKS
+
+log_must dd if=/dev/urandom of=/$TESTPOOL/file1 bs=128K count=4
+log_must sync_pool $TESTPOOL
+
+log_must clonefile -r /$TESTPOOL/file1 /$TESTPOOL/file2 0 0 524288
+log_must sync_pool $TESTPOOL
+
+log_must have_same_content /$TESTPOOL/file1 /$TESTPOOL/file2
+
+typeset blocks=$(get_same_blocks $TESTPOOL file1 $TESTPOOL file2)
+log_must [ "$blocks" = "0 1 2 3" ]
+
+log_pass $claim
diff --git a/tests/zfs-tests/tests/functional/block_cloning/block_cloning_ficlonerange_partial.ksh b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_ficlonerange_partial.ksh
new file mode 100755
index 000000000000..067f55aaa65b
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_ficlonerange_partial.ksh
@@ -0,0 +1,64 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023, Klara Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib
+
+verify_runnable "global"
+
+claim="The FICLONERANGE ioctl can clone parts of a file."
+
+log_assert $claim
+
+function cleanup
+{
+ datasetexists $TESTPOOL && destroy_pool $TESTPOOL
+}
+
+log_onexit cleanup
+
+log_must zpool create -o feature@block_cloning=enabled $TESTPOOL $DISKS
+
+log_must dd if=/dev/urandom of=/$TESTPOOL/file1 bs=128K count=4
+log_must sync_pool $TESTPOOL
+
+log_must dd if=/$TESTPOOL/file1 of=/$TESTPOOL/file2 bs=128K count=4
+log_must sync_pool $TESTPOOL
+
+log_must have_same_content /$TESTPOOL/file1 /$TESTPOOL/file2
+
+typeset blocks=$(get_same_blocks $TESTPOOL file1 $TESTPOOL file2)
+log_must [ "$blocks" = "" ]
+
+log_must clonefile -r /$TESTPOOL/file1 /$TESTPOOL/file2 131072 131072 262144
+log_must sync_pool $TESTPOOL
+
+log_must have_same_content /$TESTPOOL/file1 /$TESTPOOL/file2
+
+typeset blocks=$(get_same_blocks $TESTPOOL file1 $TESTPOOL file2)
+log_must [ "$blocks" = "1 2" ]
+
+log_pass $claim
diff --git a/tests/zfs-tests/tests/functional/block_cloning/block_cloning_lwb_buffer_overflow.ksh b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_lwb_buffer_overflow.ksh
new file mode 100755
index 000000000000..919f320dea3f
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_lwb_buffer_overflow.ksh
@@ -0,0 +1,90 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by iXsystems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib
+
+#
+# DESCRIPTION:
+# Test for LWB buffer overflow with multiple VDEVs ZIL when 128KB
+# block write is split into two 68KB ones, trying to write maximum
+# sizes 128KB TX_CLONE_RANGE record with 1022 block pointers into
+# 68KB buffer.
+#
+# STRATEGY:
+# 1. Create a pool with multiple VDEVs ZIL
+# 2. Write maximum sizes TX_CLONE_RANGE record with 1022 block
+# pointers into 68KB buffer
+# 3. Sync TXG
+# 4. Clone the file
+# 5. Synchronize cached writes
+#
+
+verify_runnable "global"
+
+if is_linux && [[ $(linux_version) -lt $(linux_version "4.5") ]]; then
+ log_unsupported "copy_file_range not available before Linux 4.5"
+fi
+
+VDIR=$TEST_BASE_DIR/disk-bclone
+VDEV="$VDIR/a $VDIR/b $VDIR/c"
+LDEV="$VDIR/e $VDIR/f"
+
+function cleanup
+{
+ datasetexists $TESTPOOL && destroy_pool $TESTPOOL
+ rm -rf $VDIR
+}
+
+log_onexit cleanup
+
+log_assert "Test for LWB buffer overflow with multiple VDEVs ZIL"
+
+log_must rm -rf $VDIR
+log_must mkdir -p $VDIR
+log_must truncate -s $MINVDEVSIZE $VDEV $LDEV
+
+log_must zpool create -o feature@block_cloning=enabled $TESTPOOL $VDEV \
+ log mirror $LDEV
+log_must zfs create -o recordsize=32K $TESTPOOL/$TESTFS
+# Each ZIL log entry can fit 130816 bytes for a block cloning operation,
+# so it can store 1022 block pointers. When LWB optimization is enabled,
+# an assert is hit when 128KB block write is split into two 68KB ones
+# for 2 SLOG devices
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/file1 bs=32K count=1022 \
+ conv=fsync
+sync_pool $TESTPOOL
+log_must clonefile -f /$TESTPOOL/$TESTFS/file1 /$TESTPOOL/$TESTFS/file2
+log_must sync
+
+sync_pool $TESTPOOL
+log_must have_same_content /$TESTPOOL/$TESTFS/file1 /$TESTPOOL/$TESTFS/file2
+typeset blocks=$(get_same_blocks $TESTPOOL/$TESTFS file1 $TESTPOOL/$TESTFS file2)
+# FreeBSD's seq(1) leaves a trailing space, remove it with sed(1).
+log_must [ "$blocks" = "$(seq -s " " 0 1021 | sed 's/ $//')" ]
+
+log_pass "LWB buffer overflow is not triggered with multiple VDEVs ZIL"
+
diff --git a/tests/zfs-tests/tests/functional/block_cloning/block_cloning_replay.ksh b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_replay.ksh
new file mode 100755
index 000000000000..530152004686
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_replay.ksh
@@ -0,0 +1,132 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib
+
+#
+# DESCRIPTION:
+# Verify slogs are replayed correctly for cloned files. This
+# test is ported from slog_replay tests for block cloning.
+#
+# STRATEGY:
+# 1. Create an empty file system (TESTFS)
+# 2. Create regular files and sync
+# 3. Freeze TESTFS
+# 4. Clone the file
+# 5. Unmount filesystem
+# <At this stage TESTFS is frozen, the intent log contains a
+# complete set of deltas to replay it>
+# 6. Remount TESTFS <which replays the intent log>
+# 7. Compare clone file with the original file
+#
+
+verify_runnable "global"
+
+if is_linux && [[ $(linux_version) -lt $(linux_version "4.5") ]]; then
+ log_unsupported "copy_file_range not available before Linux 4.5"
+fi
+
+export VDIR=$TEST_BASE_DIR/disk-bclone
+export VDEV="$VDIR/a $VDIR/b $VDIR/c"
+export LDEV="$VDIR/e $VDIR/f"
+log_must rm -rf $VDIR
+log_must mkdir -p $VDIR
+log_must truncate -s $MINVDEVSIZE $VDEV $LDEV
+
+claim="The slogs are replayed correctly for cloned files."
+
+log_assert $claim
+
+function cleanup
+{
+ datasetexists $TESTPOOL && destroy_pool $TESTPOOL
+ rm -rf $TESTDIR $VDIR $VDIR2
+}
+
+log_onexit cleanup
+
+#
+# 1. Create an empty file system (TESTFS)
+#
+log_must zpool create -o feature@block_cloning=enabled $TESTPOOL $VDEV \
+ log mirror $LDEV
+log_must zfs create $TESTPOOL/$TESTFS
+
+#
+# 2. TX_WRITE: Create two files and sync txg
+#
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/file1 \
+ oflag=sync bs=128k count=4
+log_must zfs set recordsize=16K $TESTPOOL/$TESTFS
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/file2 \
+ oflag=sync bs=16K count=2048
+sync_pool $TESTPOOL
+
+#
+# 3. Checkpoint for ZIL Replay
+#
+log_must zpool freeze $TESTPOOL
+
+#
+# 4. TX_CLONE_RANGE: Clone the file
+#
+log_must clonefile -f /$TESTPOOL/$TESTFS/file1 /$TESTPOOL/$TESTFS/clone1
+log_must clonefile -f /$TESTPOOL/$TESTFS/file2 /$TESTPOOL/$TESTFS/clone2
+
+#
+# 5. Unmount filesystem and export the pool
+#
+# At this stage TESTFS is frozen, the intent log contains a complete set
+# of deltas to replay for clone files.
+#
+log_must zfs unmount /$TESTPOOL/$TESTFS
+
+log_note "Verify transactions to replay:"
+log_must zdb -iv $TESTPOOL/$TESTFS
+
+log_must zpool export $TESTPOOL
+
+#
+# 6. Remount TESTFS <which replays the intent log>
+#
+# Import the pool to unfreeze it and claim log blocks. It has to be
+# `zpool import -f` because we can't write a frozen pool's labels!
+#
+log_must zpool import -f -d $VDIR $TESTPOOL
+
+#
+# 7. Compare clone file with the original file
+#
+log_must have_same_content /$TESTPOOL/$TESTFS/file1 /$TESTPOOL/$TESTFS/clone1
+log_must have_same_content /$TESTPOOL/$TESTFS/file2 /$TESTPOOL/$TESTFS/clone2
+
+typeset blocks=$(get_same_blocks $TESTPOOL/$TESTFS file1 \
+ $TESTPOOL/$TESTFS clone1)
+log_must [ "$blocks" = "0 1 2 3" ]
+
+typeset blocks=$(get_same_blocks $TESTPOOL/$TESTFS file2 \
+ $TESTPOOL/$TESTFS clone2)
+# FreeBSD's seq(1) leaves a trailing space, remove it with sed(1).
+log_must [ "$blocks" = "$(seq -s " " 0 2047 | sed 's/ $//')" ]
+
+log_pass $claim
diff --git a/tests/zfs-tests/tests/functional/block_cloning/block_cloning_replay_encrypted.ksh b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_replay_encrypted.ksh
new file mode 100755
index 000000000000..0967415b7b7b
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_replay_encrypted.ksh
@@ -0,0 +1,134 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib
+
+#
+# DESCRIPTION:
+# Verify slogs are replayed correctly for encrypted cloned files.
+# This test is ported from slog_replay tests for block cloning.
+#
+# STRATEGY:
+# 1. Create an encrypted file system (TESTFS)
+# 2. Create regular files and sync
+# 3. Freeze TESTFS
+# 4. Clone the file
+# 5. Unmount filesystem
+# <At this stage TESTFS is frozen, the intent log contains a
+# complete set of deltas to replay it>
+# 6. Remount encrypted TESTFS <which replays the intent log>
+# 7. Compare clone file with the original file
+#
+
+verify_runnable "global"
+
+if is_linux && [[ $(linux_version) -lt $(linux_version "4.5") ]]; then
+ log_unsupported "copy_file_range not available before Linux 4.5"
+fi
+
+export VDIR=$TEST_BASE_DIR/disk-bclone
+export VDEV="$VDIR/a $VDIR/b $VDIR/c"
+export LDEV="$VDIR/e $VDIR/f"
+log_must rm -rf $VDIR
+log_must mkdir -p $VDIR
+log_must truncate -s $MINVDEVSIZE $VDEV $LDEV
+export PASSPHRASE="password"
+
+claim="The slogs are replayed correctly for encrypted cloned files."
+
+log_assert $claim
+
+function cleanup
+{
+ datasetexists $TESTPOOL && destroy_pool $TESTPOOL
+ rm -rf $TESTDIR $VDIR $VDIR2
+}
+
+log_onexit cleanup
+
+#
+# 1. Create an encrypted file system (TESTFS)
+#
+log_must zpool create -o feature@block_cloning=enabled $TESTPOOL $VDEV \
+ log mirror $LDEV
+log_must eval "echo $PASSPHRASE | zfs create -o encryption=on" \
+ "-o keyformat=passphrase -o keylocation=prompt $TESTPOOL/$TESTFS"
+
+#
+# 2. TX_WRITE: Create two files and sync txg
+#
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/file1 \
+ oflag=sync bs=128k count=4
+log_must zfs set recordsize=16K $TESTPOOL/$TESTFS
+log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/file2 \
+ oflag=sync bs=16K count=2048
+sync_pool $TESTPOOL
+
+#
+# 3. Checkpoint for ZIL Replay
+#
+log_must zpool freeze $TESTPOOL
+
+#
+# 4. TX_CLONE_RANGE: Clone the file
+#
+log_must clonefile -f /$TESTPOOL/$TESTFS/file1 /$TESTPOOL/$TESTFS/clone1
+log_must clonefile -f /$TESTPOOL/$TESTFS/file2 /$TESTPOOL/$TESTFS/clone2
+
+#
+# 5. Unmount filesystem and export the pool
+#
+# At this stage TESTFS is frozen, the intent log contains a complete set
+# of deltas to replay for clone files.
+#
+log_must zfs unmount /$TESTPOOL/$TESTFS
+
+log_note "Verify transactions to replay:"
+log_must zdb -iv $TESTPOOL/$TESTFS
+
+log_must zpool export $TESTPOOL
+
+#
+# 6. Remount TESTFS <which replays the intent log>
+#
+# Import the pool to unfreeze it and claim log blocks. It has to be
+# `zpool import -f` because we can't write a frozen pool's labels!
+#
+log_must eval "echo $PASSPHRASE | zpool import -l -f -d $VDIR $TESTPOOL"
+
+#
+# 7. Compare clone file with the original file
+#
+log_must have_same_content /$TESTPOOL/$TESTFS/file1 /$TESTPOOL/$TESTFS/clone1
+log_must have_same_content /$TESTPOOL/$TESTFS/file2 /$TESTPOOL/$TESTFS/clone2
+
+typeset blocks=$(get_same_blocks $TESTPOOL/$TESTFS file1 \
+ $TESTPOOL/$TESTFS clone1 $PASSPHRASE)
+log_must [ "$blocks" = "0 1 2 3" ]
+
+typeset blocks=$(get_same_blocks $TESTPOOL/$TESTFS file2 \
+ $TESTPOOL/$TESTFS clone2 $PASSPHRASE)
+# FreeBSD's seq(1) leaves a trailing space, remove it with sed(1).
+log_must [ "$blocks" = "$(seq -s " " 0 2047 | sed 's/ $//')" ]
+
+log_pass $claim
diff --git a/tests/zfs-tests/tests/functional/block_cloning/cleanup.ksh b/tests/zfs-tests/tests/functional/block_cloning/cleanup.ksh
new file mode 100755
index 000000000000..b985445a5d12
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/cleanup.ksh
@@ -0,0 +1,38 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023, Klara Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib
+
+verify_runnable "global"
+
+default_cleanup_noexit
+
+if tunable_exists BCLONE_ENABLED ; then
+ log_must restore_tunable BCLONE_ENABLED
+fi
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/block_cloning/setup.ksh b/tests/zfs-tests/tests/functional/block_cloning/setup.ksh
new file mode 100755
index 000000000000..a9b13f062a4e
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/block_cloning/setup.ksh
@@ -0,0 +1,44 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023, Klara Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib
+
+if ! command -v clonefile > /dev/null ; then
+ log_unsupported "clonefile program required to test block cloning"
+fi
+if ! command -v clone_mmap_cached > /dev/null ; then
+ log_unsupported "clone_mmap_cached program required to test block cloning"
+fi
+
+verify_runnable "global"
+
+if tunable_exists BCLONE_ENABLED ; then
+ log_must save_tunable BCLONE_ENABLED
+ log_must set_tunable32 BCLONE_ENABLED 1
+fi
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/bootfs/bootfs_001_pos.ksh b/tests/zfs-tests/tests/functional/bootfs/bootfs_001_pos.ksh
index 6f2f54ebdddc..add455eb13ee 100755
--- a/tests/zfs-tests/tests/functional/bootfs/bootfs_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/bootfs/bootfs_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/bootfs/bootfs_002_neg.ksh b/tests/zfs-tests/tests/functional/bootfs/bootfs_002_neg.ksh
index 172b69400807..a4324a63c710 100755
--- a/tests/zfs-tests/tests/functional/bootfs/bootfs_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/bootfs/bootfs_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/bootfs/bootfs_003_pos.ksh b/tests/zfs-tests/tests/functional/bootfs/bootfs_003_pos.ksh
index 78559dd186c8..e1d27d1cc6df 100755
--- a/tests/zfs-tests/tests/functional/bootfs/bootfs_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/bootfs/bootfs_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/bootfs/bootfs_004_neg.ksh b/tests/zfs-tests/tests/functional/bootfs/bootfs_004_neg.ksh
index 5ea0f6c1a95f..fa341622f3cf 100755
--- a/tests/zfs-tests/tests/functional/bootfs/bootfs_004_neg.ksh
+++ b/tests/zfs-tests/tests/functional/bootfs/bootfs_004_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/bootfs/bootfs_005_neg.ksh b/tests/zfs-tests/tests/functional/bootfs/bootfs_005_neg.ksh
index 42c82b88fba6..39a9a85b44a7 100755
--- a/tests/zfs-tests/tests/functional/bootfs/bootfs_005_neg.ksh
+++ b/tests/zfs-tests/tests/functional/bootfs/bootfs_005_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/bootfs/bootfs_006_pos.ksh b/tests/zfs-tests/tests/functional/bootfs/bootfs_006_pos.ksh
index 2738d3916e2c..cdd69f4a5b2f 100755
--- a/tests/zfs-tests/tests/functional/bootfs/bootfs_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/bootfs/bootfs_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/bootfs/bootfs_007_pos.ksh b/tests/zfs-tests/tests/functional/bootfs/bootfs_007_pos.ksh
index 2e71df86c62b..5750fe9338eb 100755
--- a/tests/zfs-tests/tests/functional/bootfs/bootfs_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/bootfs/bootfs_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/bootfs/bootfs_008_pos.ksh b/tests/zfs-tests/tests/functional/bootfs/bootfs_008_pos.ksh
index bcf74f2cdee2..270a3d706339 100755
--- a/tests/zfs-tests/tests/functional/bootfs/bootfs_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/bootfs/bootfs_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/bootfs/cleanup.ksh b/tests/zfs-tests/tests/functional/bootfs/cleanup.ksh
index 71d8ced18206..eb542c0092fc 100755
--- a/tests/zfs-tests/tests/functional/bootfs/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/bootfs/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/bootfs/setup.ksh b/tests/zfs-tests/tests/functional/bootfs/setup.ksh
index 273f239137b0..2f89df767e4d 100755
--- a/tests/zfs-tests/tests/functional/bootfs/setup.ksh
+++ b/tests/zfs-tests/tests/functional/bootfs/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cache/cache.cfg b/tests/zfs-tests/tests/functional/cache/cache.cfg
index 07e482d7df96..84dd78438d61 100644
--- a/tests/zfs-tests/tests/functional/cache/cache.cfg
+++ b/tests/zfs-tests/tests/functional/cache/cache.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cache/cache.kshlib b/tests/zfs-tests/tests/functional/cache/cache.kshlib
index 9948c6280185..63cc0b28ecf1 100644
--- a/tests/zfs-tests/tests/functional/cache/cache.kshlib
+++ b/tests/zfs-tests/tests/functional/cache/cache.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cache/cache_001_pos.ksh b/tests/zfs-tests/tests/functional/cache/cache_001_pos.ksh
index 955c9f12019f..c77668cf7deb 100755
--- a/tests/zfs-tests/tests/functional/cache/cache_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cache/cache_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cache/cache_002_pos.ksh b/tests/zfs-tests/tests/functional/cache/cache_002_pos.ksh
index 888645c353e8..5f1dc75c9919 100755
--- a/tests/zfs-tests/tests/functional/cache/cache_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cache/cache_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cache/cache_003_pos.ksh b/tests/zfs-tests/tests/functional/cache/cache_003_pos.ksh
index 566c5c6ac675..f2a2777dc6ce 100755
--- a/tests/zfs-tests/tests/functional/cache/cache_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cache/cache_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cache/cache_004_neg.ksh b/tests/zfs-tests/tests/functional/cache/cache_004_neg.ksh
index 38fee608bbc8..fe74cbaf1dae 100755
--- a/tests/zfs-tests/tests/functional/cache/cache_004_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cache/cache_004_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cache/cache_005_neg.ksh b/tests/zfs-tests/tests/functional/cache/cache_005_neg.ksh
index 35e15abe2602..59afbb0186b6 100755
--- a/tests/zfs-tests/tests/functional/cache/cache_005_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cache/cache_005_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cache/cache_006_pos.ksh b/tests/zfs-tests/tests/functional/cache/cache_006_pos.ksh
index 46bd5fc8b3ef..2f00b43f3424 100755
--- a/tests/zfs-tests/tests/functional/cache/cache_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cache/cache_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cache/cache_007_neg.ksh b/tests/zfs-tests/tests/functional/cache/cache_007_neg.ksh
index e2cdc0a28d38..721dd2e04837 100755
--- a/tests/zfs-tests/tests/functional/cache/cache_007_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cache/cache_007_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cache/cache_008_neg.ksh b/tests/zfs-tests/tests/functional/cache/cache_008_neg.ksh
index 93866dd3097f..d0c3f621b756 100755
--- a/tests/zfs-tests/tests/functional/cache/cache_008_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cache/cache_008_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cache/cache_009_pos.ksh b/tests/zfs-tests/tests/functional/cache/cache_009_pos.ksh
index 7a0586648f84..1d83e144266e 100755
--- a/tests/zfs-tests/tests/functional/cache/cache_009_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cache/cache_009_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cache/cache_010_pos.ksh b/tests/zfs-tests/tests/functional/cache/cache_010_pos.ksh
index 1d9fc5a8922b..b912eeec8769 100755
--- a/tests/zfs-tests/tests/functional/cache/cache_010_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cache/cache_010_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cache/cache_011_pos.ksh b/tests/zfs-tests/tests/functional/cache/cache_011_pos.ksh
index caa7e6e900b7..0e48ac5e2a9e 100755
--- a/tests/zfs-tests/tests/functional/cache/cache_011_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cache/cache_011_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cache/cache_012_pos.ksh b/tests/zfs-tests/tests/functional/cache/cache_012_pos.ksh
index be250158bf7e..945db71bf113 100755
--- a/tests/zfs-tests/tests/functional/cache/cache_012_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cache/cache_012_pos.ksh
@@ -31,15 +31,13 @@
# 2. Set l2arc_write_max to a value larger than the cache device.
# 3. Create a file larger than the cache device and random read
# for 10 sec.
-# 4. Verify that l2arc_write_max is set back to the default.
-# 5. Set l2arc_write_max to a value less than the cache device size but
-# larger than the default (64MB).
-# 6. Record the l2_size.
-# 7. Random read for 1 sec.
-# 8. Record the l2_size again.
-# 9. If (6) <= (8) then we have not looped around yet.
-# 10. If (6) > (8) then we looped around. Break out of the loop and test.
-# 11. Destroy pool.
+# 4. Set l2arc_write_max to a value less than the cache device size but
+# larger than the default (256MB).
+# 5. Record the l2_size.
+# 6. Random read for 1 sec.
+# 7. Record the l2_size again.
+# 8. If (5) <= (7) then we have not looped around yet.
+# 9. Destroy pool.
#
verify_runnable "global"
@@ -87,14 +85,13 @@ log_must truncate -s $VDEV_SZ $VDEV
log_must zpool create -f $TESTPOOL $VDEV cache $VCACHE
+# Actually, this test relies on atime writes to force the L2 ARC discards
+log_must zfs set relatime=off $TESTPOOL
+
log_must fio $FIO_SCRIPTS/mkfiles.fio
log_must fio $FIO_SCRIPTS/random_reads.fio
-typeset write_max2=$(get_tunable L2ARC_WRITE_MAX)
-
-log_must test $write_max2 -eq $write_max
-
-log_must set_tunable32 L2ARC_WRITE_MAX $(( 64 * 1024 * 1024 ))
+log_must set_tunable32 L2ARC_WRITE_MAX $(( 256 * 1024 * 1024 ))
export RUNTIME=1
typeset do_once=true
@@ -105,8 +102,6 @@ while $do_once || [[ $l2_size1 -le $l2_size2 ]]; do
do_once=false
done
-log_must test $l2_size1 -gt $l2_size2
-
log_must zpool destroy $TESTPOOL
log_pass "Looping around a cache device succeeds."
diff --git a/tests/zfs-tests/tests/functional/cache/cleanup.ksh b/tests/zfs-tests/tests/functional/cache/cleanup.ksh
index 258f92d19e0e..23d9e2d45286 100755
--- a/tests/zfs-tests/tests/functional/cache/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cache/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cache/setup.ksh b/tests/zfs-tests/tests/functional/cache/setup.ksh
index 0493637fcca8..84d11a4d70e6 100755
--- a/tests/zfs-tests/tests/functional/cache/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cache/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cachefile/cachefile.cfg b/tests/zfs-tests/tests/functional/cachefile/cachefile.cfg
index bd48cfdf2f87..47b0853184e0 100644
--- a/tests/zfs-tests/tests/functional/cachefile/cachefile.cfg
+++ b/tests/zfs-tests/tests/functional/cachefile/cachefile.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cachefile/cachefile.kshlib b/tests/zfs-tests/tests/functional/cachefile/cachefile.kshlib
index 7723e3083f1d..463355371c75 100644
--- a/tests/zfs-tests/tests/functional/cachefile/cachefile.kshlib
+++ b/tests/zfs-tests/tests/functional/cachefile/cachefile.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cachefile/cachefile_001_pos.ksh b/tests/zfs-tests/tests/functional/cachefile/cachefile_001_pos.ksh
index f164a1fad32f..256c2d38878b 100755
--- a/tests/zfs-tests/tests/functional/cachefile/cachefile_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cachefile/cachefile_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cachefile/cachefile_002_pos.ksh b/tests/zfs-tests/tests/functional/cachefile/cachefile_002_pos.ksh
index 9268f9786355..71039c11b2be 100755
--- a/tests/zfs-tests/tests/functional/cachefile/cachefile_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cachefile/cachefile_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cachefile/cachefile_003_pos.ksh b/tests/zfs-tests/tests/functional/cachefile/cachefile_003_pos.ksh
index a5f427cb4135..4a6d28f69333 100755
--- a/tests/zfs-tests/tests/functional/cachefile/cachefile_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cachefile/cachefile_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cachefile/cachefile_004_pos.ksh b/tests/zfs-tests/tests/functional/cachefile/cachefile_004_pos.ksh
index 841b141e16fc..59a3b7dcf995 100755
--- a/tests/zfs-tests/tests/functional/cachefile/cachefile_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cachefile/cachefile_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cachefile/cleanup.ksh b/tests/zfs-tests/tests/functional/cachefile/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cachefile/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cachefile/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cachefile/setup.ksh b/tests/zfs-tests/tests/functional/cachefile/setup.ksh
index 47c7893bfdd6..de6c2be66b7b 100755
--- a/tests/zfs-tests/tests/functional/cachefile/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cachefile/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/channel_program/synctask_core/tst.snapshot_rename.ksh b/tests/zfs-tests/tests/functional/channel_program/synctask_core/tst.snapshot_rename.ksh
new file mode 100755
index 000000000000..0561e4b7c635
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/channel_program/synctask_core/tst.snapshot_rename.ksh
@@ -0,0 +1,41 @@
+#!/bin/ksh -p
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2022 by Andriy Gapon. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/channel_program/channel_common.kshlib
+
+#
+# DESCRIPTION: Make sure basic snapshot functionality works in channel programs
+#
+
+verify_runnable "global"
+
+fs=$TESTPOOL/$TESTFS/testchild
+snapname1=testsnap1
+snapname2=testsnap2
+
+function cleanup
+{
+ destroy_dataset $fs "-R"
+}
+
+log_onexit cleanup
+
+log_must zfs create $fs
+
+log_must_program_sync $TESTPOOL \
+ $ZCP_ROOT/synctask_core/tst.snapshot_rename.zcp $fs $snapname1 $snapname2
+
+log_pass "Snapshot renaming works"
diff --git a/tests/zfs-tests/tests/functional/channel_program/synctask_core/tst.snapshot_rename.zcp b/tests/zfs-tests/tests/functional/channel_program/synctask_core/tst.snapshot_rename.zcp
new file mode 100644
index 000000000000..ef893d1551d9
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/channel_program/synctask_core/tst.snapshot_rename.zcp
@@ -0,0 +1,27 @@
+--
+-- This file and its contents are supplied under the terms of the
+-- Common Development and Distribution License ("CDDL"), version 1.0.
+-- You may only use this file in accordance with the terms of version
+-- 1.0 of the CDDL.
+--
+-- A full copy of the text of the CDDL should have accompanied this
+-- source. A copy of the CDDL is also available via the Internet at
+-- http://www.illumos.org/license/CDDL.
+--
+
+--
+-- Copyright (c) 2022 by Andriy Gapon. All rights reserved.
+--
+
+-- This program should be invoked as "zfs program <pool> <prog> <fs> <snap>"
+
+args = ...
+argv = args["argv"]
+assert(zfs.sync.snapshot(argv[1] .. "@" .. argv[2]) == 0)
+assert(zfs.sync.rename_snapshot(argv[1], argv[2], argv[3]) == 0)
+snaps = {}
+for s in zfs.list.snapshots(argv[1]) do
+ table.insert(snaps, s)
+end
+assert(#snaps == 1)
+assert(snaps[1] == (argv[1] .. "@" .. argv[3]))
diff --git a/tests/zfs-tests/tests/functional/chattr/chattr_001_pos.ksh b/tests/zfs-tests/tests/functional/chattr/chattr_001_pos.ksh
index cb8c2ead593a..c263c0f4fadf 100755
--- a/tests/zfs-tests/tests/functional/chattr/chattr_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/chattr/chattr_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/chattr/chattr_002_neg.ksh b/tests/zfs-tests/tests/functional/chattr/chattr_002_neg.ksh
index cad1b0a38a4d..758de3fd277d 100755
--- a/tests/zfs-tests/tests/functional/chattr/chattr_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/chattr/chattr_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/chattr/cleanup.ksh b/tests/zfs-tests/tests/functional/chattr/cleanup.ksh
index 59875d609ad9..59a93a652d05 100755
--- a/tests/zfs-tests/tests/functional/chattr/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/chattr/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/chattr/setup.ksh b/tests/zfs-tests/tests/functional/chattr/setup.ksh
index 85c9b6ea6351..d9fc7be4e4fe 100755
--- a/tests/zfs-tests/tests/functional/chattr/setup.ksh
+++ b/tests/zfs-tests/tests/functional/chattr/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/checksum/cleanup.ksh b/tests/zfs-tests/tests/functional/checksum/cleanup.ksh
index 19b0f35cf768..7d2380db5c6d 100755
--- a/tests/zfs-tests/tests/functional/checksum/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/checksum/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/checksum/default.cfg b/tests/zfs-tests/tests/functional/checksum/default.cfg
index a7e143e75ea3..ca13be4e4d5d 100644
--- a/tests/zfs-tests/tests/functional/checksum/default.cfg
+++ b/tests/zfs-tests/tests/functional/checksum/default.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/checksum/filetest_001_pos.ksh b/tests/zfs-tests/tests/functional/checksum/filetest_001_pos.ksh
index c9cefcd43dae..7257da488383 100755
--- a/tests/zfs-tests/tests/functional/checksum/filetest_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/checksum/filetest_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/checksum/filetest_002_pos.ksh b/tests/zfs-tests/tests/functional/checksum/filetest_002_pos.ksh
index 921a4b392a45..23e7aa577484 100755
--- a/tests/zfs-tests/tests/functional/checksum/filetest_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/checksum/filetest_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -76,7 +76,7 @@ while [[ $j -lt ${#CHECKSUM_TYPES[*]} ]]; do
log_must zpool export $TESTPOOL
log_must zpool import $TESTPOOL
- log_mustnot eval "cat $TESTDIR/test_$type >/dev/null"
+ log_mustnot eval "dd if=$TESTDIR/test_$type of=/dev/null bs=$WRITESZ count=$NWRITES"
cksum=$(zpool status -P -v $TESTPOOL | grep "$firstvdev" | \
awk '{print $5}')
diff --git a/tests/zfs-tests/tests/functional/checksum/setup.ksh b/tests/zfs-tests/tests/functional/checksum/setup.ksh
index 204069de7383..be72cacc0fc2 100755
--- a/tests/zfs-tests/tests/functional/checksum/setup.ksh
+++ b/tests/zfs-tests/tests/functional/checksum/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_001_pos.ksh b/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_001_pos.ksh
index 8dd337a6efb9..f644b8f81325 100755
--- a/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_002_pos.ksh b/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_002_pos.ksh
index a156368d0c89..6246b0c09f07 100755
--- a/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_003_pos.ksh b/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_003_pos.ksh
index 144dcf1c0b72..3a64001eb5ac 100755
--- a/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_004_pos.ksh b/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_004_pos.ksh
index ce1aac56d85a..cfbd81941023 100755
--- a/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_common.kshlib b/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_common.kshlib
index cf1d77d9ccb5..1a75816f2c03 100644
--- a/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_common.kshlib
+++ b/tests/zfs-tests/tests/functional/clean_mirror/clean_mirror_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/clean_mirror/cleanup.ksh b/tests/zfs-tests/tests/functional/clean_mirror/cleanup.ksh
index d5614bef0420..3b54cff0e4c6 100755
--- a/tests/zfs-tests/tests/functional/clean_mirror/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/clean_mirror/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/clean_mirror/default.cfg b/tests/zfs-tests/tests/functional/clean_mirror/default.cfg
index dfe7f1d0ba33..83ec31f29930 100644
--- a/tests/zfs-tests/tests/functional/clean_mirror/default.cfg
+++ b/tests/zfs-tests/tests/functional/clean_mirror/default.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/clean_mirror/setup.ksh b/tests/zfs-tests/tests/functional/clean_mirror/setup.ksh
index 0024f284d8f5..8d14f2d96e2d 100755
--- a/tests/zfs-tests/tests/functional/clean_mirror/setup.ksh
+++ b/tests/zfs-tests/tests/functional/clean_mirror/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/cli_common.kshlib b/tests/zfs-tests/tests/functional/cli_root/cli_common.kshlib
index 1e4917affff7..bdb2d86f0380 100644
--- a/tests/zfs-tests/tests/functional/cli_root/cli_common.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/cli_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_args_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_args_neg.ksh
index cb88def7cc3e..688d488ceb62 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_args_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_args_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -57,8 +57,8 @@ set -A args "create" "add" "destroy" "import fakepool" \
"add raidz1 fakepool" "add raidz2 fakepool" \
"setvprop" "blah blah" "-%" "--?" "-*" "-=" \
"-a" "-f" "-g" "-j" "-n" "-o" "-p" "-p /tmp" \
- "-t" "-w" "-z" "-E" "-H" "-I" "-J" "-K" \
- "-Q" "-R" "-T" "-W"
+ "-t" "-w" "-z" "-E" "-H" "-I" "-J" \
+ "-Q" "-R" "-W"
log_assert "Execute zdb using invalid parameters."
diff --git a/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_args_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_args_pos.ksh
index 75654c29b1ef..37f45eae55f1 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_args_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_args_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_backup.ksh b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_backup.ksh
new file mode 100755
index 000000000000..d98ab86ab667
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_backup.ksh
@@ -0,0 +1,55 @@
+#!/bin/ksh
+
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2023, Klara Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+write_count=8
+blksize=131072
+
+tmpfile=$TEST_BASE_DIR/tmpfile
+
+function cleanup
+{
+ datasetexists $TESTPOOL && destroy_pool $TESTPOOL
+ rm $tmpfile.1 $tmpfile.2
+}
+
+log_onexit cleanup
+
+log_assert "Verify that zfs send and zdb -B produce the same stream"
+
+verify_runnable "global"
+verify_disk_count "$DISKS" 2
+
+default_mirror_setup_noexit $DISKS
+file_write -o create -w -f $TESTDIR/file -b $blksize -c $write_count
+
+snap=$TESTPOOL/$TESTFS@snap
+log_must zfs snapshot $snap
+typeset -i objsetid=$(zfs get -Ho value objsetid $snap)
+
+sync_pool $TESTPOOL
+
+log_must eval "zfs send -ecL $snap > $tmpfile.1"
+log_must eval "zdb -B $TESTPOOL/$objsetid ecL > $tmpfile.2"
+
+typeset sum1=$(cat $tmpfile.1 | md5sum)
+typeset sum2=$(cat $tmpfile.2 | md5sum)
+
+log_must test "$sum1" = "$sum2"
+
+log_pass "zfs send and zdb -B produce the same stream"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_block_size_histogram.ksh b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_block_size_histogram.ksh
index 0a4d24fa695a..cfa26f54b11f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_block_size_histogram.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_block_size_histogram.ksh
@@ -204,11 +204,11 @@ function histo_check_test_pool
# 4096 blocksize count for asize. For verification we stick
# to just lsize counts.
#
- # The max_variance is hard-coded here at 12% to leave us some
- # margin. Testing has shown this normally to be in the range
- # of 2%-8%, but it may be as large as 11%.
+ # Variances are expected since this test does not account for
+ # metadata. The hardcoded limit here is empirical and should
+ # not be construed as deterministic.
###################
- let max_variance=12
+ let max_variance=15
let fail_value=0
let error_count=0
log_note "Comparisons for ${pool}"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_encrypted.ksh b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_encrypted.ksh
new file mode 100755
index 000000000000..0218c2ea1033
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_encrypted.ksh
@@ -0,0 +1,69 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2017, Datto, Inc. All rights reserved.
+# Copyright (c) 2023, Rob Norris <robn@despairlabs.com>
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/cli_root/zfs_load-key/zfs_load-key_common.kshlib
+
+#
+# DESCRIPTION:
+# 'zdb -K ...' should enable reading from an encrypt dataset
+#
+# STRATEGY:
+# 1. Create an encrypted dataset
+# 2. Write some data to a file
+# 3. Run zdb -dddd on the file, confirm it can't be read
+# 4. Run zdb -K ... -ddddd on the file, confirm it can be read
+#
+
+verify_runnable "both"
+
+dataset="$TESTPOOL/$TESTFS2"
+file="$TESTDIR2/somefile"
+
+function cleanup
+{
+ datasetexists $dataset && destroy_dataset $dataset -f
+ default_cleanup_noexit
+}
+
+log_onexit cleanup
+
+log_must default_setup_noexit $DISKS
+
+log_assert "'zdb -K' should enable reading from an encrypted dataset"
+
+log_must eval "echo $PASSPHRASE | zfs create -o mountpoint=$TESTDIR2" \
+ "-o encryption=on -o keyformat=passphrase $dataset"
+
+echo 'my great encrypted text' > $file
+
+typeset -i obj=$(ls -i $file | cut -d' ' -f1)
+typeset -i size=$(wc -c < $file)
+
+log_note "test file $file is objid $obj, size $size"
+
+sync_pool $TESTPOOL true
+
+log_must eval "zdb -dddd $dataset $obj | grep -q 'object encrypted'"
+
+log_must eval "zdb -K $PASSPHRASE -dddd $dataset $obj | grep -q 'size\s$size$'"
+
+log_pass "'zdb -K' enables reading from an encrypted dataset"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs/setup.ksh
index 6a9af3bc28c3..4c719075a741 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs/zfs_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs/zfs_001_neg.ksh
index c6e45c80dd30..24ffd4751688 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs/zfs_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs/zfs_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs/zfs_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs/zfs_002_pos.ksh
index 044ccb185c48..de434cc47b31 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs/zfs_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs/zfs_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs/zfs_003_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs/zfs_003_neg.ksh
index 6c85e0c13ab4..2f592642c3ba 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs/zfs_003_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs/zfs_003_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_bookmark/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_bookmark/cleanup.ksh
index f84ac43e67c9..eed1c9ccf54f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_bookmark/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_bookmark/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_bookmark/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_bookmark/setup.ksh
index 40953415c6b9..8815d150bbdb 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_bookmark/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_bookmark/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_bookmark/zfs_bookmark_cliargs.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_bookmark/zfs_bookmark_cliargs.ksh
index ec21c81aba1b..b6cb0c60034f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_bookmark/zfs_bookmark_cliargs.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_bookmark/zfs_bookmark_cliargs.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_change-key/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_change-key/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_change-key/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_change-key/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_change-key/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_change-key/setup.ksh
index 6a9af3bc28c3..4c719075a741 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_change-key/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_change-key/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/cleanup.ksh
index d247991fbbdb..d9f935900f90 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/setup.ksh
index 985554f8cd2e..0a74ee3a879d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_001_neg.ksh
index e6ffa26c0208..e8d5d73dd841 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_002_pos.ksh
index 96eb3ea48d64..755079ed57df 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_003_pos.ksh
index ac3bc891c86f..c113fb27aaf9 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_004_pos.ksh
index 1c4c579f26bd..993b279411d0 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_005_pos.ksh
index 6f17b176734a..e965ec1251b3 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_006_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_006_pos.ksh
index f2f7a5bcd077..30fafca90054 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_007_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_007_pos.ksh
index 5f42006de289..a615392d70dc 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_008_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_008_neg.ksh
index 2f2b0ca18d64..96f0c16a45f4 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_008_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_008_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_009_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_009_neg.ksh
index 6cdf5717fa92..e328d5b64158 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_009_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_009_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/cleanup.ksh
index f5e862593e1e..8c8d37276d1d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/setup.ksh
index d4cf2095012b..f76b49af706f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies.cfg b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies.cfg
index eb85e65c790e..ec3244c7a804 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies.kshlib b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies.kshlib
index 1273ed59df30..5617bd01ba42 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_001_pos.ksh
index 672692b59e42..1f8d770fc99f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_002_pos.ksh
index aa895956c936..5b10189e8f57 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_003_pos.ksh
index 94e72bce4e67..cfb3d3308db8 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_004_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_004_neg.ksh
index dc007b11160d..ab250d4f2782 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_004_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_004_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_005_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_005_neg.ksh
index 6a8b81ac5b87..d15629fb2bd0 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_005_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_005_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_006_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_006_pos.ksh
index 6dc9306b33ef..28017b59a00f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/properties.kshlib b/tests/zfs-tests/tests/functional/cli_root/zfs_create/properties.kshlib
index 4130ba446334..16d19bdbd8aa 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/properties.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/properties.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/setup.ksh
index 6a9af3bc28c3..4c719075a741 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create.cfg b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create.cfg
index 785d5a001603..807285ea6c73 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_001_pos.ksh
index f74b2c9816f3..7b34ec33f3bf 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_002_pos.ksh
index 84f758904bd9..74b39cdaf983 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_003_pos.ksh
index 120de10281db..798354db954b 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_004_pos.ksh
index bd01623b3627..cc429419e67a 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_005_pos.ksh
index 1321854d21cd..22f154400a1b 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_006_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_006_pos.ksh
index 551ae78cd239..733402fed39a 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_007_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_007_pos.ksh
index c49c77703409..bb6f9a21db13 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_008_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_008_neg.ksh
index d82f10f71f71..650d7dbcc3bd 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_008_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_008_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_009_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_009_neg.ksh
index 6722a659eb65..f23f0a969df8 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_009_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_009_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_010_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_010_neg.ksh
index d4784d6530e5..a872881b5494 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_010_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_010_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_011_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_011_pos.ksh
index c5012d4f34a8..2bbe6d84815f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_011_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_011_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_012_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_012_pos.ksh
index 2a140d954876..71706d4b0f65 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_012_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_012_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_013_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_013_pos.ksh
index d3855cb315c1..3fa5e246d8e4 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_013_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_013_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_014_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_014_pos.ksh
index 2482a68dc089..8010c6df4586 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_014_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_014_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_common.kshlib b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_common.kshlib
index bf8e145e5112..76a63a094807 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_common.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/cleanup.ksh
index e838ba8a5947..8f25922aa7ac 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/setup.ksh
index f4288f715b22..479ee930f27f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy.cfg b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy.cfg
index a62739b07ec8..5bb720bf1d6b 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_001_pos.ksh
index 11157e93c78d..1f977628295e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_002_pos.ksh
index 128921226a73..2eff646ea76a 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_003_pos.ksh
index 8b7e59b412b4..2c61bb7ecebb 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_004_pos.ksh
index d618f21e9eb5..fedc30d550a4 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh
index 1c5b2cf1c741..f91909c2bc56 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_006_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_006_neg.ksh
index 7dbcb242041d..2a9381cab5fa 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_006_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_006_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_007_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_007_neg.ksh
index 57eb736fd88b..cafb87a42368 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_007_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_007_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_008_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_008_pos.ksh
index f8b8f9005514..29e1e5e95cf6 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_009_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_009_pos.ksh
index 57e5761bc064..aa841151603c 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_009_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_009_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_010_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_010_pos.ksh
index 369029775f4b..91e6dfd96e1d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_010_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_010_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_common.kshlib b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_common.kshlib
index 51b3d2e513cc..bcc24efa6515 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_common.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_get/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_get/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_get/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_get/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_get/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_get/setup.ksh
index 9692385996d1..2a909eba4f87 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_get/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_get/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_001_pos.ksh
index b3286c31e6fa..935a85285e8e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_002_pos.ksh
index 6717787d06e6..65986f6bd1a2 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_003_pos.ksh
index e96899118a89..db80ccf1883f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_004_pos.ksh
index 20597c9a5feb..6101bae032c8 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_005_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_005_neg.ksh
index 13685ef6f4bc..d9be907909db 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_005_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_005_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_006_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_006_neg.ksh
index e19936ef88dc..feed960b17e4 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_006_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_006_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_007_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_007_neg.ksh
index 63dfb6a50b52..08a6bb7529b5 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_007_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_007_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_008_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_008_pos.ksh
index 9f3dd47cde7d..6be432036845 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_009_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_009_pos.ksh
index 1e80d4d2b7ef..5686b63b41cc 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_009_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_009_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_010_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_010_neg.ksh
index e1f53845fd9c..1b6e211e0681 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_010_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_010_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_common.kshlib b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_common.kshlib
index 9b4eecf37127..12f157dedf19 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_common.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_list_d.kshlib b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_list_d.kshlib
index d5388e6ef2ae..2084e0c18b10 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_list_d.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_list_d.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_ids_to_path/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_ids_to_path/cleanup.ksh
index b5ff02217237..3b16891a6b18 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_ids_to_path/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_ids_to_path/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_ids_to_path/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_ids_to_path/setup.ksh
index fd6f8f8bb078..f69103b7c373 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_ids_to_path/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_ids_to_path/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_ids_to_path/zfs_ids_to_path_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_ids_to_path/zfs_ids_to_path_001_pos.ksh
index 563b3e00dd89..ff05a75725ad 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_ids_to_path/zfs_ids_to_path_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_ids_to_path/zfs_ids_to_path_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/setup.ksh
index 9692385996d1..2a909eba4f87 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_001_neg.ksh
index aba317f54237..f1bd3d6e1fd3 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_002_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_002_neg.ksh
index 8e37e8dbcae0..0bb93a0789bf 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_003_pos.ksh
index 3f7e4ff972ed..d27fa84c5d14 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_inherit/zfs_inherit_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_jail/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_jail/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_jail/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_jail/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_jail/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_jail/setup.ksh
index 6a9af3bc28c3..4c719075a741 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_jail/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_jail/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_jail/zfs_jail_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_jail/zfs_jail_001_pos.ksh
index 2c0808110276..fa33bdb02ffa 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_jail/zfs_jail_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_jail/zfs_jail_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/cleanup.ksh
index d397bcf4e9f0..60a1450f4c06 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/setup.ksh
index 6cc5528ce5d7..43e4db5b09bf 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/zfs_load-key_common.kshlib b/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/zfs_load-key_common.kshlib
index 4a85999b4ab8..f174eeeeaae9 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/zfs_load-key_common.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/zfs_load-key_common.kshlib
@@ -123,7 +123,10 @@ if not httpd:
with open('$HTTPS_PORT_FILE', 'w') as portf:
print(port, file=portf)
-httpd.socket = ssl.wrap_socket(httpd.socket, server_side=True, keyfile='/$TESTPOOL/snakeoil.key', certfile='$SSL_CA_CERT_FILE', ssl_version=ssl.PROTOCOL_TLS)
+sslctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
+sslctx.check_hostname = False
+sslctx.load_cert_chain(certfile='$SSL_CA_CERT_FILE', keyfile='/$TESTPOOL/snakeoil.key')
+httpd.socket = httpd.socket = sslctx.wrap_socket(httpd.socket, server_side=True)
os.chdir('$STF_SUITE/tests/functional/cli_root/zfs_load-key')
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/setup.ksh
index 6a9af3bc28c3..4c719075a741 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount.cfg b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount.cfg
index c8e46895d2a6..739baf16086a 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -31,6 +31,7 @@
export mountcmd=mount
export mountforce="$mountcmd -f"
export mountall="$mountcmd -a"
+export mountrecursive="$mountcmd -R"
export unmountcmd=unmount
export unmountforce="$unmountcmd -f"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib
index 23cab2511a41..8d06a32e7f52 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_001_pos.ksh
index c46a35695492..68ec78478571 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_002_pos.ksh
index 8ee3e029fb4a..50161bc0a45d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_003_pos.ksh
index 59d8c235f8fe..1beb501f5b64 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_004_pos.ksh
index 4874c6d6530a..9dcd8af0bb35 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_005_pos.ksh
index b42b2496e4b9..b94d83f45119 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_006_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_006_pos.ksh
index 5edce35c721e..e9ab472795eb 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -94,7 +94,7 @@ while (( depth < MAXDEPTH )); do
done
log_must zfs set mountpoint=$mtpt $TESTPOOL/$TESTFS
-log_must zfs $mountcmd $TESTPOOL/$TESTFS
+log_must ismounted $TESTPOOL/$TESTFS
log_must zfs set overlay=off $TESTPOOL/$TESTFS
if ! is_illumos; then
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_007_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_007_pos.ksh
index a11f53d79ba0..84f478c938bd 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_008_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_008_pos.ksh
index 6a251330f62d..0437c61a2c40 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -71,7 +71,7 @@ log_must mkfile 1M $testfile $testfile1
log_must zfs unmount $fs1
log_must zfs set mountpoint=$mntpnt $fs1
-log_must zfs mount $fs1
+log_must ismounted $fs1
log_must zfs unmount $fs1
log_must zfs mount -O $fs1
@@ -85,7 +85,7 @@ log_must ls $mntpnt/$TESTFILE1 $mntpnt/$TESTFILE2
# Verify $TESTFILE2 was created in $fs1, rather than $fs
log_must zfs unmount $fs1
log_must zfs set mountpoint=$mntpnt1 $fs1
-log_must zfs mount $fs1
+log_must ismounted $fs1
log_must ls $testfile1 $mntpnt1/$TESTFILE2
# Verify $TESTFILE2 was not created in $fs, and $fs is accessible again.
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_009_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_009_neg.ksh
index 978a5a4f2eea..02b3477a4452 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_009_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_009_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_010_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_010_neg.ksh
index 53ebf1f26248..2c26157be835 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_010_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_010_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_011_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_011_neg.ksh
index 95e2bc39727a..0e0879823619 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_011_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_011_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_012_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_012_pos.ksh
index 5ff094d2c479..66958f2f0884 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_012_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_012_pos.ksh
@@ -25,13 +25,12 @@
# STRATEGY:
# 1. Unmount the dataset
# 2. Create a new empty directory
-# 3. Set the dataset's mountpoint
-# 4. Attempt to mount the dataset
-# 5. Verify the mount succeeds
-# 6. Unmount the dataset
-# 7. Create a file in the directory created in step 2
-# 8. Attempt to mount the dataset
-# 9. Verify the mount succeeds
+# 3. Set the dataset's mountpoint, this should mount the dataset
+# 4. Verify the mount succeeds
+# 5. Unmount the dataset
+# 6. Create a file in the directory created in step 2
+# 7. Attempt to mount the dataset
+# 8. Verify the mount succeeds
#
verify_runnable "both"
@@ -43,7 +42,7 @@ fs=$TESTPOOL/$TESTFS
log_must zfs umount $fs
log_must mkdir -p $TESTDIR
log_must zfs set mountpoint=$TESTDIR $fs
-log_must zfs mount $fs
+log_must ismounted $fs
log_must zfs umount $fs
log_must touch $TESTDIR/testfile.$$
log_must zfs mount $fs
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_all_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_all_001_pos.ksh
index 765e242796b8..5fd963c03997 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_all_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_all_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_recursive.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_recursive.ksh
new file mode 100755
index 000000000000..0e5cc5d6955e
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_recursive.ksh
@@ -0,0 +1,146 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2024, iXsystems Inc. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib
+
+#
+# DESCRIPTION:
+# Verify zfs mount -R <filesystems/s> functionality.
+#
+# STRATEGY:
+# 1. Create nested datasets
+# 2. Unmount all datasets
+# 3. Recusrively mount root datasets, this should mount all datasets
+# present in a pool
+# 4. Unmount all datasets
+# 5. Recusrsively mount child datasets with children. This should mount
+# child datasets, but not the root dataset or parent datasets
+# 6. Unmount all datasets
+# 7. Mount root dataset recursively again and confirm all child
+# datasets are mounted.
+#
+
+verify_runnable "both"
+
+function cleanup
+{
+ log_must datasetexists $TESTPOOL/$TESTFS1 && \
+ destroy_dataset $TESTPOOL/$TESTFS1 -R
+ log_must datasetexists $TESTPOOL/$TESTFS2 && \
+ destroy_dataset $TESTPOOL/$TESTFS2 -R
+ log_must datasetexists $TESTPOOL/$TESTFS3 && \
+ destroy_dataset $TESTPOOL/$TESTFS3 -R
+}
+
+function setup_all
+{
+ log_must datasetexists $TESTPOOL/$TESTFS || zfs create $TESTPOOL/$TESTFS
+ log_must zfs create $TESTPOOL/$TESTFS1
+ log_must zfs create $TESTPOOL/$TESTFS2
+ log_must zfs create $TESTPOOL/$TESTFS3
+ log_must zfs create $TESTPOOL/$TESTFS2/child1
+ log_must zfs create $TESTPOOL/$TESTFS2/child2
+ log_must zfs create $TESTPOOL/$TESTFS2/child3
+ log_must zfs create $TESTPOOL/$TESTFS2/child2/subchild
+ log_must zfs create $TESTPOOL/$TESTFS3/child
+}
+
+log_assert "Verify that 'zfs $mountrecursive' successfully, " \
+ "mounts the dataset along with all its children."
+
+log_onexit cleanup
+
+log_must setup_all
+
+log_must zfs $unmountall
+
+log_must zfs $mountrecursive $TESTPOOL
+
+log_must mounted $TESTPOOL
+log_must mounted $TESTPOOL/$TESTFS
+log_must mounted $TESTPOOL/$TESTFS1
+log_must mounted $TESTPOOL/$TESTFS2
+log_must mounted $TESTPOOL/$TESTFS3
+log_must mounted $TESTPOOL/$TESTFS2/child1
+log_must mounted $TESTPOOL/$TESTFS2/child2
+log_must mounted $TESTPOOL/$TESTFS2/child3
+log_must mounted $TESTPOOL/$TESTFS2/child2/subchild
+log_must mounted $TESTPOOL/$TESTFS3/child
+
+log_must zfs $unmountall
+
+log_mustnot mounted $TESTPOOL
+log_mustnot mounted $TESTPOOL/$TESTFS
+log_mustnot mounted $TESTPOOL/$TESTFS1
+log_mustnot mounted $TESTPOOL/$TESTFS2
+log_mustnot mounted $TESTPOOL/$TESTFS3
+log_mustnot mounted $TESTPOOL/$TESTFS2/child1
+log_mustnot mounted $TESTPOOL/$TESTFS2/child2
+log_mustnot mounted $TESTPOOL/$TESTFS2/child3
+log_mustnot mounted $TESTPOOL/$TESTFS2/child2/subchild
+log_mustnot mounted $TESTPOOL/$TESTFS3/child
+
+log_must zfs $mountrecursive $TESTPOOL/$TESTFS2 $TESTPOOL/$TESTFS3
+
+log_mustnot mounted $TESTPOOL
+log_mustnot mounted $TESTPOOL/$TESTFS
+log_mustnot mounted $TESTPOOL/$TESTFS1
+log_must mounted $TESTPOOL/$TESTFS2
+log_must mounted $TESTPOOL/$TESTFS3
+log_must mounted $TESTPOOL/$TESTFS2/child1
+log_must mounted $TESTPOOL/$TESTFS2/child2
+log_must mounted $TESTPOOL/$TESTFS2/child3
+log_must mounted $TESTPOOL/$TESTFS2/child2/subchild
+log_must mounted $TESTPOOL/$TESTFS3/child
+
+log_must zfs $unmountall
+
+log_mustnot mounted $TESTPOOL
+log_mustnot mounted $TESTPOOL/$TESTFS
+log_mustnot mounted $TESTPOOL/$TESTFS1
+log_mustnot mounted $TESTPOOL/$TESTFS2
+log_mustnot mounted $TESTPOOL/$TESTFS3
+log_mustnot mounted $TESTPOOL/$TESTFS2/child1
+log_mustnot mounted $TESTPOOL/$TESTFS2/child2
+log_mustnot mounted $TESTPOOL/$TESTFS2/child3
+log_mustnot mounted $TESTPOOL/$TESTFS2/child2/subchild
+log_mustnot mounted $TESTPOOL/$TESTFS3/child
+
+log_must zfs $mountrecursive $TESTPOOL/$TESTFS2/child2
+
+log_must mounted $TESTPOOL/$TESTFS2/child2
+log_must mounted $TESTPOOL/$TESTFS2/child2/subchild
+log_mustnot mounted $TESTPOOL
+log_mustnot mounted $TESTPOOL/$TESTFS
+log_mustnot mounted $TESTPOOL/$TESTFS1
+log_mustnot mounted $TESTPOOL/$TESTFS2
+log_mustnot mounted $TESTPOOL/$TESTFS3
+log_mustnot mounted $TESTPOOL/$TESTFS2/child1
+log_mustnot mounted $TESTPOOL/$TESTFS2/child3
+log_mustnot mounted $TESTPOOL/$TESTFS3/child
+
+log_pass "'zfs $mountrecursive' behaves as expected."
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_remount.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_remount.ksh
index 259f0e99b65c..ed35b6e831a6 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_remount.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_remount.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_program/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_program/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_program/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_program/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_program/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_program/setup.ksh
index 6a9af3bc28c3..4c719075a741 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_program/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_program/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_program/zfs_program_json.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_program/zfs_program_json.ksh
index b0265c5ee4a1..2241b77bf806 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_program/zfs_program_json.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_program/zfs_program_json.ksh
@@ -117,7 +117,9 @@ usage:
For the property list, run: zfs set|get
-For the delegated permission list, run: zfs allow|unallow")
+For the delegated permission list, run: zfs allow|unallow
+
+For further help on a command or topic, run: zfs help [<topic>]")
cnt=0
for cmd in ${neg_cmds[@]}; do
log_mustnot zfs program $cmd $TESTPOOL $TESTZCP $TESTDS 2>&1
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/setup.ksh
index 3e2e2ce319a6..13a5febb25c1 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote.cfg b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote.cfg
index 6407328efd91..02d7c097a519 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_001_pos.ksh
index dc3ffd65ed38..173c46d76449 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_002_pos.ksh
index 1a774da2c15c..fa7c82ee87ab 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_003_pos.ksh
index 7dedaf91bed6..8d1ba8238a10 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_004_pos.ksh
index b8a5ab9c1707..653b21139f54 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_005_pos.ksh
index 289ddc6713bc..aa2deb9c3efd 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_006_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_006_neg.ksh
index 7f08f28a9379..1aca734f46a1 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_006_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_006_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_007_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_007_neg.ksh
index 95db7d9e6b4e..26740dcc4f6b 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_007_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_007_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_008_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_008_pos.ksh
index c37c9a6269e7..33dc403aefcc 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_property/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_property/cleanup.ksh
index e4998138f701..7bb00caed5a3 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_property/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_property/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_property/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_property/setup.ksh
index 746a05015f8c..75bee687f5b7 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_property/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_property/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_property/zfs_written_property_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_property/zfs_written_property_001_pos.ksh
index f53a4ac71b68..fd3194fe9895 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_property/zfs_written_property_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_property/zfs_written_property_001_pos.ksh
@@ -163,6 +163,7 @@ before_clone=$(get_prop written $TESTPOOL/$TESTFS1)
log_must zfs clone $TESTPOOL/$TESTFS1@snap1 $TESTPOOL/$TESTFS1/snap1.clone
log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS1/snap1.clone/testfile bs=1M \
count=40
+sync_pool
after_clone=$(get_prop written $TESTPOOL/$TESTFS1)
within_percent $before_clone $after_clone 99.5 || \
log_fail "unexpected written for clone $before_clone $after_clone"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/cleanup.ksh
index cec69d4709f4..e3a213302614 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/setup.ksh
index 878189bafa2f..5fd3ff953096 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_-wR-encrypted-mix.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_-wR-encrypted-mix.ksh
index 6e27130e0248..dc1653b698ee 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_-wR-encrypted-mix.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_-wR-encrypted-mix.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_001_pos.ksh
index 2b4a086965e8..d8051c919f4d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_002_pos.ksh
index ba3fc49bd84c..9fb25a3e42b4 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_003_pos.ksh
index 48cebc87f039..9cac9f54df16 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_004_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_004_neg.ksh
index 2860cab2b679..9f4b32ade733 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_004_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_004_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_005_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_005_neg.ksh
index 6a708a45e177..1841e07bdb00 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_005_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_005_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_006_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_006_pos.ksh
index 06a0804515a7..1406882645d1 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_007_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_007_neg.ksh
index ec2437db929f..e88b2853c85c 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_007_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_007_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_008_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_008_pos.ksh
index f948dfd6690b..be112d0cd394 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_009_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_009_neg.ksh
index 6cda13690cbd..c7cfe3cba71c 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_009_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_009_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_010_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_010_pos.ksh
index c91172ee048e..3e24d3e2e3b7 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_010_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_010_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_compressed_corrective.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_compressed_corrective.ksh
new file mode 100755
index 000000000000..7f8eb0b138ee
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_compressed_corrective.ksh
@@ -0,0 +1,193 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2019 Datto, Inc. All rights reserved.
+# Copyright (c) 2022 Axcient.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+#
+# DESCRIPTION:
+# OpenZFS should be able to heal data using corrective recv when the send file
+# was generated with the --compressed flag
+#
+# STRATEGY:
+# 0. Create a file, checksum the file to be corrupted then compare it's checksum
+# with the one obtained after healing under different testing scenarios:
+# 1. Test healing (aka corrective) recv from a full send file
+# 2. Test healing recv (aka heal recv) from an incremental send file
+# 3. Test healing recv when compression on-disk is off but source was compressed
+# 4. Test heal recv when compression on-disk is on but source was uncompressed
+# 5. Test heal recv when compression doesn't match between send file and on-disk
+# 6. Test healing recv of an encrypted dataset using an unencrypted send file
+# 7. Test healing recv (on an encrypted dataset) using a raw send file
+# 8. Test healing when specifying destination filesystem only (no snapshot)
+# 9. Test incremental recv aftear healing recv
+#
+
+verify_runnable "both"
+
+DISK=${DISKS%% *}
+
+backup=$TEST_BASE_DIR/backup
+raw_backup=$TEST_BASE_DIR/raw_backup
+ibackup=$TEST_BASE_DIR/ibackup
+unc_backup=$TEST_BASE_DIR/unc_backup
+
+function cleanup
+{
+ log_must rm -f $backup $raw_backup $ibackup $unc_backup
+
+ poolexists $TESTPOOL && destroy_pool $TESTPOOL
+ log_must zpool create -f $TESTPOOL $DISK
+}
+
+function test_corrective_recv
+{
+ log_must zpool scrub -w $TESTPOOL
+ log_must zpool status -v $TESTPOOL
+ log_must eval "zpool status -v $TESTPOOL | \
+ grep \"Permanent errors have been detected\""
+
+ # make sure we will read the corruption from disk by flushing the ARC
+ log_must zinject -a
+
+ log_must eval "zfs recv -c $1 < $2"
+
+ log_must zpool scrub -w $TESTPOOL
+ log_must zpool status -v $TESTPOOL
+ log_mustnot eval "zpool status -v $TESTPOOL | \
+ grep \"Permanent errors have been detected\""
+ typeset cksum=$(md5digest $file)
+ [[ "$cksum" == "$checksum" ]] || \
+ log_fail "Checksums differ ($cksum != $checksum)"
+}
+
+log_onexit cleanup
+
+log_assert "ZFS corrective receive should be able to heal data corruption"
+
+typeset passphrase="password"
+typeset file="/$TESTPOOL/$TESTFS1/$TESTFILE0"
+
+log_must eval "poolexists $TESTPOOL && destroy_pool $TESTPOOL"
+log_must zpool create -f -o feature@head_errlog=disabled $TESTPOOL $DISK
+
+log_must eval "echo $passphrase > /$TESTPOOL/pwd"
+
+log_must zfs create -o primarycache=none \
+ -o atime=off -o compression=lz4 $TESTPOOL/$TESTFS1
+
+log_must dd if=/dev/urandom of=$file bs=1024 count=1024 oflag=sync
+log_must eval "echo 'aaaaaaaa' >> "$file
+typeset checksum=$(md5digest $file)
+
+log_must zfs snapshot $TESTPOOL/$TESTFS1@snap1
+
+# create full send file
+log_must eval "zfs send --compressed $TESTPOOL/$TESTFS1@snap1 > $backup"
+
+log_must dd if=/dev/urandom of=$file"1" bs=1024 count=1024 oflag=sync
+log_must eval "echo 'bbbbbbbb' >> "$file"1"
+log_must zfs snapshot $TESTPOOL/$TESTFS1@snap2
+# create incremental send file
+log_must eval "zfs send -c -i $TESTPOOL/$TESTFS1@snap1 \
+ $TESTPOOL/$TESTFS1@snap2 > $ibackup"
+
+corrupt_blocks_at_level $file 0
+# test healing recv from a full send file
+test_corrective_recv $TESTPOOL/$TESTFS1@snap1 $backup
+
+corrupt_blocks_at_level $file"1" 0
+# test healing recv from an incremental send file
+test_corrective_recv $TESTPOOL/$TESTFS1@snap2 $ibackup
+
+# create new uncompressed dataset using our send file
+log_must eval "zfs recv -o compression=off -o primarycache=none \
+ $TESTPOOL/$TESTFS2 < $backup"
+typeset compr=$(get_prop compression $TESTPOOL/$TESTFS2)
+[[ "$compr" == "off" ]] || \
+ log_fail "Unexpected compression $compr in recved dataset"
+corrupt_blocks_at_level "/$TESTPOOL/$TESTFS2/$TESTFILE0" 0
+# test healing recv when compression on-disk is off but source was compressed
+test_corrective_recv "$TESTPOOL/$TESTFS2@snap1" $backup
+
+# create a full sendfile from an uncompressed source
+log_must eval "zfs send --compressed $TESTPOOL/$TESTFS2@snap1 > $unc_backup"
+log_must eval "zfs recv -o compression=gzip -o primarycache=none \
+ $TESTPOOL/testfs3 < $unc_backup"
+typeset compr=$(get_prop compression $TESTPOOL/testfs3)
+[[ "$compr" == "gzip" ]] || \
+ log_fail "Unexpected compression $compr in recved dataset"
+corrupt_blocks_at_level "/$TESTPOOL/testfs3/$TESTFILE0" 0
+# test healing recv when compression on-disk is on but source was uncompressed
+test_corrective_recv "$TESTPOOL/testfs3@snap1" $unc_backup
+
+# create new compressed dataset using our send file
+log_must eval "zfs recv -o compression=gzip -o primarycache=none \
+ $TESTPOOL/testfs4 < $backup"
+typeset compr=$(get_prop compression $TESTPOOL/testfs4)
+[[ "$compr" == "gzip" ]] || \
+ log_fail "Unexpected compression $compr in recved dataset"
+corrupt_blocks_at_level "/$TESTPOOL/testfs4/$TESTFILE0" 0
+# test healing recv when compression doesn't match between send file and on-disk
+test_corrective_recv "$TESTPOOL/testfs4@snap1" $backup
+
+# create new encrypted (and compressed) dataset using our send file
+log_must eval "zfs recv -o encryption=aes-256-ccm -o keyformat=passphrase \
+ -o keylocation=file:///$TESTPOOL/pwd -o primarycache=none \
+ $TESTPOOL/testfs5 < $backup"
+typeset encr=$(get_prop encryption $TESTPOOL/testfs5)
+[[ "$encr" == "aes-256-ccm" ]] || \
+ log_fail "Unexpected encryption $encr in recved dataset"
+log_must eval "zfs send --raw $TESTPOOL/testfs5@snap1 > $raw_backup"
+log_must eval "zfs send --compressed $TESTPOOL/testfs5@snap1 > $backup"
+corrupt_blocks_at_level "/$TESTPOOL/testfs5/$TESTFILE0" 0
+# test healing recv of an encrypted dataset using an unencrypted send file
+test_corrective_recv "$TESTPOOL/testfs5@snap1" $backup
+corrupt_blocks_at_level "/$TESTPOOL/testfs5/$TESTFILE0" 0
+log_must zfs unmount $TESTPOOL/testfs5
+log_must zfs unload-key $TESTPOOL/testfs5
+# test healing recv (on an encrypted dataset) using a raw send file
+test_corrective_recv "$TESTPOOL/testfs5@snap1" $raw_backup
+# non raw send file healing an encrypted dataset with an unloaded key will fail
+log_mustnot eval "zfs recv -c $TESTPOOL/testfs5@snap1 < $backup"
+
+log_must zfs rollback -r $TESTPOOL/$TESTFS1@snap1
+corrupt_blocks_at_level $file 0
+# test healing when specifying destination filesystem only (no snapshot)
+test_corrective_recv $TESTPOOL/$TESTFS1 $backup
+# test incremental recv aftear healing recv
+log_must eval "zfs recv $TESTPOOL/$TESTFS1 < $ibackup"
+
+# test that healing recv can not be combined with incompatible recv options
+log_mustnot eval "zfs recv -h -c $TESTPOOL/$TESTFS1@snap1 < $backup"
+log_mustnot eval "zfs recv -F -c $TESTPOOL/$TESTFS1@snap1 < $backup"
+log_mustnot eval "zfs recv -s -c $TESTPOOL/$TESTFS1@snap1 < $backup"
+log_mustnot eval "zfs recv -u -c $TESTPOOL/$TESTFS1@snap1 < $backup"
+log_mustnot eval "zfs recv -d -c $TESTPOOL/$TESTFS1@snap1 < $backup"
+log_mustnot eval "zfs recv -e -c $TESTPOOL/$TESTFS1@snap1 < $backup"
+
+# ensure healing recv doesn't work when snap GUIDS don't match
+log_mustnot eval "zfs recv -c $TESTPOOL/testfs5@snap2 < $backup"
+log_mustnot eval "zfs recv -c $TESTPOOL/testfs5 < $backup"
+
+# test that healing recv doesn't work on non-existing snapshots
+log_mustnot eval "zfs recv -c $TESTPOOL/$TESTFS1@missing < $backup"
+
+log_pass "OpenZFS corrective recv works for data healing"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_corrective.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_corrective.ksh
new file mode 100755
index 000000000000..261fc5eed8cb
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_corrective.ksh
@@ -0,0 +1,209 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2019 Datto, Inc. All rights reserved.
+# Copyright (c) 2022 Axcient.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+#
+# DESCRIPTION:
+# OpenZFS should be able to heal data using corrective recv
+#
+# STRATEGY:
+# 0. Create a file, checksum the file to be corrupted then compare it's checksum
+# with the one obtained after healing under different testing scenarios:
+# 1. Test healing (aka corrective) recv from a full send file
+# 2. Test healing recv (aka heal recv) from an incremental send file
+# 3. Test healing recv when compression on-disk is off but source was compressed
+# 4. Test heal recv when compression on-disk is on but source was uncompressed
+# 5. Test heal recv when compression doesn't match between send file and on-disk
+# 6. Test healing recv of an encrypted dataset using an unencrypted send file
+# 7. Test healing recv (on an encrypted dataset) using a raw send file
+# 8. Test healing when specifying destination filesystem only (no snapshot)
+# 9. Test incremental recv aftear healing recv
+#
+
+verify_runnable "both"
+
+DISK=${DISKS%% *}
+
+backup=$TEST_BASE_DIR/backup
+raw_backup=$TEST_BASE_DIR/raw_backup
+ibackup=$TEST_BASE_DIR/ibackup
+unc_backup=$TEST_BASE_DIR/unc_backup
+
+function cleanup
+{
+ log_must rm -f $backup $raw_backup $ibackup $unc_backup
+
+ poolexists $TESTPOOL && destroy_pool $TESTPOOL
+ log_must zpool create -f $TESTPOOL $DISK
+}
+
+function test_corrective_recv
+{
+ log_must zpool scrub -w $TESTPOOL
+ log_must zpool status -v $TESTPOOL
+ log_must eval "zpool status -v $TESTPOOL | \
+ grep \"Permanent errors have been detected\""
+
+ # make sure we will read the corruption from disk by flushing the ARC
+ log_must zinject -a
+
+ log_must eval "zfs recv -c $1 < $2"
+
+ log_must zpool scrub -w $TESTPOOL
+ log_must zpool status -v $TESTPOOL
+ log_mustnot eval "zpool status -v $TESTPOOL | \
+ grep \"Permanent errors have been detected\""
+ typeset cksum=$(md5digest $file)
+ [[ "$cksum" == "$checksum" ]] || \
+ log_fail "Checksums differ ($cksum != $checksum)"
+}
+
+log_onexit cleanup
+
+log_assert "ZFS corrective receive should be able to heal data corruption"
+
+typeset passphrase="password"
+typeset file="/$TESTPOOL/$TESTFS1/$TESTFILE0"
+
+log_must eval "poolexists $TESTPOOL && destroy_pool $TESTPOOL"
+log_must zpool create -f $TESTPOOL $DISK
+
+log_must eval "echo $passphrase > /$TESTPOOL/pwd"
+
+log_must zfs create -o primarycache=none \
+ -o atime=off -o compression=lz4 $TESTPOOL/$TESTFS1
+
+log_must dd if=/dev/urandom of=$file bs=1024 count=1024 oflag=sync
+log_must eval "echo 'aaaaaaaa' >> "$file
+typeset checksum=$(md5digest $file)
+
+log_must zfs snapshot $TESTPOOL/$TESTFS1@snap1
+
+# create full send file
+log_must eval "zfs send $TESTPOOL/$TESTFS1@snap1 > $backup"
+
+log_must dd if=/dev/urandom of=$file"1" bs=1024 count=1024 oflag=sync
+log_must eval "echo 'bbbbbbbb' >> "$file"1"
+log_must zfs snapshot $TESTPOOL/$TESTFS1@snap2
+# create incremental send file
+log_must eval "zfs send -i $TESTPOOL/$TESTFS1@snap1 \
+ $TESTPOOL/$TESTFS1@snap2 > $ibackup"
+
+corrupt_blocks_at_level $file 0
+# test healing recv from a full send file
+test_corrective_recv $TESTPOOL/$TESTFS1@snap1 $backup
+
+corrupt_blocks_at_level $file"1" 0
+# test healing recv from an incremental send file
+test_corrective_recv $TESTPOOL/$TESTFS1@snap2 $ibackup
+
+# create new uncompressed dataset using our send file
+log_must eval "zfs recv -o compression=off -o primarycache=none \
+ $TESTPOOL/$TESTFS2 < $backup"
+typeset compr=$(get_prop compression $TESTPOOL/$TESTFS2)
+[[ "$compr" == "off" ]] || \
+ log_fail "Unexpected compression $compr in recved dataset"
+corrupt_blocks_at_level "/$TESTPOOL/$TESTFS2/$TESTFILE0" 0
+# test healing recv when compression on-disk is off but source was compressed
+test_corrective_recv "$TESTPOOL/$TESTFS2@snap1" $backup
+
+# create a full sendfile from an uncompressed source
+log_must eval "zfs send $TESTPOOL/$TESTFS2@snap1 > $unc_backup"
+log_must eval "zfs recv -o compression=gzip -o primarycache=none \
+ $TESTPOOL/testfs3 < $unc_backup"
+typeset compr=$(get_prop compression $TESTPOOL/testfs3)
+[[ "$compr" == "gzip" ]] || \
+ log_fail "Unexpected compression $compr in recved dataset"
+corrupt_blocks_at_level "/$TESTPOOL/testfs3/$TESTFILE0" 0
+# test healing recv when compression on-disk is on but source was uncompressed
+test_corrective_recv "$TESTPOOL/testfs3@snap1" $unc_backup
+
+# create new compressed dataset using our send file
+log_must eval "zfs recv -o compression=gzip -o primarycache=none \
+ $TESTPOOL/testfs4 < $backup"
+typeset compr=$(get_prop compression $TESTPOOL/testfs4)
+[[ "$compr" == "gzip" ]] || \
+ log_fail "Unexpected compression $compr in recved dataset"
+corrupt_blocks_at_level "/$TESTPOOL/testfs4/$TESTFILE0" 0
+# test healing recv when compression doesn't match between send file and on-disk
+test_corrective_recv "$TESTPOOL/testfs4@snap1" $backup
+
+# create new encrypted (and compressed) dataset using our send file
+log_must eval "zfs recv -o encryption=aes-256-ccm -o keyformat=passphrase \
+ -o keylocation=file:///$TESTPOOL/pwd -o primarycache=none \
+ $TESTPOOL/testfs5 < $backup"
+typeset encr=$(get_prop encryption $TESTPOOL/testfs5)
+[[ "$encr" == "aes-256-ccm" ]] || \
+ log_fail "Unexpected encryption $encr in recved dataset"
+log_must eval "zfs send --raw $TESTPOOL/testfs5@snap1 > $raw_backup"
+log_must eval "zfs send $TESTPOOL/testfs5@snap1 > $backup"
+corrupt_blocks_at_level "/$TESTPOOL/testfs5/$TESTFILE0" 0
+# test healing recv of an encrypted dataset using an unencrypted send file
+test_corrective_recv "$TESTPOOL/testfs5@snap1" $backup
+corrupt_blocks_at_level "/$TESTPOOL/testfs5/$TESTFILE0" 0
+log_must zfs unmount $TESTPOOL/testfs5
+log_must zfs unload-key $TESTPOOL/testfs5
+# test healing recv (on an encrypted dataset) using a raw send file
+# This is a special case since with unloaded keys we cannot report errors
+# in the filesystem.
+log_must zpool scrub -w $TESTPOOL
+log_must zpool status -v $TESTPOOL
+log_mustnot eval "zpool status -v $TESTPOOL | \
+ grep \"permission denied\""
+# make sure we will read the corruption from disk by flushing the ARC
+log_must zinject -a
+log_must eval "zfs recv -c $TESTPOOL/testfs5@snap1 < $raw_backup"
+
+log_must zpool scrub -w $TESTPOOL
+log_must zpool status -v $TESTPOOL
+log_mustnot eval "zpool status -v $TESTPOOL | \
+ grep \"Permanent errors have been detected\""
+typeset cksum=$(md5digest $file)
+[[ "$cksum" == "$checksum" ]] || \
+ log_fail "Checksums differ ($cksum != $checksum)"
+
+# non raw send file healing an encrypted dataset with an unloaded key will fail
+log_mustnot eval "zfs recv -c $TESTPOOL/testfs5@snap1 < $backup"
+
+log_must zfs rollback -r $TESTPOOL/$TESTFS1@snap1
+corrupt_blocks_at_level $file 0
+# test healing when specifying destination filesystem only (no snapshot)
+test_corrective_recv $TESTPOOL/$TESTFS1 $backup
+# test incremental recv aftear healing recv
+log_must eval "zfs recv $TESTPOOL/$TESTFS1 < $ibackup"
+
+# test that healing recv can not be combined with incompatible recv options
+log_mustnot eval "zfs recv -h -c $TESTPOOL/$TESTFS1@snap1 < $backup"
+log_mustnot eval "zfs recv -F -c $TESTPOOL/$TESTFS1@snap1 < $backup"
+log_mustnot eval "zfs recv -s -c $TESTPOOL/$TESTFS1@snap1 < $backup"
+log_mustnot eval "zfs recv -u -c $TESTPOOL/$TESTFS1@snap1 < $backup"
+log_mustnot eval "zfs recv -d -c $TESTPOOL/$TESTFS1@snap1 < $backup"
+log_mustnot eval "zfs recv -e -c $TESTPOOL/$TESTFS1@snap1 < $backup"
+
+# ensure healing recv doesn't work when snap GUIDS don't match
+log_mustnot eval "zfs recv -c $TESTPOOL/testfs5@snap2 < $backup"
+log_mustnot eval "zfs recv -c $TESTPOOL/testfs5 < $backup"
+
+# test that healing recv doesn't work on non-existing snapshots
+log_mustnot eval "zfs recv -c $TESTPOOL/$TESTFS1@missing < $backup"
+
+log_pass "OpenZFS corrective recv works for data healing"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_large_block_corrective.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_large_block_corrective.ksh
new file mode 100755
index 000000000000..fbcd33f60704
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_large_block_corrective.ksh
@@ -0,0 +1,194 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2019 Datto, Inc. All rights reserved.
+# Copyright (c) 2022 Axcient.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+#
+# DESCRIPTION:
+# OpenZFS should be able to heal data using corrective recv when the send file
+# was generated with the --large-block flag
+#
+# STRATEGY:
+# 0. Create a file, checksum the file to be corrupted then compare it's checksum
+# with the one obtained after healing under different testing scenarios:
+# 1. Test healing (aka corrective) recv from a full send file
+# 2. Test healing recv (aka heal recv) from an incremental send file
+# 3. Test healing recv when compression on-disk is off but source was compressed
+# 4. Test heal recv when compression on-disk is on but source was uncompressed
+# 5. Test heal recv when compression doesn't match between send file and on-disk
+# 6. Test healing recv of an encrypted dataset using an unencrypted send file
+# 7. Test healing recv (on an encrypted dataset) using a raw send file
+# 8. Test healing when specifying destination filesystem only (no snapshot)
+# 9. Test incremental recv aftear healing recv
+#
+
+verify_runnable "both"
+
+DISK=${DISKS%% *}
+
+backup=$TEST_BASE_DIR/backup
+raw_backup=$TEST_BASE_DIR/raw_backup
+ibackup=$TEST_BASE_DIR/ibackup
+unc_backup=$TEST_BASE_DIR/unc_backup
+
+function cleanup
+{
+ log_must rm -f $backup $raw_backup $ibackup $unc_backup
+
+ poolexists $TESTPOOL && destroy_pool $TESTPOOL
+ log_must zpool create -f $TESTPOOL $DISK
+}
+
+function test_corrective_recv
+{
+ log_must zpool scrub -w $TESTPOOL
+ log_must zpool status -v $TESTPOOL
+ log_must eval "zpool status -v $TESTPOOL | \
+ grep \"Permanent errors have been detected\""
+
+ # make sure we will read the corruption from disk by flushing the ARC
+ log_must zinject -a
+
+ log_must eval "zfs recv -c $1 < $2"
+
+ log_must zpool scrub -w $TESTPOOL
+ log_must zpool status -v $TESTPOOL
+ log_mustnot eval "zpool status -v $TESTPOOL | \
+ grep \"Permanent errors have been detected\""
+ typeset cksum=$(md5digest $file)
+ [[ "$cksum" == "$checksum" ]] || \
+ log_fail "Checksums differ ($cksum != $checksum)"
+}
+
+log_onexit cleanup
+
+log_assert "ZFS corrective receive should be able to heal data corruption"
+
+typeset passphrase="password"
+typeset file="/$TESTPOOL/$TESTFS1/$TESTFILE0"
+
+log_must eval "poolexists $TESTPOOL && destroy_pool $TESTPOOL"
+log_must zpool create -f -o feature@large_blocks=enabled \
+ -o feature@head_errlog=disabled $TESTPOOL $DISK
+
+log_must eval "echo $passphrase > /$TESTPOOL/pwd"
+
+log_must zfs create -o recordsize=1m -o primarycache=none \
+ -o atime=off -o compression=lz4 $TESTPOOL/$TESTFS1
+
+log_must dd if=/dev/urandom of=$file bs=1024 count=1024 oflag=sync
+log_must eval "echo 'aaaaaaaa' >> "$file
+typeset checksum=$(md5digest $file)
+
+log_must zfs snapshot $TESTPOOL/$TESTFS1@snap1
+
+# create full send file
+log_must eval "zfs send -L $TESTPOOL/$TESTFS1@snap1 > $backup"
+
+log_must dd if=/dev/urandom of=$file"1" bs=1024 count=1024 oflag=sync
+log_must eval "echo 'bbbbbbbb' >> "$file"1"
+log_must zfs snapshot $TESTPOOL/$TESTFS1@snap2
+# create incremental send file
+log_must eval "zfs send -Li $TESTPOOL/$TESTFS1@snap1 \
+ $TESTPOOL/$TESTFS1@snap2 > $ibackup"
+
+corrupt_blocks_at_level $file 0
+# test healing recv from a full send file
+test_corrective_recv $TESTPOOL/$TESTFS1@snap1 $backup
+
+corrupt_blocks_at_level $file"1" 0
+# test healing recv from an incremental send file
+test_corrective_recv $TESTPOOL/$TESTFS1@snap2 $ibackup
+
+# create new uncompressed dataset using our send file
+log_must eval "zfs recv -o compression=off -o primarycache=none \
+ $TESTPOOL/$TESTFS2 < $backup"
+typeset compr=$(get_prop compression $TESTPOOL/$TESTFS2)
+[[ "$compr" == "off" ]] || \
+ log_fail "Unexpected compression $compr in recved dataset"
+corrupt_blocks_at_level "/$TESTPOOL/$TESTFS2/$TESTFILE0" 0
+# test healing recv when compression on-disk is off but source was compressed
+test_corrective_recv "$TESTPOOL/$TESTFS2@snap1" $backup
+
+# create a full sendfile from an uncompressed source
+log_must eval "zfs send -L $TESTPOOL/$TESTFS2@snap1 > $unc_backup"
+log_must eval "zfs recv -o compression=gzip -o primarycache=none \
+ -o recordsize=1m $TESTPOOL/testfs3 < $unc_backup"
+typeset compr=$(get_prop compression $TESTPOOL/testfs3)
+[[ "$compr" == "gzip" ]] || \
+ log_fail "Unexpected compression $compr in recved dataset"
+corrupt_blocks_at_level "/$TESTPOOL/testfs3/$TESTFILE0" 0
+# test healing recv when compression on-disk is on but source was uncompressed
+test_corrective_recv "$TESTPOOL/testfs3@snap1" $unc_backup
+
+# create new compressed dataset using our send file
+log_must eval "zfs recv -o compression=gzip -o primarycache=none \
+ -o recordsize=1m $TESTPOOL/testfs4 < $backup"
+typeset compr=$(get_prop compression $TESTPOOL/testfs4)
+[[ "$compr" == "gzip" ]] || \
+ log_fail "Unexpected compression $compr in recved dataset"
+corrupt_blocks_at_level "/$TESTPOOL/testfs4/$TESTFILE0" 0
+# test healing recv when compression doesn't match between send file and on-disk
+test_corrective_recv "$TESTPOOL/testfs4@snap1" $backup
+
+# create new encrypted (and compressed) dataset using our send file
+log_must eval "zfs recv -o encryption=aes-256-ccm -o keyformat=passphrase \
+ -o recordsize=1m -o keylocation=file:///$TESTPOOL/pwd -o primarycache=none \
+ $TESTPOOL/testfs5 < $backup"
+typeset encr=$(get_prop encryption $TESTPOOL/testfs5)
+[[ "$encr" == "aes-256-ccm" ]] || \
+ log_fail "Unexpected encryption $encr in recved dataset"
+log_must eval "zfs send -L --raw $TESTPOOL/testfs5@snap1 > $raw_backup"
+log_must eval "zfs send -L $TESTPOOL/testfs5@snap1 > $backup"
+corrupt_blocks_at_level "/$TESTPOOL/testfs5/$TESTFILE0" 0
+# test healing recv of an encrypted dataset using an unencrypted send file
+test_corrective_recv "$TESTPOOL/testfs5@snap1" $backup
+corrupt_blocks_at_level "/$TESTPOOL/testfs5/$TESTFILE0" 0
+log_must zfs unmount $TESTPOOL/testfs5
+log_must zfs unload-key $TESTPOOL/testfs5
+# test healing recv (on an encrypted dataset) using a raw send file
+test_corrective_recv "$TESTPOOL/testfs5@snap1" $raw_backup
+# non raw send file healing an encrypted dataset with an unloaded key will fail
+log_mustnot eval "zfs recv -c $TESTPOOL/testfs5@snap1 < $backup"
+
+log_must zfs rollback -r $TESTPOOL/$TESTFS1@snap1
+corrupt_blocks_at_level $file 0
+# test healing when specifying destination filesystem only (no snapshot)
+test_corrective_recv $TESTPOOL/$TESTFS1 $backup
+# test incremental recv aftear healing recv
+log_must eval "zfs recv -o recordsize=1m $TESTPOOL/$TESTFS1 < $ibackup"
+
+# test that healing recv can not be combined with incompatible recv options
+log_mustnot eval "zfs recv -h -c $TESTPOOL/$TESTFS1@snap1 < $backup"
+log_mustnot eval "zfs recv -F -c $TESTPOOL/$TESTFS1@snap1 < $backup"
+log_mustnot eval "zfs recv -s -c $TESTPOOL/$TESTFS1@snap1 < $backup"
+log_mustnot eval "zfs recv -u -c $TESTPOOL/$TESTFS1@snap1 < $backup"
+log_mustnot eval "zfs recv -d -c $TESTPOOL/$TESTFS1@snap1 < $backup"
+log_mustnot eval "zfs recv -e -c $TESTPOOL/$TESTFS1@snap1 < $backup"
+
+# ensure healing recv doesn't work when snap GUIDS don't match
+log_mustnot eval "zfs recv -c $TESTPOOL/testfs5@snap2 < $backup"
+log_mustnot eval "zfs recv -c $TESTPOOL/testfs5 < $backup"
+
+# test that healing recv doesn't work on non-existing snapshots
+log_mustnot eval "zfs recv -c $TESTPOOL/$TESTFS1@missing < $backup"
+
+log_pass "OpenZFS corrective recv works for data healing"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_to_encrypted.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_to_encrypted.ksh
index 5d76c220fc45..7e12d30d0e7e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_to_encrypted.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_to_encrypted.ksh
@@ -25,20 +25,27 @@
# ZFS should receive to an encrypted child dataset.
#
# STRATEGY:
-# 1. Snapshot the default dataset
-# 2. Create an encrypted dataset
-# 3. Attempt to receive a stream to an encrypted child
-# 4. Attempt to receive a stream with properties to an encrypted child
-# 5. Attempt to receive a replication stream to an encrypted child
-# 6. Unmount and unload the encrypted dataset keys
-# 7. Attempt to receive a snapshot stream to an encrypted child
+# 1. Snapshot the default dataset
+# 2. Create an encrypted dataset
+# 3. Attempt to receive a stream to an encrypted child
+# 4. Unload the key
+# 5. Attempt to receive an incremental stream to an encrypted child (must fail)
+# 6. Attempt to receive a stream with properties to an unencrypted child
+# 7. Attempt to receive an incremental stream to an unencrypted child
+# 8. Attempt to receive with -o encryption=off to an unencrypted child
+# 9. Attempt to receive a replication stream to an unencrypted child
+# 10. Attempt to receive a snapshot stream to an encrypted child (must fail)
#
verify_runnable "both"
function cleanup
{
+ datasetexists $TESTPOOL/encrypted && \
+ destroy_dataset $TESTPOOL/encrypted -r
+
snapexists $snap && destroy_dataset $snap -f
+ snapexists $snap2 && destroy_dataset $snap2 -f
datasetexists $TESTPOOL/$TESTFS1 && \
destroy_dataset $TESTPOOL/$TESTFS1 -r
@@ -50,15 +57,17 @@ log_assert "ZFS should receive encrypted filesystems into child dataset"
typeset passphrase="password"
typeset snap="$TESTPOOL/$TESTFS@snap"
+typeset snap2="$TESTPOOL/$TESTFS@snap2"
typeset testfile="testfile"
log_must zfs snapshot $snap
+log_must zfs snapshot $snap2
log_must eval "echo $passphrase | zfs create -o encryption=on" \
"-o keyformat=passphrase $TESTPOOL/$TESTFS1"
log_note "Verifying ZFS will receive to an encrypted child"
-log_must eval "zfs send $snap | zfs receive $TESTPOOL/$TESTFS1/c1"
+log_must eval "zfs send $snap | zfs receive -u $TESTPOOL/$TESTFS1/c1"
log_must test "$(get_prop 'encryption' $TESTPOOL/$TESTFS1/c1)" != "off"
# Unload the key, the following tests won't require it and we will test
@@ -66,10 +75,17 @@ log_must test "$(get_prop 'encryption' $TESTPOOL/$TESTFS1/c1)" != "off"
log_must zfs unmount $TESTPOOL/$TESTFS1
log_must zfs unload-key $TESTPOOL/$TESTFS1
+log_note "Verifying ZFS will not receive an incremental into an encrypted" \
+ "dataset when the key is unloaded"
+log_mustnot eval "zfs send -i $snap $snap2 | zfs receive $TESTPOOL/$TESTFS1/c1"
+
log_note "Verifying 'send -p' will receive to an unencrypted child"
-log_must eval "zfs send -p $snap | zfs receive $TESTPOOL/$TESTFS1/c2"
+log_must eval "zfs send -p $snap | zfs receive -u $TESTPOOL/$TESTFS1/c2"
log_must test "$(get_prop 'encryption' $TESTPOOL/$TESTFS1/c2)" == "off"
+log_note "Verifying 'send -i' will receive to an unencrypted child"
+log_must eval "zfs send -i $snap $snap2 | zfs receive $TESTPOOL/$TESTFS1/c2"
+
# For completeness add the property override case.
log_note "Verifying recv -o encyption=off' will receive to an unencrypted child"
log_must eval "zfs send $snap | \
@@ -84,4 +100,15 @@ log_note "Verifying ZFS will not receive to an encrypted child when the" \
"parent key is unloaded"
log_mustnot eval "zfs send $snap | zfs receive $TESTPOOL/$TESTFS1/c4"
+# Verify that replication can override encryption properties
+log_note "Verifying replication can override encryption properties for plain dataset"
+typeset key_location="/$TESTPOOL/pkey1"
+log_must eval "echo $passphrase > $key_location"
+log_must eval "zfs send -R $snap2 | zfs recv -s -F -o encryption=on" \
+ "-o keyformat=passphrase -o keylocation=file://$key_location" \
+ "-o mountpoint=none $TESTPOOL/encrypted"
+log_must test "$(get_prop 'encryption' $TESTPOOL/encrypted)" != "off"
+log_must test "$(get_prop 'keyformat' $TESTPOOL/encrypted)" == "passphrase"
+log_must test "$(get_prop 'keylocation' $TESTPOOL/encrypted)" == "file://$key_location"
+
log_pass "ZFS can receive encrypted filesystems into child dataset"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/cleanup.ksh
index 0a5b6c36111b..f8f253a3b615 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/setup.ksh
index 03701d4f5522..0f22179024bc 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename.cfg b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename.cfg
index 9a8f38dc2443..8d3da7cdeaa0 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename.kshlib b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename.kshlib
index cafffbd85266..a3d735756fad 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_001_pos.ksh
index c76b5a2fe5c3..a4fb95c8d10e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_002_pos.ksh
index 6d51f612b311..05f1474b1854 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_003_pos.ksh
index 0bd4aca3a7fd..26ee9cb923df 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_004_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_004_neg.ksh
index b1438e8663e3..224fceaddd08 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_004_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_004_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_005_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_005_neg.ksh
index 5ef77de0c751..3717d1d9dad2 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_005_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_005_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_006_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_006_pos.ksh
index 4d1605152201..5d67a4ed9547 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_007_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_007_pos.ksh
index 2a3f8a8ccd7b..5b8d7c78dfc1 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_008_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_008_pos.ksh
index 229163839058..6f5974cc235e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_009_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_009_neg.ksh
index 7e8119766bf7..7eef546380b2 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_009_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_009_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_010_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_010_neg.ksh
index 171770fa32a1..b631ea886823 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_010_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_010_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_011_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_011_pos.ksh
index 71d72619d646..43632c7d34ba 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_011_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_011_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_012_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_012_neg.ksh
index 6daf001797e6..16c93e9f4e14 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_012_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_012_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_013_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_013_pos.ksh
index 73790f58cd45..f33a971729ed 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_013_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_013_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_014_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_014_neg.ksh
index 57bae24277e1..d0b6984d21cb 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_014_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_014_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_reservation/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_reservation/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_reservation/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_reservation/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_reservation/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_reservation/setup.ksh
index 6a9af3bc28c3..4c719075a741 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_reservation/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_reservation/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_reservation/zfs_reservation_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_reservation/zfs_reservation_001_pos.ksh
index 7ec55ce0f3d2..416139f7aa3b 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_reservation/zfs_reservation_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_reservation/zfs_reservation_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_reservation/zfs_reservation_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_reservation/zfs_reservation_002_pos.ksh
index 7f90630360ff..49eabfeb7223 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_reservation/zfs_reservation_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_reservation/zfs_reservation_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/cleanup.ksh
index 707e8f121ddb..93abeb1338ce 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/setup.ksh
index d3341b1c27fc..562e5242d3c8 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback.cfg b/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback.cfg
index d6c8934d9753..215f3c350785 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_001_pos.ksh
index 607bbf06eafd..5290f06205b2 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_002_pos.ksh
index 659660dc0fe7..3b03063d0c1c 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_003_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_003_neg.ksh
index 1e3109108bae..e798a7bec5c2 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_003_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_003_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_004_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_004_neg.ksh
index 9537d5077b1a..be59742c9051 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_004_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_004_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_common.kshlib b/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_common.kshlib
index cc1b24697d21..29eb82a22cd6 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_common.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_send/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_send/cleanup.ksh
index cec69d4709f4..e3a213302614 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_send/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_send/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_send/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_send/setup.ksh
index 6a9af3bc28c3..4c719075a741 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_send/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_send/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send.cfg b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send.cfg
index bbc4d3ac833e..49f7245f9c58 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_001_pos.ksh
index 2c7bac851608..a8b22756a6d5 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_002_pos.ksh
index c55ce08d006e..f575c0cc8da7 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_003_pos.ksh
index b04c9d3b240c..211225dd6fbe 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_004_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_004_neg.ksh
index 66a3da69f74b..ea3a759ddadc 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_004_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_004_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_005_pos.ksh
index de8b28534fe1..174b21feb23e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_006_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_006_pos.ksh
index c5dfb89394f4..d7ee161eb3be 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_006_pos.ksh
@@ -119,33 +119,33 @@ full_size=$(zfs send $full_snapshot 2>&1 | wc -c)
incremental_size=$(zfs send $incremental_snapshot 2>&1 | wc -c)
incremental_send=$(zfs send -i $full_snapshot $incremental_snapshot 2>&1 | wc -c)
-log_note "verify zfs send -nv"
-options="-nv"
+log_note "verify zfs send -nvV"
+options="-nvV"
refer_size=$(get_prop refer $full_snapshot)
estimate_size=$(get_estimate_size $full_snapshot $options)
log_must verify_size_estimates $options $full_size
-log_note "verify zfs send -Pnv"
-options="-Pnv"
+log_note "verify zfs send -PnvV"
+options="-PnvV"
estimate_size=$(get_estimate_size $full_snapshot $options)
log_must verify_size_estimates $options $full_size
-log_note "verify zfs send -nv for multiple snapshot send"
-options="-nv"
+log_note "verify zfs send -nvV for multiple snapshot send"
+options="-nvV"
refer_size=$(get_prop refer $incremental_snapshot)
estimate_size=$(get_estimate_size $incremental_snapshot $options)
log_must verify_size_estimates $options $incremental_size
-log_note "verify zfs send -vPn for multiple snapshot send"
-options="-vPn"
+log_note "verify zfs send -vVPn for multiple snapshot send"
+options="-vVPn"
estimate_size=$(get_estimate_size $incremental_snapshot $options)
log_must verify_size_estimates $options $incremental_size
-log_note "verify zfs send -inv for incremental send"
-options="-nvi"
+log_note "verify zfs send -invV for incremental send"
+options="-nvVi"
refer_size=$(get_prop refer $incremental_snapshot)
deduct_size=$(get_prop refer $full_snapshot)
refer_size=$(echo "$refer_size - $deduct_size" | bc)
@@ -155,8 +155,8 @@ log_must verify_size_estimates $options $incremental_send
estimate_size=$(get_estimate_size $incremental_snapshot $options $full_bookmark)
log_must verify_size_estimates $options $incremental_send
-log_note "verify zfs send -ivPn for incremental send"
-options="-vPni"
+log_note "verify zfs send -ivVPn for incremental send"
+options="-vVPni"
estimate_size=$(get_estimate_size $incremental_snapshot $options $full_snapshot)
log_must verify_size_estimates $options $incremental_send
@@ -186,16 +186,16 @@ for ds in $datasets; do
datasetexists $ds@snap64 || log_fail "Create $ds@snap64 snapshot fail."
done
recursive_size=$(zfs send -R $full_snapshot 2>&1 | wc -c)
-log_note "verify zfs send -Rnv for recursive send"
-options="-Rnv"
+log_note "verify zfs send -RnvV for recursive send"
+options="-RnvV"
refer_size=$(get_prop refer $full_snapshot)
refer_size=$(echo "$refer_size * 3" | bc)
estimate_size=$(get_estimate_size $full_snapshot $options)
log_must verify_size_estimates $options $recursive_size
-log_note "verify zfs send -RvPn for recursive send"
-options="-RvPn"
+log_note "verify zfs send -RvVPn for recursive send"
+options="-RvVPn"
estimate_size=$(get_estimate_size $full_snapshot $options)
log_must verify_size_estimates $options $recursive_size
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_skip_missing.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_skip_missing.ksh
index 17b191a36173..06a53fcddd5e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_skip_missing.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_skip_missing.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/cache_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/cache_001_pos.ksh
index bffc47f817dd..de073bf1132f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/cache_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/cache_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/cache_002_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/cache_002_neg.ksh
index caad211bcf65..b4f24f5adf19 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/cache_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/cache_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_001_pos.ksh
index fe8aa2fd1e07..4eb11423d9e4 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_002_pos.ksh
index bb7cd4cccc39..d628d6fc6ab1 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_003_pos.ksh
index b370118a7f76..fa9948445d9f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_004_pos.ksh
index e75114efdec0..b3f1afc63ab2 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/canmount_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/checksum_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/checksum_001_pos.ksh
index cab7c185e16a..91b08a838bd1 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/checksum_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/checksum_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/cleanup.ksh
index fad025cac246..b6c8bb2f47e9 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/compression_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/compression_001_pos.ksh
index 06da5f2f3ce8..ebeed4a7dab7 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/compression_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/compression_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_001_pos.ksh
index 30efef1c383f..c1f5affa3414 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_002_pos.ksh
index 603e84dcd07f..c227a6fb8aa8 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -35,7 +35,9 @@
#
# DESCRIPTION:
# If ZFS is currently managing the file system but it is currently unmounted,
-# and the mountpoint property is changed, the file system remains unmounted.
+# and the mountpoint property is changed, the file system should be mounted
+# if it is a valid mountpoint and canmount allows to mount, otherwise it
+# should not be mounted.
#
# STRATEGY:
# 1. Setup a pool and create fs, ctr within it.
@@ -62,7 +64,7 @@ function cleanup
}
log_assert "Setting a valid mountpoint for an unmounted file system, \
- it remains unmounted."
+ it gets mounted."
log_onexit cleanup
old_fs_mpt=$(get_prop mountpoint $TESTPOOL/$TESTFS)
@@ -83,7 +85,11 @@ while (( i < ${#dataset[@]} )); do
while (( j < ${#values[@]} )); do
set_n_check_prop "${values[j]}" "mountpoint" \
"${dataset[i]}"
- log_mustnot ismounted ${dataset[i]}
+ if [ "${dataset[i]}" = "$TESTPOOL/$TESTFS" ]; then
+ log_must ismounted ${dataset[i]}
+ else
+ log_mustnot ismounted ${dataset[i]}
+ fi
(( j += 1 ))
done
cleanup
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_003_pos.ksh
index 38bbda0d1fae..01b505e4ab1a 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/onoffs_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/onoffs_001_pos.ksh
index 7ba6d7fb659d..d6daf0e1b74e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/onoffs_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/onoffs_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/property_alias_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/property_alias_001_pos.ksh
index 0ddafe178e3a..b75143ed61bd 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/property_alias_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/property_alias_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/readonly_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/readonly_001_pos.ksh
index 4adac420f748..20d6b634429a 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/readonly_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/readonly_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/reservation_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/reservation_001_neg.ksh
index b929047cf129..9430c1ac4070 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/reservation_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/reservation_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/ro_props_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/ro_props_001_pos.ksh
index e24376a2bf74..d3d041f3395d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/ro_props_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/ro_props_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/setup.ksh
index 9692385996d1..2a909eba4f87 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/share_mount_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/share_mount_001_neg.ksh
index fa32c2774f8b..3097d931f683 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/share_mount_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/share_mount_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/snapdir_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/snapdir_001_pos.ksh
index 29a709397422..a41fa6c251b3 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/snapdir_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/snapdir_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_001_pos.ksh
index 16b9638787e2..b897dffcbd27 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_002_pos.ksh
index 12cff78ea4ca..868abc82f394 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_003_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_003_neg.ksh
index 3d8c1e7be18d..80f279cbe992 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_003_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_003_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_004_pos.ksh
index 8ab52679eb9a..bcd367773722 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/version_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/version_001_neg.ksh
index 318a9aae6b45..0443b63376f1 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/version_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/version_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_001_neg.ksh
index e58fe9bfe93c..0701c9ef0f28 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_002_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_002_neg.ksh
index 2178175cd5b6..946f6983b161 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_003_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_003_neg.ksh
index fd5f7f285f5b..5901ba7dc461 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_003_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_003_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -33,7 +33,9 @@
#
# DESCRIPTION:
-# 'zfs set mountpoint/sharenfs' should fail when the mountpoint is invalid
+# 'zfs set mountpoint/sharenfs' should set the property when mountpoint
+# is invalid. Setting the property should be successful, but dataset
+# should not be mounted, as mountpoint is invalid.
#
# STRATEGY:
# 1. Create invalid scenarios
@@ -62,10 +64,12 @@ longpath=$(gen_dataset_name 1030 "abcdefg")
log_must zfs create -o mountpoint=legacy $TESTPOOL/foo
# Do the negative testing about "property may be set but unable to remount filesystem"
-log_mustnot eval "zfs set mountpoint=$badpath $TESTPOOL/foo >/dev/null 2>&1"
+set_n_check_prop "$badpath" "mountpoint" "$TESTPOOL/foo"
+log_mustnot ismounted $TESTPOOL/foo
# Do the negative testing about "property may be set but unable to reshare filesystem"
-log_mustnot eval "zfs set sharenfs=on $TESTPOOL/foo >/dev/null 2>&1"
+set_n_check_prop "on" "sharenfs" "$TESTPOOL/foo"
+log_mustnot ismounted $TESTPOOL/foo
# Do the negative testing about "sharenfs property can not be set to null"
log_mustnot eval "zfs set sharenfs= $TESTPOOL/foo >/dev/null 2>&1"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib b/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
index 2858275cf2b9..484c7d862276 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_feature_activation.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_feature_activation.ksh
index c5e6fb9c1140..760301c11758 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_feature_activation.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_feature_activation.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_nomount.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_nomount.ksh
new file mode 100755
index 000000000000..ebf08711423c
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_nomount.ksh
@@ -0,0 +1,103 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by iXsystems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
+
+#
+# DESCRIPTION:
+# 'zfs set -u' should update the mountpoint, sharenfs and sharesmb
+# properties without mounting and sharing the dataset. Validate the
+# bevaior while dataset is mounted and unmounted.
+#
+# STRATEGY:
+# 1. Confirm dataset is currently mounted
+# 2. Update the mountpoint with -u flag
+# 3. Confirm mountpoint property is updated with new value
+# 4. Confirm dataset is still mounted at previous mountpoint
+# 5. Unmount the dataset
+# 6. Confirm dataset is unmounted
+# 7. Mount the dataset
+# 8. Confirm dataset is mounted at new mountpoint, that was set with -u flag.
+# 9. Update and mount the dataset at previous mountpoint.
+# 10. Unmount the dataset
+# 11. Update mountpoint property with zfs set -u
+# 12. Confirm dataset is not mounted
+# 13. Update sharenfs property with zfs set -u
+# 14. Confirm dataset is not mounted
+# 15. Update sharesmb property with zfs set -u
+# 16. Confirm dataset is not mounted
+# 17. Mount the dataset and confirm dataset is mounted at new mountpoint
+#
+
+verify_runnable "both"
+
+function cleanup
+{
+ log_must zfs set sharenfs=off $TESTPOOL/$TESTFS
+ if is_linux; then
+ log_must zfs set sharesmb=off $TESTPOOL/$TESTFS
+ fi
+ rm -r $newmpt
+}
+
+log_assert "'zfs set -u' sets the mountpoint and share properties without " \
+ "mounting the dataset"
+log_onexit cleanup
+
+oldmpt=$(get_prop mountpoint $TESTPOOL/$TESTFS)
+newmpt=$TEST_BASE_DIR/abc
+
+# Test while dataset is mounted
+log_must ismounted $TESTPOOL/$TESTFS
+log_must zfs set -u mountpoint=$newmpt $TESTPOOL/$TESTFS
+log_must check_user_prop $TESTPOOL/$TESTFS mountpoint $newmpt
+log_must eval "[[ "$(mount | grep $TESTPOOL/$TESTFS | awk '{print $3}')" == $oldmpt ]]"
+log_must zfs unmount $TESTPOOL/$TESTFS
+log_mustnot ismounted $TESTPOOL/$TESTFS
+log_must zfs mount $TESTPOOL/$TESTFS
+log_must eval "[[ "$(mount | grep $TESTPOOL/$TESTFS | awk '{print $3}')" == $newmpt ]]"
+
+# Test while dataset is unmounted
+log_must zfs set mountpoint=$oldmpt $TESTPOOL/$TESTFS
+log_must ismounted $TESTPOOL/$TESTFS
+log_must zfs unmount $TESTPOOL/$TESTFS
+log_must zfs set -u mountpoint=$newmpt $TESTPOOL/$TESTFS
+log_mustnot ismounted $TESTPOOL/$TESTFS
+log_must zfs set -u sharenfs=on $TESTPOOL/$TESTFS
+log_mustnot ismounted $TESTPOOL/$TESTFS
+if is_linux; then
+ log_must zfs set -u sharesmb=on $TESTPOOL/$TESTFS
+ log_mustnot ismounted $TESTPOOL/$TESTFS
+fi
+log_must zfs mount $TESTPOOL/$TESTFS
+log_must check_user_prop $TESTPOOL/$TESTFS mountpoint $newmpt
+log_must eval "[[ "$(mount | grep $TESTPOOL/$TESTFS | awk '{print $3}')" == $newmpt ]]"
+
+log_must zfs set mountpoint=$oldmpt $TESTPOOL/$TESTFS
+log_must ismounted $TESTPOOL/$TESTFS
+
+log_pass "'zfs set -u' functions correctly"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/setup.ksh
index 1601087f712c..4310985e6624 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share.cfg b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share.cfg
index 5c31c8fbb6e7..4c52ddef529d 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_001_pos.ksh
index 6d4396aa1912..b8e9407e756e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_002_pos.ksh
index 588a30f46de9..65cbe3f2a89d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_003_pos.ksh
index b99c72ca14e5..b2cb8f5c470f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_004_pos.ksh
index 6c48875f5268..a00a3ddcc8ac 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_005_pos.ksh
index 719dd645028a..85854085f560 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_006_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_006_pos.ksh
index d5394017d780..64d6e9515549 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_007_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_007_neg.ksh
index 553605000d1b..6a21dd22b93c 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_007_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_007_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_008_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_008_neg.ksh
index 34fbd389949d..3ac845510b24 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_008_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_008_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_009_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_009_neg.ksh
index ddd65e88859b..07aa52afd201 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_009_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_009_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_010_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_010_neg.ksh
index 238a5862920b..946fa36f1ffc 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_010_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_010_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_011_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_011_pos.ksh
index efd7a2d0c7bd..7bd50e7514a8 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_011_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_011_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_012_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_012_pos.ksh
index fe38d5559542..70eb5abd02fb 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_012_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_012_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_013_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_013_pos.ksh
index e9766de49285..1aacebbe44d2 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_013_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_013_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_after_mount.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_after_mount.ksh
new file mode 100755
index 000000000000..0d4b66ea854c
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_after_mount.ksh
@@ -0,0 +1,62 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Proxmox. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+# DESCRIPTION:
+# Verify that nfs shares persist after zfs mount -a
+#
+# STRATEGY:
+# 1. Verify that the filesystem is not shared.
+# 2. Enable the 'sharenfs' property
+# 3. Verify filesystem is shared
+# 4. Invoke 'zfs mount -a'
+# 5. Verify filesystem is still shared
+
+verify_runnable "global"
+
+function cleanup
+{
+ log_must zfs set sharenfs=off $TESTPOOL/$TESTFS
+ is_shared $TESTPOOL/$TESTFS && \
+ log_must unshare_fs $TESTPOOL/$TESTFS
+ log_must zfs share -a
+}
+
+
+log_onexit cleanup
+
+cleanup
+
+log_must zfs set sharenfs="on" $TESTPOOL/$TESTFS
+log_must is_shared $TESTPOOL/$TESTFS
+log_must is_exported $TESTPOOL/$TESTFS
+
+log_must zfs mount -a
+log_must is_shared $TESTPOOL/$TESTFS
+log_must is_exported $TESTPOOL/$TESTFS
+
+log_pass "Verify that nfs shares persist after zfs mount -a"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_concurrent_shares.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_concurrent_shares.ksh
index 22b8af4e89d8..d779689f83bd 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_concurrent_shares.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_concurrent_shares.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -98,11 +98,26 @@ function test_share # filesystem
zfs set sharenfs=on $filesystem || \
sub_fail "zfs set sharenfs=on $filesystem failed."
- is_shared $mntp || \
- sub_fail "File system $filesystem is not shared (set sharenfs)."
#
- # Verify 'zfs share' works as well.
+ # Verify 'zfs share' results in a shared mount. We check this
+ # multiple times because of Fedora 37+ it's been observed in
+ # the CI that the share may not be immediately reported.
+ #
+ for retry in $(seq 1 10); do
+ is_shared $mntp && break
+
+ log_note "Wait $retry / 10 for is_shared $mntp (set sharenfs)"
+
+ if [[ $retry -eq 10 ]]; then
+ sub_fail "File system $filesystem is not shared (set sharenfs)."
+ fi
+
+ sleep 1
+ done
+
+ #
+ # Verify 'zfs unshare' works as well.
#
zfs unshare $filesystem || \
sub_fail "zfs unshare $filesystem failed."
@@ -112,9 +127,23 @@ function test_share # filesystem
zfs share $filesystem || \
sub_fail "zfs share $filesystem failed."
- is_shared $mntp || \
- sub_fail "file system $filesystem is not shared (zfs share)."
+ #
+ # Verify 'zfs share' results in a shared mount. We check this
+ # multiple times because of Fedora 37+ it's been observed in
+ # the CI that the share may not be immediately reported.
+ #
+ for retry in $(seq 1 10); do
+ is_shared $mntp && break
+
+ log_note "Wait $retry / 10 for is_shared $mntp (zfs share)"
+
+ if [[ $retry -eq 10 ]]; then
+ sub_fail "File system $filesystem is not shared (zfs share)."
+ fi
+
+ sleep 1
+ done
#log_note "Sharing a shared file system fails."
zfs share $filesystem && \
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/cleanup.ksh
index d247991fbbdb..d9f935900f90 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/setup.ksh
index b3f2b0262687..b76d7c5f2560 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot.cfg b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot.cfg
index fb22367be869..cbad8a572067 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_001_neg.ksh
index 2b89af9e5a43..2b883e4943ef 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_002_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_002_neg.ksh
index 4ae68d411dd0..11904554a49c 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_003_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_003_neg.ksh
index ca8ff8ca4357..7b6b01da07cb 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_003_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_003_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_004_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_004_neg.ksh
index 62bf71390c70..53f3015393eb 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_004_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_004_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_005_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_005_neg.ksh
index be5bbc8346d6..c9f9803c673e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_005_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_005_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_006_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_006_pos.ksh
index 6b711286c68d..785ea8659705 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_007_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_007_neg.ksh
index 40b936dee977..5d1840447fc4 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_007_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_007_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_008_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_008_neg.ksh
index 627910abd6ed..a2f890f15f32 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_008_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_008_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/cleanup.ksh
index 7d6a7e13db22..a2ee99c24171 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/setup.ksh
index 261bce4386e9..f40ac985e80c 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfeature_set_unsupported.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfeature_set_unsupported.ksh
index c9d24224337f..523b30ff9bfe 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfeature_set_unsupported.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfeature_set_unsupported.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfs_get_unsupported.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfs_get_unsupported.ksh
index 59ed7e9500dd..1d52498de0dc 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfs_get_unsupported.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfs_get_unsupported.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfs_set_unsupported.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfs_set_unsupported.ksh
index 5a0b88a0b14d..5bb46ec973ad 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfs_set_unsupported.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfs_set_unsupported.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfs_sysfs_live.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfs_sysfs_live.ksh
index 4bb5cc2e05ba..08a9aeaa9bad 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfs_sysfs_live.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfs_sysfs_live.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zpool_get_unsupported.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zpool_get_unsupported.ksh
index 3ab1d941e860..3624a7e8de5b 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zpool_get_unsupported.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zpool_get_unsupported.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zpool_set_unsupported.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zpool_set_unsupported.ksh
index 03eb2aea3fdd..a2f0c7a26405 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zpool_set_unsupported.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zpool_set_unsupported.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unload-key/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unload-key/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unload-key/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unload-key/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unload-key/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unload-key/setup.ksh
index 6a9af3bc28c3..4c719075a741 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unload-key/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unload-key/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/setup.ksh
index 6a9af3bc28c3..4c719075a741 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount.cfg b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount.cfg
index c8e46895d2a6..06d25faf0356 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount.kshlib b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount.kshlib
index 3fc5509a612e..929452403b2e 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_001_pos.ksh
index 6036eb27a062..6395a1b64363 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_002_pos.ksh
index b8a50785868f..c5cabbde1642 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_003_pos.ksh
index 985c3d2b1fe2..e4b292436a29 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_004_pos.ksh
index bcc25ccd0f80..e139321e04ab 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_005_pos.ksh
index eaea4696dfb4..23963ceaa82c 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_006_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_006_pos.ksh
index 0afb9b6f8501..aca84ed39856 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_007_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_007_neg.ksh
index cdf4a5a26661..1a8665b86ea8 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_007_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_007_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_008_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_008_neg.ksh
index e85a0f3cbf68..3524efcd076d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_008_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_008_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_009_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_009_pos.ksh
index 814d603db5e0..ece19ca1bbdf 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_009_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_009_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_all_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_all_001_pos.ksh
index b5a01b53aeab..f98d48ad92d3 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_all_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_all_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_unload_keys.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_unload_keys.ksh
index c92287ad75e4..d296118e1924 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_unload_keys.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unmount/zfs_unmount_unload_keys.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_001_pos.ksh
index 3955f0ee3590..4f0ef6bd389f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_002_pos.ksh
index 2fb8ae7814ea..e5f786e0ae28 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_003_pos.ksh
index 6e66deda9bee..6d081ab6ee89 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_004_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_004_neg.ksh
index fd916040b1bc..bae5e335158b 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_004_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_004_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_005_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_005_neg.ksh
index 7df3136dd6b4..0404e0d6ede5 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_005_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_005_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_006_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_006_pos.ksh
index b6e5178cf2bb..ab8bfa3791b7 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_007_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_007_pos.ksh
index 36817a092099..0fc5bbaf3f6a 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_008_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_008_pos.ksh
index 21d5ac79bbdc..1ade9c92691e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/cleanup.ksh
index e2d0604fded2..6b9dbd6b6dfa 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/setup.ksh
index c9f36017df9a..ab5ca7b27e6f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade.kshlib b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade.kshlib
index 9c7d273b385c..948123e81157 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_001_pos.ksh
index db8b96f50568..7f5f65978ebf 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_002_pos.ksh
index 994ee2b3475a..ea5baf8e5483 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_003_pos.ksh
index 57f74ca28513..e2a85ada96aa 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_004_pos.ksh
index 0b8fef5cd043..5367503f270d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_005_pos.ksh
index 5fcdc6e26852..ab200674b098 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_006_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_006_neg.ksh
index f5eef319330b..9c4eab3ff79e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_006_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_006_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_007_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_007_neg.ksh
index 6c6f94754d3c..a7d366e650ea 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_007_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_upgrade/zfs_upgrade_007_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zhack/library.kshlib b/tests/zfs-tests/tests/functional/cli_root/zhack/library.kshlib
new file mode 100644
index 000000000000..880a78861630
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zhack/library.kshlib
@@ -0,0 +1,361 @@
+#!/bin/ksh
+
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2021 by vStack. All rights reserved.
+#
+
+. "$STF_SUITE"/include/libtest.shlib
+. "$STF_SUITE"/include/blkdev.shlib
+
+#
+# Description:
+#
+# Test whether zhack label repair commands can recover detached devices
+# and corrupted checksums with a variety of sizes, and ensure
+# the purposes of either command is cleanly separated from the others.
+#
+# Strategy:
+#
+# Tests are done on loopback devices with sizes divisible by label size and sizes that are not.
+#
+# Test one:
+#
+# 1. Create pool on a loopback device with some test data
+# 2. Export the pool.
+# 3. Corrupt all label checksums in the pool
+# 4. Check that pool cannot be imported
+# 5. Verify that it cannot be imported after using zhack label repair -u
+# to ensure that the -u option will quit on corrupted checksums.
+# 6. Use zhack label repair -c on device
+# 7. Check that pool can be imported and that data is intact
+#
+# Test two:
+#
+# 1. Create pool on a loopback device with some test data
+# 2. Detach either device from the mirror
+# 3. Export the pool
+# 4. Remove the non-detached device and its backing file
+# 5. Verify that the remaining detached device cannot be imported
+# 6. Verify that it cannot be imported after using zhack label repair -c
+# to ensure that the -c option will not undetach a device.
+# 7. Use zhack label repair -u on device
+# 8. Verify that the detached device can be imported and that data is intact
+#
+# Test three:
+#
+# 1. Create pool on a loopback device with some test data
+# 2. Detach either device from the mirror
+# 3. Export the pool
+# 4. Remove the non-detached device and its backing file
+# 5. Corrupt all label checksums on the remaining device
+# 6. Verify that the remaining detached device cannot be imported
+# 7. Verify that it cannot be imported after using zhack label repair -u
+# to ensure that the -u option will quit on corrupted checksums.
+# 8. Verify that it cannot be imported after using zhack label repair -c
+# -c should repair the checksums, but not undetach a device.
+# 9. Use zhack label repair -u on device
+# 10. Verify that the detached device can be imported and that data is intact
+#
+# Test four:
+#
+# 1. Create pool on a loopback device with some test data
+# 2. Detach either device from the mirror
+# 3. Export the pool
+# 4. Remove the non-detached device and its backing file
+# 5. Corrupt all label checksums on the remaining device
+# 6. Verify that the remaining detached device cannot be imported
+# 7. Use zhack label repair -cu on device to attempt to fix checksums and
+# undetach the device in a single operation.
+# 8. Verify that the detached device can be imported and that data is intact
+#
+
+log_assert "Verify zhack label repair <operation> <vdev> will repair label checksums and uberblocks"
+log_onexit cleanup
+
+LABEL_SIZE="$((2**18))"
+LABEL_NVLIST_END="$((LABEL_SIZE / 2))"
+LABEL_CKSUM_SIZE="32"
+LABEL_CKSUM_START="$(( LABEL_NVLIST_END - LABEL_CKSUM_SIZE ))"
+
+VIRTUAL_DISK=$TEST_BASE_DIR/disk
+VIRTUAL_MIRROR_DISK=$TEST_BASE_DIR/mirrordisk
+
+VIRTUAL_DEVICE=
+VIRTUAL_MIRROR_DEVICE=
+
+function cleanup_lo
+{
+ L_DEVICE="$1"
+
+ if [[ -e $L_DEVICE ]]; then
+ if is_linux; then
+ log_must losetup -d "$L_DEVICE"
+ elif is_freebsd; then
+ log_must mdconfig -d -u "$L_DEVICE"
+ else
+ log_must lofiadm -d "$L_DEVICE"
+ fi
+ fi
+}
+
+function cleanup
+{
+ poolexists "$TESTPOOL" && destroy_pool "$TESTPOOL"
+ cleanup_lo "$VIRTUAL_DEVICE"
+ cleanup_lo "$VIRTUAL_MIRROR_DEVICE"
+ VIRTUAL_DEVICE=
+ VIRTUAL_MIRROR_DEVICE=
+ [[ -f "$VIRTUAL_DISK" ]] && log_must rm "$VIRTUAL_DISK"
+ [[ -f "$VIRTUAL_MIRROR_DISK" ]] && log_must rm "$VIRTUAL_MIRROR_DISK"
+}
+
+RAND_MAX="$((2**15 - 1))"
+function get_devsize
+{
+ if [ "$RANDOM" -gt "$(( RAND_MAX / 2 ))" ]; then
+ echo "$(( MINVDEVSIZE + RANDOM ))"
+ else
+ echo "$MINVDEVSIZE"
+ fi
+}
+
+function pick_logop
+{
+ L_SHOULD_SUCCEED="$1"
+
+ l_logop="log_mustnot"
+ if [ "$L_SHOULD_SUCCEED" == true ]; then
+ l_logop="log_must"
+ fi
+
+ echo "$l_logop"
+}
+
+function check_dataset
+{
+ L_SHOULD_SUCCEED="$1"
+ L_LOGOP="$(pick_logop "$L_SHOULD_SUCCEED")"
+
+ "$L_LOGOP" mounted "$TESTPOOL"/"$TESTFS"
+
+ "$L_LOGOP" test -f "$TESTDIR"/"test"
+}
+
+function setup_dataset
+{
+ log_must zfs create "$TESTPOOL"/"$TESTFS"
+
+ log_must mkdir -p "$TESTDIR"
+ log_must zfs set mountpoint="$TESTDIR" "$TESTPOOL"/"$TESTFS"
+
+ log_must mounted "$TESTPOOL"/"$TESTFS"
+
+ log_must touch "$TESTDIR"/"test"
+ log_must test -f "$TESTDIR"/"test"
+
+ log_must zpool sync "$TESTPOOL"
+
+ check_dataset true
+}
+
+function get_practical_size
+{
+ L_SIZE="$1"
+
+ if [ "$((L_SIZE % LABEL_SIZE))" -ne 0 ]; then
+ echo "$(((L_SIZE / LABEL_SIZE) * LABEL_SIZE))"
+ else
+ echo "$L_SIZE"
+ fi
+}
+
+function corrupt_sized_label_checksum
+{
+ L_SIZE="$1"
+ L_LABEL="$2"
+ L_DEVICE="$3"
+
+ L_PRACTICAL_SIZE="$(get_practical_size "$L_SIZE")"
+
+ typeset -a L_OFFSETS=("$LABEL_CKSUM_START" \
+ "$((LABEL_SIZE + LABEL_CKSUM_START))" \
+ "$(((L_PRACTICAL_SIZE - LABEL_SIZE*2) + LABEL_CKSUM_START))" \
+ "$(((L_PRACTICAL_SIZE - LABEL_SIZE) + LABEL_CKSUM_START))")
+
+ dd if=/dev/urandom of="$L_DEVICE" \
+ seek="${L_OFFSETS["$L_LABEL"]}" bs=1 count="$LABEL_CKSUM_SIZE" \
+ conv=notrunc
+}
+
+function corrupt_labels
+{
+ L_SIZE="$1"
+ L_DISK="$2"
+
+ corrupt_sized_label_checksum "$L_SIZE" 0 "$L_DISK"
+ corrupt_sized_label_checksum "$L_SIZE" 1 "$L_DISK"
+ corrupt_sized_label_checksum "$L_SIZE" 2 "$L_DISK"
+ corrupt_sized_label_checksum "$L_SIZE" 3 "$L_DISK"
+}
+
+function try_import_and_repair
+{
+ L_REPAIR_SHOULD_SUCCEED="$1"
+ L_IMPORT_SHOULD_SUCCEED="$2"
+ L_OP="$3"
+ L_POOLDISK="$4"
+ L_REPAIR_LOGOP="$(pick_logop "$L_REPAIR_SHOULD_SUCCEED")"
+ L_IMPORT_LOGOP="$(pick_logop "$L_IMPORT_SHOULD_SUCCEED")"
+
+ log_mustnot zpool import "$TESTPOOL" -d "$L_POOLDISK"
+
+ "$L_REPAIR_LOGOP" zhack label repair "$L_OP" "$L_POOLDISK"
+
+ "$L_IMPORT_LOGOP" zpool import "$TESTPOOL" -d "$L_POOLDISK"
+
+ check_dataset "$L_IMPORT_SHOULD_SUCCEED"
+}
+
+function prepare_vdev
+{
+ L_SIZE="$1"
+ L_BACKFILE="$2"
+
+ l_devname=
+ if truncate -s "$L_SIZE" "$L_BACKFILE"; then
+ if is_linux; then
+ l_devname="$(losetup -f "$L_BACKFILE" --show)"
+ elif is_freebsd; then
+ l_devname=/dev/"$(mdconfig -a -t vnode -f "$L_BACKFILE")"
+ else
+ l_devname="$(lofiadm -a "$L_BACKFILE")"
+ fi
+ fi
+ echo "$l_devname"
+}
+
+function run_test_one
+{
+ L_SIZE="$1"
+
+ VIRTUAL_DEVICE="$(prepare_vdev "$L_SIZE" "$VIRTUAL_DISK")"
+ log_must test -e "$VIRTUAL_DEVICE"
+
+ log_must zpool create "$TESTPOOL" "$VIRTUAL_DEVICE"
+
+ setup_dataset
+
+ log_must zpool export "$TESTPOOL"
+
+ corrupt_labels "$L_SIZE" "$VIRTUAL_DISK"
+
+ try_import_and_repair false false "-u" "$VIRTUAL_DEVICE"
+
+ try_import_and_repair true true "-c" "$VIRTUAL_DEVICE"
+
+ cleanup
+
+ log_pass "zhack label repair corruption test passed with a randomized size of $L_SIZE"
+}
+
+function make_mirrored_pool
+{
+ L_SIZE="$1"
+
+ VIRTUAL_DEVICE="$(prepare_vdev "$L_SIZE" "$VIRTUAL_DISK")"
+ log_must test -e "$VIRTUAL_DEVICE"
+ VIRTUAL_MIRROR_DEVICE="$(prepare_vdev "$L_SIZE" "$VIRTUAL_MIRROR_DISK")"
+ log_must test -e "$VIRTUAL_MIRROR_DEVICE"
+
+ log_must zpool create "$TESTPOOL" "$VIRTUAL_DEVICE"
+ log_must zpool attach "$TESTPOOL" "$VIRTUAL_DEVICE" "$VIRTUAL_MIRROR_DEVICE"
+}
+
+function export_and_cleanup_vdisk
+{
+ log_must zpool export "$TESTPOOL"
+
+ cleanup_lo "$VIRTUAL_DEVICE"
+
+ VIRTUAL_DEVICE=
+
+ log_must rm "$VIRTUAL_DISK"
+}
+
+function run_test_two
+{
+ L_SIZE="$1"
+
+ make_mirrored_pool "$L_SIZE"
+
+ setup_dataset
+
+ log_must zpool detach "$TESTPOOL" "$VIRTUAL_MIRROR_DEVICE"
+
+ export_and_cleanup_vdisk
+
+ try_import_and_repair false false "-c" "$VIRTUAL_MIRROR_DEVICE"
+
+ try_import_and_repair true true "-u" "$VIRTUAL_MIRROR_DEVICE"
+
+ cleanup
+
+ log_pass "zhack label repair detached test passed with a randomized size of $L_SIZE"
+}
+
+function run_test_three
+{
+ L_SIZE="$1"
+
+ make_mirrored_pool "$L_SIZE"
+
+ setup_dataset
+
+ log_must zpool detach "$TESTPOOL" "$VIRTUAL_MIRROR_DEVICE"
+
+ export_and_cleanup_vdisk
+
+ corrupt_labels "$L_SIZE" "$VIRTUAL_MIRROR_DISK"
+
+ try_import_and_repair false false "-u" "$VIRTUAL_MIRROR_DEVICE"
+
+ try_import_and_repair true false "-c" "$VIRTUAL_MIRROR_DEVICE"
+
+ try_import_and_repair true true "-u" "$VIRTUAL_MIRROR_DEVICE"
+
+ cleanup
+
+ log_pass "zhack label repair corruption and detached test passed with a randomized size of $L_SIZE"
+}
+
+function run_test_four
+{
+ L_SIZE="$1"
+
+ make_mirrored_pool "$L_SIZE"
+
+ setup_dataset
+
+ log_must zpool detach "$TESTPOOL" "$VIRTUAL_MIRROR_DEVICE"
+
+ export_and_cleanup_vdisk
+
+ corrupt_labels "$L_SIZE" "$VIRTUAL_MIRROR_DISK"
+
+ try_import_and_repair true true "-cu" "$VIRTUAL_MIRROR_DEVICE"
+
+ cleanup
+
+ log_pass "zhack label repair corruption and detached single-command test passed with a randomized size of $L_SIZE."
+}
diff --git a/tests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_checksum.ksh b/tests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_checksum.ksh
deleted file mode 100755
index 67c7e7c4487d..000000000000
--- a/tests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_checksum.ksh
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/ksh
-
-#
-# This file and its contents are supplied under the terms of the
-# Common Development and Distribution License ("CDDL"), version 1.0.
-# You may only use this file in accordance with the terms of version
-# 1.0 of the CDDL.
-#
-# A full copy of the text of the CDDL should have accompanied this
-# source. A copy of the CDDL is also available via the Internet at
-# http://www.illumos.org/license/CDDL.
-#
-
-#
-# Copyright (c) 2021 by vStack. All rights reserved.
-#
-
-. $STF_SUITE/include/libtest.shlib
-. $STF_SUITE/include/blkdev.shlib
-
-#
-# Description:
-# zhack label repair <vdev> will calculate and rewrite label checksum if invalid
-#
-# Strategy:
-# 1. Create pool with some number of vdevs and export it
-# 2. Corrupt all labels checksums
-# 3. Check that pool cannot be imported
-# 4. Use zhack to repair labels checksums
-# 5. Check that pool can be imported
-#
-
-log_assert "Verify zhack label repair <vdev> will repair labels checksums"
-log_onexit cleanup
-
-VIRTUAL_DISK=$TEST_BASE_DIR/disk
-
-function cleanup
-{
- poolexists $TESTPOOL && destroy_pool $TESTPOOL
- [[ -f $VIRTUAL_DISK ]] && log_must rm $VIRTUAL_DISK
-}
-
-log_must truncate -s $(($MINVDEVSIZE * 8)) $VIRTUAL_DISK
-
-log_must zpool create $TESTPOOL $VIRTUAL_DISK
-log_must zpool export $TESTPOOL
-
-log_mustnot zhack label repair $VIRTUAL_DISK
-
-corrupt_label_checksum 0 $VIRTUAL_DISK
-corrupt_label_checksum 1 $VIRTUAL_DISK
-corrupt_label_checksum 2 $VIRTUAL_DISK
-corrupt_label_checksum 3 $VIRTUAL_DISK
-
-log_mustnot zpool import $TESTPOOL -d $TEST_BASE_DIR
-
-log_must zhack label repair $VIRTUAL_DISK
-
-log_must zpool import $TESTPOOL -d $TEST_BASE_DIR
-
-cleanup
-
-log_pass "zhack label repair works correctly."
diff --git a/tests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_repair_001.ksh b/tests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_repair_001.ksh
new file mode 100755
index 000000000000..2a511e9efcb6
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_repair_001.ksh
@@ -0,0 +1,30 @@
+#!/bin/ksh
+
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+
+#
+# Description:
+#
+# Test whether zhack label repair can recover
+# corrupted checksums on devices of varied size,
+# but not undetached devices.
+#
+# Strategy:
+#
+# 1. Create pool on a loopback device with some test data
+# 2. Export the pool.
+# 3. Corrupt all label checksums in the pool
+# 4. Check that pool cannot be imported
+# 5. Verify that it cannot be imported after using zhack label repair -u
+# to ensure that the -u option will quit on corrupted checksums.
+# 6. Use zhack label repair -c on device
+# 7. Check that pool can be imported and that data is intact
+
+. "$STF_SUITE"/tests/functional/cli_root/zhack/library.kshlib
+
+run_test_one "$(get_devsize)"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_repair_002.ksh b/tests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_repair_002.ksh
new file mode 100755
index 000000000000..4f1e61a39857
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_repair_002.ksh
@@ -0,0 +1,31 @@
+#!/bin/ksh
+
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+
+#
+# Description:
+#
+# Test whether zhack label repair can recover
+# detached drives on devices of varied size, but not
+# repair corrupted checksums.
+#
+# Strategy:
+#
+# 1. Create pool on a loopback device with some test data
+# 2. Detach either device from the mirror
+# 3. Export the pool
+# 4. Remove the non-detached device and its backing file
+# 5. Verify that the remaining detached device cannot be imported
+# 6. Verify that it cannot be imported after using zhack label repair -c
+# to ensure that the -c option will not undetach a device.
+# 7. Use zhack label repair -u on device
+# 8. Verify that the detached device can be imported and that data is intact
+
+. "$STF_SUITE"/tests/functional/cli_root/zhack/library.kshlib
+
+run_test_two "$(get_devsize)"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_repair_003.ksh b/tests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_repair_003.ksh
new file mode 100755
index 000000000000..7e82363d2f46
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_repair_003.ksh
@@ -0,0 +1,33 @@
+#!/bin/ksh
+
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+
+#
+# Description:
+#
+# Test whether zhack label repair can recover a device of varied size with
+# corrupted checksums and which has been detached.
+#
+# Strategy:
+#
+# 1. Create pool on a loopback device with some test data
+# 2. Detach either device from the mirror
+# 3. Export the pool
+# 4. Remove the non-detached device and its backing file
+# 5. Corrupt all label checksums on the remaining device
+# 6. Verify that the remaining detached device cannot be imported
+# 7. Verify that it cannot be imported after using zhack label repair -u
+# to ensure that the -u option will quit on corrupted checksums.
+# 8. Verify that it cannot be imported after using zhack label repair -c
+# -c should repair the checksums, but not undetach a device.
+# 9. Use zhack label repair -u on device
+# 10. Verify that the detached device can be imported and that data is intact
+
+. "$STF_SUITE"/tests/functional/cli_root/zhack/library.kshlib
+
+run_test_three "$(get_devsize)"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_repair_004.ksh b/tests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_repair_004.ksh
new file mode 100755
index 000000000000..0b739402b199
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_repair_004.ksh
@@ -0,0 +1,30 @@
+#!/bin/ksh
+
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+
+#
+# Description:
+#
+# Test whether zhack label repair can recover a device of varied size with
+# corrupted checksums and which has been detached (in one command).
+#
+# Strategy:
+#
+# 1. Create pool on a loopback device with some test data
+# 2. Detach either device from the mirror
+# 3. Export the pool
+# 4. Remove the non-detached device and its backing file
+# 5. Corrupt all label checksums on the remaining device
+# 6. Verify that the remaining detached device cannot be imported
+# 7. Use zhack label repair -cu on device to attempt to fix checksums and
+# undetach the device in a single operation.
+# 8. Verify that the detached device can be imported and that data is intact
+
+. "$STF_SUITE"/tests/functional/cli_root/zhack/library.kshlib
+
+run_test_four "$(get_devsize)"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zinject/zinject_args.ksh b/tests/zfs-tests/tests/functional/cli_root/zinject/zinject_args.ksh
new file mode 100755
index 000000000000..dd9ef9ddd229
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zinject/zinject_args.ksh
@@ -0,0 +1,62 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2024, Klara Inc.
+#
+
+#
+# TODO: this only checks that the set of valid device fault types. It should
+# check all the other options, and that they work, and everything really.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+verify_runnable "global"
+
+log_assert "Check zinject parameters."
+
+log_onexit cleanup
+
+DISK1=${DISKS%% *}
+
+function cleanup
+{
+ zinject -c all
+ default_cleanup_noexit
+}
+
+function test_device_fault
+{
+ typeset -a errno=("io" "decompress" "decrypt" "nxio" "dtl" "corrupt" "noop")
+ for e in ${errno[@]}; do
+ log_must eval \
+ "zinject -d $DISK1 -e $e -T read -f 0.001 $TESTPOOL"
+ done
+ zinject -c all
+}
+
+default_mirror_setup_noexit $DISKS
+
+test_device_fault
+
+log_pass "zinject parameters work as expected."
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool/setup.ksh
index 4e3b6b0e9f47..200e914f3f5b 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool/zpool_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool/zpool_001_neg.ksh
index 25decd78863b..de4ca0c4ea2c 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool/zpool_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool/zpool_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool/zpool_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool/zpool_002_pos.ksh
index ef88925dc92f..bd564cc6d8c3 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool/zpool_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool/zpool_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool/zpool_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool/zpool_003_pos.ksh
index 00f24bdff020..215af6188420 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool/zpool_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool/zpool_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/add-o_ashift.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_add/add-o_ashift.ksh
index 80a2213d9aa8..51871934dd22 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/add-o_ashift.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/add-o_ashift.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -22,7 +22,7 @@
#
# Copyright 2017, loli10K. All rights reserved.
-# Copyright (c) 2020 by Delphix. All rights reserved.
+# Copyright (c) 2020, 2024 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
@@ -44,7 +44,7 @@ verify_runnable "global"
function cleanup
{
- log_must set_tunable64 VDEV_FILE_PHYSICAL_ASHIFT $orig_ashift
+ log_must set_tunable32 VDEV_FILE_PHYSICAL_ASHIFT $orig_ashift
poolexists $TESTPOOL && destroy_pool $TESTPOOL
rm -f $disk1 $disk2
}
@@ -57,13 +57,26 @@ disk2=$TEST_BASE_DIR/disk2
log_must mkfile $SIZE $disk1
log_must mkfile $SIZE $disk2
+logical_ashift=$(get_tunable VDEV_FILE_LOGICAL_ASHIFT)
orig_ashift=$(get_tunable VDEV_FILE_PHYSICAL_ASHIFT)
+max_auto_ashift=$(get_tunable VDEV_MAX_AUTO_ASHIFT)
+opt=""
typeset ashifts=("9" "10" "11" "12" "13" "14" "15" "16")
for ashift in ${ashifts[@]}
do
+ #
+ # Need to add the --allow-ashift-mismatch option to disable the
+ # ashift mismatch checks in zpool add.
+ #
+ if [[ $ashift -eq $orig_ashift ]]; then
+ opt=""
+ else
+ opt="--allow-ashift-mismatch"
+ fi
+
log_must zpool create $TESTPOOL $disk1
- log_must zpool add -o ashift=$ashift $TESTPOOL $disk2
+ log_must zpool add $opt -o ashift=$ashift $TESTPOOL $disk2
log_must verify_ashift $disk2 $ashift
# clean things for the next run
@@ -75,12 +88,13 @@ do
# Make sure we can also set the ashift using the tunable.
#
log_must zpool create $TESTPOOL $disk1
- log_must set_tunable64 VDEV_FILE_PHYSICAL_ASHIFT $ashift
- log_must zpool add $TESTPOOL $disk2
- log_must verify_ashift $disk2 $ashift
+ log_must set_tunable32 VDEV_FILE_PHYSICAL_ASHIFT $ashift
+ log_must zpool add $opt $TESTPOOL $disk2
+ exp=$(( (ashift <= max_auto_ashift) ? ashift : logical_ashift ))
+ log_must verify_ashift $disk2 $exp
# clean things for the next run
- log_must set_tunable64 VDEV_FILE_PHYSICAL_ASHIFT $orig_ashift
+ log_must set_tunable32 VDEV_FILE_PHYSICAL_ASHIFT $orig_ashift
log_must zpool destroy $TESTPOOL
log_must zpool labelclear $disk1
log_must zpool labelclear $disk2
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/add_nested_replacing_spare.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_add/add_nested_replacing_spare.ksh
index 677d0762eecb..e86de0deae62 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/add_nested_replacing_spare.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/add_nested_replacing_spare.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/add_prop_ashift.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_add/add_prop_ashift.ksh
index df04ecc5b89e..6a3283d0618f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/add_prop_ashift.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/add_prop_ashift.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -22,7 +22,7 @@
#
# Copyright 2017, loli10K. All rights reserved.
-# Copyright (c) 2020 by Delphix. All rights reserved.
+# Copyright (c) 2020, 2024 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
@@ -44,7 +44,7 @@ verify_runnable "global"
function cleanup
{
- log_must set_tunable64 VDEV_FILE_PHYSICAL_ASHIFT $orig_ashift
+ log_must set_tunable32 VDEV_FILE_PHYSICAL_ASHIFT $orig_ashift
poolexists $TESTPOOL && destroy_pool $TESTPOOL
log_must rm -f $disk1 $disk2
}
@@ -63,13 +63,18 @@ orig_ashift=$(get_tunable VDEV_FILE_PHYSICAL_ASHIFT)
# the ashift using the -o ashift property should still
# be honored.
#
-log_must set_tunable64 VDEV_FILE_PHYSICAL_ASHIFT 16
+log_must set_tunable32 VDEV_FILE_PHYSICAL_ASHIFT 16
typeset ashifts=("9" "10" "11" "12" "13" "14" "15" "16")
for ashift in ${ashifts[@]}
do
+ if [ $ashift -eq $orig_ashift ];then
+ opt=""
+ else
+ opt="--allow-ashift-mismatch"
+ fi
log_must zpool create -o ashift=$ashift $TESTPOOL $disk1
- log_must zpool add $TESTPOOL $disk2
+ log_must zpool add $opt $TESTPOOL $disk2
log_must verify_ashift $disk2 $ashift
# clean things for the next run
@@ -82,8 +87,13 @@ for ashift in ${ashifts[@]}
do
for cmdval in ${ashifts[@]}
do
+ if [ $ashift -eq $cmdval ];then
+ opt=""
+ else
+ opt="--allow-ashift-mismatch"
+ fi
log_must zpool create -o ashift=$ashift $TESTPOOL $disk1
- log_must zpool add -o ashift=$cmdval $TESTPOOL $disk2
+ log_must zpool add $opt -o ashift=$cmdval $TESTPOOL $disk2
log_must verify_ashift $disk2 $cmdval
# clean things for the next run
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_add/cleanup.ksh
index 33bd94fdc4f9..f3691e9207a9 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_add/setup.ksh
index 13bd33ee42aa..ef19ba998678 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add--allow-ashift-mismatch.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add--allow-ashift-mismatch.ksh
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add--allow-ashift-mismatch.ksh
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add.cfg b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add.cfg
index a634b8b3c617..1831e6563e8c 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add.kshlib b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add.kshlib
index e10357340b40..cc850e3e451f 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_001_pos.ksh
index 191ec839a955..9ef96f554744 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_002_pos.ksh
index 67810bbf985b..afee34a33469 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -65,4 +65,15 @@ log_mustnot vdevs_in_pool $TESTPOOL $DISK2
log_must zpool add -f $TESTPOOL $DISK2
log_must vdevs_in_pool $TESTPOOL $DISK2
+log_must zpool destroy $TESTPOOL
+
+create_pool $TESTPOOL mirror $DISK0 $DISK1
+log_must poolexists $TESTPOOL
+
+log_mustnot zpool add $TESTPOOL $DISK2
+log_mustnot vdevs_in_pool $TESTPOOL $DISK2
+
+log_must zpool add --allow-replication-mismatch $TESTPOOL $DISK2
+log_must vdevs_in_pool $TESTPOOL $DISK2
+
log_pass "'zpool add -f <pool> <vdev> ...' executes successfully."
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_003_pos.ksh
index 3816444667cf..62eddff7f6b6 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_004_pos.ksh
index 64e52960d3d6..cecda56ab125 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -70,8 +70,12 @@ if is_freebsd; then
recursive=$(get_tunable VOL_RECURSIVE)
log_must set_tunable64 VOL_RECURSIVE 1
fi
-log_must zpool add $TESTPOOL $ZVOL_DEVDIR/$TESTPOOL1/$TESTVOL
+log_must zpool add --allow-ashift-mismatch $TESTPOOL $ZVOL_DEVDIR/$TESTPOOL1/$TESTVOL
log_must vdevs_in_pool "$TESTPOOL" "$ZVOL_DEVDIR/$TESTPOOL1/$TESTVOL"
+# Give zed a chance to finish processing the event, otherwise
+# a race condition can lead to stuck "zpool destroy $TESTPOOL"
+sleep 1
+
log_pass "'zpool add <pool> <vdev> ...' adds zfs volume to the pool successfully"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_005_pos.ksh
index c40f8db6f026..0e9d9f5f030f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -75,7 +75,9 @@ log_must poolexists $TESTPOOL1
unset NOINUSE_CHECK
log_mustnot zpool add -f $TESTPOOL $DISK1
+log_mustnot zpool add --allow-in-use $TESTPOOL $DISK1
log_mustnot zpool add -f $TESTPOOL $mnttab_dev
+log_mustnot zpool add --allow-in-use $TESTPOOL $mnttab_dev
if is_linux; then
log_mustnot zpool add $TESTPOOL $vfstab_dev
else
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_006_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_006_pos.ksh
index 2c3f488ea267..836d6d21c746 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_007_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_007_neg.ksh
index 4e9535c1c6b5..a7df42fc788f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_007_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_007_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_008_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_008_neg.ksh
index 77a899f70c83..c43f90792a9d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_008_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_008_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_009_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_009_neg.ksh
index 0a9fa868cb81..a13a27160e76 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_009_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_009_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -64,7 +64,9 @@ log_mustnot zpool add -f $TESTPOOL $DISK0
for type in "" "mirror" "raidz" "draid" "spare" "log" "dedup" "special" "cache"
do
log_mustnot zpool add -f $TESTPOOL $type $DISK0 $DISK1
+ log_mustnot zpool add --allow-in-use $TESTPOOL $type $DISK0 $DISK1
log_mustnot zpool add -f $TESTPOOL $type $DISK1 $DISK1
+ log_mustnot zpool add --allow-in-use $TESTPOOL $type $DISK1 $DISK1
done
log_pass "'zpool add' get fail as expected if vdevs are the same or vdev is " \
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_010_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_010_pos.ksh
index 771b689c93fd..22860e9caf1d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_010_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_010_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -138,7 +138,7 @@ function zpool_create_forced_add
while ((j < ${#add_args[@]})); do
log_must zpool create $TESTPOOL1 ${create_args[$i]}
log_mustnot zpool add $TESTPOOL1 ${add_args[$j]}
- log_must zpool add -f $TESTPOOL1 ${add_args[$j]}
+ log_must zpool add --allow-replication-mismatch $TESTPOOL1 ${add_args[$j]}
log_must zpool destroy -f $TESTPOOL1
((j += 1))
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_dryrun_output.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_dryrun_output.ksh
index 73dec9240326..fa1ce9c64d33 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_dryrun_output.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_dryrun_output.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_attach/attach-o_ashift.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_attach/attach-o_ashift.ksh
index 745f60507bed..574cb7654d10 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_attach/attach-o_ashift.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_attach/attach-o_ashift.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -35,14 +35,14 @@
#
# STRATEGY:
# 1. Create various pools with different ashift values.
-# 2. Verify 'attach -o ashift=<n>' works only with allowed values.
+# 2. Verify 'attach' works.
#
verify_runnable "global"
function cleanup
{
- log_must set_tunable64 VDEV_FILE_PHYSICAL_ASHIFT $orig_ashift
+ log_must set_tunable32 VDEV_FILE_PHYSICAL_ASHIFT $orig_ashift
poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1
rm -f $disk1 $disk2
}
@@ -61,31 +61,19 @@ orig_ashift=$(get_tunable VDEV_FILE_PHYSICAL_ASHIFT)
# the ashift using the -o ashift property should still
# be honored.
#
-log_must set_tunable64 VDEV_FILE_PHYSICAL_ASHIFT 16
+log_must set_tunable32 VDEV_FILE_PHYSICAL_ASHIFT 16
typeset ashifts=("9" "10" "11" "12" "13" "14" "15" "16")
for ashift in ${ashifts[@]}
do
- for cmdval in ${ashifts[@]}
- do
- log_must zpool create -o ashift=$ashift $TESTPOOL1 $disk1
- log_must verify_ashift $disk1 $ashift
-
- # ashift_of(attached_disk) <= ashift_of(existing_vdev)
- if [[ $cmdval -le $ashift ]]
- then
- log_must zpool attach -o ashift=$cmdval $TESTPOOL1 \
- $disk1 $disk2
- log_must verify_ashift $disk2 $ashift
- else
- log_mustnot zpool attach -o ashift=$cmdval $TESTPOOL1 \
- $disk1 $disk2
- fi
- # clean things for the next run
- log_must zpool destroy $TESTPOOL1
- log_must zpool labelclear $disk1
- log_must zpool labelclear $disk2
- done
+ log_must zpool create -o ashift=$ashift $TESTPOOL1 $disk1
+ log_must verify_ashift $disk1 $ashift
+ log_must zpool attach $TESTPOOL1 $disk1 $disk2
+ log_must verify_ashift $disk2 $ashift
+ # clean things for the next run
+ log_must zpool destroy $TESTPOOL1
+ log_must zpool labelclear $disk1
+ log_must zpool labelclear $disk2
done
typeset badvals=("off" "on" "1" "8" "17" "1b" "ff" "-")
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_attach/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_attach/cleanup.ksh
index 89c146249e71..3167a5097b5a 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_attach/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_attach/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_attach/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_attach/setup.ksh
index 2229f87e6208..23dc57ed3679 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_attach/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_attach/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_attach/zpool_attach_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_attach/zpool_attach_001_neg.ksh
index 01b8e41ee439..50993a52a5e2 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_attach/zpool_attach_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_attach/zpool_attach_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_clear/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_clear/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_clear/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_clear/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_clear/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_clear/setup.ksh
index 6a9af3bc28c3..4c719075a741 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_clear/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_clear/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear.cfg b/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear.cfg
index e6977350af90..4b4b05c8993b 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_001_pos.ksh
index f1f926831baa..b1a295cd2337 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_002_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_002_neg.ksh
index 91a637b3377b..e8ba4e66420b 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_003_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_003_neg.ksh
index 637fdd84288b..46c07bf56076 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_003_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_003_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_readonly.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_readonly.ksh
index 9eb2a3608f17..e3d089d0469b 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_readonly.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_readonly.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/cleanup.ksh
index a50487754053..2bce044319c4 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/create-o_ashift.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/create-o_ashift.ksh
index 426321db06d6..f6f46cb98e90 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/create-o_ashift.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/create-o_ashift.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/setup.ksh
index 115126b1ac5b..f9e3add1ed68 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create.cfg b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create.cfg
index 976570d621b7..3f22136e7460 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create.shlib b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create.shlib
index 9954bc23fc9f..4987bc3a9dac 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create.shlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create.shlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_001_pos.ksh
index 42f57beae2a3..f24a9c705622 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_002_pos.ksh
index 2f709086f751..21df8eb2b1ff 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_003_pos.ksh
index dd8d0107aed2..ae81828b3e8c 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_004_pos.ksh
index 835cd1f547bd..9e73c29b3b00 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_005_pos.ksh
index 98f469108b15..26c0119242a1 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_006_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_006_pos.ksh
index 79b41fdaec90..37790c03fee3 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_007_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_007_neg.ksh
index 2873202cce91..ad0a282f731d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_007_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_007_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_008_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_008_pos.ksh
index 56bb64c64051..f33fb8a2281e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_009_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_009_neg.ksh
index e2f38990314c..bb74c9cdda5f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_009_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_009_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_010_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_010_neg.ksh
index 36bbaa7de33a..4bb9a6d8bb49 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_010_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_010_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_011_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_011_neg.ksh
index 9437033ae547..1dcbaff19eca 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_011_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_011_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_012_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_012_neg.ksh
index b9274c08b2ab..e3ed3f850958 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_012_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_012_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_014_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_014_neg.ksh
index 44ed950f7870..df14bde6b178 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_014_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_014_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_015_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_015_neg.ksh
index babf5ca9c66d..6e02b585a916 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_015_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_015_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_016_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_016_pos.ksh
index b3dd2cefc76c..eee869820f58 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_016_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_016_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_017_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_017_neg.ksh
index ded1e3c3966b..3892fbad165c 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_017_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_017_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_018_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_018_pos.ksh
index 6ad662f95011..6da1709071ba 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_018_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_018_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_019_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_019_pos.ksh
index 694ea2163c94..deddb8ba58a5 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_019_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_019_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_020_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_020_pos.ksh
index 39097df2fb59..5711d9f2686a 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_020_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_020_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_021_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_021_pos.ksh
index 264c75279d17..00e347897206 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_021_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_021_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_022_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_022_pos.ksh
index 717fcaa6ec51..0e9da881261e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_022_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_022_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_023_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_023_neg.ksh
index 780cf86d6c5e..d2ae03eee687 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_023_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_023_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_024_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_024_pos.ksh
index 3e3c9ce942b5..a09ae6abc972 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_024_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_024_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_001_pos.ksh
index 9717af505267..9e3e22db7cad 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_002_pos.ksh
index 2e1ff39311ab..acc3c06bacb0 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_003_pos.ksh
index 52cd00cf4ee4..8058691fcb12 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_004_pos.ksh
index 6b700fa362a4..dbcb6e5ce737 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_draid_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_dryrun_output.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_dryrun_output.ksh
index 1e4db20cfedf..485891c945a3 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_dryrun_output.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_dryrun_output.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_001_pos.ksh
index 67eff8edcf3b..38a7ec06076b 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_002_pos.ksh
index 7ad4ae805565..db79b31a91ca 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_003_pos.ksh
index c72edffde67d..032878dcb12b 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_004_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_004_neg.ksh
index 5c6b29c4939e..3dfaf22c15a1 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_004_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_004_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_005_pos.ksh
index a8ed95109f2a..4b0618017e38 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_006_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_006_pos.ksh
index fe98434d1bb6..292346ad96de 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_007_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_007_pos.ksh
index 8c812911b3b3..c7c133a219cd 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -34,6 +34,7 @@
# STRATEGY:
# 1. Create a pool with a known feature set.
# 2. Verify only those features are active/enabled.
+# 3. Do this for all known feature sets
#
verify_runnable "global"
@@ -47,8 +48,11 @@ log_onexit cleanup
log_assert "creates a pool with a specified feature set enabled"
-log_must zpool create -f -o compatibility=compat-2020 $TESTPOOL $DISKS
-check_feature_set $TESTPOOL compat-2020
-log_must zpool destroy -f $TESTPOOL
+for compat in "$ZPOOL_COMPAT_DIR"/*
+do
+ log_must zpool create -f -o compatibility="${compat##*/}" $TESTPOOL $DISKS
+ check_feature_set $TESTPOOL "${compat##*/}"
+ log_must zpool destroy -f $TESTPOOL
+done
log_pass "creates a pool with a specified feature set enabled"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_008_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_008_pos.ksh
index 0580d444e724..99db3d31a088 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_009_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_009_pos.ksh
index 052c18dcee2b..cd3111496461 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_009_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_009_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy.cfg b/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy.cfg
index 906cba700573..c67212ce14af 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_001_pos.ksh
index c25b6c9230a7..e5248a1bad9a 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_002_pos.ksh
index a634f10f1114..258c64754790 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_003_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_003_neg.ksh
index 75b77b4bde72..12718eb8d987 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_003_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_destroy/zpool_destroy_003_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_detach/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_detach/cleanup.ksh
index 89c146249e71..3167a5097b5a 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_detach/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_detach/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_detach/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_detach/setup.ksh
index 2229f87e6208..23dc57ed3679 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_detach/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_detach/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_detach/zpool_detach_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_detach/zpool_detach_001_neg.ksh
index 74f8e1e664fa..5d1523fa0f92 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_detach/zpool_detach_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_detach/zpool_detach_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear_retained.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear_retained.ksh
index c16094f54038..0eda2de1f6cb 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear_retained.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear_retained.ksh
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh
index 9097ac008334..5bc369480d90 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_errors.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_errors.ksh
index 82a1a1131f06..2e98cdfc6f4a 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_errors.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_errors.ksh
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_expand/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_expand/cleanup.ksh
index 059c3839050b..2b21521f867d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_expand/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_expand/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_expand/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_expand/setup.ksh
index 9832a441c20b..ff052d23f659 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_expand/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_expand/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand.cfg b/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand.cfg
index bec5fb1638aa..0a9c1954f123 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_001_pos.ksh
index c49777e6b3c4..c58e933f11be 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -54,6 +54,14 @@
verify_runnable "global"
+# We override $org_size and $exp_size from zpool_expand.cfg to make sure we get
+# an expected free space value every time. Otherwise, if we left it
+# configurable, the free space ratio to pool size ratio would diverge too much
+# much at low $org_size values.
+#
+org_size=$((1024 * 1024 * 1024))
+exp_size=$(($org_size * 2))
+
function cleanup
{
poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1
@@ -68,6 +76,30 @@ function cleanup
unload_scsi_debug
}
+# Wait for the size of a pool to autoexpand to $1 and the total free space to
+# expand to $2 (both values allowing a 10% tolerance).
+#
+# Wait for up to 10 seconds for this to happen (typically takes 1-2 seconds)
+#
+function wait_for_autoexpand
+{
+ typeset exp_new_size=$1
+ typeset exp_new_free=$2
+
+ for i in $(seq 1 10) ; do
+ typeset new_size=$(get_pool_prop size $TESTPOOL1)
+ typeset new_free=$(get_prop avail $TESTPOOL1)
+ # Values need to be within 90% of each other (10% tolerance)
+ if within_percent $new_size $exp_new_size 90 > /dev/null && \
+ within_percent $new_free $exp_new_free 90 > /dev/null ; then
+ return
+ fi
+ sleep 1
+ done
+ log_fail "$TESTPOOL never expanded to $exp_new_size with $exp_new_free" \
+ " free space (got $new_size with $new_free free space)"
+}
+
log_onexit cleanup
log_assert "zpool can be autoexpanded after set autoexpand=on on vdev expansion"
@@ -105,63 +137,38 @@ for type in " " mirror raidz draid:1s; do
log_note "Expanding loopback, scsi_debug, and file vdevs"
log_must truncate -s $exp_size $FILE_LO
log_must losetup -c $DEV1
- sleep 3
echo "2" > /sys/bus/pseudo/drivers/scsi_debug/virtual_gb
echo "1" > /sys/class/block/$DEV2/device/rescan
block_device_wait
- sleep 3
log_must truncate -s $exp_size $FILE_RAW
log_must zpool online -e $TESTPOOL1 $FILE_RAW
- typeset expand_size=$(get_pool_prop size $TESTPOOL1)
- typeset zfs_expand_size=$(get_prop avail $TESTPOOL1)
-
- log_note "$TESTPOOL1 $type has previous size: $prev_size and " \
- "expanded size: $expand_size"
- # compare available pool size from zfs
- if [[ $zfs_expand_size -gt $zfs_prev_size ]]; then
- # check for zpool history for the pool size expansion
- if [[ $type == " " ]]; then
- typeset expansion_size=$(($exp_size-$org_size))
- typeset size_addition=$(zpool history -il $TESTPOOL1 |\
- grep "pool '$TESTPOOL1' size:" | \
- grep "vdev online" | \
- grep -c "(+${expansion_size}")
-
- if [[ $size_addition -ne 3 ]]; then
- log_fail "pool $TESTPOOL1 has not expanded, " \
- "$size_addition/3 vdevs expanded"
- fi
- elif [[ $type == "mirror" ]]; then
- typeset expansion_size=$(($exp_size-$org_size))
- zpool history -il $TESTPOOL1 | \
- grep "pool '$TESTPOOL1' size:" | \
- grep "vdev online" | \
- grep -q "(+${expansion_size})" ||
- log_fail "pool $TESTPOOL1 has not expanded"
- elif [[ $type == "draid:1s" ]]; then
- typeset expansion_size=$((2*($exp_size-$org_size)))
- zpool history -il $TESTPOOL1 | \
- grep "pool '$TESTPOOL1' size:" | \
- grep "vdev online" | \
- grep -q "(+${expansion_size})" ||
- log_fail "pool $TESTPOOL has not expanded"
- else
- typeset expansion_size=$((3*($exp_size-$org_size)))
- zpool history -il $TESTPOOL1 | \
- grep "pool '$TESTPOOL1' size:" | \
- grep "vdev online" | \
- grep -q "(+${expansion_size})" ||
- log_fail "pool $TESTPOOL has not expanded"
- fi
- else
- log_fail "pool $TESTPOOL1 is not autoexpanded after vdev " \
- "expansion. Previous size: $zfs_prev_size and expanded " \
- "size: $zfs_expand_size"
+
+ # The expected free space values below were observed at the time of
+ # this commit. However, we know ZFS overhead will change over time,
+ # and thus we do not do an exact comparison to these values in
+ # wait_for_autoexpand. Rather, we make sure the free space
+ # is within some small percentage threshold of these values.
+ typeset exp_new_size=$(($prev_size * 2))
+ if [[ "$type" == " " ]] ; then
+ exp_new_free=6045892608
+ elif [[ "$type" == "mirror" ]] ; then
+ exp_new_free=1945997312
+ elif [[ "$type" == "raidz" ]] ; then
+ exp_new_free=3977637338
+ elif [[ "$type" == "draid:1s" ]] then
+ exp_new_free=1946000384
fi
+ wait_for_autoexpand $exp_new_size $exp_new_free
+
+ expand_size=$(get_pool_prop size $TESTPOOL1)
+
+ log_note "$TESTPOOL1 '$type' grew from $prev_size -> $expand_size with" \
+ "free space from $zfs_prev_size -> $(get_prop avail $TESTPOOL1)"
+
cleanup
done
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_002_pos.ksh
index ccd266c727be..34357ca070b5 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_003_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_003_neg.ksh
index 5bd8b56ffd0d..68b17592e2f8 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_003_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_003_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_004_pos.ksh
index 09e2b6da2148..e50c1f8b1606 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_005_pos.ksh
index 54ec73b67b26..5e8f1d7053e8 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_export/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_export/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_export/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_export/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_export/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_export/setup.ksh
index 023920dae1e9..57bbf32711e3 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_export/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_export/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.cfg b/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.cfg
index 349399263da8..0cedb61c25d9 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.kshlib b/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.kshlib
index 5484f20674d5..54f805ea71a4 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_001_pos.ksh
index 111453c7a161..f084ac023997 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_002_pos.ksh
index 913a4cd6a34c..8bdaddc43da4 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_003_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_003_neg.ksh
index a2ee7fbdf908..ec4eae3d5685 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_003_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_003_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_004_pos.ksh
index 9be3f23c4fda..4b4038bb8bfd 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_get/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_get/cleanup.ksh
index 6c992b5f02ae..dde462e66cf9 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_get/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_get/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_get/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_get/setup.ksh
index 063ad743b7a8..03d149cd967a 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_get/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_get/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_get/vdev_get.cfg b/tests/zfs-tests/tests/functional/cli_root/zpool_get/vdev_get.cfg
new file mode 100644
index 000000000000..c3b9efd6464a
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_get/vdev_get.cfg
@@ -0,0 +1,75 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2022, Klara Inc.
+#
+
+# Set the expected properties of a vdev
+typeset -a properties=(
+ capacity
+ state
+ guid
+ asize
+ psize
+ ashift
+ size
+ free
+ allocated
+ comment
+ expandsize
+ fragmentation
+ bootsize
+ parity
+ path
+ devid
+ physpath
+ encpath
+ fru
+ parent
+ children
+ numchildren
+ read_errors
+ write_errors
+ checksum_errors
+ initialize_errors
+ null_ops
+ read_ops
+ write_ops
+ free_ops
+ claim_ops
+ trim_ops
+ null_bytes
+ read_bytes
+ write_bytes
+ free_bytes
+ claim_bytes
+ trim_bytes
+ removing
+ allocating
+ failfast
+ checksum_n
+ checksum_t
+ io_n
+ io_t
+ slow_io_n
+ slow_io_t
+)
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_get/vdev_get_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_get/vdev_get_001_pos.ksh
new file mode 100755
index 000000000000..bca2337861d4
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_get/vdev_get_001_pos.ksh
@@ -0,0 +1,62 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2022, Klara Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/cli_root/zpool_get/vdev_get.cfg
+
+#
+# DESCRIPTION:
+#
+# zpool get <pool> root works as expected
+#
+# STRATEGY:
+#
+# 1. use zpool get to retrieve properties from root vdev
+# 2. verify expected properties match detected properties
+#
+
+log_assert "zpool get all on root vdev"
+
+EXPECT="$(zpool get -H all ${TESTPOOL} root | wc -l)"
+if [ $? -ne 0 ]; then
+ log_fail "cannot retrieve properties from root vdev"
+fi
+
+i=0;
+while [ $i -lt "${#properties[@]}" ]
+do
+ log_must zpool get -H "${properties[$i]}" "$TESTPOOL" root
+ i=$(($i+1))
+done
+
+EXPECT=$((EXPECT))
+if [ $i -gt $EXPECT ]; then
+ log_fail "found vdev properties not in vdev_get.cfg: $i/$EXPECT."
+elif [ $i -lt $EXPECT ]; then
+ log_fail "expected properties not found in vdev_get.cfg: $i/$EXPECT."
+fi
+
+log_pass "zpool get all on root vdev"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get.cfg b/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get.cfg
index 7849ed22634e..6ebce9459190 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -58,6 +58,9 @@ typeset -a properties=(
"multihost"
"autotrim"
"compatibility"
+ "bcloneused"
+ "bclonesaved"
+ "bcloneratio"
"feature@async_destroy"
"feature@empty_bpobj"
"feature@lz4_compress"
@@ -83,6 +86,7 @@ typeset -a properties=(
"feature@log_spacemap"
"feature@device_rebuild"
"feature@draid"
+ "feature@redaction_list_spill"
)
if is_linux || is_freebsd; then
@@ -100,5 +104,8 @@ if is_linux || is_freebsd; then
"feature@zilsaxattr"
"feature@head_errlog"
"feature@blake3"
+ "feature@block_cloning"
+ "feature@vdev_zaps_v2"
+ "feature@raidz_expansion"
)
fi
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_001_pos.ksh
index d3b21d663f16..49017fb5eef4 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_002_pos.ksh
index de39aa260f61..fef573c8dd7d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_003_pos.ksh
index 7c2e214b7da0..2a4c98b61c65 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_004_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_004_neg.ksh
index bbdd32933c81..873f58ee7f31 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_004_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_004_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_005_pos.ksh
index 4481dab69f7b..e00690fd94a7 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_parsable.cfg b/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_parsable.cfg
index e7b95a47223b..22778b41177d 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_parsable.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_parsable.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_history/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_history/cleanup.ksh
index e4998138f701..7bb00caed5a3 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_history/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_history/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_history/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_history/setup.ksh
index b2a852a4c9b5..06829b1da5a2 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_history/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_history/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_history/zpool_history_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_history/zpool_history_001_neg.ksh
index b5cd8d529ed0..052108479079 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_history/zpool_history_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_history/zpool_history_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_history/zpool_history_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_history/zpool_history_002_pos.ksh
index 0146aa5bc1dd..5796c60a3772 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_history/zpool_history_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_history/zpool_history_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/cleanup.ksh
index bee0e11a4ff4..a1f0284c97ed 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_log_missing.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_log_missing.ksh
new file mode 100755
index 000000000000..f12cac78540f
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/import_log_missing.ksh
@@ -0,0 +1,75 @@
+#!/bin/ksh -p
+
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+. $STF_SUITE/tests/functional/cli_root/zpool_import/zpool_import.kshlib
+
+#
+# DESCRIPTION:
+# Import with missing log device should not remove spare/cache.
+#
+# STRATEGY:
+# 1. Create a pool.
+# 2. Add spare, cache and log devices to the pool.
+# 3. Export the pool.
+# 4. Remove the log device.
+# 5. Import the pool with -m flag.
+# 6. Verify that spare and cache are still present in the pool.
+#
+
+verify_runnable "global"
+
+log_onexit cleanup
+
+function test_missing_log
+{
+ typeset poolcreate="$1"
+ typeset cachevdev="$2"
+ typeset sparevdev="$3"
+ typeset logvdev="$4"
+ typeset missingvdev="$4"
+
+ log_note "$0: pool '$poolcreate', adding $cachevdev, $sparevdev," \
+ "$logvdev then moving away $missingvdev."
+
+ log_must zpool create $TESTPOOL1 $poolcreate
+
+ log_must zpool add $TESTPOOL1 cache $cachevdev spare $sparevdev \
+ log $logvdev
+
+ log_must_busy zpool export $TESTPOOL1
+
+ log_must mv $missingvdev $BACKUP_DEVICE_DIR
+
+ log_must zpool import -m -d $DEVICE_DIR $TESTPOOL1
+
+ CACHE_PRESENT=$(zpool status -v $TESTPOOL1 | grep $cachevdev)
+
+ SPARE_PRESENT=$(zpool status -v $TESTPOOL1 | grep $sparevdev)
+
+ if [ -z "$CACHE_PRESENT"] || [ -z "SPARE_PRESENT"]
+ then
+ log_fail "cache/spare vdev missing after importing with missing" \
+ "log device"
+ fi
+
+ # Cleanup
+ log_must zpool destroy $TESTPOOL1
+
+ log_note ""
+}
+
+log_must mkdir -p $BACKUP_DEVICE_DIR
+
+test_missing_log "$VDEV0" "$VDEV1" "$VDEV2" "$VDEV3"
+
+log_pass "zpool import succeeded with missing log device"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/setup.ksh
index 22e619d7411b..47f85fc493c1 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import.cfg b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import.cfg
index 25f541ebf185..cf9c6a8499af 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -26,6 +26,7 @@
#
# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
+# Copyright (c) 2023 by Klara, Inc.
#
. $STF_SUITE/include/libtest.shlib
@@ -63,3 +64,7 @@ export VDEV4=$DEVICE_DIR/${DEVICE_FILE}4
export VDEV5=$DEVICE_DIR/${DEVICE_FILE}5
export ALTER_ROOT=/alter_import-test
+
+export HOSTID_FILE="/etc/hostid"
+export HOSTID1=01234567
+export HOSTID2=89abcdef
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import.kshlib b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import.kshlib
index 559810ff0e30..50157fa80578 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import.kshlib
@@ -11,6 +11,7 @@
#
# Copyright (c) 2016 by Delphix. All rights reserved.
+# Copyright (c) 2023 by Klara, Inc.
#
. $STF_SUITE/include/libtest.shlib
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_001_pos.ksh
index e159c1a04195..4d061eff21f4 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_002_pos.ksh
index 95ebe0ae294d..d677f8fb4916 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_003_pos.ksh
index dfda989deab9..56914dd4a0f9 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_004_pos.ksh
index 657e28be2563..494542d59a99 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_005_pos.ksh
index 79f026ede55f..b8805cd5803b 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_006_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_006_pos.ksh
index 2353bb07d040..d648b3262d8a 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_007_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_007_pos.ksh
index 928efebdd2d5..d7967eb5ef39 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_008_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_008_pos.ksh
index f8da584aad1c..9489ce1460a4 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_009_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_009_neg.ksh
index e7886ef3c859..be18907f6c12 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_009_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_009_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_010_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_010_pos.ksh
index 212024dfcb34..107f0d88282d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_010_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_010_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_011_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_011_neg.ksh
index b54168941722..19d4f56709da 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_011_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_011_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_012_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_012_pos.ksh
index a9d5e2b319a4..bf499808eb3e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_012_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_012_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_013_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_013_neg.ksh
index 7fef6254fa68..956f851c536f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_013_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_013_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_014_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_014_pos.ksh
index d70bced265f3..6e5e06515458 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_014_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_014_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_016_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_016_pos.ksh
index 5434625cb985..7c1dd10c5c08 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_016_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_016_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_017_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_017_pos.ksh
index 2e6cef265c4f..b8547852d01f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_017_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_017_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_all_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_all_001_pos.ksh
index 9f5503454d95..c16a37620a02 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_all_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_all_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_features_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_features_001_pos.ksh
index 973efb7acf3c..7c31229afcdc 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_features_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_features_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_features_002_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_features_002_neg.ksh
index 88fde66adf04..be4d41596211 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_features_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_features_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_features_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_features_003_pos.ksh
index e92c95f54c52..31828a47a8c1 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_features_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_features_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_hostid_changed.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_hostid_changed.ksh
new file mode 100755
index 000000000000..bc82b7cc1ee8
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_hostid_changed.ksh
@@ -0,0 +1,59 @@
+#!/bin/ksh -p
+
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2021 by Delphix. All rights reserved.
+# Copyright (c) 2023 by Klara, Inc.
+#
+
+. $STF_SUITE/tests/functional/cli_root/zpool_import/zpool_import.kshlib
+
+#
+# DESCRIPTION:
+# A pool that was cleanly exported should be importable without force even if
+# the local hostid doesn't match the on-disk hostid.
+#
+# STRATEGY:
+# 1. Set a hostid.
+# 2. Create a pool.
+# 3. Export the pool.
+# 4. Change the hostid.
+# 5. Verify that importing the pool without force succeeds.
+#
+
+verify_runnable "global"
+
+function custom_cleanup
+{
+ rm -f $HOSTID_FILE
+ cleanup
+}
+
+log_onexit custom_cleanup
+
+# 1. Set a hostid.
+log_must zgenhostid -f $HOSTID1
+
+# 2. Create a pool.
+log_must zpool create $TESTPOOL1 $VDEV0
+
+# 3. Export the pool.
+log_must zpool export $TESTPOOL1
+
+# 4. Change the hostid.
+log_must zgenhostid -f $HOSTID2
+
+# 5. Verify that importing the pool without force succeeds.
+log_must zpool import -d $DEVICE_DIR $TESTPOOL1
+
+log_pass "zpool import can import cleanly exported pool when hostid changes."
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_hostid_changed_cachefile.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_hostid_changed_cachefile.ksh
new file mode 100755
index 000000000000..07c43482d68f
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_hostid_changed_cachefile.ksh
@@ -0,0 +1,65 @@
+#!/bin/ksh -p
+
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2021 by Delphix. All rights reserved.
+# Copyright (c) 2023 by Klara, Inc.
+#
+
+. $STF_SUITE/tests/functional/cli_root/zpool_import/zpool_import.kshlib
+
+#
+# DESCRIPTION:
+# A pool that was cleanly exported should be importable from a cachefile
+# without force even if the local hostid doesn't match the on-disk hostid.
+#
+# STRATEGY:
+# 1. Set a hostid.
+# 2. Create a pool with a cachefile.
+# 3. Backup the cachfile.
+# 4. Export the pool.
+# 5. Change the hostid.
+# 6. Verify that importing the pool from the cachefile succeeds
+# without force.
+#
+
+verify_runnable "global"
+
+function custom_cleanup
+{
+ rm -f $HOSTID_FILE $CPATH $CPATHBKP
+ cleanup
+}
+
+log_onexit custom_cleanup
+
+# 1. Set a hostid.
+log_must zgenhostid -f $HOSTID1
+
+# 2. Create a pool.
+log_must zpool create -o cachefile=$CPATH $TESTPOOL1 $VDEV0
+
+# 3. Backup the cachfile.
+log_must cp $CPATH $CPATHBKP
+
+# 4. Export the pool.
+log_must zpool export $TESTPOOL1
+
+# 5. Change the hostid.
+log_must zgenhostid -f $HOSTID2
+
+# 6. Verify that importing the pool from the cachefile succeeds without force.
+log_must zpool import -c $CPATHBKP $TESTPOOL1
+
+log_pass "zpool import can import cleanly exported pool from cachefile " \
+ "when hostid changes."
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_hostid_changed_cachefile_unclean_export.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_hostid_changed_cachefile_unclean_export.ksh
new file mode 100755
index 000000000000..dcb1ac1ab69f
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_hostid_changed_cachefile_unclean_export.ksh
@@ -0,0 +1,75 @@
+#!/bin/ksh -p
+
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2021 by Delphix. All rights reserved.
+# Copyright (c) 2023 by Klara, Inc.
+#
+
+. $STF_SUITE/tests/functional/cli_root/zpool_import/zpool_import.kshlib
+
+#
+# DESCRIPTION:
+# A pool that wasn't cleanly exported should not be importable from a cachefile
+# without force if the local hostid doesn't match the on-disk hostid.
+#
+# STRATEGY:
+# 1. Set a hostid.
+# 2. Create a pool.
+# 3. Backup the cachefile.
+# 4. Simulate the pool being torn down without export:
+# 4.1. Copy the underlying device state.
+# 4.2. Export the pool.
+# 4.3. Restore the device state from the copy.
+# 5. Change the hostid.
+# 6. Verify that importing the pool from the cachefile fails.
+# 7. Verify that importing the pool from the cachefile with force
+# succeeds.
+#
+
+verify_runnable "global"
+
+function custom_cleanup
+{
+ rm -f $HOSTID_FILE $CPATH $CPATHBKP $VDEV0.bak
+ cleanup
+}
+
+log_onexit custom_cleanup
+
+# 1. Set a hostid.
+log_must zgenhostid -f $HOSTID1
+
+# 2. Create a pool.
+log_must zpool create -o cachefile=$CPATH $TESTPOOL1 $VDEV0
+
+# 3. Backup the cachfile.
+log_must cp $CPATH $CPATHBKP
+
+# 4. Simulate the pool being torn down without export.
+log_must cp $VDEV0 $VDEV0.bak
+log_must zpool export $TESTPOOL1
+log_must cp -f $VDEV0.bak $VDEV0
+log_must rm -f $VDEV0.bak
+
+# 5. Change the hostid.
+log_must zgenhostid -f $HOSTID2
+
+# 6. Verify that importing the pool from the cachefile fails.
+log_mustnot zpool import -c $CPATHBKP $TESTPOOL1
+
+# 7. Verify that importing the pool from the cachefile with force succeeds.
+log_must zpool import -f -c $CPATHBKP $TESTPOOL1
+
+log_pass "zpool import from cachefile requires force if not cleanly " \
+ "exported and hostid changes."
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_hostid_changed_unclean_export.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_hostid_changed_unclean_export.ksh
new file mode 100755
index 000000000000..ad8cca642dbc
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_hostid_changed_unclean_export.ksh
@@ -0,0 +1,70 @@
+#!/bin/ksh -p
+
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2021 by Delphix. All rights reserved.
+# Copyright (c) 2023 by Klara, Inc.
+#
+
+. $STF_SUITE/tests/functional/cli_root/zpool_import/zpool_import.kshlib
+
+#
+# DESCRIPTION:
+# A pool that wasn't cleanly exported should not be importable without force if
+# the local hostid doesn't match the on-disk hostid.
+#
+# STRATEGY:
+# 1. Set a hostid.
+# 2. Create a pool.
+# 3. Simulate the pool being torn down without export:
+# 3.1. Copy the underlying device state.
+# 3.2. Export the pool.
+# 3.3. Restore the device state from the copy.
+# 4. Change the hostid.
+# 5. Verify that importing the pool fails.
+# 6. Verify that importing the pool with force succeeds.
+#
+
+verify_runnable "global"
+
+function custom_cleanup
+{
+ rm -f $HOSTID_FILE $VDEV0.bak
+ cleanup
+}
+
+log_onexit custom_cleanup
+
+# 1. Set a hostid.
+log_must zgenhostid -f $HOSTID1
+
+# 2. Create a pool.
+log_must zpool create $TESTPOOL1 $VDEV0
+
+# 3. Simulate the pool being torn down without export.
+log_must cp $VDEV0 $VDEV0.bak
+log_must zpool export $TESTPOOL1
+log_must cp -f $VDEV0.bak $VDEV0
+log_must rm -f $VDEV0.bak
+
+# 4. Change the hostid.
+log_must zgenhostid -f $HOSTID2
+
+# 5. Verify that importing the pool fails.
+log_mustnot zpool import -d $DEVICE_DIR $TESTPOOL1
+
+# 6. Verify that importing the pool with force succeeds.
+log_must zpool import -d $DEVICE_DIR -f $TESTPOOL1
+
+log_pass "zpool import requires force if not cleanly exported " \
+ "and hostid changed."
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_missing_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_missing_001_pos.ksh
index 22cec24ff457..488024cfd0e1 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_missing_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_missing_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_missing_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_missing_002_pos.ksh
index 60af3f321947..7f0cf79a4ad9 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_missing_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_missing_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_missing_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_missing_003_pos.ksh
index ac76f879c2e8..964b38f9e860 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_missing_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_missing_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_parallel_admin.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_parallel_admin.ksh
new file mode 100755
index 000000000000..c681d1b7dd23
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_parallel_admin.ksh
@@ -0,0 +1,165 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2023 Klara, Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/cli_root/zpool_import/zpool_import.cfg
+. $STF_SUITE/tests/functional/cli_root/zpool_import/zpool_import.kshlib
+
+#
+# DESCRIPTION:
+# Verify that admin commands to different pool are not blocked by import
+#
+# STRATEGY:
+# 1. Create 2 pools
+# 2. Export one of the pools
+# 4. Import the pool with an injected delay
+# 5. Execute some admin commands against both pools
+# 6. Verify that the admin commands to the non-imported pool don't stall
+#
+
+verify_runnable "global"
+
+function cleanup
+{
+ zinject -c all
+ destroy_pool $TESTPOOL1
+ destroy_pool $TESTPOOL2
+}
+
+function pool_import
+{
+ typeset dir=$1
+ typeset pool=$2
+
+ SECONDS=0
+ errmsg=$(zpool import -d $dir -f $pool 2>&1 > /dev/null)
+ if [[ $? -eq 0 ]]; then
+ echo ${pool}: imported in $SECONDS secs
+ echo $SECONDS > ${DEVICE_DIR}/${pool}-import
+ else
+ echo ${pool}: import failed $errmsg in $SECONDS secs
+ fi
+}
+
+function pool_add_device
+{
+ typeset pool=$1
+ typeset device=$2
+ typeset devtype=$3
+
+ SECONDS=0
+ errmsg=$(zpool add $pool $devtype $device 2>&1 > /dev/null)
+ if [[ $? -eq 0 ]]; then
+ echo ${pool}: added $devtype vdev in $SECONDS secs
+ echo $SECONDS > ${DEVICE_DIR}/${pool}-add
+ else
+ echo ${pool}: add $devtype vdev failed ${errmsg}, in $SECONDS secs
+ fi
+}
+
+function pool_stats
+{
+ typeset stats=$1
+ typeset pool=$2
+
+ SECONDS=0
+ errmsg=$(zpool $stats $pool 2>&1 > /dev/null)
+ if [[ $? -eq 0 ]]; then
+ echo ${pool}: $stats in $SECONDS secs
+ echo $SECONDS > ${DEVICE_DIR}/${pool}-${stats}
+ else
+ echo ${pool}: $stats failed ${errmsg}, in $SECONDS secs
+ fi
+}
+
+function pool_create
+{
+ typeset pool=$1
+ typeset device=$2
+
+ SECONDS=0
+ errmsg=$(zpool create $pool $device 2>&1 > /dev/null)
+ if [[ $? -eq 0 ]]; then
+ echo ${pool}: created in $SECONDS secs
+ echo $SECONDS > ${DEVICE_DIR}/${pool}-create
+ else
+ echo ${pool}: create failed ${errmsg}, in $SECONDS secs
+ fi
+}
+
+log_assert "Simple admin commands to different pool not blocked by import"
+
+log_onexit cleanup
+
+#
+# create two pools and export one
+#
+log_must zpool create $TESTPOOL1 $VDEV0
+log_must zpool export $TESTPOOL1
+log_must zpool create $TESTPOOL2 $VDEV1
+
+#
+# import pool asyncronously with an injected 10 second delay
+#
+log_must zinject -P import -s 10 $TESTPOOL1
+pool_import $DEVICE_DIR $TESTPOOL1 &
+
+sleep 2
+
+#
+# run some admin commands on the pools while the import is in progress
+#
+
+pool_add_device $TESTPOOL1 $VDEV2 "log" &
+pool_add_device $TESTPOOL2 $VDEV3 "cache" &
+pool_stats "status" $TESTPOOL1 &
+pool_stats "status" $TESTPOOL2 &
+pool_stats "list" $TESTPOOL1 &
+pool_stats "list" $TESTPOOL2 &
+pool_create $TESTPOOL1 $VDEV4 &
+wait
+
+log_must zpool sync $TESTPOOL1 $TESTPOOL2
+
+zpool history $TESTPOOL1
+zpool history $TESTPOOL2
+
+log_must test "5" -lt $(<${DEVICE_DIR}/${TESTPOOL1}-import)
+
+#
+# verify that commands to second pool did not wait for import to finish
+#
+log_must test "2" -gt $(<${DEVICE_DIR}/${TESTPOOL2}-status)
+log_must test "2" -gt $(<${DEVICE_DIR}/${TESTPOOL2}-list)
+log_must test "2" -gt $(<${DEVICE_DIR}/${TESTPOOL2}-add)
+[[ -e ${DEVICE_DIR}/${TESTPOOL1}-create ]] && log_fail "unexpected pool create"
+
+log_pass "Simple admin commands to different pool not blocked by import"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_parallel_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_parallel_neg.ksh
new file mode 100755
index 000000000000..339dc2575ede
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_parallel_neg.ksh
@@ -0,0 +1,130 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2023 Klara, Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/cli_root/zpool_import/zpool_import.cfg
+. $STF_SUITE/tests/functional/cli_root/zpool_import/zpool_import.kshlib
+
+#
+# DESCRIPTION:
+# Verify that pool imports by same name only have one winner
+#
+# STRATEGY:
+# 1. Create 4 single disk pools with the same name
+# 2. Generate some ZIL records (for a longer import)
+# 3. Export the pools
+# 4. Import the pools in parallel
+# 5. Repeat with using matching guids
+#
+
+verify_runnable "global"
+
+POOLNAME="import_pool"
+DEV_DIR_PREFIX="$DEVICE_DIR/$POOLNAME"
+VDEVSIZE=$((512 * 1024 * 1024))
+
+log_assert "parallel pool imports by same name only have one winner"
+
+# each pool has its own device directory
+for i in {0..3}; do
+ log_must mkdir -p ${DEV_DIR_PREFIX}$i
+ log_must truncate -s $VDEVSIZE ${DEV_DIR_PREFIX}$i/${DEVICE_FILE}$i
+done
+
+function cleanup
+{
+ zinject -c all
+ log_must set_tunable64 KEEP_LOG_SPACEMAPS_AT_EXPORT 0
+ log_must set_tunable64 METASLAB_DEBUG_LOAD 0
+
+ destroy_pool $POOLNAME
+
+ log_must rm -rf $DEV_DIR_PREFIX*
+}
+
+log_onexit cleanup
+
+log_must set_tunable64 KEEP_LOG_SPACEMAPS_AT_EXPORT 1
+log_must set_tunable64 METASLAB_DEBUG_LOAD 1
+
+function import_pool
+{
+ typeset dir=$1
+ typeset pool=$2
+ typeset newname=$3
+
+ SECONDS=0
+ errmsg=$(zpool import -N -d $dir -f $pool $newname 2>&1 > /dev/null)
+ if [[ $? -eq 0 ]]; then
+ touch $dir/imported
+ echo "imported $pool in $SECONDS secs"
+ elif [[ $errmsg == *"cannot import"* ]]; then
+ echo "pool import failed: $errmsg, waited $SECONDS secs"
+ touch $dir/failed
+ fi
+}
+
+#
+# create four exported pools with the same name
+#
+for i in {0..3}; do
+ log_must zpool create $POOLNAME ${DEV_DIR_PREFIX}$i/${DEVICE_FILE}$i
+ log_must zpool export $POOLNAME
+done
+log_must zinject -P import -s 10 $POOLNAME
+
+#
+# import the pools in parallel, expecting only one winner
+#
+for i in {0..3}; do
+ import_pool ${DEV_DIR_PREFIX}$i $POOLNAME &
+done
+wait
+
+# check the result of background imports
+typeset num_imports=0
+typeset num_cannot=0
+for i in {0..3}; do
+ if [[ -f ${DEV_DIR_PREFIX}$i/imported ]]; then
+ ((num_imports += 1))
+ fi
+ if [[ -f ${DEV_DIR_PREFIX}$i/failed ]]; then
+ ((num_cannot += 1))
+ loser=$i
+ fi
+done
+[[ $num_imports -eq "1" ]] || log_fail "expecting an import"
+[[ $num_cannot -eq "3" ]] || \
+ log_fail "expecting 3 pool exists errors, found $num_cannot"
+
+log_note "$num_imports imported and $num_cannot failed (expected)"
+
+log_pass "parallel pool imports by same name only have one winner"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_parallel_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_parallel_pos.ksh
new file mode 100755
index 000000000000..71b2437a37ec
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_parallel_pos.ksh
@@ -0,0 +1,137 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2023 Klara, Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/cli_root/zpool_import/zpool_import.cfg
+. $STF_SUITE/tests/functional/cli_root/zpool_import/zpool_import.kshlib
+
+# test uses 8 vdevs
+export MAX_NUM=8
+
+#
+# DESCRIPTION:
+# Verify that pool imports can occur in parallel
+#
+# STRATEGY:
+# 1. Create 8 pools
+# 2. Generate some ZIL records
+# 3. Export the pools
+# 4. Import half of the pools synchronously to baseline sequential cost
+# 5. Import the other half asynchronously to demonstrate parallel savings
+# 6. Export 4 pools
+# 7. Test zpool import -a
+#
+
+verify_runnable "global"
+
+#
+# override the minimum sized vdevs
+#
+VDEVSIZE=$((512 * 1024 * 1024))
+increase_device_sizes $VDEVSIZE
+
+POOLNAME="import_pool"
+
+function cleanup
+{
+ zinject -c all
+ log_must set_tunable64 KEEP_LOG_SPACEMAPS_AT_EXPORT 0
+ log_must set_tunable64 METASLAB_DEBUG_LOAD 0
+
+ for i in {0..$(($MAX_NUM - 1))}; do
+ destroy_pool $POOLNAME-$i
+ done
+ # reset the devices
+ increase_device_sizes 0
+ increase_device_sizes $FILE_SIZE
+}
+
+log_assert "Pool imports can occur in parallel"
+
+log_onexit cleanup
+
+log_must set_tunable64 KEEP_LOG_SPACEMAPS_AT_EXPORT 1
+log_must set_tunable64 METASLAB_DEBUG_LOAD 1
+
+
+#
+# create some exported pools with import delay injectors
+#
+for i in {0..$(($MAX_NUM - 1))}; do
+ log_must zpool create $POOLNAME-$i $DEVICE_DIR/${DEVICE_FILE}$i
+ log_must zpool export $POOLNAME-$i
+ log_must zinject -P import -s 12 $POOLNAME-$i
+done
+wait
+
+#
+# import half of the pools synchronously
+#
+SECONDS=0
+for i in {0..3}; do
+ log_must zpool import -d $DEVICE_DIR -f $POOLNAME-$i
+done
+sequential_time=$SECONDS
+log_note "sequentially imported 4 pools in $sequential_time seconds"
+
+#
+# import half of the pools in parallel
+#
+SECONDS=0
+for i in {4..7}; do
+ log_must zpool import -d $DEVICE_DIR -f $POOLNAME-$i &
+done
+wait
+parallel_time=$SECONDS
+log_note "asyncronously imported 4 pools in $parallel_time seconds"
+
+log_must test $parallel_time -lt $(($sequential_time / 3))
+
+#
+# export pools with import delay injectors
+#
+for i in {4..7}; do
+ log_must zpool export $POOLNAME-$i
+ log_must zinject -P import -s 12 $POOLNAME-$i
+done
+wait
+
+#
+# now test zpool import -a
+#
+SECONDS=0
+log_must zpool import -a -d $DEVICE_DIR -f
+parallel_time=$SECONDS
+log_note "asyncronously imported 4 pools in $parallel_time seconds"
+
+log_must test $parallel_time -lt $(($sequential_time / 3))
+
+log_pass "Pool imports occur in parallel"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_rename_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_rename_001_pos.ksh
index 4e49e8d01d88..4d6005d2cb02 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_rename_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_rename_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_status.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_status.ksh
new file mode 100755
index 000000000000..c96961bf6419
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_status.ksh
@@ -0,0 +1,132 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2023 Klara, Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/cli_root/zpool_import/zpool_import.cfg
+
+#
+# DESCRIPTION:
+# During a pool import, the 'import_progress' kstat contains details
+# on the import progress.
+#
+# STRATEGY:
+# 1. Create test pool with several devices
+# 2. Generate some ZIL records and spacemap logs
+# 3. Export the pool
+# 4. Import the pool in the background and monitor the kstat content
+# 5. Check the zfs debug messages for import progress
+#
+
+verify_runnable "global"
+
+function cleanup
+{
+ log_must set_tunable64 KEEP_LOG_SPACEMAPS_AT_EXPORT 0
+ log_must set_tunable64 METASLAB_DEBUG_LOAD 0
+
+ destroy_pool $TESTPOOL1
+}
+
+log_assert "During a pool import, the 'import_progress' kstat contains " \
+ "notes on the progress"
+
+log_onexit cleanup
+
+log_must zpool create $TESTPOOL1 $VDEV0 $VDEV1 $VDEV2
+typeset guid=$(zpool get -H -o value guid $TESTPOOL1)
+
+log_must zfs create -o recordsize=8k $TESTPOOL1/fs
+#
+# This dd command works around an issue where ZIL records aren't created
+# after freezing the pool unless a ZIL header already exists. Create a file
+# synchronously to force ZFS to write one out.
+#
+log_must dd if=/dev/zero of=/$TESTPOOL1/fs/sync conv=fsync bs=1 count=1
+
+#
+# Overwrite some blocks to populate spacemap logs
+#
+log_must dd if=/dev/urandom of=/$TESTPOOL1/fs/00 bs=1M count=200
+sync_all_pools
+log_must dd if=/dev/urandom of=/$TESTPOOL1/fs/00 bs=1M count=200
+sync_all_pools
+
+#
+# Freeze the pool to retain intent log records
+#
+log_must zpool freeze $TESTPOOL1
+
+# fill_fs [destdir] [dirnum] [filenum] [bytes] [num_writes] [data]
+log_must fill_fs /$TESTPOOL1/fs 1 2000 100 1024 R
+
+log_must zpool list -v $TESTPOOL1
+
+#
+# Unmount filesystem and export the pool
+#
+# At this stage the zfs intent log contains
+# a set of records to replay.
+#
+log_must zfs unmount /$TESTPOOL1/fs
+
+log_must set_tunable64 KEEP_LOG_SPACEMAPS_AT_EXPORT 1
+log_must zpool export $TESTPOOL1
+
+log_must set_tunable64 METASLAB_DEBUG_LOAD 1
+log_note "Starting zpool import in background at" $(date +'%H:%M:%S')
+zpool import -d $DEVICE_DIR -f $guid &
+pid=$!
+
+#
+# capture progress until import is finished
+#
+log_note waiting for pid $pid to exit
+kstat import_progress
+while [[ -d /proc/"$pid" ]]; do
+ line=$(kstat import_progress | grep -v pool_guid)
+ if [[ -n $line ]]; then
+ echo $line
+ fi
+ if [[ -f /$TESTPOOL1/fs/00 ]]; then
+ break;
+ fi
+ sleep 0.0001
+done
+log_note "zpool import completed at" $(date +'%H:%M:%S')
+
+entries=$(kstat dbgmsg | grep "spa_import_progress_set_notes_impl(): 'testpool1'" | wc -l)
+log_note "found $entries progress notes in dbgmsg"
+log_must test $entries -gt 20
+
+log_must zpool status $TESTPOOL1
+
+log_pass "During a pool import, the 'import_progress' kstat contains " \
+ "notes on the progress"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/cleanup.ksh
index 3c7dbd31705d..92005b4efd7f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_attach_detach_add_remove.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_attach_detach_add_remove.ksh
index 2a695025d214..56733758c633 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_attach_detach_add_remove.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_attach_detach_add_remove.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_import_export.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_import_export.ksh
index 386d2a5dc237..c29c4b07e524 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_import_export.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_import_export.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_offline_export_import_online.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_offline_export_import_online.ksh
index dedd466e4e6e..feca7f9af721 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_offline_export_import_online.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_offline_export_import_online.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_online_offline.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_online_offline.ksh
index 55bd3188c966..79f47f0f8ba2 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_online_offline.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_online_offline.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_split.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_split.ksh
index 69b27c26c9bc..e5d528d6cef8 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_split.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_split.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_start_and_cancel_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_start_and_cancel_neg.ksh
index 59b266d321c3..7de3f20223fd 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_start_and_cancel_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_start_and_cancel_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_start_and_cancel_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_start_and_cancel_pos.ksh
index 5003b5f10bdb..facbd0efda59 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_start_and_cancel_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_start_and_cancel_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_suspend_resume.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_suspend_resume.ksh
index bce3da5267cd..2f030c78a01b 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_suspend_resume.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_suspend_resume.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_uninit.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_uninit.ksh
new file mode 100755
index 000000000000..17f776cfbc20
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_uninit.ksh
@@ -0,0 +1,141 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+# Copyright (C) 2023 Lawrence Livermore National Security, LLC.
+#
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/cli_root/zpool_initialize/zpool_initialize.kshlib
+
+#
+# DESCRIPTION:
+# Starting, stopping, uninitializing, and restart an initialize works.
+#
+# STRATEGY:
+# 1. Create a one-disk pool.
+# 2. Verify uninitialize succeeds for uninitialized pool.
+# 3. Verify pool wide cancel|suspend + uninit
+# a. Start initializing and verify that initializing is active.
+# b. Verify uninitialize fails when actively initializing.
+# c. Cancel or suspend initializing and verify that initializing is not active.
+# d. Verify uninitialize succeeds after being cancelled.
+# 4. Verify per-disk cancel|suspend + uninit
+#
+
+DISK1="$(echo $DISKS | cut -d' ' -f1)"
+DISK2="$(echo $DISKS | cut -d' ' -f2)"
+DISK3="$(echo $DISKS | cut -d' ' -f3)"
+
+function status_check # pool disk1-state disk2-state disk3-state
+{
+ typeset pool="$1"
+ typeset disk1_state="$2"
+ typeset disk2_state="$3"
+ typeset disk3_state="$4"
+
+ state=$(zpool status -i "$pool" | grep "$DISK1" | grep "$disk1_state")
+ if [[ -z "$state" ]]; then
+ log_fail "DISK1 state; expected='$disk1_state' got '$state'"
+ fi
+
+ state=$(zpool status -i "$pool" | grep "$DISK2" | grep "$disk2_state")
+ if [[ -z "$state" ]]; then
+ log_fail "DISK2 state; expected='$disk2_state' got '$state'"
+ fi
+
+ state=$(zpool status -i "$pool" | grep "$DISK3" | grep "$disk3_state")
+ if [[ -z "$state" ]]; then
+ log_fail "DISK3 state; expected='$disk3_state' got '$state'"
+ fi
+}
+
+function status_check_all # pool disk-state
+{
+ typeset pool="$1"
+ typeset disk_state="$2"
+
+ status_check "$pool" "$disk_state" "$disk_state" "$disk_state"
+}
+
+# 1. Create a one-disk pool.
+log_must zpool create -f $TESTPOOL $DISK1 $DISK2 $DISK3
+status_check_all $TESTPOOL "uninitialized"
+
+# 2. Verify uninitialize succeeds for uninitialized pool.
+log_must zpool initialize -u $TESTPOOL
+status_check_all $TESTPOOL "uninitialized"
+
+# 3. Verify pool wide cancel + uninit
+log_must zpool initialize $TESTPOOL
+status_check_all $TESTPOOL "[[:digit:]]* initialized"
+
+log_mustnot zpool initialize -u $TESTPOOL
+status_check_all $TESTPOOL "[[:digit:]]* initialized"
+
+log_must zpool initialize -c $TESTPOOL
+status_check_all $TESTPOOL "uninitialized"
+
+log_must zpool initialize -u $TESTPOOL
+status_check_all $TESTPOOL "uninitialized"
+
+# 3. Verify pool wide suspend + uninit
+log_must zpool initialize $TESTPOOL
+status_check_all $TESTPOOL "[[:digit:]]* initialized"
+
+log_mustnot zpool initialize -u $TESTPOOL
+status_check_all $TESTPOOL "[[:digit:]]* initialized"
+
+log_must zpool initialize -s $TESTPOOL
+status_check_all $TESTPOOL "suspended"
+
+log_must zpool initialize -u $TESTPOOL
+status_check_all $TESTPOOL "uninitialized"
+
+# 4. Verify per-disk cancel|suspend + uninit
+log_must zpool initialize $TESTPOOL
+status_check_all $TESTPOOL "[[:digit:]]* initialized"
+
+log_must zpool initialize -c $TESTPOOL $DISK1
+log_must zpool initialize -s $TESTPOOL $DISK2
+log_mustnot zpool initialize -u $TESTPOOL $DISK3
+status_check $TESTPOOL "uninitialized" "suspended" "[[:digit:]]* initialized"
+
+log_must zpool initialize -u $TESTPOOL $DISK1
+status_check $TESTPOOL "uninitialized" "suspended" "[[:digit:]]* initialized"
+
+log_must zpool initialize -u $TESTPOOL $DISK2
+status_check $TESTPOOL "uninitialized" "uninitialized" "[[:digit:]]* initialized"
+
+log_must zpool initialize $TESTPOOL $DISK1
+status_check $TESTPOOL "[[:digit:]]* initialized" "uninitialized" "[[:digit:]]* initialized"
+
+log_must zpool initialize $TESTPOOL $DISK2
+status_check_all $TESTPOOL "[[:digit:]]* initialized"
+
+log_must zpool initialize -s $TESTPOOL
+status_check_all $TESTPOOL "suspended"
+
+log_must zpool initialize -u $TESTPOOL $DISK1 $DISK2 $DISK3
+status_check_all $TESTPOOL "uninitialized"
+
+log_pass "Initialize start + cancel/suspend + uninit + start works"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_unsupported_vdevs.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_unsupported_vdevs.ksh
index bd4ca069c49b..3055478841fc 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_unsupported_vdevs.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_unsupported_vdevs.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_verify_checksums.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_verify_checksums.ksh
index 2ccc57b475b7..794d61c4e13f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_verify_checksums.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_verify_checksums.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_verify_initialized.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_verify_initialized.ksh
index 5e40eee4b83e..dc44727d8757 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_verify_initialized.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_verify_initialized.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_offline/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_offline/cleanup.ksh
index 89c146249e71..3167a5097b5a 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_offline/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_offline/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_offline/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_offline/setup.ksh
index 2229f87e6208..23dc57ed3679 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_offline/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_offline/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_offline/zpool_offline_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_offline/zpool_offline_001_pos.ksh
index 4f3c187b91d5..23bb47545e81 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_offline/zpool_offline_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_offline/zpool_offline_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_offline/zpool_offline_002_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_offline/zpool_offline_002_neg.ksh
index 14e0ab3fa75b..be31eb69c4f2 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_offline/zpool_offline_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_offline/zpool_offline_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_offline/zpool_offline_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_offline/zpool_offline_003_pos.ksh
index ceef4cc3161d..a881c7622de2 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_offline/zpool_offline_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_offline/zpool_offline_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_online/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_online/cleanup.ksh
index 89c146249e71..3167a5097b5a 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_online/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_online/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_online/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_online/setup.ksh
index 2229f87e6208..23dc57ed3679 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_online/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_online/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_online/zpool_online_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_online/zpool_online_001_pos.ksh
index e104a9323f27..8cf64dfab713 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_online/zpool_online_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_online/zpool_online_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_online/zpool_online_002_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_online/zpool_online_002_neg.ksh
index 79855e64a809..a0e7f21072fe 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_online/zpool_online_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_online/zpool_online_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/cleanup.ksh
index 307fae7196d2..af286ff9047f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/setup.ksh
index 8ce094bcc701..405f6fa1da8e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove.cfg b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove.cfg
index 1b8312e99372..8baaeb0b3299 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_001_neg.ksh
index 0c098a61e238..e87336ed00b3 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_002_pos.ksh
index 4ab7ac659b83..ddaed845e0db 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_003_pos.ksh
index 4e132d9d00b5..dc1745bf130e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_remove/zpool_remove_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_replace/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_replace/cleanup.ksh
index 89c146249e71..3167a5097b5a 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_replace/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_replace/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_replace/replace-o_ashift.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_replace/replace-o_ashift.ksh
index f1b957e620c9..9595e51241b3 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_replace/replace-o_ashift.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_replace/replace-o_ashift.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -35,14 +35,14 @@
#
# STRATEGY:
# 1. Create various pools with different ashift values.
-# 2. Verify 'replace -o ashift=<n>' works only with allowed values.
+# 2. Verify 'replace' works.
#
verify_runnable "global"
function cleanup
{
- log_must set_tunable64 VDEV_FILE_PHYSICAL_ASHIFT $orig_ashift
+ log_must set_tunable32 VDEV_FILE_PHYSICAL_ASHIFT $orig_ashift
poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1
rm -f $disk1 $disk2
}
@@ -61,31 +61,21 @@ orig_ashift=$(get_tunable VDEV_FILE_PHYSICAL_ASHIFT)
# the ashift using the -o ashift property should still
# be honored.
#
-log_must set_tunable64 VDEV_FILE_PHYSICAL_ASHIFT 16
+log_must set_tunable32 VDEV_FILE_PHYSICAL_ASHIFT 16
typeset ashifts=("9" "10" "11" "12" "13" "14" "15" "16")
for ashift in ${ashifts[@]}
do
- for cmdval in ${ashifts[@]}
- do
- log_must zpool create -o ashift=$ashift $TESTPOOL1 $disk1
- log_must verify_ashift $disk1 $ashift
- # ashift_of(replacing_disk) <= ashift_of(existing_vdev)
- if [[ $cmdval -le $ashift ]]
- then
- log_must zpool replace -o ashift=$cmdval $TESTPOOL1 \
- $disk1 $disk2
- log_must verify_ashift $disk2 $ashift
- wait_replacing $TESTPOOL1
- else
- log_mustnot zpool replace -o ashift=$cmdval $TESTPOOL1 \
- $disk1 $disk2
- fi
- # clean things for the next run
- log_must zpool destroy $TESTPOOL1
- log_must zpool labelclear $disk1
- log_must zpool labelclear $disk2
- done
+ log_must zpool create -o ashift=$ashift $TESTPOOL1 $disk1
+ log_must verify_ashift $disk1 $ashift
+ # ashift_of(replacing_disk) <= ashift_of(existing_vdev)
+ log_must zpool replace $TESTPOOL1 $disk1 $disk2
+ log_must verify_ashift $disk2 $ashift
+ wait_replacing $TESTPOOL1
+ # clean things for the next run
+ log_must zpool destroy $TESTPOOL1
+ log_must zpool labelclear $disk1
+ log_must zpool labelclear $disk2
done
typeset badvals=("off" "on" "1" "8" "17" "1b" "ff" "-")
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_replace/replace_prop_ashift.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_replace/replace_prop_ashift.ksh
index a524c4b17ae5..b4ac18e5ea25 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_replace/replace_prop_ashift.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_replace/replace_prop_ashift.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -34,17 +34,15 @@
#
# STRATEGY:
# 1. Create a pool with default values.
-# 2. Verify 'zpool replace' uses the ashift pool property value when
-# replacing an existing device.
-# 3. Verify the default ashift value can still be overridden by manually
-# specifying '-o ashift=<n>' from the command line.
+# 2. Override the pool ashift property.
+# 3. Verify 'zpool replace' works.
#
verify_runnable "global"
function cleanup
{
- log_must set_tunable64 VDEV_FILE_PHYSICAL_ASHIFT $orig_ashift
+ log_must set_tunable32 VDEV_FILE_PHYSICAL_ASHIFT $orig_ashift
poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1
rm -f $disk1 $disk2
}
@@ -63,7 +61,7 @@ orig_ashift=$(get_tunable VDEV_FILE_PHYSICAL_ASHIFT)
# the ashift using the -o ashift property should still
# be honored.
#
-log_must set_tunable64 VDEV_FILE_PHYSICAL_ASHIFT 16
+log_must set_tunable32 VDEV_FILE_PHYSICAL_ASHIFT 16
typeset ashifts=("9" "10" "11" "12" "13" "14" "15" "16")
for ashift in ${ashifts[@]}
@@ -72,21 +70,9 @@ do
do
log_must zpool create -o ashift=$ashift $TESTPOOL1 $disk1
log_must zpool set ashift=$pprop $TESTPOOL1
- # ashift_of(replacing_disk) <= ashift_of(existing_vdev)
- if [[ $pprop -le $ashift ]]
- then
- log_must zpool replace $TESTPOOL1 $disk1 $disk2
- wait_replacing $TESTPOOL1
- log_must verify_ashift $disk2 $ashift
- else
- # cannot replace if pool prop ashift > vdev ashift
- log_mustnot zpool replace $TESTPOOL1 $disk1 $disk2
- # verify we can override the pool prop value manually
- log_must zpool replace -o ashift=$ashift $TESTPOOL1 \
- $disk1 $disk2
- wait_replacing $TESTPOOL1
- log_must verify_ashift $disk2 $ashift
- fi
+ log_must zpool replace $TESTPOOL1 $disk1 $disk2
+ wait_replacing $TESTPOOL1
+ log_must verify_ashift $disk2 $ashift
# clean things for the next run
log_must zpool destroy $TESTPOOL1
log_must zpool labelclear $disk1
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_replace/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_replace/setup.ksh
index 2229f87e6208..23dc57ed3679 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_replace/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_replace/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_replace/zpool_replace_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_replace/zpool_replace_001_neg.ksh
index 725e495ebb89..6049c1a3697c 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_replace/zpool_replace_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_replace/zpool_replace_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/cleanup.ksh
index c74e23919cd1..066eb36b6f36 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/setup.ksh
index 48ceecdf9eb7..02ab31958a15 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/zpool_resilver.cfg b/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/zpool_resilver.cfg
index 2b8c9e954ad7..16984432ee27 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/zpool_resilver.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/zpool_resilver.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/zpool_resilver_bad_args.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/zpool_resilver_bad_args.ksh
index abd514086630..3f4115aff089 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/zpool_resilver_bad_args.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/zpool_resilver_bad_args.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/zpool_resilver_concurrent.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/zpool_resilver_concurrent.ksh
new file mode 100755
index 000000000000..4c3b09796869
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/zpool_resilver_concurrent.ksh
@@ -0,0 +1,101 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 Hewlett Packard Enterprise Development LP.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/redundancy/redundancy.kshlib
+
+#
+# DESCRIPTION:
+# Verify 'zpool clear' doesn't cause concurrent resilvers
+#
+# STRATEGY:
+# 1. Create N(10) virtual disk files.
+# 2. Create draid pool based on the virtual disk files.
+# 3. Fill the filesystem with directories and files.
+# 4. Force-fault 2 vdevs and verify distributed spare is kicked in.
+# 5. Free the distributed spare by replacing the faulty drive.
+# 6. Run zpool clear and verify that it does not initiate 2 resilvers
+# concurrently while distributed spare gets kicked in.
+#
+
+verify_runnable "global"
+
+typeset -ir devs=10
+typeset -ir nparity=1
+typeset -ir ndata=8
+typeset -ir dspare=1
+
+function cleanup
+{
+ poolexists "$TESTPOOL" && destroy_pool "$TESTPOOL"
+
+ for i in {0..$devs}; do
+ log_must rm -f "$BASEDIR/vdev$i"
+ done
+
+ for dir in $BASEDIR; do
+ if [[ -d $dir ]]; then
+ log_must rm -rf $dir
+ fi
+ done
+
+ zed_stop
+ zed_cleanup
+}
+
+log_assert "Verify zpool clear on draid pool doesn't cause concurrent resilvers"
+log_onexit cleanup
+
+setup_test_env $TESTPOOL draid${nparity}:${ndata}d:${dspare}s $devs
+
+# ZED needed for sequential resilver
+zed_setup
+log_must zed_start
+
+log_must zpool offline -f $TESTPOOL $BASEDIR/vdev5
+log_must wait_vdev_state $TESTPOOL draid1-0-0 "ONLINE" 60
+log_must zpool wait -t resilver $TESTPOOL
+log_must zpool offline -f $TESTPOOL $BASEDIR/vdev6
+
+log_must zpool labelclear -f $BASEDIR/vdev5
+log_must zpool labelclear -f $BASEDIR/vdev6
+
+log_must zpool replace -w $TESTPOOL $BASEDIR/vdev5
+sync_pool $TESTPOOL
+
+log_must zpool events -c
+log_must zpool clear $TESTPOOL
+log_must wait_vdev_state $TESTPOOL draid1-0-0 "ONLINE" 60
+log_must zpool wait -t resilver $TESTPOOL
+log_must zpool wait -t scrub $TESTPOOL
+
+nof_resilver=$(zpool events | grep -c resilver_start)
+if [ $nof_resilver = 1 ] ; then
+ log_must verify_pool $TESTPOOL
+ log_pass "zpool clear on draid pool doesn't cause concurrent resilvers"
+else
+ log_fail "FAIL: sequential and healing resilver initiated concurrently"
+fi
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/zpool_resilver_restart.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/zpool_resilver_restart.ksh
index e487afd8ae4d..8b5b5975774d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/zpool_resilver_restart.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_resilver/zpool_resilver_restart.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/cleanup.ksh
index 03eb9901cb3e..c725664380f2 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/setup.ksh
index 936fd798e9dd..a0652219ae7d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_001_pos.ksh
new file mode 100755
index 000000000000..e414cd1beaad
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_001_pos.ksh
@@ -0,0 +1,79 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2019, Delphix. All rights reserved.
+# Copyright (c) 2023, George Amanakis. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/cli_root/zpool_scrub/zpool_scrub.cfg
+
+#
+# DESCRIPTION:
+# Verify scrub -e, -p, and -s show the right status.
+#
+# STRATEGY:
+# 1. Create a pool and create a 10MB file in it.
+# 2. Start a error scrub (-e) and verify it's doing a scrub.
+# 3. Pause error scrub (-p) and verify it's paused.
+# 4. Try to pause a paused error scrub (-p) and make sure that fails.
+# 5. Resume the paused error scrub and verify again it's doing a scrub.
+# 6. Verify zpool scrub -s succeed when the system is error scrubbing.
+#
+
+verify_runnable "global"
+
+function cleanup
+{
+ log_must set_tunable32 SCAN_SUSPEND_PROGRESS 0
+ log_must zinject -c all
+ rm -f /$TESTPOOL/10m_file
+}
+
+log_onexit cleanup
+
+log_assert "Verify scrub -e, -p, and -s show the right status."
+
+log_must fio --rw=write --name=job --size=10M --filename=/$TESTPOOL/10m_file
+
+log_must zpool export $TESTPOOL
+log_must zpool import $TESTPOOL
+log_must zinject -t data -e checksum -f 100 -am /$TESTPOOL/10m_file
+
+# create some error blocks
+dd if=/$TESTPOOL/10m_file bs=1M count=1 || true
+
+# sync error blocks to disk
+log_must sync_pool $TESTPOOL
+
+log_must set_tunable32 SCAN_SUSPEND_PROGRESS 1
+log_must zpool scrub -e $TESTPOOL
+log_must is_pool_error_scrubbing $TESTPOOL true
+log_must zpool scrub -p $TESTPOOL
+log_must is_pool_error_scrub_paused $TESTPOOL true
+log_mustnot zpool scrub -p $TESTPOOL
+log_must is_pool_error_scrub_paused $TESTPOOL true
+log_must zpool scrub -e $TESTPOOL
+log_must is_pool_error_scrubbing $TESTPOOL true
+log_must zpool scrub -s $TESTPOOL
+log_must is_pool_error_scrub_stopped $TESTPOOL true
+
+log_pass "Verified scrub -e, -p, and -s show expected status."
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_002_pos.ksh
new file mode 100755
index 000000000000..daa11c3949c6
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_002_pos.ksh
@@ -0,0 +1,99 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2019, Delphix. All rights reserved.
+# Copyright (c) 2023, George Amanakis. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/cli_root/zpool_scrub/zpool_scrub.cfg
+
+#
+# DESCRIPTION:
+# Verify regular scrub and error scrub can't run at the same time.
+#
+# STRATEGY:
+# 1. Create a pool and create a 10MB file in it.
+# 2. Start a scrub and verify it's doing a scrub.
+# 3. Start a error scrub (-e) and verify it fails.
+# 4. Pause scrub (-p) and verify it's paused.
+# 5. Start a error scrub (-e) verify it fails again.
+# 6. Resume the paused scrub, verify it and cancel it.
+# 7. Start a error scrub (-e) and verify it's doing error scrub.
+# 8. Start a scrub and verify it fails.
+# 9. Cancel error scrub (-e) and verify it is canceled.
+# 10. Start scrub, verify it, cancel it and verify it.
+#
+
+verify_runnable "global"
+
+function cleanup
+{
+ log_must set_tunable32 SCAN_SUSPEND_PROGRESS 0
+ log_must zinject -c all
+ rm -f /$TESTPOOL/10m_file
+}
+
+log_onexit cleanup
+
+log_assert "Verify regular scrub and error scrub can't run at the same time."
+
+log_must fio --rw=write --name=job --size=10M --filename=/$TESTPOOL/10m_file
+
+log_must zpool export $TESTPOOL
+log_must zpool import $TESTPOOL
+log_must zinject -t data -e checksum -f 100 -am /$TESTPOOL/10m_file
+
+# create some error blocks before error scrub is requested.
+dd if=/$TESTPOOL/10m_file bs=1M count=1 || true
+# sync error blocks to disk
+log_must sync_pool $TESTPOOL
+
+log_must set_tunable32 SCAN_SUSPEND_PROGRESS 1
+
+log_must zpool scrub $TESTPOOL
+log_must is_pool_scrubbing $TESTPOOL true
+log_mustnot zpool scrub -e $TESTPOOL
+log_must zpool scrub -p $TESTPOOL
+log_must is_pool_scrub_paused $TESTPOOL true
+log_mustnot zpool scrub -e $TESTPOOL
+log_must zpool scrub $TESTPOOL
+log_must is_pool_scrubbing $TESTPOOL true
+log_must zpool scrub -s $TESTPOOL
+log_must is_pool_scrub_stopped $TESTPOOL true
+
+# create some error blocks before error scrub is requested.
+dd if=/$TESTPOOL/10m_file bs=1M count=1 || true
+# sync error blocks to disk
+log_must sync_pool $TESTPOOL
+
+log_must zpool scrub -e $TESTPOOL
+log_must is_pool_error_scrubbing $TESTPOOL true
+log_mustnot zpool scrub $TESTPOOL
+log_must zpool scrub -s $TESTPOOL
+log_must is_pool_error_scrub_stopped $TESTPOOL true
+
+log_must zpool scrub $TESTPOOL
+log_must is_pool_scrubbing $TESTPOOL true
+log_must zpool scrub -s $TESTPOOL
+log_must is_pool_scrub_stopped $TESTPOOL true
+
+log_pass "Verified regular scrub and error scrub can't run at the same time."
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_003_pos.ksh
new file mode 100755
index 000000000000..d0066fdbb4a3
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_003_pos.ksh
@@ -0,0 +1,109 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2019, Delphix. All rights reserved.
+# Copyright (c) 2023, George Amanakis. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/cli_root/zpool_scrub/zpool_scrub.cfg
+
+#
+# DESCRIPTION:
+# Verify error scrub clears the errorlog, if errors no longer exist.
+#
+# STRATEGY:
+# 1. Create a pool and create file in it.
+# 2. Zinject errors and read using dd to log errors to disk.
+# 3. Make sure file name is mentioned in the list of error files.
+# 4. Start error scrub and wait for it finish.
+# 5. Check scrub ran and errors are still reported.
+# 6. Clear corruption and error scrub again.
+# 7. Check scrub ran and errors are cleared.
+#
+
+verify_runnable "global"
+
+function cleanup
+{
+ zinject -c all
+ rm -f /$TESTPOOL2/$TESTFILE0
+ destroy_pool $TESTPOOL2
+}
+
+log_onexit cleanup
+
+log_assert "Verify error scrub clears the errorlog, if errors no longer exist."
+
+truncate -s $MINVDEVSIZE $TESTDIR/vdev_a
+log_must zpool create -f -O primarycache=none $TESTPOOL2 $TESTDIR/vdev_a
+log_must zfs create $TESTPOOL2/$TESTFS1
+typeset file=/$TESTPOOL2/$TESTFS1/$TESTFILE0
+log_must dd if=/dev/urandom of=$file bs=2M count=10
+
+lastfs="$(zfs list -r $TESTPOOL2 | tail -1 | awk '{print $1}')"
+for i in {1..3}; do
+ log_must zfs snap $lastfs@snap$i
+ log_must zfs clone $lastfs@snap$i $TESTPOOL2/clone$i
+ lastfs="$(zfs list -r $TESTPOOL2/clone$i | tail -1 | awk '{print $1}')"
+done
+
+log_must zinject -t data -e checksum -f 100 -a $file
+dd if=$file of=/dev/null bs=2M count=10
+
+# Important: sync error log to disk
+log_must sync_pool $TESTPOOL2
+
+# Check reported errors
+log_must zpool status -v $TESTPOOL2
+log_must eval "zpool status -v $TESTPOOL2 | \
+ grep \"Permanent errors have been detected\""
+log_must eval "zpool status -v | grep '$TESTPOOL2/$TESTFS1/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/$TESTFS1@snap1:/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone1/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone1@snap2:/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone2/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone2@snap3:/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone3/$TESTFILE0'"
+
+# Check errors are reported if corruption persists
+log_must zpool scrub -e -w $TESTPOOL2
+log_must eval "zpool status -v | grep 'error blocks'"
+log_must zpool status -v $TESTPOOL2
+log_must eval "zpool status -v $TESTPOOL2 | \
+ grep \"Permanent errors have been detected\""
+log_must eval "zpool status -v | grep '$TESTPOOL2/$TESTFS1/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/$TESTFS1@snap1:/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone1/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone1@snap2:/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone2/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone2@snap3:/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone3/$TESTFILE0'"
+
+# Check errors are cleared
+log_must zinject -c all
+log_must zpool scrub -e -w $TESTPOOL2
+log_must zpool status -v $TESTPOOL2
+log_must eval "zpool status -v | grep 'error blocks'"
+log_mustnot eval "zpool status -v | grep '$TESTFILE0'"
+
+
+log_pass "Verify error scrub clears the errorlog, if errors no longer exist."
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_004_pos.ksh
new file mode 100755
index 000000000000..c88b9b0c8d33
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_004_pos.ksh
@@ -0,0 +1,54 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2023, George Amanakis. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/cli_root/zpool_scrub/zpool_scrub.cfg
+
+#
+# DESCRIPTION:
+# Verify error scrub clears the errorlog, if errors no longer exist.
+#
+# STRATEGY:
+# 1. Create a pool with head_errlog disabled.
+# 2. Run an error scrub and verify it is not supported.
+#
+
+verify_runnable "global"
+
+function cleanup
+{
+ rm -f /$TESTPOOL2/$TESTFILE0
+ destroy_pool $TESTPOOL2
+}
+
+log_onexit cleanup
+
+log_assert "Verify error scrub cannot run without the head_errlog feature."
+
+truncate -s $MINVDEVSIZE $TESTDIR/vdev_a
+log_must zpool create -f -o feature@head_errlog=disabled $TESTPOOL2 $TESTDIR/vdev_a
+log_mustnot zpool scrub -ew $TESTPOOL2
+
+log_pass "Verify error scrub cannot run without the head_errlog feature."
+
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub.cfg b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub.cfg
index f98b1c0613f6..d95c1decd5de 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_001_neg.ksh
index 96bc185dd40c..0368c5809995 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_002_pos.ksh
index 116d622960f9..e11825f91589 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_003_pos.ksh
index 12dc044e9e08..1e1412ee0da9 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_004_pos.ksh
index a7ae7f16b1af..846473be9736 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_005_pos.ksh
index 69a33983d379..62d529486509 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_offline_device.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_offline_device.ksh
index 7a07e643343d..815f26179132 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_offline_device.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_offline_device.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_print_repairing.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_print_repairing.ksh
index 4b51cd9625ec..be06d6147af7 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_print_repairing.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_print_repairing.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_set/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_set/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_set/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_set/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_set/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_set/setup.ksh
index 6a9af3bc28c3..4c719075a741 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_set/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_set/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_001_pos.ksh
new file mode 100755
index 000000000000..4b9097933f37
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_001_pos.ksh
@@ -0,0 +1,89 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+# Copyright (c) 2023 by Klara Inc.
+#
+
+. $STF_SUITE/tests/functional/cli_root/zpool_set/zpool_set_common.kshlib
+
+#
+# DESCRIPTION:
+# ZFS can set any valid user-defined pool property.
+#
+# STRATEGY:
+# 1. Combine all kind of valid characters into a valid user-defined
+# property name.
+# 2. Random get a string as the value.
+# 3. Verify all the valid user-defined pool properties can be set to a
+# pool.
+#
+
+verify_runnable "both"
+
+log_assert "ZFS can set any valid user-defined pool property."
+log_onexit cleanup_user_prop $TESTPOOL
+
+typeset -a names=()
+typeset -a values=()
+
+# Longest property name (255 bytes, which is the 256-byte limit minus 1 byte
+# for the null byte)
+names+=("$(awk 'BEGIN { printf "x:"; while (c++ < (256 - 2 - 1)) printf "a" }')")
+values+=("long-property-name")
+# Longest property value (the limits are 1024 on FreeBSD and 4096 on Linux, so
+# pick the right one; the longest value can use limit minus 1 bytes for the
+# null byte)
+if is_linux; then
+ typeset ZFS_MAXPROPLEN=4096
+else
+ typeset ZFS_MAXPROPLEN=1024
+fi
+names+=("long:property:value")
+values+=("$(awk -v max="$ZFS_MAXPROPLEN" 'BEGIN { while (c++ < (max - 1)) printf "A" }')")
+# Valid property names
+for i in {1..10}; do
+ typeset -i len
+ ((len = RANDOM % 32))
+ names+=("$(valid_user_property $len)")
+ ((len = RANDOM % 512))
+ values+=("$(user_property_value $len)")
+done
+
+typeset -i i=0
+while ((i < ${#names[@]})); do
+ typeset name="${names[$i]}"
+ typeset value="${values[$i]}"
+
+ log_must eval "zpool set $name='$value' $TESTPOOL"
+ log_must eval "check_user_prop $TESTPOOL $name '$value'"
+
+ ((i += 1))
+done
+
+log_pass "ZFS can set any valid user-defined pool property passed."
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_002_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_002_neg.ksh
new file mode 100755
index 000000000000..7c8fcba6e471
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_002_neg.ksh
@@ -0,0 +1,88 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+# Copyright (c) 2023 by Klara Inc.
+#
+
+. $STF_SUITE/tests/functional/cli_root/zpool_set/zpool_set_common.kshlib
+
+#
+# DESCRIPTION:
+# ZFS can handle any invalid user-defined pool property.
+#
+# STRATEGY:
+# 1. Combine all kind of invalid user pool property names.
+# 2. Random get a string as the value.
+# 3. Verify all the invalid user-defined pool properties can not be set
+# to the pool.
+#
+
+verify_runnable "both"
+
+log_assert "ZFS can handle any invalid user pool property."
+log_onexit cleanup_user_prop $TESTPOOL
+
+typeset -a names=()
+typeset -a values=()
+
+# Too long property name (256 bytes, which is the 256-byte limit minus 1 byte
+# for the null byte plus 1 byte to reach back over the limit)
+names+=("$(awk 'BEGIN { printf "x:"; while (c++ < (256 - 2 - 1 + 1)) printf "a" }')")
+values+=("too-long-property-name")
+# Too long property value (the limits are 1024 on FreeBSD and 4096 on Linux, so
+# pick the right one; the too long value is, e.g., the limit minus 1 bytes for the
+# null byte plus 1 byte to reach back over the limit)
+if is_linux; then
+ typeset ZFS_MAXPROPLEN=4096
+else
+ typeset ZFS_MAXPROPLEN=1024
+fi
+names+=("too:long:property:value")
+values+=("$(awk -v max="$ZFS_MAXPROPLEN" 'BEGIN { while (c++ < (max - 1 + 1)) printf "A" }')")
+# Invalid property names
+for i in {1..10}; do
+ typeset -i len
+ ((len = RANDOM % 32))
+ names+=("$(invalid_user_property $len)")
+ ((len = RANDOM % 512))
+ values+=("$(user_property_value $len)")
+done
+
+typeset -i i=0
+while ((i < ${#names[@]})); do
+ typeset name="${names[$i]}"
+ typeset value="${values[$i]}"
+
+ log_mustnot zpool set $name=$value $TESTPOOL
+ log_mustnot check_user_prop $TESTPOOL \"$name\" \"$value\"
+
+ ((i += 1))
+done
+
+log_pass "ZFS can handle invalid user pool property passed."
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_set/vdev_set_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_set/vdev_set_001_pos.ksh
new file mode 100755
index 000000000000..a1f3efb90577
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_set/vdev_set_001_pos.ksh
@@ -0,0 +1,52 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2022, Klara Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+#
+# DESCRIPTION:
+#
+# zpool set comment property on root vdev
+#
+# STRATEGY:
+# 1. set a property on root vdev
+# 2. verify the property is set
+#
+
+log_assert "zpool set comment property on root vdev"
+
+log_must zpool set comment="openzfs" ${TESTPOOL} root
+
+COMMENT="$(zpool get -H -o value comment ${TESTPOOL} root)"
+if [ $? -ne 0 ]; then
+ log_fail "cant retrieve comment property from root vdev"
+fi
+
+if [ "$COMMENT" != "openzfs" ]; then
+ log_fail "unexpected value for comment property: $COMMENT != \"openzfs\""
+fi
+
+log_pass "zpool set comment property on root vdev"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_001_pos.ksh
index 6e4e6be6a18e..3eb1411c8c86 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_002_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_002_neg.ksh
index 34d7fd821464..ab592d433a80 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_003_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_003_neg.ksh
index 1d637b77af00..7e93c8725355 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_003_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_003_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_ashift.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_ashift.ksh
index 09b5f50d5e18..41fef8f7cdb4 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_ashift.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_ashift.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -42,7 +42,7 @@ verify_runnable "global"
function cleanup
{
- log_must set_tunable64 VDEV_FILE_PHYSICAL_ASHIFT $orig_ashift
+ log_must set_tunable32 VDEV_FILE_PHYSICAL_ASHIFT $orig_ashift
destroy_pool $TESTPOOL1
rm -f $disk
}
@@ -60,7 +60,7 @@ orig_ashift=$(get_tunable VDEV_FILE_PHYSICAL_ASHIFT)
# the ashift using the -o ashift property should still
# be honored.
#
-log_must set_tunable64 VDEV_FILE_PHYSICAL_ASHIFT 16
+log_must set_tunable32 VDEV_FILE_PHYSICAL_ASHIFT 16
disk=$TEST_BASE_DIR/disk
log_must mkfile $SIZE $disk
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_common.kshlib b/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_common.kshlib
new file mode 100644
index 000000000000..346e4a16b2ad
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_common.kshlib
@@ -0,0 +1,178 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2014, 2016 by Delphix. All rights reserved.
+# Copyright (c) 2023 by Klara Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+set -A VALID_NAME_CHAR a b c d e f g h i j k l m n o p q r s t u v w x y z \
+ 0 1 2 3 4 5 6 7 8 9 ':' '-' '.' '_'
+set -A INVALID_NAME_CHAR A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \
+ '`' '~' '!' '@' '#' '$' '%' '^' '&' '(' ')' '+' '=' '|' "\\" '{' '[' ']' \
+ '}' ';' '"' '<' ',' '>' '?' '/' ' '
+set -A ALL_CHAR ${VALID_NAME_CHAR[*]} ${INVALID_NAME_CHAR[*]}
+
+#
+# Cleanup all the user properties of the pool.
+#
+# $1 pool name
+#
+function cleanup_user_prop
+{
+ typeset pool=$1
+
+ typeset user_prop
+ user_prop=$(zpool get -H -o property all $pool | grep ":")
+
+ typeset prop
+ for prop in $user_prop; do
+ zpool set $prop="" $pool ||
+ log_must zpool set $prop="" $pool
+ done
+}
+
+#
+# Random select character from the specified character set and combine into a
+# random string
+#
+# $1 character set name
+# $2 String length
+#
+function random_string
+{
+ typeset char_set=${1:-VALID_NAME_CHAR}
+ typeset -i len=${2:-5}
+
+ eval typeset -i count=\${#$char_set[@]}
+
+ # No consumers want an empty string.
+ ((len == 0)) && len=3
+
+ typeset str
+ typeset -i i=0
+ while ((i < len)); do
+ typeset -i ind
+ ((ind = RANDOM % count))
+ eval str=\${str}\${$char_set[\$ind]}
+
+ ((i += 1))
+ done
+
+ echo "$str"
+}
+
+#
+# Get valid user-defined property name
+#
+# $1 user-defined property name length
+#
+function valid_user_property
+{
+ typeset -i sumlen=${1:-10}
+ ((sumlen < 2 )) && sumlen=2
+ typeset -i len
+ ((len = RANDOM % sumlen))
+ typeset part1 part2
+
+ while true; do
+ part1="$(random_string VALID_NAME_CHAR $len)"
+ if [[ "$part1" == "-"* ]]; then
+ continue
+ fi
+ break
+ done
+ ((len = sumlen - (len + 1)))
+
+ while true; do
+ part2="$(random_string VALID_NAME_CHAR $len)"
+ if [[ -z $part1 && -z $part2 ]]; then
+ continue
+ fi
+ break
+ done
+
+ echo "${part1}:${part2}"
+}
+
+#
+# Get invalid user-defined property name
+#
+# $1 user-defined property name length
+#
+function invalid_user_property
+{
+ typeset -i sumlen=${1:-10}
+ ((sumlen == 0)) && sumlen=1
+ typeset -i len
+ ((len = RANDOM % sumlen))
+
+ typeset part1 part2
+ while true; do
+ part1="$(random_string VALID_NAME_CHAR $len)"
+ ((len = sumlen - len))
+ part2="$(random_string INVALID_NAME_CHAR $len)"
+
+ # Avoid $part1 is *:* and $part2 is "=*"
+ if [[ "$part1" == *":"* && "$part2" == "="* ]]; then
+ continue
+ fi
+ break
+ done
+
+ echo "${part1}${part2}"
+}
+
+#
+# Get user-defined property value
+#
+# $1 user-defined property name length
+#
+function user_property_value
+{
+ typeset -i len=${1:-100}
+
+ random_string ALL_CHAR $len
+}
+
+#
+# Check if the user-defined property is identical to the expected value.
+#
+# $1 pool
+# $2 user property
+# $3 expected value
+#
+function check_user_prop
+{
+ typeset pool=$1
+ typeset user_prop="$2"
+ typeset expect_value="$3"
+ typeset value=$(zpool get -p -H -o value "$user_prop" $pool 2>&1)
+
+ [ "$expect_value" = "$value" ]
+}
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_dryrun_output.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_dryrun_output.ksh
index 2267ea7bd895..410b1fe7a03e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_dryrun_output.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_split/zpool_split_dryrun_output.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_status/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_status/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_status/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_status/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_status/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_status/setup.ksh
index 6a9af3bc28c3..4c719075a741 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_status/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_status/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_001_pos.ksh
index 88c0601032a5..076a08802fbe 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_002_pos.ksh
index e2751b112597..d6f32cdc7ac6 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -51,7 +51,7 @@ else
fi
set -A args "" "-x" "-v" "-x $testpool" "-v $testpool" "-xv $testpool" \
- "-vx $testpool"
+ "-vx $testpool" "-e $testpool" "-es $testpool"
log_assert "Executing 'zpool status' with correct options succeeds"
@@ -64,4 +64,6 @@ while [[ $i -lt ${#args[*]} ]]; do
(( i = i + 1 ))
done
+cleanup
+
log_pass "'zpool status' with correct options succeeded"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_003_pos.ksh
index e0c2ed669e32..52b22dd833f0 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -37,6 +37,7 @@
# 3. Read the file
# 4. Take a snapshot and make a clone
# 5. Verify we see "snapshot, clone and filesystem" output in 'zpool status -v'
+# and 'zpool status -ev'
function cleanup
{
@@ -61,10 +62,14 @@ dd if=/$TESTPOOL2/10m_file bs=1M || true
log_must zfs snapshot $TESTPOOL2@snap
log_must zfs clone $TESTPOOL2@snap $TESTPOOL2/clone
+log_must zfs create $TESTPOOL2/$TESTFS1
# Look to see that snapshot, clone and filesystem our files report errors
+log_must zpool status -v $TESTPOOL2
log_must eval "zpool status -v | grep '$TESTPOOL2@snap:/10m_file'"
log_must eval "zpool status -v | grep '$TESTPOOL2/clone/10m_file'"
log_must eval "zpool status -v | grep '$TESTPOOL2/10m_file'"
+log_must eval "zpool status -ev | grep '$TESTPOOL2/10m_file'"
+log_mustnot eval "zpool status -v | grep '$TESTFS1'"
log_pass "'zpool status -v' outputs affected filesystem, snapshot & clone"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_004_pos.ksh
index 6d8571950eec..111d598dfb7d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -74,6 +74,7 @@ log_must eval "zpool status -v | grep '$TESTPOOL2/10m_file'"
# Check that enabling the feature reports the error properly.
log_must zpool set feature@head_errlog=enabled $TESTPOOL2
+log_must zpool status -v $TESTPOOL2
log_must eval "zpool status -v | grep '$TESTPOOL2@snap:/10m_file'"
log_must eval "zpool status -v | grep '$TESTPOOL2/clone/10m_file'"
log_must eval "zpool status -v | grep '$TESTPOOL2/10m_file'"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_005_pos.ksh
new file mode 100755
index 000000000000..ec4c67fb42f5
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_005_pos.ksh
@@ -0,0 +1,90 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2022 George Amanakis. All rights reserved.
+#
+
+#
+# DESCRIPTION:
+# Verify correct output with 'zpool status -v' after corrupting a file
+#
+# STRATEGY:
+# 1. Create a pool, an encrypted filesystem and a file
+# 2. zinject checksum errors
+# 3. Unmount the filesystem and unload the key
+# 4. Scrub the pool
+# 5. Verify we report that errors were detected but we do not report
+# the filename since the key is not loaded.
+# 6. Load the key and mount the encrypted fs.
+# 7. Verify we report errors in the pool in 'zpool status -v'
+
+. $STF_SUITE/include/libtest.shlib
+
+verify_runnable "both"
+
+DISK=${DISKS%% *}
+
+function cleanup
+{
+ log_must zinject -c all
+ destroy_pool $TESTPOOL2
+ rm -f $TESTDIR/vdev_a
+}
+
+log_assert "Verify reporting errors with unloaded keys works"
+log_onexit cleanup
+
+typeset passphrase="password"
+typeset file="/$TESTPOOL2/$TESTFS1/$TESTFILE0"
+
+truncate -s $MINVDEVSIZE $TESTDIR/vdev_a
+log_must zpool create -f -o feature@head_errlog=enabled $TESTPOOL2 $TESTDIR/vdev_a
+
+log_must eval "echo $passphrase > /$TESTPOOL2/pwd"
+
+log_must zfs create -o encryption=aes-256-ccm -o keyformat=passphrase \
+ -o keylocation=file:///$TESTPOOL2/pwd -o primarycache=none \
+ $TESTPOOL2/$TESTFS1
+
+log_must dd if=/dev/urandom of=$file bs=1024 count=1024 oflag=sync
+log_must eval "echo 'aaaaaaaa' >> "$file
+
+corrupt_blocks_at_level $file 0
+log_must zfs umount $TESTPOOL2/$TESTFS1
+log_must zfs unload-key -a
+log_must zpool sync $TESTPOOL2
+log_must zpool scrub $TESTPOOL2
+log_must zpool wait -t scrub $TESTPOOL2
+log_must zpool status -v $TESTPOOL2
+log_mustnot eval "zpool status -v $TESTPOOL2 | \
+ grep \"permission denied\""
+log_mustnot eval "zpool status -v $TESTPOOL2 | grep '$file'"
+
+log_must eval "cat /$TESTPOOL2/pwd | zfs load-key $TESTPOOL2/$TESTFS1"
+log_must zfs mount $TESTPOOL2/$TESTFS1
+log_must zpool status -v $TESTPOOL2
+log_must eval "zpool status -v $TESTPOOL2 | \
+ grep \"Permanent errors have been detected\""
+log_must eval "zpool status -v $TESTPOOL2 | grep '$file'"
+
+log_pass "Verify reporting errors with unloaded keys works"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_006_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_006_pos.ksh
new file mode 100755
index 000000000000..d6f4a4fe2d86
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_006_pos.ksh
@@ -0,0 +1,97 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 George Amanakis. All rights reserved.
+#
+
+#
+# DESCRIPTION:
+# Verify reporting errors when deleting files
+#
+# STRATEGY:
+# 1. Create a pool, and a file
+# 2. zinject checksum errors
+# 3. Create snapshots and clones like:
+# fs->snap1->clone1->snap2->clone2->...
+# 4. Read the original file and immediately delete it
+# 5. Delete the file in clone2
+# 6. Snapshot clone2->snapxx and clone into snapxx->clonexx
+# 7. Verify we report errors in the pool in 'zpool status -v'
+# 8. Promote clone1
+# 9. Verify we report errors in the pool in 'zpool status -v'
+
+. $STF_SUITE/include/libtest.shlib
+
+verify_runnable "both"
+
+function cleanup
+{
+ log_must zinject -c all
+ destroy_pool $TESTPOOL2
+ rm -f $TESTDIR/vdev_a
+}
+
+log_assert "Verify reporting errors when deleting files"
+log_onexit cleanup
+
+typeset file="/$TESTPOOL2/$TESTFILE0"
+
+truncate -s $MINVDEVSIZE $TESTDIR/vdev_a
+log_must zpool create -f -o feature@head_errlog=enabled $TESTPOOL2 $TESTDIR/vdev_a
+log_must dd if=/dev/urandom of=$file bs=1024 count=1024 oflag=sync
+log_must zinject -t data -e checksum -f 100 -am $file
+
+for i in {1..3}; do
+ lastfs="$(zfs list -r $TESTPOOL2 | tail -1 | awk '{print $1}')"
+ log_must zfs snap $lastfs@snap$i
+ log_must zfs clone $lastfs@snap$i $TESTPOOL2/clone$i
+done
+
+log_mustnot dd if=$file of=/dev/null bs=1024
+log_must rm $file /$TESTPOOL2/clone2/$TESTFILE0
+log_must zfs snap $TESTPOOL2/clone2@snapxx
+log_must zfs clone $TESTPOOL2/clone2@snapxx $TESTPOOL2/clonexx
+log_must zpool status -v $TESTPOOL2
+
+log_must eval "zpool status -v $TESTPOOL2 | \
+ grep \"Permanent errors have been detected\""
+log_must eval "zpool status -v | grep '$TESTPOOL2@snap1:/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone1/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone1@snap2:/$TESTFILE0'"
+log_mustnot eval "zpool status -v | grep '$TESTPOOL2/clone2/$TESTFILE0'"
+log_mustnot eval "zpool status -v | grep '$TESTPOOL2/clonexx/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone2@snap3:/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone3/$TESTFILE0'"
+
+log_must zfs promote $TESTPOOL2/clone1
+log_must eval "zpool status -v $TESTPOOL2 | \
+ grep \"Permanent errors have been detected\""
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone1@snap1:/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone1/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone1@snap2:/$TESTFILE0'"
+log_mustnot eval "zpool status -v | grep '$TESTPOOL2/clone2/$TESTFILE0'"
+log_mustnot eval "zpool status -v | grep '$TESTPOOL2/clonexx/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone2@snap3:/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone3/$TESTFILE0'"
+
+log_pass "Verify reporting errors when deleting files"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_007_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_007_pos.ksh
new file mode 100755
index 000000000000..666ac9bfc9dd
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_007_pos.ksh
@@ -0,0 +1,111 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 George Amanakis. All rights reserved.
+#
+
+#
+# DESCRIPTION:
+# Verify reporting errors when deleting corrupted files after scrub
+#
+# STRATEGY:
+# 1. Create a pool, and a file
+# 2. Corrupt the file
+# 3. Create snapshots and clones like:
+# fs->snap1->clone1->snap2->clone2->...
+# 4. Read the original file and immediately delete it
+# 5. Delete the file in clone2
+# 6. Snapshot clone2->snapxx and clone into snapxx->clonexx
+# 7. Verify we report errors in the pool in 'zpool status -v'
+# 8. Promote clone1
+# 9. Verify we report errors in the pool in 'zpool status -v'
+# 10. Delete the corrupted file and origin snapshots.
+# 11. Verify we do not report data errors anymore, without requiring
+# a scrub.
+
+. $STF_SUITE/include/libtest.shlib
+
+verify_runnable "both"
+
+function cleanup
+{
+ destroy_pool $TESTPOOL2
+ rm -f $TESTDIR/vdev_a
+}
+
+log_assert "Verify reporting errors when deleting corrupted files after scrub"
+log_onexit cleanup
+
+typeset file="/$TESTPOOL2/$TESTFS1/$TESTFILE0"
+
+truncate -s $MINVDEVSIZE $TESTDIR/vdev_a
+log_must zpool create -f $TESTPOOL2 $TESTDIR/vdev_a
+log_must zfs create -o primarycache=none $TESTPOOL2/$TESTFS1
+log_must dd if=/dev/urandom of=$file bs=1024 count=1024 oflag=sync
+corrupt_blocks_at_level $file 0
+
+lastfs="$(zfs list -r $TESTPOOL2 | tail -1 | awk '{print $1}')"
+for i in {1..3}; do
+ log_must zfs snap $lastfs@snap$i
+ log_must zfs clone $lastfs@snap$i $TESTPOOL2/clone$i
+ lastfs="$(zfs list -r $TESTPOOL2/clone$i | tail -1 | awk '{print $1}')"
+done
+
+log_must zpool scrub -w $TESTPOOL2
+log_must rm $file /$TESTPOOL2/clone2/$TESTFILE0
+log_must zfs snap $TESTPOOL2/clone2@snapxx
+log_must zfs clone $TESTPOOL2/clone2@snapxx $TESTPOOL2/clonexx
+log_must zpool status -v $TESTPOOL2
+
+log_must eval "zpool status -v $TESTPOOL2 | \
+ grep \"Permanent errors have been detected\""
+log_must eval "zpool status -v | grep '$TESTPOOL2/$TESTFS1@snap1:/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone1/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone1@snap2:/$TESTFILE0'"
+log_mustnot eval "zpool status -v | grep '$TESTPOOL2/clone2/$TESTFILE0'"
+log_mustnot eval "zpool status -v | grep '$TESTPOOL2/clonexx/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone2@snap3:/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone3/$TESTFILE0'"
+
+log_must zfs promote $TESTPOOL2/clone1
+log_must eval "zpool status -v $TESTPOOL2 | \
+ grep \"Permanent errors have been detected\""
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone1@snap1:/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone1/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone1@snap2:/$TESTFILE0'"
+log_mustnot eval "zpool status -v | grep '$TESTPOOL2/clone2/$TESTFILE0'"
+log_mustnot eval "zpool status -v | grep '$TESTPOOL2/clonexx/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone2@snap3:/$TESTFILE0'"
+log_must eval "zpool status -v | grep '$TESTPOOL2/clone3/$TESTFILE0'"
+
+log_must rm /$TESTPOOL2/clone1/$TESTFILE0
+log_must zfs destroy -R $TESTPOOL2/clone1@snap1
+log_must zfs destroy -R $TESTPOOL2/clone1@snap2
+log_must zfs list -r $TESTPOOL2
+log_must zpool status -v $TESTPOOL2
+log_must zpool sync
+log_must zpool status -v $TESTPOOL2
+log_must eval "zpool status -v $TESTPOOL2 | \
+ grep \"No known data errors\""
+
+log_pass "Verify reporting errors when deleting corrupted files after scrub"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_008_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_008_pos.ksh
new file mode 100755
index 000000000000..6be2ad5a7410
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_008_pos.ksh
@@ -0,0 +1,104 @@
+#!/bin/ksh -p
+
+#
+# CDDL HEADER START
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2024 by Lawrence Livermore National Security, LLC.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+#
+# DESCRIPTION:
+# Verify 'zpool status -e' only shows unhealthy devices.
+#
+# STRATEGY:
+# 1. Create zpool
+# 2. Force DEGRADE, FAULT, or inject slow IOs for vdevs
+# 3. Verify vdevs are reported correctly with -e and -s
+# 4. Verify parents are reported as DEGRADED
+# 5. Verify healthy children are not reported
+#
+
+function cleanup
+{
+ log_must set_tunable64 ZIO_SLOW_IO_MS $OLD_SLOW_IO
+ zinject -c all
+ poolexists $TESTPOOL2 && destroy_pool $TESTPOOL2
+ log_must rm -f $all_vdevs
+}
+
+log_assert "Verify 'zpool status -e'"
+
+log_onexit cleanup
+
+all_vdevs=$(echo $TESTDIR/vdev{1..6})
+log_must mkdir -p $TESTDIR
+log_must truncate -s $MINVDEVSIZE $all_vdevs
+
+OLD_SLOW_IO=$(get_tunable ZIO_SLOW_IO_MS)
+
+for raid_type in "draid2:3d:6c:1s" "raidz2"; do
+
+ log_must zpool create -f $TESTPOOL2 $raid_type $all_vdevs
+
+ # Check DEGRADED vdevs are shown.
+ log_must check_vdev_state $TESTPOOL2 $TESTDIR/vdev4 "ONLINE"
+ log_must zinject -d $TESTDIR/vdev4 -A degrade $TESTPOOL2
+ log_must eval "zpool status -e $TESTPOOL2 | grep $TESTDIR/vdev4 | grep DEGRADED"
+
+ # Check FAULTED vdevs are shown.
+ log_must check_vdev_state $TESTPOOL2 $TESTDIR/vdev5 "ONLINE"
+ log_must zinject -d $TESTDIR/vdev5 -A fault $TESTPOOL2
+ log_must eval "zpool status -e $TESTPOOL2 | grep $TESTDIR/vdev5 | grep FAULTED"
+
+ # Check no ONLINE vdevs are shown
+ log_mustnot eval "zpool status -e $TESTPOOL2 | grep ONLINE"
+
+ # Check no ONLINE slow vdevs are show. Then mark IOs greater than
+ # 10ms slow, delay IOs 20ms to vdev6, check slow IOs.
+ log_must check_vdev_state $TESTPOOL2 $TESTDIR/vdev6 "ONLINE"
+ log_mustnot eval "zpool status -es $TESTPOOL2 | grep ONLINE"
+
+ log_must set_tunable64 ZIO_SLOW_IO_MS 10
+ log_must zinject -d $TESTDIR/vdev6 -D20:100 $TESTPOOL2
+ log_must mkfile 1048576 /$TESTPOOL2/testfile
+ sync_pool $TESTPOOL2
+ log_must set_tunable64 ZIO_SLOW_IO_MS $OLD_SLOW_IO
+
+ # Check vdev6 slow IOs are only shown when requested with -s.
+ log_mustnot eval "zpool status -e $TESTPOOL2 | grep $TESTDIR/vdev6 | grep ONLINE"
+ log_must eval "zpool status -es $TESTPOOL2 | grep $TESTDIR/vdev6 | grep ONLINE"
+
+ # Pool level and top-vdev level status must be DEGRADED.
+ log_must eval "zpool status -e $TESTPOOL2 | grep $TESTPOOL2 | grep DEGRADED"
+ log_must eval "zpool status -e $TESTPOOL2 | grep $raid_type | grep DEGRADED"
+
+ # Check that healthy vdevs[1-3] aren't shown with -e.
+ log_must check_vdev_state $TESTPOOL2 $TESTDIR/vdev1 "ONLINE"
+ log_must check_vdev_state $TESTPOOL2 $TESTDIR/vdev2 "ONLINE"
+ log_must check_vdev_state $TESTPOOL2 $TESTDIR/vdev3 "ONLINE"
+ log_mustnot eval "zpool status -es $TESTPOOL2 | grep $TESTDIR/vdev1 | grep ONLINE"
+ log_mustnot eval "zpool status -es $TESTPOOL2 | grep $TESTDIR/vdev2 | grep ONLINE"
+ log_mustnot eval "zpool status -es $TESTPOOL2 | grep $TESTDIR/vdev3 | grep ONLINE"
+
+ log_must zinject -c all
+ log_must zpool status -es $TESTPOOL2
+
+ zpool destroy $TESTPOOL2
+done
+
+log_pass "Verify zpool status -e shows only unhealthy vdevs"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_features_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_features_001_pos.ksh
index 635125fc0d1e..f5c68aca53e0 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_features_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_features_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_sync/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_sync/cleanup.ksh
index 89c146249e71..3167a5097b5a 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_sync/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_sync/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_sync/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_sync/setup.ksh
index 181e62b113c1..3d866cfd9f20 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_sync/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_sync/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_partial.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_partial.ksh
index bdbf3db53336..9342cbe880ae 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_partial.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_partial.ksh
@@ -60,7 +60,7 @@ log_must set_tunable64 VDEV_MIN_MS_COUNT 64
# Minimum trim size is decreased to verify all trim sizes.
typeset trim_extent_bytes_min=$(get_tunable TRIM_EXTENT_BYTES_MIN)
-log_must set_tunable64 TRIM_EXTENT_BYTES_MIN 4096
+log_must set_tunable64 TRIM_EXTENT_BYTES_MIN 512
log_must mkdir "$TESTDIR"
log_must truncate -s $LARGESIZE "$LARGEFILE"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_verify_trimmed.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_verify_trimmed.ksh
index d5aaf49aebc5..41d1decd13ce 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_verify_trimmed.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_verify_trimmed.ksh
@@ -52,7 +52,7 @@ LARGEFILE="$TESTDIR/largefile"
# Reduce trim size to allow for tighter tolerance below when checking.
typeset trim_extent_bytes_min=$(get_tunable TRIM_EXTENT_BYTES_MIN)
-log_must set_tunable64 TRIM_EXTENT_BYTES_MIN 4096
+log_must set_tunable64 TRIM_EXTENT_BYTES_MIN 512
log_must mkdir "$TESTDIR"
log_must truncate -s $LARGESIZE "$LARGEFILE"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/cleanup.ksh
index 1fab5305adc0..3b6f28dd7970 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/setup.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/setup.ksh
index 860ba0f061a6..94301e865bc8 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.cfg b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.cfg
index 993fafc0324d..977aca621278 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.cfg
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib
index 0bc2cfab0470..0889946e8f27 100644
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_001_pos.ksh
index b49c19c5551c..bd44db9eb6be 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_002_pos.ksh
index 16ab14907055..8e5f3dd3a9b1 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_003_pos.ksh
index 0ac3470dedfe..559fdf2b0980 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_004_pos.ksh
index 0e278c81ccb4..bbadfc1f1d1d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_005_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_005_neg.ksh
index b294af06cf46..46c93119561f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_005_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_005_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_006_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_006_neg.ksh
index 4c16f81082ca..c8280086e2e7 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_006_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_006_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_007_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_007_pos.ksh
index 696c8c66cc1c..018d9c1739fe 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_008_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_008_pos.ksh
index 71d59b93a4ca..aae7120bd69f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_009_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_009_neg.ksh
index 22ffda2114a5..f32eac17bce9 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_009_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_009_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_features_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_features_001_pos.ksh
index 5170d31b46da..448de3e4041e 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_features_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_features_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/arc_summary_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/arc_summary_001_pos.ksh
index 5c3d06f228ce..853d40e0355b 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/arc_summary_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/arc_summary_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/arc_summary_002_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/arc_summary_002_neg.ksh
index 59fe057e8ca6..1edc9fa82047 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/arc_summary_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/arc_summary_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/arcstat_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/arcstat_001_pos.ksh
index af301829c196..d48aae19c746 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/arcstat_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/arcstat_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/cleanup.ksh
index e3dc8c179c0a..bbc2565f3b36 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/misc.cfg b/tests/zfs-tests/tests/functional/cli_user/misc/misc.cfg
index 1a96ff5d93fa..9c76a8780b4a 100644
--- a/tests/zfs-tests/tests/functional/cli_user/misc/misc.cfg
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/misc.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -29,7 +29,7 @@
#
if is_linux; then
- # these are the set of setable ZFS properties
+ # these are the set of settable ZFS properties
PROP_NAMES="\
acltype atime \
checksum compression devices \
@@ -81,7 +81,7 @@ elif is_freebsd; then
hidden"
else
- # these are the set of setable ZFS properties
+ # these are the set of settable ZFS properties
PROP_NAMES="\
aclinherit aclmode atime \
checksum compression devices \
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/setup.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/setup.ksh
index fc0ebde10025..9e49c7188ce5 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zdb_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zdb_001_neg.ksh
index 490da6c8caa7..ee889dfc2682 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zdb_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zdb_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_001_neg.ksh
index ec91ded976ff..a70dc47fcc95 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_allow_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_allow_001_neg.ksh
index ce474657b42c..74dc1956105d 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_allow_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_allow_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_clone_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_clone_001_neg.ksh
index 7497553ed8a5..4cb615b07cd2 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_clone_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_clone_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_create_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_create_001_neg.ksh
index aa74bcf40c1f..c77641ad8d7a 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_create_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_create_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_destroy_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_destroy_001_neg.ksh
index fabba4f13e9c..c1bdf6a83cea 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_destroy_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_destroy_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_get_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_get_001_neg.ksh
index 0657b9143670..352dcae6301b 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_get_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_get_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_inherit_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_inherit_001_neg.ksh
index 284c9f76dff1..c52c7bbfd170 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_inherit_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_inherit_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_mount_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_mount_001_neg.ksh
index 8e4c39bfce75..b5779ec8b56a 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_mount_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_mount_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_promote_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_promote_001_neg.ksh
index dd92f534d3a1..64cbbd57cc58 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_promote_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_promote_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_receive_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_receive_001_neg.ksh
index 38c11a051028..3eec6306a60d 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_receive_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_receive_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_rename_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_rename_001_neg.ksh
index ac275b01e5f9..a7c0d78e4a8f 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_rename_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_rename_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_rollback_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_rollback_001_neg.ksh
index 51b5162decfc..bda0702c7581 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_rollback_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_rollback_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_send_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_send_001_neg.ksh
index 6ecb66a3584c..9bdcd519716a 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_send_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_send_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_set_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_set_001_neg.ksh
index 9cfb79210b11..1ec198415705 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_set_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_set_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_share_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_share_001_neg.ksh
index 0d15c0c8e5ae..4ef9ac28af51 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_share_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_share_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_snapshot_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_snapshot_001_neg.ksh
index 232d9574b51c..8c770ae4cc22 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_snapshot_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_snapshot_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_unallow_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_unallow_001_neg.ksh
index 604887f6a2d8..e382141393c1 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_unallow_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_unallow_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_unmount_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_unmount_001_neg.ksh
index 5b0a773f15a9..d421643314cf 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_unmount_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_unmount_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_unshare_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_unshare_001_neg.ksh
index 62b5bf39f43c..f6f5b13556c9 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_unshare_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_unshare_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_upgrade_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_upgrade_001_neg.ksh
index fd65feb8c001..d03907293501 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_upgrade_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_upgrade_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zilstat_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zilstat_001_pos.ksh
new file mode 100755
index 000000000000..9deee67a56ca
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zilstat_001_pos.ksh
@@ -0,0 +1,37 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+is_freebsd && ! python3 -c 'import sysctl' 2>/dev/null && log_unsupported "python3 sysctl module missing"
+
+set -A args "" "-s \",\"" "-v" \
+ "-f time,cwc,imnb,imsb"
+
+log_assert "zilstat generates output and doesn't return an error code"
+
+typeset -i i=0
+while [[ $i -lt ${#args[*]} ]]; do
+ log_must eval "zilstat ${args[i]} > /dev/null"
+ ((i = i + 1))
+done
+log_pass "zilstat generates output and doesn't return an error code"
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_001_neg.ksh
index 00a86eebafe6..13c4ad0f1362 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_add_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_add_001_neg.ksh
index 7bcd911543ed..b68a3eae9920 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_add_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_add_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_attach_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_attach_001_neg.ksh
index b0fadca8c9fe..959f2aea991d 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_attach_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_attach_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_clear_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_clear_001_neg.ksh
index 5d6ef5ff3e4d..f73169ac5b75 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_clear_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_clear_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_create_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_create_001_neg.ksh
index 77d08ee39009..15a44abd4dda 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_create_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_create_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_destroy_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_destroy_001_neg.ksh
index acc93fe74826..fabac4dbcddb 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_destroy_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_destroy_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_detach_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_detach_001_neg.ksh
index dbc540cebbe7..35f200148fc8 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_detach_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_detach_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_export_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_export_001_neg.ksh
index 9bca4668d3d1..9f5c7c224f07 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_export_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_export_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_get_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_get_001_neg.ksh
index c8abf4da58e6..d3179be3970d 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_get_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_get_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_history_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_history_001_neg.ksh
index 47082e3524e3..916905e24ec1 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_history_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_history_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_import_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_import_001_neg.ksh
index 09fd775ff4cc..66dd71507abd 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_import_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_import_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_import_002_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_import_002_neg.ksh
index f3460186725c..3eb091ef2573 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_import_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_import_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_offline_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_offline_001_neg.ksh
index 523883c6f0dd..1f8b5dc94c9e 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_offline_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_offline_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_online_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_online_001_neg.ksh
index cd290515357f..e3c0699e096c 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_online_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_online_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_remove_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_remove_001_neg.ksh
index 1168e6bdac9f..91632c539e66 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_remove_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_remove_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_replace_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_replace_001_neg.ksh
index 6211e6575540..fb6f5847c0fd 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_replace_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_replace_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_scrub_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_scrub_001_neg.ksh
index bf9ee4cfadb0..730c18e085ba 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_scrub_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_scrub_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_set_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_set_001_neg.ksh
index 03d01f20e959..8c89379f5690 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_set_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_set_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_status_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_status_001_neg.ksh
index 9cd811a5487c..a5a44be812f0 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_status_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_status_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_upgrade_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_upgrade_001_neg.ksh
index aa380010574f..eebe13ad30b3 100755
--- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_upgrade_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_upgrade_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zfs_list/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_user/zfs_list/cleanup.ksh
index 115e00c47be5..635042bc11bc 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zfs_list/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zfs_list/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zfs_list/setup.ksh b/tests/zfs-tests/tests/functional/cli_user/zfs_list/setup.ksh
index b4c588282ff7..0196b795395d 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zfs_list/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zfs_list/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list.cfg b/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list.cfg
index 59f367cfa544..de343510186d 100644
--- a/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list.cfg
+++ b/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list.kshlib b/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list.kshlib
index d993c3037444..4c0d9b5b4606 100644
--- a/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_001_pos.ksh
index 5d995a79ba33..318b42e86bdf 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_002_pos.ksh
index 4951097aca51..cc0659f0761e 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_003_pos.ksh
index 8e3a5680d34d..896f629a260a 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_004_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_004_neg.ksh
index 727c0aef0883..cc3f2084a8b0 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_004_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_004_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_007_pos.ksh b/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_007_pos.ksh
index 0f60113b76fe..1049ba9dbe1b 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_008_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_008_neg.ksh
index 4f3504ac41ba..dda1c4f18ca0 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_008_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_008_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/cleanup.ksh
index 3166bd6ec16e..42fe70042d6a 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/setup.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/setup.ksh
index 77eb6bd34f40..009d931c100d 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_-c_disable.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_-c_disable.ksh
index 0d64eb0ec624..5fea262a4f61 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_-c_disable.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_-c_disable.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_-c_homedir.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_-c_homedir.ksh
index 22450d89dfd2..60d350573a15 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_-c_homedir.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_-c_homedir.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_-c_searchpath.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_-c_searchpath.ksh
index 11f51350af56..efd279faed1a 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_-c_searchpath.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_-c_searchpath.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_001_neg.ksh
index d99d42984780..eeb2c47dcb27 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_002_pos.ksh
index 333177accbe5..72c5367522ff 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_003_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_003_neg.ksh
index b6bcf71bffff..5f490b54a795 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_003_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_003_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_004_pos.ksh
index a20321950113..3ff871b0d2d9 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_005_pos.ksh
index 53652ec11b5a..10b4761fe233 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_list/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_list/cleanup.ksh
index 3166bd6ec16e..42fe70042d6a 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_list/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_list/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_list/setup.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_list/setup.ksh
index d275e063b13a..76aa23035dd9 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_list/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_list/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_list/zpool_list_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_list/zpool_list_001_pos.ksh
index 4c57413f1464..a54124a58e5c 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_list/zpool_list_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_list/zpool_list_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_list/zpool_list_002_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_list/zpool_list_002_neg.ksh
index 4ed38d475cd7..001c7292bed2 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_list/zpool_list_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_list/zpool_list_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_status/cleanup.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_status/cleanup.ksh
index 79cd6e9f908e..17d29ee4f548 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_status/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_status/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_status/setup.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_status/setup.ksh
index 6a9af3bc28c3..4c719075a741 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_status/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_status/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_disable.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_disable.ksh
index c8105fb4a50a..4cac07371660 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_disable.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_disable.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_homedir.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_homedir.ksh
index 5363043a8307..a0d17ba7c94c 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_homedir.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_homedir.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_searchpath.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_searchpath.ksh
index 3f64fdf1a708..e3c9187355ae 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_searchpath.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_-c_searchpath.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_003_pos.ksh
index fa7d3f3f2d56..69b5448b458a 100755
--- a/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_user/zpool_status/zpool_status_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/compression/cleanup.ksh b/tests/zfs-tests/tests/functional/compression/cleanup.ksh
index 0573003b6af5..f3647ea2bbee 100755
--- a/tests/zfs-tests/tests/functional/compression/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/compression/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/compression/compress.cfg b/tests/zfs-tests/tests/functional/compression/compress.cfg
index b2373064505f..6c955807c482 100644
--- a/tests/zfs-tests/tests/functional/compression/compress.cfg
+++ b/tests/zfs-tests/tests/functional/compression/compress.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/compression/compress_001_pos.ksh b/tests/zfs-tests/tests/functional/compression/compress_001_pos.ksh
index fb3bae3b6725..cddd45a628f4 100755
--- a/tests/zfs-tests/tests/functional/compression/compress_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/compression/compress_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/compression/compress_002_pos.ksh b/tests/zfs-tests/tests/functional/compression/compress_002_pos.ksh
index e7c6d6c6e57e..1f7d234c10bf 100755
--- a/tests/zfs-tests/tests/functional/compression/compress_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/compression/compress_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/compression/compress_003_pos.ksh b/tests/zfs-tests/tests/functional/compression/compress_003_pos.ksh
index d5b7256b52d6..f8028ad218a1 100755
--- a/tests/zfs-tests/tests/functional/compression/compress_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/compression/compress_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/compression/compress_004_pos.ksh b/tests/zfs-tests/tests/functional/compression/compress_004_pos.ksh
index b924bcd0ba62..ba851343712f 100755
--- a/tests/zfs-tests/tests/functional/compression/compress_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/compression/compress_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/compression/compress_zstd_bswap.ksh b/tests/zfs-tests/tests/functional/compression/compress_zstd_bswap.ksh
index 9726cf0dd5a6..73428e8af510 100755
--- a/tests/zfs-tests/tests/functional/compression/compress_zstd_bswap.ksh
+++ b/tests/zfs-tests/tests/functional/compression/compress_zstd_bswap.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/compression/setup.ksh b/tests/zfs-tests/tests/functional/compression/setup.ksh
index 677cb12d79ac..1eeefeaa18c1 100755
--- a/tests/zfs-tests/tests/functional/compression/setup.ksh
+++ b/tests/zfs-tests/tests/functional/compression/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cp_files/.gitignore b/tests/zfs-tests/tests/functional/cp_files/.gitignore
new file mode 100644
index 000000000000..d15225ac8429
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cp_files/.gitignore
@@ -0,0 +1 @@
+seekflood
diff --git a/tests/zfs-tests/tests/functional/cp_files/cleanup.ksh b/tests/zfs-tests/tests/functional/cp_files/cleanup.ksh
index 3166bd6ec16e..42fe70042d6a 100755
--- a/tests/zfs-tests/tests/functional/cp_files/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/cp_files/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cp_files/cp_files_001_pos.ksh b/tests/zfs-tests/tests/functional/cp_files/cp_files_001_pos.ksh
index 3a814ca3621f..5a48f0fbc522 100755
--- a/tests/zfs-tests/tests/functional/cp_files/cp_files_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cp_files/cp_files_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/cp_files/cp_files_002_pos.ksh b/tests/zfs-tests/tests/functional/cp_files/cp_files_002_pos.ksh
new file mode 100755
index 000000000000..4db968ffae05
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cp_files/cp_files_002_pos.ksh
@@ -0,0 +1,161 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2024 by Lawrence Livermore National Security, LLC.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/bclone/bclone_common.kshlib
+
+#
+# DESCRIPTION:
+# Verify all cp --reflink modes work with modified file.
+#
+# STRATEGY:
+# 1. Verify "cp --reflink=never|auto|always" behaves as expected.
+# Two different modes of operation are tested.
+#
+# a. zfs_bclone_wait_dirty=0: FICLONE and FICLONERANGE fail with EINVAL
+# when there are dirty blocks which cannot be immediately cloned.
+# This is the default behavior.
+#
+# b. zfs_bclone_wait_dirty=1: FICLONE and FICLONERANGE wait for
+# dirty blocks to be written to disk allowing the clone to succeed.
+# The downside to this is it may be slow which depending on the
+# situtation may defeat the point of making a clone.
+#
+
+verify_runnable "global"
+verify_block_cloning
+
+if ! is_linux; then
+ log_unsupported "cp --reflink is a GNU coreutils option"
+fi
+
+function cleanup
+{
+ datasetexists $TESTPOOL/cp-reflink && \
+ destroy_dataset $$TESTPOOL/cp-reflink -f
+ log_must set_tunable32 BCLONE_WAIT_DIRTY 0
+}
+
+function verify_copy
+{
+ src_cksum=$(sha256digest $1)
+ dst_cksum=$(sha256digest $2)
+
+ if [[ "$src_cksum" != "$dst_cksum" ]]; then
+ log_must ls -l $CP_TESTDIR
+ log_fail "checksum mismatch ($src_cksum != $dst_cksum)"
+ fi
+}
+
+log_assert "Verify all cp --reflink modes work with modified file"
+
+log_onexit cleanup
+
+SRC_FILE=src.data
+DST_FILE=dst.data
+SRC_SIZE=$((1024 + $RANDOM % 1024))
+
+# A smaller recordsize is used merely to speed up the test.
+RECORDSIZE=4096
+
+log_must zfs create -o recordsize=$RECORDSIZE $TESTPOOL/cp-reflink
+CP_TESTDIR=$(get_prop mountpoint $TESTPOOL/cp-reflink)
+
+log_must cd $CP_TESTDIR
+
+# Never wait on dirty blocks (zfs_bclone_wait_dirty=0)
+log_must set_tunable32 BCLONE_WAIT_DIRTY 0
+
+for mode in "never" "auto" "always"; do
+ log_note "Checking 'cp --reflink=$mode'"
+
+ # Create a new file and immediately copy it.
+ log_must dd if=/dev/urandom of=$SRC_FILE bs=$RECORDSIZE count=$SRC_SIZE
+
+ if [[ "$mode" == "always" ]]; then
+ log_mustnot cp --reflink=$mode $SRC_FILE $DST_FILE
+ log_must ls -l $CP_TESTDIR
+ else
+ log_must cp --reflink=$mode $SRC_FILE $DST_FILE
+ verify_copy $SRC_FILE $DST_FILE
+ fi
+ log_must rm -f $DST_FILE
+
+ # Append to an existing file and immediately copy it.
+ sync_pool $TESTPOOL
+ log_must dd if=/dev/urandom of=$SRC_FILE bs=$RECORDSIZE seek=$SRC_SIZE \
+ count=1 conv=notrunc
+ if [[ "$mode" == "always" ]]; then
+ log_mustnot cp --reflink=$mode $SRC_FILE $DST_FILE
+ log_must ls -l $CP_TESTDIR
+ else
+ log_must cp --reflink=$mode $SRC_FILE $DST_FILE
+ verify_copy $SRC_FILE $DST_FILE
+ fi
+ log_must rm -f $DST_FILE
+
+ # Overwrite a random range of an existing file and immediately copy it.
+ sync_pool $TESTPOOL
+ log_must dd if=/dev/urandom of=$SRC_FILE bs=$((RECORDSIZE / 2)) \
+ seek=$(($RANDOM % $SRC_SIZE)) count=$((1 + $RANDOM % 16)) conv=notrunc
+ if [[ "$mode" == "always" ]]; then
+ log_mustnot cp --reflink=$mode $SRC_FILE $DST_FILE
+ log_must ls -l $CP_TESTDIR
+ else
+ log_must cp --reflink=$mode $SRC_FILE $DST_FILE
+ verify_copy $SRC_FILE $DST_FILE
+ fi
+ log_must rm -f $SRC_FILE $DST_FILE
+done
+
+# Wait on dirty blocks (zfs_bclone_wait_dirty=1)
+log_must set_tunable32 BCLONE_WAIT_DIRTY 1
+
+for mode in "never" "auto" "always"; do
+ log_note "Checking 'cp --reflink=$mode'"
+
+ # Create a new file and immediately copy it.
+ log_must dd if=/dev/urandom of=$SRC_FILE bs=$RECORDSIZE count=$SRC_SIZE
+ log_must cp --reflink=$mode $SRC_FILE $DST_FILE
+ verify_copy $SRC_FILE $DST_FILE
+ log_must rm -f $DST_FILE
+
+ # Append to an existing file and immediately copy it.
+ log_must dd if=/dev/urandom of=$SRC_FILE bs=$RECORDSIZE seek=$SRC_SIZE \
+ count=1 conv=notrunc
+ log_must cp --reflink=$mode $SRC_FILE $DST_FILE
+ verify_copy $SRC_FILE $DST_FILE
+ log_must rm -f $DST_FILE
+
+ # Overwrite a random range of an existing file and immediately copy it.
+ log_must dd if=/dev/urandom of=$SRC_FILE bs=$((RECORDSIZE / 2)) \
+ seek=$(($RANDOM % $SRC_SIZE)) count=$((1 + $RANDOM % 16)) conv=notrunc
+ log_must cp --reflink=$mode $SRC_FILE $DST_FILE
+ verify_copy $SRC_FILE $DST_FILE
+ log_must rm -f $SRC_FILE $DST_FILE
+done
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/cp_files/cp_stress.ksh b/tests/zfs-tests/tests/functional/cp_files/cp_stress.ksh
new file mode 100755
index 000000000000..43bb8ab572d2
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cp_files/cp_stress.ksh
@@ -0,0 +1,73 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+
+#
+# Copyright (c) 2023 by Lawrence Livermore National Security, LLC.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+#
+# DESCRIPTION:
+#
+# https://github.com/openzfs/zfs/issues/15526 identified a dirty dnode
+# SEEK_HOLE/SEEK_DATA bug. https://github.com/openzfs/zfs/pull/15571
+# fixed the bug, and was backported to 2.1.14 and 2.2.2.
+#
+# This test is to ensure that the bug, as understood, will not recur.
+#
+# STRATEGY:
+#
+# 1. Run the 'seekflood' binary, for creation of files with timing
+# characteristics that can trigger #15526.
+# 2. A single run is not always a trigger, so run repeatedly.
+
+verify_runnable "global"
+
+function cleanup
+{
+ rm -rf /$TESTDIR/cp_stress
+}
+
+log_assert "Run the 'seekflood' binary repeatedly to try to trigger #15526"
+
+log_onexit cleanup
+
+log_must mkdir /$TESTPOOL/cp_stress
+
+MYPWD="$PWD"
+cd /$TESTPOOL/cp_stress
+CPUS=$(get_num_cpus)
+
+if is_freebsd ; then
+ # 'seekflood' takes longer on FreeBSD and can timeout the test
+ RUNS=3
+else
+ RUNS=10
+fi
+
+for i in $(seq 1 $RUNS) ; do
+ # Each run takes around 12 seconds.
+ log_must $STF_SUITE/tests/functional/cp_files/seekflood 2000 $CPUS
+done
+cd "$MYPWD"
+
+log_pass "No corruption detected"
diff --git a/tests/zfs-tests/tests/functional/cp_files/seekflood.c b/tests/zfs-tests/tests/functional/cp_files/seekflood.c
new file mode 100644
index 000000000000..02c2c8e6eca5
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/cp_files/seekflood.c
@@ -0,0 +1,180 @@
+/*
+ * SPDX-License-Identifier: MIT
+ *
+ * Copyright (c) 2023, Rob Norris <robn@despairlabs.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+
+#define DATASIZE (4096)
+char data[DATASIZE];
+
+static int
+_open_file(int n, int wr)
+{
+ char buf[256];
+ int fd;
+
+ snprintf(buf, sizeof (buf), "testdata_%d_%d", getpid(), n);
+
+ if ((fd = open(buf, wr ? (O_WRONLY | O_CREAT) : O_RDONLY,
+ wr ? (S_IRUSR | S_IWUSR) : 0)) < 0) {
+ fprintf(stderr, "Error: open '%s' (%s): %s\n",
+ buf, wr ? "write" : "read", strerror(errno));
+ exit(1);
+ }
+
+ return (fd);
+}
+
+static void
+_write_file(int n, int fd)
+{
+ /* write a big ball of stuff */
+ ssize_t nwr = write(fd, data, DATASIZE);
+ if (nwr < 0) {
+ fprintf(stderr, "Error: write '%d_%d': %s\n",
+ getpid(), n, strerror(errno));
+ exit(1);
+ } else if (nwr < DATASIZE) {
+ fprintf(stderr, "Error: write '%d_%d': short write\n", getpid(),
+ n);
+ exit(1);
+ }
+}
+
+static int
+_seek_file(int n, int fd)
+{
+ struct stat st;
+ if (fstat(fd, &st) < 0) {
+ fprintf(stderr, "Error: fstat '%d_%d': %s\n", getpid(), n,
+ strerror(errno));
+ exit(1);
+ }
+
+ /*
+ * A zero-sized file correctly has no data, so seeking the file is
+ * pointless.
+ */
+ if (st.st_size == 0)
+ return (0);
+
+ /* size is real, and we only write, so SEEK_DATA must find something */
+ if (lseek(fd, 0, SEEK_DATA) < 0) {
+ if (errno == ENXIO)
+ return (1);
+ fprintf(stderr, "Error: lseek '%d_%d': %s\n",
+ getpid(), n, strerror(errno));
+ exit(2);
+ }
+
+ return (0);
+}
+
+int
+main(int argc, char **argv)
+{
+ int nfiles = 0;
+ int nthreads = 0;
+
+ if (argc < 3 || (nfiles = atoi(argv[1])) == 0 ||
+ (nthreads = atoi(argv[2])) == 0) {
+ printf("usage: seekflood <nfiles> <threads>\n");
+ exit(1);
+ }
+
+ memset(data, 0x5a, DATASIZE);
+
+ /* fork off some flood threads */
+ for (int i = 0; i < nthreads; i++) {
+ if (!fork()) {
+ /* thread main */
+
+ /* create zero file */
+ int fd = _open_file(0, 1);
+ _write_file(0, fd);
+ close(fd);
+
+ int count = 0;
+
+ int h = 0, i, j, rfd, wfd;
+ for (i = 0; i < nfiles; i += 2, h++) {
+ j = i+1;
+
+ /* seek h, write i */
+ rfd = _open_file(h, 0);
+ wfd = _open_file(i, 1);
+ count += _seek_file(h, rfd);
+ _write_file(i, wfd);
+ close(rfd);
+ close(wfd);
+
+ /* seek i, write j */
+ rfd = _open_file(i, 0);
+ wfd = _open_file(j, 1);
+ count += _seek_file(i, rfd);
+ _write_file(j, wfd);
+ close(rfd);
+ close(wfd);
+ }
+
+ /* return count of failed seeks to parent */
+ exit(count < 256 ? count : 255);
+ }
+ }
+
+ /* wait for threads, take their seek fail counts from exit code */
+ int count = 0, crashed = 0;
+ for (int i = 0; i < nthreads; i++) {
+ int wstatus;
+ wait(&wstatus);
+ if (WIFEXITED(wstatus))
+ count += WEXITSTATUS(wstatus);
+ else
+ crashed++;
+ }
+
+ if (crashed) {
+ fprintf(stderr, "Error: child crashed; test failed\n");
+ exit(1);
+ }
+
+ if (count) {
+ fprintf(stderr, "Error: %d seek failures; test failed\n",
+ count);
+ exit(1);
+ }
+
+ exit(0);
+}
diff --git a/tests/zfs-tests/tests/functional/cp_files/setup.ksh b/tests/zfs-tests/tests/functional/cp_files/setup.ksh
index fc5cec3063a6..b756d4e76c83 100755
--- a/tests/zfs-tests/tests/functional/cp_files/setup.ksh
+++ b/tests/zfs-tests/tests/functional/cp_files/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/crtime/cleanup.ksh b/tests/zfs-tests/tests/functional/crtime/cleanup.ksh
index 3166bd6ec16e..42fe70042d6a 100755
--- a/tests/zfs-tests/tests/functional/crtime/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/crtime/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/crtime/crtime_001_pos.ksh b/tests/zfs-tests/tests/functional/crtime/crtime_001_pos.ksh
index 4f9810553fa6..b2d0e7378652 100755
--- a/tests/zfs-tests/tests/functional/crtime/crtime_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/crtime/crtime_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/crtime/setup.ksh b/tests/zfs-tests/tests/functional/crtime/setup.ksh
index fc5cec3063a6..b756d4e76c83 100755
--- a/tests/zfs-tests/tests/functional/crtime/setup.ksh
+++ b/tests/zfs-tests/tests/functional/crtime/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/ctime/cleanup.ksh b/tests/zfs-tests/tests/functional/ctime/cleanup.ksh
index 3166bd6ec16e..42fe70042d6a 100755
--- a/tests/zfs-tests/tests/functional/ctime/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/ctime/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/ctime/ctime_001_pos.ksh b/tests/zfs-tests/tests/functional/ctime/ctime_001_pos.ksh
index 035785772db4..6791067ff72f 100755
--- a/tests/zfs-tests/tests/functional/ctime/ctime_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/ctime/ctime_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/ctime/setup.ksh b/tests/zfs-tests/tests/functional/ctime/setup.ksh
index fc5cec3063a6..b756d4e76c83 100755
--- a/tests/zfs-tests/tests/functional/ctime/setup.ksh
+++ b/tests/zfs-tests/tests/functional/ctime/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/deadman/deadman.cfg b/tests/zfs-tests/tests/functional/deadman/deadman.cfg
index e767f3dd5a98..96dc06b78675 100644
--- a/tests/zfs-tests/tests/functional/deadman/deadman.cfg
+++ b/tests/zfs-tests/tests/functional/deadman/deadman.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/deadman/deadman_ratelimit.ksh b/tests/zfs-tests/tests/functional/deadman/deadman_ratelimit.ksh
index 7c8fb08b7e01..4dd4c5b9a76c 100755
--- a/tests/zfs-tests/tests/functional/deadman/deadman_ratelimit.ksh
+++ b/tests/zfs-tests/tests/functional/deadman/deadman_ratelimit.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/deadman/deadman_sync.ksh b/tests/zfs-tests/tests/functional/deadman/deadman_sync.ksh
index 7b18ebdcb859..34a8821725a6 100755
--- a/tests/zfs-tests/tests/functional/deadman/deadman_sync.ksh
+++ b/tests/zfs-tests/tests/functional/deadman/deadman_sync.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/deadman/deadman_zio.ksh b/tests/zfs-tests/tests/functional/deadman/deadman_zio.ksh
index f0774c4b29d9..592399be0e80 100755
--- a/tests/zfs-tests/tests/functional/deadman/deadman_zio.ksh
+++ b/tests/zfs-tests/tests/functional/deadman/deadman_zio.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/cleanup.ksh b/tests/zfs-tests/tests/functional/delegate/cleanup.ksh
index 1951c00e2cf3..173a3ef2e136 100755
--- a/tests/zfs-tests/tests/functional/delegate/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/delegate.cfg b/tests/zfs-tests/tests/functional/delegate/delegate.cfg
index a9a46281b185..d78896fb0174 100644
--- a/tests/zfs-tests/tests/functional/delegate/delegate.cfg
+++ b/tests/zfs-tests/tests/functional/delegate/delegate.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/delegate_common.kshlib b/tests/zfs-tests/tests/functional/delegate/delegate_common.kshlib
index 90045f0b3e55..5ddb6ca2ddc8 100644
--- a/tests/zfs-tests/tests/functional/delegate/delegate_common.kshlib
+++ b/tests/zfs-tests/tests/functional/delegate/delegate_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -861,7 +861,7 @@ function verify_fs_mount
fi
if ! ismounted $fs ; then
- log_must zfs set mountpoint=$newmntpt $fs
+ log_must zfs set -u mountpoint=$newmntpt $fs
log_must rm -rf $newmntpt
log_must mkdir $newmntpt
@@ -878,7 +878,7 @@ function verify_fs_mount
fi
log_must zfs umount $fs
log_must rm -rf $newmntpt
- log_must zfs set mountpoint=$mntpt $fs
+ log_must zfs set -u mountpoint=$mntpt $fs
fi
return 0
diff --git a/tests/zfs-tests/tests/functional/delegate/setup.ksh b/tests/zfs-tests/tests/functional/delegate/setup.ksh
index d783b417346a..dd2822442bd1 100755
--- a/tests/zfs-tests/tests/functional/delegate/setup.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_allow_001_pos.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_allow_001_pos.ksh
index 22e52ccc90b7..4324e3f4cbf3 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_allow_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_allow_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_allow_002_pos.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_allow_002_pos.ksh
index fc603eae19dc..9045f316ca81 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_allow_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_allow_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_allow_003_pos.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_allow_003_pos.ksh
index d8eb58ae1d65..34a26cfc0ca4 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_allow_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_allow_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_allow_004_pos.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_allow_004_pos.ksh
index 1462f5ebe984..f90cdd8aa5a9 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_allow_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_allow_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_allow_005_pos.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_allow_005_pos.ksh
index 3feb598c4ced..d8e7b56021f7 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_allow_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_allow_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_allow_006_pos.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_allow_006_pos.ksh
index 2fc05dee907a..a4e96adf088e 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_allow_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_allow_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_allow_007_pos.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_allow_007_pos.ksh
index f3213254b97a..8855fa48e3a4 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_allow_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_allow_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_allow_008_pos.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_allow_008_pos.ksh
index b0e1df32a64d..be187475e937 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_allow_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_allow_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_allow_009_neg.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_allow_009_neg.ksh
index a6f12244ce2f..9b7995f651df 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_allow_009_neg.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_allow_009_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_allow_010_pos.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_allow_010_pos.ksh
index 3a8ef5e6251b..549928697edd 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_allow_010_pos.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_allow_010_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_allow_011_neg.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_allow_011_neg.ksh
index d4203a814341..44a98dde5ba2 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_allow_011_neg.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_allow_011_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_allow_012_neg.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_allow_012_neg.ksh
index fd95db92e049..dac66c0318bd 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_allow_012_neg.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_allow_012_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_unallow_001_pos.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_unallow_001_pos.ksh
index 178d250ca529..5d64880d030a 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_unallow_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_unallow_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_unallow_002_pos.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_unallow_002_pos.ksh
index ea1de97614f3..471c5645bced 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_unallow_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_unallow_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_unallow_003_pos.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_unallow_003_pos.ksh
index 35eb9a961ebc..98af7fba226f 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_unallow_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_unallow_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_unallow_004_pos.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_unallow_004_pos.ksh
index d41d76bd0950..7e35d4cc38ec 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_unallow_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_unallow_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_unallow_005_pos.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_unallow_005_pos.ksh
index a97f500ea98e..59bc6cc7d6de 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_unallow_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_unallow_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_unallow_006_pos.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_unallow_006_pos.ksh
index 2bba43de9d14..5521eccebfd6 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_unallow_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_unallow_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_unallow_007_neg.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_unallow_007_neg.ksh
index b1a221be0bd9..a25f60b41d0b 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_unallow_007_neg.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_unallow_007_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/delegate/zfs_unallow_008_neg.ksh b/tests/zfs-tests/tests/functional/delegate/zfs_unallow_008_neg.ksh
index a8bd5ebcb6b4..1cda9cef9fb1 100755
--- a/tests/zfs-tests/tests/functional/delegate/zfs_unallow_008_neg.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/zfs_unallow_008_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/devices/cleanup.ksh b/tests/zfs-tests/tests/functional/devices/cleanup.ksh
index 3166bd6ec16e..42fe70042d6a 100755
--- a/tests/zfs-tests/tests/functional/devices/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/devices/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/devices/devices.cfg b/tests/zfs-tests/tests/functional/devices/devices.cfg
index ba3c36ae8c4a..6024834aa3f6 100644
--- a/tests/zfs-tests/tests/functional/devices/devices.cfg
+++ b/tests/zfs-tests/tests/functional/devices/devices.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/devices/devices_001_pos.ksh b/tests/zfs-tests/tests/functional/devices/devices_001_pos.ksh
index 2f2802bc65a3..d130a3d0362d 100755
--- a/tests/zfs-tests/tests/functional/devices/devices_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/devices/devices_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/devices/devices_002_neg.ksh b/tests/zfs-tests/tests/functional/devices/devices_002_neg.ksh
index a768c4aa6b34..1cc7b2bd26eb 100755
--- a/tests/zfs-tests/tests/functional/devices/devices_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/devices/devices_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/devices/devices_003_pos.ksh b/tests/zfs-tests/tests/functional/devices/devices_003_pos.ksh
index 1fcd67409c11..909ca9c80d4b 100755
--- a/tests/zfs-tests/tests/functional/devices/devices_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/devices/devices_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/devices/devices_common.kshlib b/tests/zfs-tests/tests/functional/devices/devices_common.kshlib
index fa7fdbecf5fd..800c565bfe67 100644
--- a/tests/zfs-tests/tests/functional/devices/devices_common.kshlib
+++ b/tests/zfs-tests/tests/functional/devices/devices_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/devices/setup.ksh b/tests/zfs-tests/tests/functional/devices/setup.ksh
index ee6cf83acb9e..c464156ceb60 100755
--- a/tests/zfs-tests/tests/functional/devices/setup.ksh
+++ b/tests/zfs-tests/tests/functional/devices/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/dos_attributes/cleanup.ksh b/tests/zfs-tests/tests/functional/dos_attributes/cleanup.ksh
index 3166bd6ec16e..42fe70042d6a 100755
--- a/tests/zfs-tests/tests/functional/dos_attributes/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/dos_attributes/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/dos_attributes/read_dos_attrs_001.ksh b/tests/zfs-tests/tests/functional/dos_attributes/read_dos_attrs_001.ksh
index c36c0183315e..2c99a4049c67 100755
--- a/tests/zfs-tests/tests/functional/dos_attributes/read_dos_attrs_001.ksh
+++ b/tests/zfs-tests/tests/functional/dos_attributes/read_dos_attrs_001.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/dos_attributes/setup.ksh b/tests/zfs-tests/tests/functional/dos_attributes/setup.ksh
index fc5cec3063a6..b756d4e76c83 100755
--- a/tests/zfs-tests/tests/functional/dos_attributes/setup.ksh
+++ b/tests/zfs-tests/tests/functional/dos_attributes/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/dos_attributes/write_dos_attrs_001.ksh b/tests/zfs-tests/tests/functional/dos_attributes/write_dos_attrs_001.ksh
index 9d66cd357599..4a7fb747f930 100755
--- a/tests/zfs-tests/tests/functional/dos_attributes/write_dos_attrs_001.ksh
+++ b/tests/zfs-tests/tests/functional/dos_attributes/write_dos_attrs_001.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/events/cleanup.ksh b/tests/zfs-tests/tests/functional/events/cleanup.ksh
index 72570d9288fd..669b8ae99456 100755
--- a/tests/zfs-tests/tests/functional/events/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/events/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -26,8 +26,10 @@
. $STF_SUITE/include/libtest.shlib
+zed_stop
+
zed_cleanup all-debug.sh all-syslog.sh all-dumpfds
-zed_stop
+zed_events_drain
default_cleanup
diff --git a/tests/zfs-tests/tests/functional/events/events.cfg b/tests/zfs-tests/tests/functional/events/events.cfg
index 27046c1b0c6b..5dbdb3074f31 100644
--- a/tests/zfs-tests/tests/functional/events/events.cfg
+++ b/tests/zfs-tests/tests/functional/events/events.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/events/events_001_pos.ksh b/tests/zfs-tests/tests/functional/events/events_001_pos.ksh
index 189cf435e88e..b509a44606f0 100755
--- a/tests/zfs-tests/tests/functional/events/events_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/events/events_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/events/events_002_pos.ksh b/tests/zfs-tests/tests/functional/events/events_002_pos.ksh
index 42088fc0905f..e355b8977378 100755
--- a/tests/zfs-tests/tests/functional/events/events_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/events/events_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/events/events_common.kshlib b/tests/zfs-tests/tests/functional/events/events_common.kshlib
index 73bf4cf357b5..7a0b032c3b2f 100644
--- a/tests/zfs-tests/tests/functional/events/events_common.kshlib
+++ b/tests/zfs-tests/tests/functional/events/events_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/events/setup.ksh b/tests/zfs-tests/tests/functional/events/setup.ksh
index 2f81d16b1814..0f058b8fe18c 100755
--- a/tests/zfs-tests/tests/functional/events/setup.ksh
+++ b/tests/zfs-tests/tests/functional/events/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/events/zed_cksum_config.ksh b/tests/zfs-tests/tests/functional/events/zed_cksum_config.ksh
new file mode 100755
index 000000000000..5aae3d034660
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/events/zed_cksum_config.ksh
@@ -0,0 +1,158 @@
+#!/bin/ksh -p
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2022, Klara Inc.
+#
+
+# DESCRIPTION:
+# Verify that vdev properties, checksum_n and checksum_t, work with ZED.
+#
+# STRATEGY:
+# 1. Create a pool with single vdev
+# 2. Set checksum_n/checksum_t to non-default values
+# 3. Inject checksum errors
+# 4. Verify that ZED degrades vdev
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/events/events_common.kshlib
+
+verify_runnable "both"
+
+MOUNTDIR="$TEST_BASE_DIR/checksum_mount"
+FILEPATH="$MOUNTDIR/checksum_file"
+VDEV="$TEST_BASE_DIR/vdevfile.$$"
+POOL="checksum_pool"
+FILESIZE="10M"
+
+function cleanup
+{
+ log_must zed_stop
+
+ log_must zinject -c all
+ if poolexists $POOL ; then
+ destroy_pool $POOL
+ fi
+ log_must rm -fd $VDEV $MOUNTDIR
+}
+
+log_onexit cleanup
+
+log_assert "Test ZED checksum_N and checksum_T configurability"
+
+function do_setup
+{
+ log_must zpool create -f -m $MOUNTDIR $POOL $VDEV
+ log_must zpool events -c
+ log_must truncate -s 0 $ZED_DEBUG_LOG
+ log_must zfs set compression=off $POOL
+ log_must zfs set primarycache=none $POOL
+ log_must zfs set recordsize=512 $POOL
+}
+
+function do_clean
+{
+ log_must zinject -c all
+ log_must zpool destroy $POOL
+}
+
+function must_degrade
+{
+ log_must wait_vdev_state $POOL $VDEV "DEGRADED" 60
+}
+
+function mustnot_degrade
+{
+ log_must file_wait $ZED_DEBUG_LOG 5
+ log_must wait_vdev_state $POOL $VDEV "ONLINE" 60
+}
+
+# Test default settings of ZED:
+# checksum_n=10
+# checksum_t=600
+# fire 10 events, should degrade.
+function default_degrade
+{
+ do_setup
+
+ log_must mkfile $FILESIZE $FILEPATH
+ log_must zinject -a -t data -e checksum -T read -f 100 $FILEPATH
+
+ blk=0
+ for _ in {1..10}; do
+ dd if=$FILEPATH of=/dev/null bs=1 count=1 skip=$blk 2>/dev/null
+ blk=$((blk+512))
+ done
+
+ must_degrade
+
+ do_clean
+}
+
+# Set checksum_t=1
+# fire 10 events over 2.5 seconds, should not degrade.
+function checksum_t_no_degrade
+{
+ do_setup
+
+ log_must zpool set checksum_t=1 $POOL $VDEV
+ log_must mkfile $FILESIZE $FILEPATH
+ log_must zinject -a -t data -e checksum -T read -f 100 $FILEPATH
+
+ blk=0
+ for _ in {1..10}; do
+ dd if=$FILEPATH of=/dev/null bs=1 count=1 skip=$blk 2>/dev/null
+ blk=$((blk+512))
+ sleep 0.25
+ done
+
+ mustnot_degrade
+
+ do_clean
+}
+
+# Set checksum_n=1
+# fire 1 event, should degrade.
+function checksum_n_degrade
+{
+ do_setup
+
+ log_must zpool set checksum_n=1 $POOL $VDEV
+ log_must mkfile $FILESIZE $FILEPATH
+ log_must zinject -a -t data -e checksum -T read -f 100 $FILEPATH
+
+ dd if=$FILEPATH of=/dev/null bs=1 count=1 2>/dev/null
+
+ must_degrade
+
+ do_clean
+}
+
+log_must truncate -s $MINVDEVSIZE $VDEV
+log_must mkdir -p $MOUNTDIR
+
+log_must zed_start
+default_degrade
+checksum_n_degrade
+checksum_t_no_degrade
+
+log_pass "Test ZED checksum_N and checksum_T configurability"
diff --git a/tests/zfs-tests/tests/functional/events/zed_cksum_reported.ksh b/tests/zfs-tests/tests/functional/events/zed_cksum_reported.ksh
new file mode 100755
index 000000000000..78acd76c2eeb
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/events/zed_cksum_reported.ksh
@@ -0,0 +1,124 @@
+#!/bin/ksh -p
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2022, Klara Inc.
+#
+# This software was developed by Rob Wing <rob.wing@klarasystems.com>
+# under sponsorship from Seagate Technology LLC and Klara Inc.
+
+# DESCRIPTION:
+# Verify that checksum errors are accurately reported to ZED
+#
+# STRATEGY:
+# 1. Create a mirrored/raidz pool
+# 2. Inject checksum error
+# 3. Verify checksum error count reported to ZED is not zero
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/events/events_common.kshlib
+
+verify_runnable "both"
+
+MOUNTDIR="$TEST_BASE_DIR/checksum_mount"
+FILEPATH="$MOUNTDIR/checksum_file"
+VDEV="$TEST_BASE_DIR/vdevfile.$$"
+VDEV1="$TEST_BASE_DIR/vdevfile1.$$"
+POOL="checksum_pool"
+FILESIZE="10M"
+
+function cleanup
+{
+ log_must zed_stop
+
+ log_must zinject -c all
+ if poolexists $POOL ; then
+ destroy_pool $POOL
+ fi
+ log_must rm -fd $VDEV $MOUNTDIR
+}
+log_onexit cleanup
+
+log_assert "Test reported checksum errors to ZED"
+
+function setup_pool
+{
+ type="$1"
+
+ log_must zpool create -f -m $MOUNTDIR $POOL $type $VDEV $VDEV1
+ log_must zpool events -c
+ log_must truncate -s 0 $ZED_DEBUG_LOG
+ log_must zfs set compression=off $POOL
+ log_must zfs set primarycache=none $POOL
+}
+
+function do_clean
+{
+ log_must zinject -c all
+ log_must zpool destroy $POOL
+}
+
+function do_checksum_error
+{
+ log_must mkfile $FILESIZE $FILEPATH
+ log_must zinject -a -t data -e checksum -T read -f 100 $FILEPATH
+
+ dd if=$FILEPATH of=/dev/null bs=1 count=1 2>/dev/null
+
+ log_must file_wait_event $ZED_DEBUG_LOG "ereport.fs.zfs.checksum" 10
+
+ # checksum error as reported from the vdev.
+ zpool_cksum=`zpool get -H -o value checksum_errors $POOL $VDEV`
+
+ # first checksum error reported to ZED.
+ zed_cksum=$(awk '/ZEVENT_CLASS=ereport.fs.zfs.checksum/, \
+ /ZEVENT_VDEV_CKSUM_ERRORS=/ { \
+ if ($1 ~ "ZEVENT_VDEV_CKSUM_ERRORS") \
+ { print $0; exit } }' $ZED_DEBUG_LOG)
+
+ log_must [ $zpool_cksum -gt 0 ]
+
+ log_mustnot [ "$zed_cksum" = "ZEVENT_VDEV_CKSUM_ERRORS=0" ]
+
+ log_must [ "$zed_cksum" = "ZEVENT_VDEV_CKSUM_ERRORS=1" ]
+}
+
+# Set checksum_n=1
+# fire 1 event, should degrade.
+function checksum_error
+{
+ type=$1
+
+ setup_pool $type
+ do_checksum_error
+ do_clean
+}
+
+log_must truncate -s $MINVDEVSIZE $VDEV
+log_must truncate -s $MINVDEVSIZE $VDEV1
+log_must mkdir -p $MOUNTDIR
+
+log_must zed_start
+checksum_error mirror
+checksum_error raidz
+
+log_pass "Test reported checksum errors to ZED"
diff --git a/tests/zfs-tests/tests/functional/events/zed_fd_spill.ksh b/tests/zfs-tests/tests/functional/events/zed_fd_spill.ksh
index d70dd0c7b445..4803f0f3de7c 100755
--- a/tests/zfs-tests/tests/functional/events/zed_fd_spill.ksh
+++ b/tests/zfs-tests/tests/functional/events/zed_fd_spill.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/events/zed_io_config.ksh b/tests/zfs-tests/tests/functional/events/zed_io_config.ksh
new file mode 100755
index 000000000000..637f979fe8d1
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/events/zed_io_config.ksh
@@ -0,0 +1,150 @@
+#!/bin/ksh -p
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2022, Klara Inc.
+#
+
+# DESCRIPTION:
+# Verify that vdev properties, io_n and io_t, work with ZED.
+#
+# STRATEGY:
+# 1. Create a mirrored pool.
+# 3. Set io_n/io_t to non-default values
+# 3. Inject io errors
+# 4. Verify that ZED degrades vdev
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/events/events_common.kshlib
+
+verify_runnable "both"
+
+MOUNTDIR="$TEST_BASE_DIR/io_mount"
+FILEPATH="$MOUNTDIR/io_file"
+VDEV="$TEST_BASE_DIR/vdevfile.$$"
+VDEV1="$TEST_BASE_DIR/vdevfile1.$$"
+POOL="io_pool"
+
+function cleanup
+{
+ log_must zed_stop
+
+ log_must zinject -c all
+ if poolexists $POOL ; then
+ destroy_pool $POOL
+ fi
+ log_must rm -fd $VDEV $VDEV1 $MOUNTDIR
+ log_must set_tunable32 PREFETCH_DISABLE $zfsprefetch
+}
+log_onexit cleanup
+
+log_assert "Test ZED io_n and io_t configurability"
+
+zfsprefetch=$(get_tunable PREFETCH_DISABLE)
+log_must set_tunable32 PREFETCH_DISABLE 1
+
+function setup_pool
+{
+ log_must zpool create -f -m $MOUNTDIR $POOL mirror $VDEV $VDEV1
+ log_must zpool events -c
+ log_must truncate -s 0 $ZED_DEBUG_LOG
+ log_must zfs set compression=off $POOL
+ log_must zfs set primarycache=none $POOL
+ log_must zfs set recordsize=512 $POOL
+}
+
+function do_clean
+{
+ log_must zinject -c all
+ log_must zpool destroy $POOL
+}
+
+# Test default ZED settings:
+# io_n=10 (events)
+# io_t=600 (seconds)
+# fire 10 events over 2.5 seconds, should degrade.
+function default_degrade
+{
+ setup_pool
+
+ log_must dd if=/dev/urandom of=$FILEPATH bs=1M count=64
+ log_must zinject -a -d $VDEV -e io -T read -f 100 $POOL
+
+ blk=0
+ for _ in {1..10}; do
+ dd if=$FILEPATH of=/dev/null bs=1 count=1 skip=$blk 2>/dev/null
+ blk=$((blk+512))
+ sleep 0.25
+ done
+
+ log_must wait_vdev_state $POOL $VDEV "FAULTED" 60
+ do_clean
+}
+
+# set io_n=1
+# fire 1 event, should degrade
+function io_n_degrade
+{
+ setup_pool
+
+ log_must zpool set io_n=1 $POOL $VDEV
+ log_must dd if=/dev/urandom of=$FILEPATH bs=1M count=64
+ log_must zinject -a -d $VDEV -e io -T read -f 100 $POOL
+
+ dd if=$FILEPATH of=/dev/null bs=1 count=1 2>/dev/null
+
+ log_must wait_vdev_state $POOL $VDEV "FAULTED" 60
+ do_clean
+}
+
+# set io_t=1
+# fire 10 events over 2.5 seconds, should not degrade
+function io_t_nodegrade
+{
+ setup_pool
+
+ log_must zpool set io_t=1 $POOL $VDEV
+ log_must dd if=/dev/urandom of=$FILEPATH bs=1M count=64
+ log_must zinject -a -d $VDEV -e io -T read -f 100 $POOL
+
+ blk=0
+ for _ in {1..10}; do
+ dd if=$FILEPATH of=/dev/null bs=1 count=1 skip=$blk 2>/dev/null
+ blk=$((blk+512))
+ sleep 0.25
+ done
+
+ log_must file_wait $ZED_DEBUG_LOG 30
+ log_must wait_vdev_state $POOL $VDEV "ONLINE" 1
+
+ do_clean
+}
+
+log_must truncate -s $MINVDEVSIZE $VDEV
+log_must truncate -s $MINVDEVSIZE $VDEV1
+log_must mkdir -p $MOUNTDIR
+
+log_must zed_start
+default_degrade
+io_n_degrade
+io_t_nodegrade
+
+log_pass "Test ZED io_n and io_t configurability"
diff --git a/tests/zfs-tests/tests/functional/events/zed_rc_filter.ksh b/tests/zfs-tests/tests/functional/events/zed_rc_filter.ksh
index 0bef0ef1f96b..766468b5660d 100755
--- a/tests/zfs-tests/tests/functional/events/zed_rc_filter.ksh
+++ b/tests/zfs-tests/tests/functional/events/zed_rc_filter.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/events/zed_slow_io.ksh b/tests/zfs-tests/tests/functional/events/zed_slow_io.ksh
new file mode 100755
index 000000000000..d9fabb2c3bc9
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/events/zed_slow_io.ksh
@@ -0,0 +1,205 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023, Klara Inc.
+#
+
+# DESCRIPTION:
+# Verify that vdev properties, slow_io_n and slow_io_t, work with ZED.
+#
+# STRATEGY:
+# 1. Create a pool with single vdev
+# 2. Set slow_io_n/slow_io_t to non-default values
+# 3. Inject slow io errors
+# 4. Verify that ZED degrades vdev
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+TESTDIR="$TEST_BASE_DIR/zed_slow_io"
+VDEV="$TEST_BASE_DIR/vdevfile.$$"
+TESTPOOL="slow_io_pool"
+FILEPATH="$TESTDIR/slow_io.testfile"
+
+OLD_SLOW_IO=$(get_tunable ZIO_SLOW_IO_MS)
+OLD_SLOW_IO_EVENTS=$(get_tunable SLOW_IO_EVENTS_PER_SECOND)
+
+verify_runnable "both"
+
+function do_setup
+{
+ log_must truncate -s 1G $VDEV
+ default_setup_noexit $VDEV
+ zed_events_drain
+ log_must zfs set compression=off $TESTPOOL
+ log_must zfs set primarycache=none $TESTPOOL
+ log_must zfs set prefetch=none $TESTPOOL
+ log_must zfs set recordsize=512 $TESTPOOL
+ for i in {1..10}; do
+ dd if=/dev/urandom of=${FILEPATH}$i bs=512 count=1 2>/dev/null
+ done
+ zpool sync
+}
+
+# intermediate cleanup
+function do_clean
+{
+ log_must zinject -c all
+ log_must zpool destroy $TESTPOOL
+ log_must rm -f $VDEV
+}
+
+# final cleanup
+function cleanup
+{
+ log_must zinject -c all
+
+ # if pool still exists then something failed so log additional info
+ if poolexists $TESTPOOL ; then
+ log_note "$(zpool status -s $TESTPOOL)"
+ echo "=================== zed log search ==================="
+ grep "Diagnosis Engine" $ZEDLET_DIR/zed.log
+ destroy_pool $TESTPOOL
+ fi
+ log_must zed_stop
+
+ log_must rm -f $VDEV
+
+ log_must set_tunable64 ZIO_SLOW_IO_MS $OLD_SLOW_IO
+ log_must set_tunable64 SLOW_IO_EVENTS_PER_SECOND $OLD_SLOW_IO_EVENTS
+}
+
+function start_slow_io
+{
+ zpool sync
+ log_must set_tunable64 ZIO_SLOW_IO_MS 10
+ log_must set_tunable64 SLOW_IO_EVENTS_PER_SECOND 1000
+
+ log_must zinject -d $VDEV -D10:1 -T read $TESTPOOL
+ zpool sync
+}
+
+function stop_slow_io
+{
+ log_must set_tunable64 ZIO_SLOW_IO_MS $OLD_SLOW_IO
+ log_must set_tunable64 SLOW_IO_EVENTS_PER_SECOND $OLD_SLOW_IO_EVENTS
+
+ log_must zinject -c all
+}
+
+# Test default ZED settings:
+# inject 10 events over 2.5 seconds, should not degrade.
+function default_degrade
+{
+ do_setup
+
+ start_slow_io
+ for i in {1..10}; do
+ dd if=${FILEPATH}$i of=/dev/null count=1 bs=512 2>/dev/null
+ sleep 0.25
+ done
+ stop_slow_io
+ log_note "$(zpool status -s $TESTPOOL)"
+
+ # give slow ZED a chance to process the delay events
+ sleep 18
+ log_note "$(zpool status -s $TESTPOOL)"
+
+ degrades=$(grep "zpool_vdev_degrade" $ZEDLET_DIR/zed.log | wc -l)
+ log_note $degrades vdev degrades in ZED log
+ [ $degrades -eq "0" ] || \
+ log_fail "expecting no degrade events, found $degrades"
+
+ do_clean
+}
+
+# change slow_io_n, slow_io_t to 5 events in 60 seconds
+# fire more than 5 events, should degrade
+function slow_io_degrade
+{
+ do_setup
+
+ zpool set slow_io_n=5 $TESTPOOL $VDEV
+ zpool set slow_io_t=60 $TESTPOOL $VDEV
+
+ start_slow_io
+ for i in {1..16}; do
+ dd if=${FILEPATH}$i of=/dev/null count=1 bs=512 2>/dev/null
+ sleep 0.5
+ done
+ stop_slow_io
+ zpool sync
+
+ #
+ # wait up to 60 seconds for kernel to produce at least 5 delay events
+ #
+ typeset -i i=0
+ typeset -i events=0
+ while [[ $i -lt 60 ]]; do
+ events=$(zpool events | grep "ereport\.fs\.zfs.delay" | wc -l)
+ [[ $events -ge "5" ]] && break
+ i=$((i+1))
+ sleep 1
+ done
+ log_note "$events delay events found"
+
+ if [[ $events -ge "5" ]]; then
+ log_must wait_vdev_state $TESTPOOL $VDEV "DEGRADED" 10
+ fi
+
+ do_clean
+}
+
+# change slow_io_n, slow_io_t to 10 events in 1 second
+# inject events spaced 0.5 seconds apart, should not degrade
+function slow_io_no_degrade
+{
+ do_setup
+
+ zpool set slow_io_n=10 $TESTPOOL $VDEV
+ zpool set slow_io_t=1 $TESTPOOL $VDEV
+
+ start_slow_io
+ for i in {1..16}; do
+ dd if=${FILEPATH}$i of=/dev/null count=1 bs=512 2>/dev/null
+ sleep 0.5
+ done
+ stop_slow_io
+ zpool sync
+
+ log_mustnot wait_vdev_state $TESTPOOL $VDEV "DEGRADED" 45
+
+ do_clean
+}
+
+log_assert "Test ZED slow io configurability"
+log_onexit cleanup
+
+log_must zed_events_drain
+log_must zed_start
+
+default_degrade
+slow_io_degrade
+slow_io_no_degrade
+
+log_pass "Test ZED slow io configurability"
diff --git a/tests/zfs-tests/tests/functional/events/zed_slow_io_many_vdevs.ksh b/tests/zfs-tests/tests/functional/events/zed_slow_io_many_vdevs.ksh
new file mode 100755
index 000000000000..3357ae2e3510
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/events/zed_slow_io_many_vdevs.ksh
@@ -0,0 +1,177 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023, Klara Inc.
+#
+
+# DESCRIPTION:
+# Verify that delay events from multiple vdevs doesnt degrade
+#
+# STRATEGY:
+# 1. Create a pool with a 3 disk raidz vdev
+# 2. Inject slow io errors
+# 3. Verify that ZED detects slow I/Os but doesn't degrade any vdevs
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+TESTDIR="$TEST_BASE_DIR/zed_slow_io"
+VDEV1="$TEST_BASE_DIR/vdevfile1.$$"
+VDEV2="$TEST_BASE_DIR/vdevfile2.$$"
+VDEV3="$TEST_BASE_DIR/vdevfile3.$$"
+VDEV4="$TEST_BASE_DIR/vdevfile4.$$"
+VDEVS="$VDEV1 $VDEV2 $VDEV3 $VDEV4"
+TESTPOOL="slow_io_pool"
+FILEPATH="$TESTDIR/slow_io.testfile"
+
+OLD_SLOW_IO=$(get_tunable ZIO_SLOW_IO_MS)
+OLD_SLOW_IO_EVENTS=$(get_tunable SLOW_IO_EVENTS_PER_SECOND)
+
+verify_runnable "both"
+
+function cleanup
+{
+ log_must zinject -c all
+
+ # if pool still exists then something failed so log additional info
+ if poolexists $TESTPOOL ; then
+ log_note "$(zpool status -s $TESTPOOL)"
+ echo "=================== zed log search ==================="
+ grep "Diagnosis Engine" $ZEDLET_DIR/zed.log
+ destroy_pool $TESTPOOL
+ fi
+ log_must zed_stop
+
+ log_must rm -f $VDEVS
+ log_must set_tunable64 ZIO_SLOW_IO_MS $OLD_SLOW_IO
+ log_must set_tunable64 SLOW_IO_EVENTS_PER_SECOND $OLD_SLOW_IO_EVENTS
+}
+
+function start_slow_io
+{
+ for vdev in $VDEVS
+ do
+ log_must zpool set slow_io_n=4 $TESTPOOL $vdev
+ log_must zpool set slow_io_t=60 $TESTPOOL $vdev
+ done
+ zpool sync
+
+ log_must set_tunable64 ZIO_SLOW_IO_MS 10
+ log_must set_tunable64 SLOW_IO_EVENTS_PER_SECOND 1000
+
+ for vdev in $VDEVS
+ do
+ log_must zinject -d $vdev -D10:1 $TESTPOOL
+ done
+ zpool sync
+}
+
+function stop_slow_io
+{
+ log_must set_tunable64 ZIO_SLOW_IO_MS $OLD_SLOW_IO
+ log_must set_tunable64 SLOW_IO_EVENTS_PER_SECOND $OLD_SLOW_IO_EVENTS
+
+ log_must zinject -c all
+}
+
+function multiple_slow_vdevs_test
+{
+ log_must truncate -s 1G $VDEVS
+ default_raidz_setup_noexit $VDEVS
+
+ log_must zpool events -c
+ log_must zfs set compression=off $TESTPOOL
+ log_must zfs set primarycache=none $TESTPOOL
+ log_must zfs set recordsize=4K $TESTPOOL
+
+ log_must dd if=/dev/urandom of=$FILEPATH bs=1M count=20
+ zpool sync
+
+ #
+ # Read the file with slow io injected on the disks
+ # This will cause multiple errors on each disk to trip ZED SERD
+ #
+ # pool: slow_io_pool
+ # state: ONLINE
+ # config:
+ #
+ # NAME STATE READ WRITE CKSUM SLOW
+ # slow_io_pool ONLINE 0 0 0 -
+ # raidz1-0 ONLINE 0 0 0 -
+ # /var/tmp/vdevfile1.499278 ONLINE 0 0 0 113
+ # /var/tmp/vdevfile2.499278 ONLINE 0 0 0 109
+ # /var/tmp/vdevfile3.499278 ONLINE 0 0 0 96
+ # /var/tmp/vdevfile4.499278 ONLINE 0 0 0 109
+ #
+ start_slow_io
+ dd if=$FILEPATH of=/dev/null bs=1M count=20 2>/dev/null
+ stop_slow_io
+
+ # count events available for processing
+ typeset -i i=0
+ typeset -i events=0
+ while [[ $i -lt 60 ]]; do
+ events=$(zpool events | grep "ereport\.fs\.zfs.delay" | wc -l)
+ [[ $events -ge "50" ]] && break
+ i=$((i+1))
+ sleep 1
+ done
+ log_note "$events delay events found"
+ if [[ $events -lt "50" ]]; then
+ log_note "bailing: not enough events to complete the test"
+ destroy_pool $TESTPOOL
+ return
+ fi
+
+ #
+ # give slow ZED a chance to process the delay events
+ #
+ typeset -i i=0
+ typeset -i skips=0
+ while [[ $i -lt 75 ]]; do
+ skips=$(grep "retiring case" \
+ $ZEDLET_DIR/zed.log | wc -l)
+ [[ $skips -gt "0" ]] && break
+ i=$((i+1))
+ sleep 1
+ done
+
+ log_note $skips degrade skips in ZED log after $i seconds
+ [ $skips -gt "0" ] || log_fail "expecting to see skips"
+
+ degrades=$(grep "zpool_vdev_degrade" $ZEDLET_DIR/zed.log | wc -l)
+ log_note $degrades vdev degrades in ZED log
+ [ $degrades -eq "0" ] || \
+ log_fail "expecting no degrade events, found $degrades"
+
+ destroy_pool $TESTPOOL
+}
+
+log_assert "Test ZED slow io across multiple vdevs"
+log_onexit cleanup
+
+log_must zed_events_drain
+log_must zed_start
+multiple_slow_vdevs_test
+
+log_pass "Test ZED slow io across multiple vdevs"
diff --git a/tests/zfs-tests/tests/functional/exec/cleanup.ksh b/tests/zfs-tests/tests/functional/exec/cleanup.ksh
index 3166bd6ec16e..42fe70042d6a 100755
--- a/tests/zfs-tests/tests/functional/exec/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/exec/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/exec/exec_001_pos.ksh b/tests/zfs-tests/tests/functional/exec/exec_001_pos.ksh
index 5de8a79ea30f..097ecd5f49dd 100755
--- a/tests/zfs-tests/tests/functional/exec/exec_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/exec/exec_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/exec/exec_002_neg.ksh b/tests/zfs-tests/tests/functional/exec/exec_002_neg.ksh
index 2082659a3010..5cda647ef14f 100755
--- a/tests/zfs-tests/tests/functional/exec/exec_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/exec/exec_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/exec/setup.ksh b/tests/zfs-tests/tests/functional/exec/setup.ksh
index fc5cec3063a6..b756d4e76c83 100755
--- a/tests/zfs-tests/tests/functional/exec/setup.ksh
+++ b/tests/zfs-tests/tests/functional/exec/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/fadvise/cleanup.ksh b/tests/zfs-tests/tests/functional/fadvise/cleanup.ksh
new file mode 100755
index 000000000000..8b5b43a74c16
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/fadvise/cleanup.ksh
@@ -0,0 +1,28 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+
+#
+# Portions Copyright (c) 2022 Information2 Software, Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+default_cleanup
diff --git a/tests/zfs-tests/tests/functional/fadvise/fadvise_sequential.ksh b/tests/zfs-tests/tests/functional/fadvise/fadvise_sequential.ksh
new file mode 100755
index 000000000000..7b7d1d379ac6
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/fadvise/fadvise_sequential.ksh
@@ -0,0 +1,80 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Portions Copyright (c) 2022 Information2 Software, Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/include/math.shlib
+
+#
+# DESCRIPTION:
+# Test posix_fadvise.
+#
+# STRATEGY:
+# 1. Set primarycache to metadata in order to disable prefetch
+# 2. Write some data to file
+# 3. get data_size field from arcstat
+# 4. call file_fadvise with POSIX_FADV_SEQUENTIAL
+# 5. get data_size field from arcstat again
+# 6. latter data_size should be bigger than former one
+#
+
+# NOTE: if HAVE_FILE_FADVISE is not defined former data_size
+# should less or eaqul to latter one
+
+verify_runnable "global"
+
+FILE=$TESTDIR/$TESTFILE0
+BLKSZ=$(get_prop recordsize $TESTPOOL)
+
+function cleanup
+{
+ log_must zfs set primarycache=all $TESTPOOL
+ [[ -e $TESTDIR ]] && log_must rm -Rf $TESTDIR/*
+}
+
+getstat() {
+ awk -v c="$1" '$1 == c {print $3; exit}' /proc/spl/kstat/zfs/arcstats
+}
+
+log_assert "Ensure fadvise prefetch data"
+
+log_onexit cleanup
+
+log_must zfs set primarycache=metadata $TESTPOOL
+
+log_must file_write -o create -f $FILE -b $BLKSZ -c 1000
+sync_pool $TESTPOOL
+
+data_size1=$(getstat data_size)
+
+log_must file_fadvise -f $FILE -a 2
+sleep 10
+
+data_size2=$(getstat data_size)
+log_note "original data_size is $data_size1, final data_size is $data_size2"
+
+log_must [ $data_size1 -le $data_size2 ]
+
+log_pass "Ensure data could be prefetched"
diff --git a/tests/zfs-tests/tests/functional/fadvise/setup.ksh b/tests/zfs-tests/tests/functional/fadvise/setup.ksh
new file mode 100755
index 000000000000..8ddd73307bb4
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/fadvise/setup.ksh
@@ -0,0 +1,30 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+
+#
+# Portions Copyright (c) 2022 Information2 Software, Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+DISK=${DISKS%% *}
+default_setup_noexit $DISK
+log_pass
diff --git a/tests/zfs-tests/tests/functional/fallocate/cleanup.ksh b/tests/zfs-tests/tests/functional/fallocate/cleanup.ksh
index bdfa6147117b..c99f11a0e87c 100755
--- a/tests/zfs-tests/tests/functional/fallocate/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/fallocate/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/fallocate/fallocate_prealloc.ksh b/tests/zfs-tests/tests/functional/fallocate/fallocate_prealloc.ksh
index 7bb020fe5c19..35eb828d6ba6 100755
--- a/tests/zfs-tests/tests/functional/fallocate/fallocate_prealloc.ksh
+++ b/tests/zfs-tests/tests/functional/fallocate/fallocate_prealloc.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/fallocate/fallocate_punch-hole.ksh b/tests/zfs-tests/tests/functional/fallocate/fallocate_punch-hole.ksh
index 92f4552f5bd7..d01017f9e09f 100755
--- a/tests/zfs-tests/tests/functional/fallocate/fallocate_punch-hole.ksh
+++ b/tests/zfs-tests/tests/functional/fallocate/fallocate_punch-hole.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -23,6 +23,7 @@
#
# Copyright (c) 2020 by Lawrence Livermore National Security, LLC.
# Copyright (c) 2021 by The FreeBSD Foundation.
+# Copyright (c) 2022 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
@@ -35,6 +36,10 @@
# 1. Create a dense file
# 2. Punch an assortment of holes in the file and verify the result.
#
+# Note: We can't compare exact block numbers as reported by du, because
+# different backing stores may allocate different numbers of blocks for
+# the same amount of data.
+#
verify_runnable "global"
@@ -60,27 +65,24 @@ function cleanup
[[ -e $TESTDIR ]] && log_must rm -f $FILE
}
-function check_reported_size
+function get_reported_size
{
- typeset expected_size=$1
-
- if ! [ -e "${FILE}" ]; then
+ if ! [ -e "$FILE" ]; then
log_fail "$FILE does not exist"
fi
-
- reported_size=$(du "${FILE}" | awk '{print $1}')
- if [ "$reported_size" != "$expected_size" ]; then
- log_fail "Incorrect reported size: $reported_size != $expected_size"
- fi
+
+ sync_pool $TESTPOOL >/dev/null 2>&1
+ du "$FILE" | awk '{print $1}'
}
function check_apparent_size
{
typeset expected_size=$1
- apparent_size=$(stat_size "${FILE}")
+ apparent_size=$(stat_size "$FILE")
if [ "$apparent_size" != "$expected_size" ]; then
- log_fail "Incorrect apparent size: $apparent_size != $expected_size"
+ log_fail \
+ "Incorrect apparent size: $apparent_size != $expected_size"
fi
}
@@ -90,30 +92,36 @@ log_onexit cleanup
# Create a dense file and check it is the correct size.
log_must file_write -o create -f $FILE -b $BLKSZ -c 8
-sync_pool $TESTPOOL
-log_must check_reported_size 1027
+full_size=$(get_reported_size)
-# Punch a hole for the first full block.
+# Punch a hole for the first full block. The reported size should decrease.
log_must punch_hole 0 $BLKSZ $FILE
-sync_pool $TESTPOOL
-log_must check_reported_size 899
+one_hole=$(get_reported_size)
+[[ $full_size -gt $one_hole ]] || log_fail \
+ "One hole failure: $full_size -> $one_hole"
-# Partially punch a hole in the second block.
+# Partially punch a hole in the second block. The reported size should
+# remain constant.
log_must punch_hole $BLKSZ $((BLKSZ / 2)) $FILE
-sync_pool $TESTPOOL
-log_must check_reported_size 899
+partial_hole=$(get_reported_size)
+[[ $one_hole -eq $partial_hole ]] || log_fail \
+ "Partial hole failure: $one_hole -> $partial_hole"
-# Punch a hole which overlaps the third and fourth block.
+# Punch a hole which overlaps the third and fourth block. The reported size
+# should remain constant.
log_must punch_hole $(((BLKSZ * 2) + (BLKSZ / 2))) $((BLKSZ)) $FILE
-sync_pool $TESTPOOL
-log_must check_reported_size 899
+overlap_hole=$(get_reported_size)
+[[ $one_hole -eq $overlap_hole ]] || log_fail \
+ "Overlap hole failure: $one_hole -> $overlap_hole"
-# Punch a hole from the fifth block past the end of file. The apparent
-# file size should not change since --keep-size is implied.
+# Punch a hole from the fifth block past the end of file. The reported size
+# should decrease, and the apparent file size should not change since
+# --keep-size is implied.
apparent_size=$(stat_size $FILE)
log_must punch_hole $((BLKSZ * 4)) $((BLKSZ * 10)) $FILE
-sync_pool $TESTPOOL
-log_must check_reported_size 387
+eof_hole=$(get_reported_size)
+[[ $overlap_hole -gt $eof_hole ]] || log_fail \
+ "EOF hole failure: $overlap_hole -> $eof_hole"
log_must check_apparent_size $apparent_size
log_pass "Ensure holes can be punched in files making them sparse"
diff --git a/tests/zfs-tests/tests/functional/fallocate/fallocate_zero-range.ksh b/tests/zfs-tests/tests/functional/fallocate/fallocate_zero-range.ksh
index e907b0f5d4c4..47dd06cc0dc3 100755
--- a/tests/zfs-tests/tests/functional/fallocate/fallocate_zero-range.ksh
+++ b/tests/zfs-tests/tests/functional/fallocate/fallocate_zero-range.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -23,6 +23,7 @@
#
# Copyright (c) 2020 by Lawrence Livermore National Security, LLC.
# Copyright (c) 2021 by The FreeBSD Foundation.
+# Copyright (c) 2022 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
@@ -35,6 +36,10 @@
# 1. Create a dense file
# 2. Zero various ranges in the file and verify the result.
#
+# Note: We can't compare exact block numbers as reported by du, because
+# different backing stores may allocate different numbers of blocks for
+# the same amount of data.
+#
verify_runnable "global"
@@ -50,28 +55,24 @@ function cleanup
[[ -e $TESTDIR ]] && log_must rm -f $FILE
}
-# Helpfully, this function expects kilobytes, and check_apparent_size expects bytes.
-function check_reported_size
+function get_reported_size
{
- typeset expected_size=$1
-
- if ! [ -e "${FILE}" ]; then
+ if ! [ -e "$FILE" ]; then
log_fail "$FILE does not exist"
fi
-
- reported_size=$(du "${FILE}" | awk '{print $1}')
- if [ "$reported_size" != "$expected_size" ]; then
- log_fail "Incorrect reported size: $reported_size != $expected_size"
- fi
+
+ sync_pool $TESTPOOL >/dev/null 2>&1
+ du "$FILE" | awk '{print $1}'
}
function check_apparent_size
{
typeset expected_size=$1
- apparent_size=$(stat_size "${FILE}")
+ apparent_size=$(stat_size "$FILE")
if [ "$apparent_size" != "$expected_size" ]; then
- log_fail "Incorrect apparent size: $apparent_size != $expected_size"
+ log_fail \
+ "Incorrect apparent size: $apparent_size != $expected_size"
fi
}
@@ -82,38 +83,46 @@ log_onexit cleanup
# Create a dense file and check it is the correct size.
log_must file_write -o create -f $FILE -b $BLKSZ -c 8
sync_pool $TESTPOOL
-log_must check_reported_size 1027
+full_size=$(get_reported_size)
-# Zero a range covering the first full block.
+# Zero a range covering the first full block. The reported size should decrease.
log_must zero_range 0 $BLKSZ $FILE
-sync_pool $TESTPOOL
-log_must check_reported_size 899
+one_range=$(get_reported_size)
+[[ $full_size -gt $one_range ]] || log_fail \
+ "One range failure: $full_size -> $one_range"
-# Partially zero a range in the second block.
+# Partially zero a range in the second block. The reported size should
+# remain constant.
log_must zero_range $BLKSZ $((BLKSZ / 2)) $FILE
-sync_pool $TESTPOOL
-log_must check_reported_size 899
+partial_range=$(get_reported_size)
+[[ $one_range -eq $partial_range ]] || log_fail \
+ "Partial range failure: $one_range -> $partial_range"
-# Zero range which overlaps the third and fourth block.
+# Zero range which overlaps the third and fourth block. The reported size
+# should remain constant.
log_must zero_range $(((BLKSZ * 2) + (BLKSZ / 2))) $((BLKSZ)) $FILE
-sync_pool $TESTPOOL
-log_must check_reported_size 899
+overlap_range=$(get_reported_size)
+[[ $one_range -eq $overlap_range ]] || log_fail \
+ "Overlap range failure: $one_range -> $overlap_range"
# Zero range from the fifth block past the end of file, with --keep-size.
-# The apparent file size must not change, since we did specify --keep-size.
+# The reported size should decrease, and the apparent file size must not
+# change, since we did specify --keep-size.
apparent_size=$(stat_size $FILE)
log_must fallocate --keep-size --zero-range --offset $((BLKSZ * 4)) --length $((BLKSZ * 10)) "$FILE"
-sync_pool $TESTPOOL
-log_must check_reported_size 387
+eof_range=$(get_reported_size)
+[[ $overlap_range -gt $eof_range ]] || log_fail \
+ "EOF range failure: $overlap_range -> $eof_range"
log_must check_apparent_size $apparent_size
# Zero range from the fifth block past the end of file. The apparent
# file size should change since --keep-size is not implied, unlike
-# with PUNCH_HOLE.
+# with PUNCH_HOLE. The reported size should remain constant.
apparent_size=$(stat_size $FILE)
log_must zero_range $((BLKSZ * 4)) $((BLKSZ * 10)) $FILE
-sync_pool $TESTPOOL
-log_must check_reported_size 387
+eof_range2=$(get_reported_size)
+[[ $eof_range -eq $eof_range2 ]] || log_fail \
+ "Second EOF range failure: $eof_range -> $eof_range2"
log_must check_apparent_size $((BLKSZ * 14))
log_pass "Ensure ranges can be zeroed in files"
diff --git a/tests/zfs-tests/tests/functional/fallocate/setup.ksh b/tests/zfs-tests/tests/functional/fallocate/setup.ksh
index 586ac026aa43..51fa056fd36f 100755
--- a/tests/zfs-tests/tests/functional/fallocate/setup.ksh
+++ b/tests/zfs-tests/tests/functional/fallocate/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/fault/auto_offline_001_pos.ksh b/tests/zfs-tests/tests/functional/fault/auto_offline_001_pos.ksh
index 17bde9a70636..c0387e1d3235 100755
--- a/tests/zfs-tests/tests/functional/fault/auto_offline_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/fault/auto_offline_001_pos.ksh
@@ -24,29 +24,28 @@
#
# DESCRIPTION:
-# Testing Fault Management Agent ZED Logic - Physically removed device is
-# made unavail and onlined when reattached
+# Testing Fault Management Agent ZED Logic - Physically detached device is
+# made removed and onlined when reattached
#
# STRATEGY:
# 1. Create a pool
# 2. Simulate physical removal of one device
-# 3. Verify the device is unavailable
+# 3. Verify the device is removed when detached
# 4. Reattach the device
# 5. Verify the device is onlined
# 6. Repeat the same tests with a spare device:
# zed will use the spare to handle the removed data device
# 7. Repeat the same tests again with a faulted spare device:
-# the removed data device should be unavailable
+# the removed data device should be removed
#
# NOTE: the use of 'block_device_wait' throughout the test helps avoid race
# conditions caused by mixing creation/removal events from partitioning the
# disk (zpool create) and events from physically removing it (remove_disk).
#
-# NOTE: the test relies on 'zpool sync' to prompt the kmods to transition a
-# vdev to the unavailable state. The ZED does receive a removal notification
-# but only relies on it to activate a hot spare. Additional work is planned
-# to extend an existing ioctl interface to allow the ZED to transition the
-# vdev in to a removed state.
+# NOTE: the test relies on ZED to transit state to removed on device removed
+# event. The ZED does receive a removal notification but only relies on it to
+# activate a hot spare. Additional work is planned to extend an existing ioctl
+# interface to allow the ZED to transition the vdev in to a removed state.
#
verify_runnable "both"
@@ -103,8 +102,8 @@ do
log_must mkfile 1m $mntpnt/file
sync_pool $TESTPOOL
- # 3. Verify the device is unavailable.
- log_must wait_vdev_state $TESTPOOL $removedev "UNAVAIL"
+ # 3. Verify the device is removed.
+ log_must wait_vdev_state $TESTPOOL $removedev "REMOVED"
# 4. Reattach the device
insert_disk $removedev
@@ -122,6 +121,11 @@ done
# the removed data device
for conf in "${poolconfs[@]}"
do
+ # special vdev can not be replaced by a hot spare
+ if [[ $conf = *"special mirror"* ]]; then
+ continue
+ fi
+
# 1. Create a pool with a spare
log_must zpool create -f $TESTPOOL $conf
block_device_wait ${DEV_DSKDIR}/${removedev}
@@ -136,7 +140,7 @@ do
# 3. Verify the device is handled by the spare.
log_must wait_hotspare_state $TESTPOOL $sparedev "INUSE"
- log_must wait_vdev_state $TESTPOOL $removedev "UNAVAIL"
+ log_must wait_vdev_state $TESTPOOL $removedev "REMOVED"
# 4. Reattach the device
insert_disk $removedev
@@ -170,8 +174,8 @@ do
log_must mkfile 1m $mntpnt/file
sync_pool $TESTPOOL
- # 4. Verify the device is unavailable
- log_must wait_vdev_state $TESTPOOL $removedev "UNAVAIL"
+ # 4. Verify the device is removed
+ log_must wait_vdev_state $TESTPOOL $removedev "REMOVED"
# 5. Reattach the device
insert_disk $removedev
diff --git a/tests/zfs-tests/tests/functional/fault/auto_online_001_pos.ksh b/tests/zfs-tests/tests/functional/fault/auto_online_001_pos.ksh
index 3a1a610b8daf..950e80dfc186 100755
--- a/tests/zfs-tests/tests/functional/fault/auto_online_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/fault/auto_online_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/fault/auto_online_002_pos.ksh b/tests/zfs-tests/tests/functional/fault/auto_online_002_pos.ksh
index 60185ace34bb..09285b5108ee 100755
--- a/tests/zfs-tests/tests/functional/fault/auto_online_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/fault/auto_online_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/fault/auto_replace_001_pos.ksh b/tests/zfs-tests/tests/functional/fault/auto_replace_001_pos.ksh
index 57180cdc1860..ae56ee9919bf 100755
--- a/tests/zfs-tests/tests/functional/fault/auto_replace_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/fault/auto_replace_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -34,13 +34,14 @@
# 1. Update /etc/zfs/vdev_id.conf with scsidebug alias for a persistent path.
# This creates keys ID_VDEV and ID_VDEV_PATH and set phys_path="scsidebug".
# 2. Create a pool and set autoreplace=on (auto-replace is opt-in)
-# 3. Export a pool
+# 3. Export the pool
# 4. Wipe and offline the scsi_debug disk
-# 5. Import pool with missing disk
+# 5. Import the pool with missing disk
# 6. Re-online the wiped scsi_debug disk
-# 7. Verify the ZED detects the new unused disk and adds it back to the pool
+# 7. Verify ZED detects the new blank disk and replaces the missing vdev
+# 8. Verify that the scsi_debug disk was re-partitioned
#
-# Creates a raidz1 zpool using persistent disk path names
+# Creates a raidz1 zpool using persistent /dev/disk/by-vdev path names
# (ie not /dev/sdc)
#
# Auto-replace is opt in, and matches by phys_path.
@@ -54,6 +55,7 @@ fi
function cleanup
{
+ zpool status $TESTPOOL
destroy_pool $TESTPOOL
sed -i '/alias scsidebug/d' $VDEVID_CONF
unload_scsi_debug
@@ -82,11 +84,27 @@ log_must zpool create -f $TESTPOOL raidz1 $SD_DEVICE $DISK1 $DISK2 $DISK3
log_must zpool set autoreplace=on $TESTPOOL
# Add some data to the pool
-log_must mkfile $FSIZE /$TESTPOOL/data
+log_must zfs create $TESTPOOL/fs
+log_must fill_fs /$TESTPOOL/fs 4 100 4096 512 Z
log_must zpool export $TESTPOOL
+# Record the partition UUID for later comparison
+part_uuid=$(udevadm info --query=property --property=ID_PART_TABLE_UUID \
+ --value /dev/disk/by-id/$SD_DEVICE_ID)
+[[ -z "$part_uuid" ]] || log_note original disk GPT uuid ${part_uuid}
+
+#
# Wipe and offline the disk
+#
+# Note that it is not enough to zero the disk to expunge the partitions.
+# You also need to inform the kernel (e.g., 'hdparm -z' or 'partprobe').
+#
+# Using partprobe is overkill and hdparm is not as common as wipefs. So
+# we use wipefs which lets the kernel know the partition was removed
+# from the device (i.e., calls BLKRRPART ioctl).
+#
log_must dd if=/dev/zero of=/dev/disk/by-id/$SD_DEVICE_ID bs=1M count=$SDSIZE
+log_must /usr/sbin/wipefs -a /dev/disk/by-id/$SD_DEVICE_ID
remove_disk $SD
block_device_wait
@@ -99,10 +117,24 @@ block_device_wait
insert_disk $SD $SD_HOST
# Wait for the new disk to be online and replaced
-log_must wait_vdev_state $TESTPOOL "scsidebug" "ONLINE" $MAXTIMEOUT
-log_must wait_replacing $TESTPOOL
+log_must wait_vdev_state $TESTPOOL "scsidebug" "ONLINE" 60
+log_must wait_replacing $TESTPOOL 60
# Validate auto-replace was successful
log_must check_state $TESTPOOL "" "ONLINE"
+#
+# Confirm the partition UUID changed so we know the new disk was relabeled
+#
+# Note: some older versions of udevadm don't support "--property" option so
+# we'll # skip this test when it is not supported
+#
+if [ ! -z "$part_uuid" ]; then
+ new_uuid=$(udevadm info --query=property --property=ID_PART_TABLE_UUID \
+ --value /dev/disk/by-id/$SD_DEVICE_ID)
+ log_note new disk GPT uuid ${new_uuid}
+ [[ "$part_uuid" = "$new_uuid" ]] && \
+ log_fail "The new disk was not relabeled as expected"
+fi
+
log_pass "Auto-replace test successful"
diff --git a/tests/zfs-tests/tests/functional/fault/auto_replace_002_pos.ksh b/tests/zfs-tests/tests/functional/fault/auto_replace_002_pos.ksh
new file mode 100755
index 000000000000..2259e604317b
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/fault/auto_replace_002_pos.ksh
@@ -0,0 +1,192 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2017 by Intel Corporation. All rights reserved.
+# Copyright (c) 2023 by Klara, Inc. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/fault/fault.cfg
+
+#
+# DESCRIPTION:
+# Testing Fault Management Agent ZED Logic - Automated Auto-Replace Test.
+# Verifys that auto-replace works with by-id paths.
+#
+# STRATEGY:
+# 1. Update /etc/zfs/vdev_id.conf with scsidebug alias for a persistent path.
+# This creates keys ID_VDEV and ID_VDEV_PATH and set phys_path="scsidebug".
+# 2. Create a pool and set autoreplace=on (auto-replace is opt-in)
+# 3. Export the pool
+# 4. Wipe and offline the scsi_debug disk
+# 5. Import the pool with missing disk
+# 6. Re-online the wiped scsi_debug disk with a new serial number
+# 7. Verify ZED detects the new blank disk and replaces the missing vdev
+# 8. Verify that the scsi_debug disk was re-partitioned
+#
+# Creates a raidz1 zpool using persistent /dev/disk/by-id path names
+#
+# Auto-replace is opt in, and matches by phys_path.
+#
+
+verify_runnable "both"
+
+if ! is_physical_device $DISKS; then
+ log_unsupported "Unsupported disks for this test."
+fi
+
+function cleanup
+{
+ zpool status $TESTPOOL
+ destroy_pool $TESTPOOL
+ sed -i '/alias scsidebug/d' $VDEVID_CONF
+ unload_scsi_debug
+}
+
+#
+# Wait until a vdev transitions to its replacement vdev
+#
+# Return 0 when vdev reaches expected state, 1 on timeout.
+#
+# Note: index +2 is to skip over root and raidz-0 vdevs
+#
+function wait_vdev_online # pool index oldguid timeout
+{
+ typeset pool=$1
+ typeset -i index=$2+2
+ typeset guid=$3
+ typeset timeout=${4:-60}
+ typeset -i i=0
+
+ while [[ $i -lt $timeout ]]; do
+ vdev_guids=( $(zpool get -H -o value guid $pool all-vdevs) )
+
+ if [ "${vdev_guids[$index]}" != "${guid}" ]; then
+ log_note "new vdev[$((index-2))]: ${vdev_guids[$index]}, replacing ${guid}"
+ return 0
+ fi
+
+ i=$((i+1))
+ sleep 1
+ done
+
+ return 1
+}
+log_assert "automated auto-replace with by-id paths"
+log_onexit cleanup
+
+load_scsi_debug $SDSIZE $SDHOSTS $SDTGTS $SDLUNS '512b'
+SD=$(get_debug_device)
+SD_DEVICE_ID=$(get_persistent_disk_name $SD)
+SD_HOST=$(get_scsi_host $SD)
+
+# Register vdev_id alias for scsi_debug device to create a persistent path
+echo "alias scsidebug /dev/disk/by-id/$SD_DEVICE_ID" >>$VDEVID_CONF
+block_device_wait
+
+SD_DEVICE=$(udevadm info -q all -n $DEV_DSKDIR/$SD | \
+ awk -F'=' '/ID_VDEV=/ {print $2; exit}')
+[ -z $SD_DEVICE ] && log_fail "vdev rule was not registered properly"
+
+log_must zpool events -c
+log_must zpool create -f $TESTPOOL raidz1 $SD_DEVICE_ID $DISK1 $DISK2 $DISK3
+
+vdev_guid=$(zpool get guid -H -o value $TESTPOOL $SD_DEVICE_ID)
+log_note original vdev guid ${vdev_guid}
+
+# Auto-replace is opt-in so need to set property
+log_must zpool set autoreplace=on $TESTPOOL
+
+# Add some data to the pool
+log_must zfs create $TESTPOOL/fs
+log_must fill_fs /$TESTPOOL/fs 4 100 4096 512 Z
+log_must zpool export $TESTPOOL
+
+# Record the partition UUID for later comparison
+part_uuid=$(udevadm info --query=property --property=ID_PART_TABLE_UUID \
+ --value /dev/disk/by-id/$SD_DEVICE_ID)
+[[ -z "$part_uuid" ]] || log_note original disk GPT uuid ${part_uuid}
+
+#
+# Wipe and offline the disk
+#
+# Note that it is not enough to zero the disk to expunge the partitions.
+# You also need to inform the kernel (e.g., 'hdparm -z' or 'partprobe').
+#
+# Using partprobe is overkill and hdparm is not as common as wipefs. So
+# we use wipefs which lets the kernel know the partition was removed
+# from the device (i.e., calls BLKRRPART ioctl).
+#
+log_must dd if=/dev/zero of=/dev/disk/by-id/$SD_DEVICE_ID bs=1M count=$SDSIZE
+log_must /usr/sbin/wipefs -a /dev/disk/by-id/$SD_DEVICE_ID
+remove_disk $SD
+block_device_wait
+
+# Re-import pool with drive missing
+log_must zpool import $TESTPOOL
+log_must check_state $TESTPOOL "" "DEGRADED"
+block_device_wait
+
+#
+# Online an empty disk in the same physical location, with a different by-id
+# symlink. We use vpd_use_hostno to make sure the underlying serial number
+# changes for the new disk which in turn gives us a different by-id path.
+#
+# The original names were something like:
+# /dev/disk/by-id/scsi-SLinux_scsi_debug_16000-part1
+# /dev/disk/by-id/wwn-0x33333330000007d0-part1
+#
+# This new inserted disk, will have different links like:
+# /dev/disk/by-id/scsi-SLinux_scsi_debug_2000-part1
+# /dev/disk/by-id/wwn-0x0x3333333000003e80 -part1
+#
+echo '0' > /sys/bus/pseudo/drivers/scsi_debug/vpd_use_hostno
+
+insert_disk $SD $SD_HOST
+
+# make sure the physical path points to the same scsi-debug device
+SD_DEVICE_ID=$(get_persistent_disk_name $SD)
+echo "alias scsidebug /dev/disk/by-id/$SD_DEVICE_ID" >>$VDEVID_CONF
+block_device_wait
+
+# Wait for the new disk to be online and replaced
+log_must wait_vdev_online $TESTPOOL 0 $vdev_guid 45
+log_must wait_replacing $TESTPOOL 45
+
+# Validate auto-replace was successful
+log_must check_state $TESTPOOL "" "ONLINE"
+
+#
+# Confirm the partition UUID changed so we know the new disk was relabeled
+#
+# Note: some older versions of udevadm don't support "--property" option so
+# we'll # skip this test when it is not supported
+#
+if [ ! -z "$part_uuid" ]; then
+ new_uuid=$(udevadm info --query=property --property=ID_PART_TABLE_UUID \
+ --value /dev/disk/by-id/$SD_DEVICE_ID)
+ log_note new disk GPT uuid ${new_uuid}
+ [[ "$part_uuid" = "$new_uuid" ]] && \
+ log_fail "The new disk was not relabeled as expected"
+fi
+
+log_pass "automated auto-replace with by-id paths"
diff --git a/tests/zfs-tests/tests/functional/fault/auto_spare_002_pos.ksh b/tests/zfs-tests/tests/functional/fault/auto_spare_002_pos.ksh
index e9517bad7131..bd32be9a4ff8 100755
--- a/tests/zfs-tests/tests/functional/fault/auto_spare_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/fault/auto_spare_002_pos.ksh
@@ -73,7 +73,7 @@ for type in "mirror" "raidz" "raidz2"; do
# 4. Inject CHECKSUM ERRORS on read with a zinject error handler
log_must zinject -d $FAULT_FILE -e corrupt -f 50 -T read $TESTPOOL
- log_must cp $TESTFILE /dev/null
+ log_must dd if=$TESTFILE of=/dev/null bs=1M count=64
# 5. Verify the ZED kicks in a hot spare and expected pool/device status
log_note "Wait for ZED to auto-spare"
diff --git a/tests/zfs-tests/tests/functional/fault/cleanup.ksh b/tests/zfs-tests/tests/functional/fault/cleanup.ksh
index 45b94723a543..2959236b59a3 100755
--- a/tests/zfs-tests/tests/functional/fault/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/fault/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -32,5 +32,6 @@ cleanup_devices $DISKS
zed_stop
zed_cleanup resilver_finish-start-scrub.sh
+zed_events_drain
log_pass
diff --git a/tests/zfs-tests/tests/functional/fault/fault.cfg b/tests/zfs-tests/tests/functional/fault/fault.cfg
index 108406e3e171..0cf2b05cce44 100644
--- a/tests/zfs-tests/tests/functional/fault/fault.cfg
+++ b/tests/zfs-tests/tests/functional/fault/fault.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/fault/setup.ksh b/tests/zfs-tests/tests/functional/fault/setup.ksh
index b78ee8ccdc98..61b9206ec1a6 100755
--- a/tests/zfs-tests/tests/functional/fault/setup.ksh
+++ b/tests/zfs-tests/tests/functional/fault/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -28,6 +28,7 @@
verify_runnable "global"
+zed_events_drain
zed_setup resilver_finish-start-scrub.sh
zed_start
diff --git a/tests/zfs-tests/tests/functional/fault/zpool_status_-s.ksh b/tests/zfs-tests/tests/functional/fault/zpool_status_-s.ksh
index 4fe00e2c7195..57911aa05ec9 100755
--- a/tests/zfs-tests/tests/functional/fault/zpool_status_-s.ksh
+++ b/tests/zfs-tests/tests/functional/fault/zpool_status_-s.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/features/async_destroy/async_destroy_001_pos.ksh b/tests/zfs-tests/tests/functional/features/async_destroy/async_destroy_001_pos.ksh
index e0617961ba15..d5c930ecfbb2 100755
--- a/tests/zfs-tests/tests/functional/features/async_destroy/async_destroy_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/features/async_destroy/async_destroy_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/features/async_destroy/cleanup.ksh b/tests/zfs-tests/tests/functional/features/async_destroy/cleanup.ksh
index 3166bd6ec16e..42fe70042d6a 100755
--- a/tests/zfs-tests/tests/functional/features/async_destroy/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/features/async_destroy/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/features/async_destroy/setup.ksh b/tests/zfs-tests/tests/functional/features/async_destroy/setup.ksh
index d275e063b13a..76aa23035dd9 100755
--- a/tests/zfs-tests/tests/functional/features/async_destroy/setup.ksh
+++ b/tests/zfs-tests/tests/functional/features/async_destroy/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/features/large_dnode/cleanup.ksh b/tests/zfs-tests/tests/functional/features/large_dnode/cleanup.ksh
index 60e481d998a2..9fa5ba6e13c4 100755
--- a/tests/zfs-tests/tests/functional/features/large_dnode/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/features/large_dnode/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_001_pos.ksh b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_001_pos.ksh
index c00b3b6c719a..e4aea2750669 100755
--- a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_002_pos.ksh b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_002_pos.ksh
index 9a00ceeb3cef..c0df76624f56 100755
--- a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_003_pos.ksh b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_003_pos.ksh
index 20989e1d7741..867382165235 100755
--- a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_004_neg.ksh b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_004_neg.ksh
index 2cc587b47879..a77fe10ccf31 100755
--- a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_004_neg.ksh
+++ b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_004_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_005_pos.ksh b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_005_pos.ksh
index 1d167e3ae59f..8910f375b1c5 100755
--- a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_006_pos.ksh b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_006_pos.ksh
index 3727bd5c11d2..a84e38aee87a 100755
--- a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_007_neg.ksh b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_007_neg.ksh
index 59364574b165..ac755a338d55 100755
--- a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_007_neg.ksh
+++ b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_007_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_008_pos.ksh b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_008_pos.ksh
index 71e175171322..00a0d5784cdb 100755
--- a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_009_pos.ksh b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_009_pos.ksh
index 0b61e1df2226..457c100ed989 100755
--- a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_009_pos.ksh
+++ b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_009_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/features/large_dnode/setup.ksh b/tests/zfs-tests/tests/functional/features/large_dnode/setup.ksh
index a9425cca9857..02735d765426 100755
--- a/tests/zfs-tests/tests/functional/features/large_dnode/setup.ksh
+++ b/tests/zfs-tests/tests/functional/features/large_dnode/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/grow/grow.cfg b/tests/zfs-tests/tests/functional/grow/grow.cfg
index 10d15d7546c1..0d78416317c0 100644
--- a/tests/zfs-tests/tests/functional/grow/grow.cfg
+++ b/tests/zfs-tests/tests/functional/grow/grow.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/grow/grow_pool_001_pos.ksh b/tests/zfs-tests/tests/functional/grow/grow_pool_001_pos.ksh
index 9c047223ab39..ae2b261f4efa 100755
--- a/tests/zfs-tests/tests/functional/grow/grow_pool_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/grow/grow_pool_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/grow/grow_replicas_001_pos.ksh b/tests/zfs-tests/tests/functional/grow/grow_replicas_001_pos.ksh
index 44b38291f0a9..1d0215550145 100755
--- a/tests/zfs-tests/tests/functional/grow/grow_replicas_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/grow/grow_replicas_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/history/cleanup.ksh b/tests/zfs-tests/tests/functional/history/cleanup.ksh
index 32ed921ffe76..36e0311a34cb 100755
--- a/tests/zfs-tests/tests/functional/history/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/history/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/history/history.cfg b/tests/zfs-tests/tests/functional/history/history.cfg
index e9200a2b5098..a508a7935684 100644
--- a/tests/zfs-tests/tests/functional/history/history.cfg
+++ b/tests/zfs-tests/tests/functional/history/history.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/history/history_001_pos.ksh b/tests/zfs-tests/tests/functional/history/history_001_pos.ksh
index 5b576b8a12aa..7180e9af767d 100755
--- a/tests/zfs-tests/tests/functional/history/history_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/history/history_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/history/history_002_pos.ksh b/tests/zfs-tests/tests/functional/history/history_002_pos.ksh
index b431cdc5f144..81f2ffb21731 100755
--- a/tests/zfs-tests/tests/functional/history/history_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/history/history_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/history/history_003_pos.ksh b/tests/zfs-tests/tests/functional/history/history_003_pos.ksh
index 1bebd4039746..9f27785d64f9 100755
--- a/tests/zfs-tests/tests/functional/history/history_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/history/history_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/history/history_004_pos.ksh b/tests/zfs-tests/tests/functional/history/history_004_pos.ksh
index 8bdc38f26d67..f7ec5df6fd31 100755
--- a/tests/zfs-tests/tests/functional/history/history_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/history/history_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/history/history_005_neg.ksh b/tests/zfs-tests/tests/functional/history/history_005_neg.ksh
index 5038af4a7c79..c4d699f39d6c 100755
--- a/tests/zfs-tests/tests/functional/history/history_005_neg.ksh
+++ b/tests/zfs-tests/tests/functional/history/history_005_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/history/history_006_neg.ksh b/tests/zfs-tests/tests/functional/history/history_006_neg.ksh
index a1e76e68b802..c8b6404b8c35 100755
--- a/tests/zfs-tests/tests/functional/history/history_006_neg.ksh
+++ b/tests/zfs-tests/tests/functional/history/history_006_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/history/history_007_pos.ksh b/tests/zfs-tests/tests/functional/history/history_007_pos.ksh
index 3d785183d094..714db4772aa3 100755
--- a/tests/zfs-tests/tests/functional/history/history_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/history/history_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/history/history_008_pos.ksh b/tests/zfs-tests/tests/functional/history/history_008_pos.ksh
index 26f728bb1779..eff313a31aef 100755
--- a/tests/zfs-tests/tests/functional/history/history_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/history/history_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/history/history_009_pos.ksh b/tests/zfs-tests/tests/functional/history/history_009_pos.ksh
index cf40df84ec83..be43193dc426 100755
--- a/tests/zfs-tests/tests/functional/history/history_009_pos.ksh
+++ b/tests/zfs-tests/tests/functional/history/history_009_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/history/history_010_pos.ksh b/tests/zfs-tests/tests/functional/history/history_010_pos.ksh
index 57a7cb4466d0..d972ba66d17b 100755
--- a/tests/zfs-tests/tests/functional/history/history_010_pos.ksh
+++ b/tests/zfs-tests/tests/functional/history/history_010_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/history/history_common.kshlib b/tests/zfs-tests/tests/functional/history/history_common.kshlib
index 95f9441bf692..2ee761cea93a 100644
--- a/tests/zfs-tests/tests/functional/history/history_common.kshlib
+++ b/tests/zfs-tests/tests/functional/history/history_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/history/setup.ksh b/tests/zfs-tests/tests/functional/history/setup.ksh
index fc5cec3063a6..b756d4e76c83 100755
--- a/tests/zfs-tests/tests/functional/history/setup.ksh
+++ b/tests/zfs-tests/tests/functional/history/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/idmap_mount/cleanup.ksh b/tests/zfs-tests/tests/functional/idmap_mount/cleanup.ksh
new file mode 100755
index 000000000000..4895aa23ee4a
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/idmap_mount/cleanup.ksh
@@ -0,0 +1,25 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+default_cleanup
diff --git a/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount.cfg b/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount.cfg
new file mode 100644
index 000000000000..51998945d0d1
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount.cfg
@@ -0,0 +1,25 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+export UID1=1000000
+export GID1=1000000
+export UID2=2000000
+export GID2=2000000
diff --git a/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_001.ksh b/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_001.ksh
new file mode 100755
index 000000000000..e7187935e532
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_001.ksh
@@ -0,0 +1,76 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+. $STF_SUITE/tests/functional/idmap_mount/idmap_mount_common.kshlib
+
+#
+#
+# DESCRIPTION:
+# Test uid and gid of files in idmapped folder are mapped correctly
+#
+#
+# STRATEGY:
+# 1. Create files/folder owned by $UID1 and $GID1 under "idmap_test"
+# 2. Idmap the folder to "idmap_dest"
+# 3. Verify the owner of files/folder under "idmap_dest"
+#
+
+verify_runnable "global"
+
+export WORKDIR=$TESTDIR/idmap_test
+export IDMAPDIR=$TESTDIR/idmap_dest
+
+function cleanup
+{
+ log_must rm -rf $WORKDIR
+ if mountpoint $IDMAPDIR; then
+ log_must umount $IDMAPDIR
+ fi
+ log_must rm -rf $IDMAPDIR
+}
+
+log_onexit cleanup
+
+if ! idmap_util -c $TESTDIR; then
+ log_unsupported "Idmap mount not supported."
+fi
+
+log_must mkdir -p $WORKDIR
+log_must mkdir -p $IDMAPDIR
+log_must touch $WORKDIR/file1
+log_must mkdir $WORKDIR/subdir
+log_must ln -s $WORKDIR/file1 $WORKDIR/file1_sym
+log_must ln $WORKDIR/file1 $WORKDIR/subdir/file1_hard
+log_must touch $WORKDIR/subdir/file2
+log_must chown -R $UID1:$GID1 $WORKDIR
+log_must chown $UID2:$GID2 $WORKDIR/subdir/file2
+
+log_must idmap_util -m "u:${UID1}:${UID2}:1" -m "g:${GID1}:${GID2}:1" $WORKDIR $IDMAPDIR
+
+log_must test "$UID2 $GID2" = "$(stat -c '%u %g' $IDMAPDIR/file1)"
+log_must test "$UID2 $GID2" = "$(stat -c '%u %g' $IDMAPDIR/file1_sym)"
+log_must test "$UID2 $GID2" = "$(stat -c '%u %g' $IDMAPDIR/subdir)"
+log_must test "$UID2 $GID2" = "$(stat -c '%u %g' $IDMAPDIR/subdir/file1_hard)"
+log_mustnot test "$UID2 $GID2" = "$(stat -c '%u %g' $IDMAPDIR/subdir/file2)"
+
+log_pass "Owner verification of entries under idmapped folder is successful."
+
diff --git a/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_002.ksh b/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_002.ksh
new file mode 100755
index 000000000000..8cba90ea58b7
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_002.ksh
@@ -0,0 +1,97 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+. $STF_SUITE/tests/functional/idmap_mount/idmap_mount_common.kshlib
+
+#
+#
+# DESCRIPTION:
+# Perform file operations in idmapped folder, check owner in its base.
+#
+#
+# STRATEGY:
+# 1. Create folder "idmap_test"
+# 2. Idmap the folder to "idmap_dest"
+# 3. Do basic file operations in "idmap_dest" folder, verify the owner in
+# the base folder "idmap_test"
+#
+
+verify_runnable "global"
+
+export WORKDIR=$TESTDIR/idmap_test
+export IDMAPDIR=$TESTDIR/idmap_dest
+
+function cleanup
+{
+ log_must rm -rf $IDMAPDIR/*
+ if mountpoint $IDMAPDIR; then
+ log_must umount $IDMAPDIR
+ fi
+ log_must rm -rf $IDMAPDIR $WORKDIR
+}
+
+log_onexit cleanup
+
+if ! idmap_util -c $TESTDIR; then
+ log_unsupported "Idmap mount not supported."
+fi
+
+log_must mkdir -p $WORKDIR
+log_must mkdir -p $IDMAPDIR
+
+log_must chown $UID1:$GID1 $WORKDIR
+log_must idmap_util -m "u:${UID1}:${UID2}:1" -m "g:${GID1}:${GID2}:1" $WORKDIR $IDMAPDIR
+
+SETPRIV="setpriv --reuid $UID2 --regid $GID2 --clear-groups"
+
+log_must $SETPRIV touch $IDMAPDIR/file1
+log_must test "$UID1 $GID1" = "$(stat -c '%u %g' $WORKDIR/file1)"
+
+log_must $SETPRIV mv $IDMAPDIR/file1 $IDMAPDIR/file1_renamed
+log_must test "$UID1 $GID1" = "$(stat -c '%u %g' $WORKDIR/file1_renamed)"
+
+log_must $SETPRIV mv $IDMAPDIR/file1_renamed $IDMAPDIR/file1
+log_must test "$UID1 $GID1" = "$(stat -c '%u %g' $WORKDIR/file1)"
+
+log_must $SETPRIV mkdir $IDMAPDIR/subdir
+log_must test "$UID1 $GID1" = "$(stat -c '%u %g' $WORKDIR/subdir)"
+
+log_must $SETPRIV ln -s $IDMAPDIR/file1 $IDMAPDIR/file1_sym
+log_must test "$UID1 $GID1" = "$(stat -c '%u %g' $WORKDIR/file1_sym)"
+
+log_must $SETPRIV ln $IDMAPDIR/file1 $IDMAPDIR/subdir/file1_hard
+log_must test "$UID1 $GID1" = "$(stat -c '%u %g' $WORKDIR/subdir/file1_hard)"
+
+log_must $SETPRIV touch $IDMAPDIR/subdir/file2
+log_must $SETPRIV chown $UID2:$GID2 $IDMAPDIR/subdir/file2
+log_mustnot $SETPRIV chown $UID1 $IDMAPDIR/subdir/file2
+
+log_must $SETPRIV cp -r $IDMAPDIR/subdir $IDMAPDIR/subdir1
+log_must test "$UID1 $GID1" = "$(stat -c '%u %g' $WORKDIR/subdir1/file2)"
+log_must $SETPRIV rm -rf $IDMAPDIR/subdir1
+
+log_must $SETPRIV cp -rp $IDMAPDIR/subdir $IDMAPDIR/subdir1
+log_must test "$UID1 $GID1" = "$(stat -c '%u %g' $WORKDIR/subdir1/file1_hard)"
+log_must $SETPRIV rm -rf $IDMAPDIR/subdir1
+
+log_pass "Owner verification of entries under base folder is successful."
+
diff --git a/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_003.ksh b/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_003.ksh
new file mode 100755
index 000000000000..1f1a2aec655e
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_003.ksh
@@ -0,0 +1,121 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+. $STF_SUITE/tests/functional/idmap_mount/idmap_mount_common.kshlib
+
+#
+#
+# DESCRIPTION:
+# Perform file operations in idmapped folder in user namespace,
+# then check the owner in its base.
+#
+#
+# STRATEGY:
+# 1. Create folder "idmap_test"
+# 2. Idmap the folder to "idmap_dest"
+# 3. Perform file operations in the idmapped folder in the user
+# namespace having the same idmap info as the idmapped mount
+# 4. Verify the owner of entries under the base folder "idmap_test"
+#
+
+verify_runnable "global"
+
+export WORKDIR=$TESTDIR/idmap_test
+export IDMAPDIR=$TESTDIR/idmap_dest
+
+function cleanup
+{
+ kill -TERM ${unshared_pid}
+ log_must rm -rf $IDMAPDIR/*
+ if mountpoint $IDMAPDIR; then
+ log_must umount $IDMAPDIR
+ fi
+ log_must rm -rf $IDMAPDIR $WORKDIR
+}
+
+log_onexit cleanup
+
+if ! idmap_util -c $TESTDIR; then
+ log_unsupported "Idmap mount not supported."
+fi
+
+log_must mkdir -p $WORKDIR
+log_must mkdir -p $IDMAPDIR
+
+log_must chown $UID1:$GID1 $WORKDIR
+log_must idmap_util -m "u:${UID1}:${UID2}:1" -m "g:${GID1}:${GID2}:1" $WORKDIR $IDMAPDIR
+
+# Create a user namespace with the same idmapping
+unshare -Urm echo test
+if [ "$?" -ne "0" ]; then
+ log_unsupported "Failed to create user namespace"
+fi
+unshare -Um /usr/bin/sleep 2h &
+unshared_pid=$!
+if [ "$?" -ne "0" ]; then
+ log_unsupported "Failed to create user namespace"
+fi
+# wait for userns to be ready
+sleep 1
+echo "${UID1} ${UID2} 1" > /proc/$unshared_pid/uid_map
+if [ "$?" -ne "0" ]; then
+ log_unsupported "Failed to write to uid_map"
+fi
+echo "${GID1} ${GID2} 1" > /proc/$unshared_pid/gid_map
+if [ "$?" -ne "0" ]; then
+ log_unsupported "Failed to write to gid_map"
+fi
+
+NSENTER="nsenter -t $unshared_pid --all -S ${UID1} -G ${GID1}"
+
+log_must $NSENTER touch $IDMAPDIR/file1
+log_must test "$UID1 $GID1" = "$(stat -c '%u %g' $WORKDIR/file1)"
+
+log_must $NSENTER mv $IDMAPDIR/file1 $IDMAPDIR/file1_renamed
+log_must test "$UID1 $GID1" = "$(stat -c '%u %g' $WORKDIR/file1_renamed)"
+
+log_must $NSENTER mv $IDMAPDIR/file1_renamed $IDMAPDIR/file1
+log_must test "$UID1 $GID1" = "$(stat -c '%u %g' $WORKDIR/file1)"
+
+log_must $NSENTER mkdir $IDMAPDIR/subdir
+log_must test "$UID1 $GID1" = "$(stat -c '%u %g' $WORKDIR/subdir)"
+
+log_must $NSENTER ln -s $IDMAPDIR/file1 $IDMAPDIR/file1_sym
+log_must test "$UID1 $GID1" = "$(stat -c '%u %g' $WORKDIR/file1_sym)"
+
+log_must $NSENTER ln $IDMAPDIR/file1 $IDMAPDIR/subdir/file1_hard
+log_must test "$UID1 $GID1" = "$(stat -c '%u %g' $WORKDIR/subdir/file1_hard)"
+
+log_must $NSENTER touch $IDMAPDIR/subdir/file2
+log_must $NSENTER chown $UID1:$GID1 $IDMAPDIR/subdir/file2
+log_mustnot $NSENTER chown $UID2 $IDMAPDIR/subdir/file2
+
+log_must $NSENTER cp -r $IDMAPDIR/subdir $IDMAPDIR/subdir1
+log_must test "$UID1 $GID1" = "$(stat -c '%u %g' $WORKDIR/subdir1/file2)"
+log_must $NSENTER rm -rf $IDMAPDIR/subdir1
+
+log_must $NSENTER cp -rp $IDMAPDIR/subdir $IDMAPDIR/subdir1
+log_must test "$UID1 $GID1" = "$(stat -c '%u %g' $WORKDIR/subdir1/file1_hard)"
+log_must $NSENTER rm -rf $IDMAPDIR/subdir1
+
+log_pass "Owner verification of entries under the base folder is successful."
+
diff --git a/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_004.ksh b/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_004.ksh
new file mode 100755
index 000000000000..89f2f750d23c
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_004.ksh
@@ -0,0 +1,106 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+. $STF_SUITE/tests/functional/idmap_mount/idmap_mount_common.kshlib
+
+#
+#
+# DESCRIPTION:
+# Test setgid bit is set properly on the idmapped mount
+# in a user namespace.
+#
+# STRATEGY:
+# 1. Create folder "idmap_test", set gid bit on it
+# 2. Idmap the folder to "idmap_dest"
+# 3. Create file and folder in the idmapped folder in the user
+# namespace having the same idmap info
+# 4. Verify the gid bit of the file and folder is set
+#
+
+verify_runnable "global"
+
+export WORKDIR=$TESTDIR/idmap_test
+export IDMAPDIR=$TESTDIR/idmap_dest
+
+function cleanup
+{
+ kill -TERM ${unshared_pid}
+ log_must rm -rf $IDMAPDIR/*
+ if mountpoint $IDMAPDIR; then
+ log_must umount $IDMAPDIR
+ fi
+ log_must rm -rf $IDMAPDIR $WORKDIR
+}
+
+log_onexit cleanup
+
+if ! idmap_util -c $TESTDIR; then
+ log_unsupported "Idmap mount not supported."
+fi
+
+log_must mkdir -p $WORKDIR
+log_must mkdir -p $IDMAPDIR
+
+log_must chown $UID1:$GID1 $WORKDIR
+# set gid bit
+log_must chmod 2755 $WORKDIR
+log_must idmap_util -m "u:${UID1}:${UID2}:1" -m "g:${GID1}:${GID2}:1" $WORKDIR $IDMAPDIR
+log_must test -g $IDMAPDIR
+
+# Create a user namespace with the same idmapping
+unshare -Urm echo test
+if [ "$?" -ne "0" ]; then
+ log_unsupported "Failed to create user namespace"
+fi
+unshare -Um /usr/bin/sleep 2h &
+unshared_pid=$!
+if [ "$?" -ne "0" ]; then
+ log_unsupported "Failed to create user namespace"
+fi
+# wait for userns to be ready
+sleep 1
+echo "${UID1} ${UID2} 1" > /proc/$unshared_pid/uid_map
+if [ "$?" -ne "0" ]; then
+ log_unsupported "Failed to write to uid_map"
+fi
+echo "${GID1} ${GID2} 1" > /proc/$unshared_pid/gid_map
+if [ "$?" -ne "0" ]; then
+ log_unsupported "Failed to write to gid_map"
+fi
+
+NSENTER="nsenter -t $unshared_pid --all -S ${UID1} -G ${GID1}"
+
+# gid bit can be set on the file
+log_must $NSENTER touch $IDMAPDIR/file1
+log_must $NSENTER chmod 2654 $IDMAPDIR/file1
+log_must test -g $WORKDIR/file1
+log_must test -g $IDMAPDIR/file1
+log_must test "$UID1 $GID1" = "$($NSENTER stat -c '%u %g' $IDMAPDIR/file1)"
+
+# gid bit is carried over to new folder
+log_must $NSENTER mkdir $IDMAPDIR/subdir
+log_must test -g $WORKDIR/subdir
+log_must test -g $IDMAPDIR/subdir
+log_must test "$UID1 $GID1" = "$($NSENTER stat -c '%u %g' $IDMAPDIR/subdir)"
+
+log_pass "Verification of setting gid bit in userns is successful."
+
diff --git a/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_005.ksh b/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_005.ksh
new file mode 100755
index 000000000000..a4ecea92c127
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_005.ksh
@@ -0,0 +1,138 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+. $STF_SUITE/tests/functional/idmap_mount/idmap_mount_common.kshlib
+
+#
+#
+# DESCRIPTION:
+# Test idmapped mount in a user namespace
+#
+# STRATEGY:
+# 1. Create a zoned dataset
+# 2. Create a user namespace and designate the dataset to the zone
+# 3. In the zone, mount the dataset to "idmap_test"
+# 4. In the zone, idmap mount the dataset mountpoint to "idmap_dest"
+# 5. Do some file operations in the idmapped mountpoint "idmap_dest"
+# 6. Check the owner of files/folder in the mount point "idmap_test"
+# 7. unmount the mountpoints in the zone
+# 8. Remount the dataset in global zone to "idmap_test"
+# 9. Check the owenr of filers/folder in the mountpoint "idmap_test"
+#
+
+verify_runnable "global"
+
+export WORKDIR=$TESTDIR/idmap_test
+export IDMAPDIR=$TESTDIR/idmap_dest
+
+function cleanup
+{
+ if [[ -v unshared_pid ]]; then
+ zfs unzone /proc/$unshared_pid/ns/user "$TESTPOOL/userns"
+ kill -TERM ${unshared_pid}
+ fi
+ if mountpoint $WORKDIR; then
+ log_must umount $WORKDIR
+ fi
+ log_must rm -rf $WORKDIR
+}
+
+log_onexit cleanup
+
+if ! idmap_util -c $TESTDIR; then
+ log_unsupported "Idmap mount not supported."
+fi
+
+unshare -Urm echo test
+if [ "$?" -ne "0" ]; then
+ log_unsupported "Failed to create user namespace"
+fi
+
+log_must zfs create -o zoned=off -o mountpoint=$WORKDIR "$TESTPOOL/userns"
+
+# "root" user and group in the user ns
+log_must chown 1000000:1000000 $WORKDIR
+log_must zfs set zoned=on "$TESTPOOL/userns"
+
+log_must mkdir -p $IDMAPDIR
+
+unshare -Um /usr/bin/sleep 2h &
+unshared_pid=$!
+if [ "$?" -ne "0" ]; then
+ log_unsupported "Failed to create user namespace"
+fi
+# wait for userns to be ready
+sleep 1
+echo "0 1000000 1000000" > /proc/$unshared_pid/uid_map
+if [ "$?" -ne "0" ]; then
+ log_unsupported "Failed to write to uid_map"
+fi
+echo "0 1000000 1000000" > /proc/$unshared_pid/gid_map
+if [ "$?" -ne "0" ]; then
+ log_unsupported "Failed to write to gid_map"
+fi
+
+NSENTER="nsenter -t $unshared_pid --all -S 0 -G 0"
+
+log_must zfs zone /proc/$unshared_pid/ns/user "$TESTPOOL/userns"
+log_must $NSENTER zfs mount "$TESTPOOL/userns"
+log_must $NSENTER chmod 777 $WORKDIR
+
+$NSENTER idmap_util -c $WORKDIR
+if [ "$?" -ne "0" ]; then
+ log_unsupported "Idmapped mount not supported in a user namespace"
+fi
+
+log_must $NSENTER idmap_util -m b:0:10000:100000 $WORKDIR $IDMAPDIR
+log_must $NSENTER setpriv --reuid 11000 --regid 11000 --clear-groups touch $IDMAPDIR/file
+log_must $NSENTER setpriv --reuid 11000 --regid 11000 --clear-groups mkdir $IDMAPDIR/folder
+log_must $NSENTER setpriv --reuid 11000 --regid 11000 --clear-groups ln -s file $IDMAPDIR/file-soft
+log_must $NSENTER setpriv --reuid 11000 --regid 11000 --clear-groups ln $IDMAPDIR/file $IDMAPDIR/file-hard
+
+log_must $NSENTER setpriv --reuid 11000 --regid 11000 --clear-groups cp -p $IDMAPDIR/file $IDMAPDIR/folder/file-p
+log_must $NSENTER setpriv --reuid 11000 --regid 11000 --clear-groups cp $IDMAPDIR/file $IDMAPDIR/folder/file
+
+log_must test "1000 1000" = "$($NSENTER stat -c '%u %g' $WORKDIR/file)"
+log_must test "1000 1000" = "$($NSENTER stat -c '%u %g' $WORKDIR/folder)"
+log_must test "1000 1000" = "$($NSENTER stat -c '%u %g' $WORKDIR/file-soft)"
+log_must test "1000 1000" = "$($NSENTER stat -c '%u %g' $WORKDIR/file-hard)"
+log_must test "1000 1000" = "$($NSENTER stat -c '%u %g' $WORKDIR/folder/file-p)"
+log_must test "1000 1000" = "$($NSENTER stat -c '%u %g' $WORKDIR/folder/file)"
+
+log_must $NSENTER umount $IDMAPDIR
+log_must $NSENTER umount $WORKDIR
+
+log_must zfs unzone /proc/$unshared_pid/ns/user "$TESTPOOL/userns"
+log_must kill -TERM $unshared_pid
+unset unshared_pid
+log_must zfs set zoned=off "$TESTPOOL/userns"
+log_must zfs mount "$TESTPOOL/userns"
+
+log_must test "1001000 1001000" = "$(stat -c '%u %g' $WORKDIR/file)"
+log_must test "1001000 1001000" = "$(stat -c '%u %g' $WORKDIR/folder)"
+log_must test "1001000 1001000" = "$(stat -c '%u %g' $WORKDIR/file-soft)"
+log_must test "1001000 1001000" = "$(stat -c '%u %g' $WORKDIR/file-hard)"
+log_must test "1001000 1001000" = "$(stat -c '%u %g' $WORKDIR/folder/file-p)"
+log_must test "1001000 1001000" = "$(stat -c '%u %g' $WORKDIR/folder/file)"
+
+log_pass "Testing idmapped mount in a user ns is successful."
+
diff --git a/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_common.kshlib b/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_common.kshlib
new file mode 100644
index 000000000000..980845ca209c
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/idmap_mount/idmap_mount_common.kshlib
@@ -0,0 +1,23 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/idmap_mount/idmap_mount.cfg
diff --git a/tests/zfs-tests/tests/functional/idmap_mount/setup.ksh b/tests/zfs-tests/tests/functional/idmap_mount/setup.ksh
new file mode 100755
index 000000000000..90a14f12058f
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/idmap_mount/setup.ksh
@@ -0,0 +1,30 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+# unable to do idmapped mount in a local zone
+verify_runnable "global"
+
+DISK=${DISKS%% *}
+default_setup $DISK
+
diff --git a/tests/zfs-tests/tests/functional/inheritance/README.config b/tests/zfs-tests/tests/functional/inheritance/README.config
index 607f10a554ec..95fd363bac4f 100644
--- a/tests/zfs-tests/tests/functional/inheritance/README.config
+++ b/tests/zfs-tests/tests/functional/inheritance/README.config
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/README.state b/tests/zfs-tests/tests/functional/inheritance/README.state
index c1d3cc05d603..2fbd103f178e 100644
--- a/tests/zfs-tests/tests/functional/inheritance/README.state
+++ b/tests/zfs-tests/tests/functional/inheritance/README.state
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/cleanup.ksh b/tests/zfs-tests/tests/functional/inheritance/cleanup.ksh
index daac5c18a345..7fa851fc0ef6 100755
--- a/tests/zfs-tests/tests/functional/inheritance/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/inheritance/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config001.cfg b/tests/zfs-tests/tests/functional/inheritance/config001.cfg
index 23616cbf3b7f..23819eb7ff8b 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config001.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config001.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config002.cfg b/tests/zfs-tests/tests/functional/inheritance/config002.cfg
index 31294110f6ad..09f6bb3535cb 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config002.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config002.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config003.cfg b/tests/zfs-tests/tests/functional/inheritance/config003.cfg
index 57a73b95d433..99c5f9f3e0d4 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config003.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config003.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config004.cfg b/tests/zfs-tests/tests/functional/inheritance/config004.cfg
index 1052526379f0..196683d53d53 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config004.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config004.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config005.cfg b/tests/zfs-tests/tests/functional/inheritance/config005.cfg
index d15beb2c4ca8..27f49c54e77f 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config005.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config005.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config006.cfg b/tests/zfs-tests/tests/functional/inheritance/config006.cfg
index a059d17978f7..3cb630b931bb 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config006.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config006.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config007.cfg b/tests/zfs-tests/tests/functional/inheritance/config007.cfg
index b416c9f17d20..8a7b47c1a93a 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config007.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config007.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config008.cfg b/tests/zfs-tests/tests/functional/inheritance/config008.cfg
index 4f7e7b0ef7f8..c8105f9e47a6 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config008.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config008.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config009.cfg b/tests/zfs-tests/tests/functional/inheritance/config009.cfg
index 4f7e7b0ef7f8..c8105f9e47a6 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config009.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config009.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config010.cfg b/tests/zfs-tests/tests/functional/inheritance/config010.cfg
index 4f7e7b0ef7f8..c8105f9e47a6 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config010.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config010.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config011.cfg b/tests/zfs-tests/tests/functional/inheritance/config011.cfg
index 57a73b95d433..99c5f9f3e0d4 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config011.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config011.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config012.cfg b/tests/zfs-tests/tests/functional/inheritance/config012.cfg
index 57a73b95d433..99c5f9f3e0d4 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config012.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config012.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config013.cfg b/tests/zfs-tests/tests/functional/inheritance/config013.cfg
index 1052526379f0..196683d53d53 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config013.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config013.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config014.cfg b/tests/zfs-tests/tests/functional/inheritance/config014.cfg
index 1052526379f0..196683d53d53 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config014.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config014.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config015.cfg b/tests/zfs-tests/tests/functional/inheritance/config015.cfg
index 31294110f6ad..09f6bb3535cb 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config015.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config015.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config016.cfg b/tests/zfs-tests/tests/functional/inheritance/config016.cfg
index 31294110f6ad..09f6bb3535cb 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config016.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config016.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config017.cfg b/tests/zfs-tests/tests/functional/inheritance/config017.cfg
index d15beb2c4ca8..27f49c54e77f 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config017.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config017.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config018.cfg b/tests/zfs-tests/tests/functional/inheritance/config018.cfg
index d15beb2c4ca8..27f49c54e77f 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config018.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config018.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config019.cfg b/tests/zfs-tests/tests/functional/inheritance/config019.cfg
index 23616cbf3b7f..23819eb7ff8b 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config019.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config019.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config020.cfg b/tests/zfs-tests/tests/functional/inheritance/config020.cfg
index 23616cbf3b7f..23819eb7ff8b 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config020.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config020.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config021.cfg b/tests/zfs-tests/tests/functional/inheritance/config021.cfg
index a059d17978f7..3cb630b931bb 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config021.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config021.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config022.cfg b/tests/zfs-tests/tests/functional/inheritance/config022.cfg
index a059d17978f7..3cb630b931bb 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config022.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config022.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config023.cfg b/tests/zfs-tests/tests/functional/inheritance/config023.cfg
index b416c9f17d20..8a7b47c1a93a 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config023.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config023.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/config024.cfg b/tests/zfs-tests/tests/functional/inheritance/config024.cfg
index b416c9f17d20..8a7b47c1a93a 100644
--- a/tests/zfs-tests/tests/functional/inheritance/config024.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/config024.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/inherit.kshlib b/tests/zfs-tests/tests/functional/inheritance/inherit.kshlib
index a485d0521d1f..8967a0fbc128 100644
--- a/tests/zfs-tests/tests/functional/inheritance/inherit.kshlib
+++ b/tests/zfs-tests/tests/functional/inheritance/inherit.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/inherit_001_pos.ksh b/tests/zfs-tests/tests/functional/inheritance/inherit_001_pos.ksh
index 4dfc3a8986a3..1f203e1dc551 100755
--- a/tests/zfs-tests/tests/functional/inheritance/inherit_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/inheritance/inherit_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -26,6 +26,7 @@
#
# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
+# Copyright (c) 2022 Hewlett Packard Enterprise Development LP.
#
. $STF_SUITE/include/libtest.shlib
@@ -332,7 +333,7 @@ function scan_state { #state-file
log_note "No operation specified"
else
export __ZFS_POOL_RESTRICT="TESTPOOL"
- log_must zfs unmount -a
+ log_must_busy zfs unmount -a
unset __ZFS_POOL_RESTRICT
for p in ${prop[i]} ${prop[((i+1))]}; do
@@ -376,7 +377,8 @@ set -A prop "checksum" "" \
"sharenfs" "" \
"recordsize" "recsize" \
"snapdir" "" \
- "readonly" ""
+ "readonly" "" \
+ "redundant_metadata" ""
#
# Note except for the mountpoint default value (which is handled in
@@ -387,12 +389,14 @@ set -A prop "checksum" "" \
set -A def_val "on" "on" "on" \
"off" "" \
"hidden" \
- "off"
+ "off" \
+ "all"
set -A local_val "off" "off" "off" \
"on" "" \
"visible" \
- "off"
+ "off" \
+ "none"
#
# Add system specific values
diff --git a/tests/zfs-tests/tests/functional/inheritance/state001.cfg b/tests/zfs-tests/tests/functional/inheritance/state001.cfg
index afaf3cccfe14..4fbdcd6e212b 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state001.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state001.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state002.cfg b/tests/zfs-tests/tests/functional/inheritance/state002.cfg
index 5b2f2d2dd98a..f368be370c24 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state002.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state002.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state003.cfg b/tests/zfs-tests/tests/functional/inheritance/state003.cfg
index 5780065ace88..06b092dd3800 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state003.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state003.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state004.cfg b/tests/zfs-tests/tests/functional/inheritance/state004.cfg
index e62979a04b7d..e679e449d850 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state004.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state004.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state005.cfg b/tests/zfs-tests/tests/functional/inheritance/state005.cfg
index 097459ffedb9..da7a4f9d4e86 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state005.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state005.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state006.cfg b/tests/zfs-tests/tests/functional/inheritance/state006.cfg
index 9863b298fe35..93d90c86cbbb 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state006.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state006.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state007.cfg b/tests/zfs-tests/tests/functional/inheritance/state007.cfg
index 731ec95a250b..871287b15878 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state007.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state007.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state008.cfg b/tests/zfs-tests/tests/functional/inheritance/state008.cfg
index 7385c98c3c07..4b1cfbd09cbb 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state008.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state008.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state009.cfg b/tests/zfs-tests/tests/functional/inheritance/state009.cfg
index 3fb2841a2cc1..19ee507ef80b 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state009.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state009.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state010.cfg b/tests/zfs-tests/tests/functional/inheritance/state010.cfg
index 4c51e808b1fa..57c29d6e3e04 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state010.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state010.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state011.cfg b/tests/zfs-tests/tests/functional/inheritance/state011.cfg
index f6e791ee73c1..5eb33af00b31 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state011.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state011.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state012.cfg b/tests/zfs-tests/tests/functional/inheritance/state012.cfg
index 47898244b025..afe1d0d947fe 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state012.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state012.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state013.cfg b/tests/zfs-tests/tests/functional/inheritance/state013.cfg
index ae5919292623..49f2c242cb76 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state013.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state013.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state014.cfg b/tests/zfs-tests/tests/functional/inheritance/state014.cfg
index 3770c5093e52..e6418e3e5a80 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state014.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state014.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state015.cfg b/tests/zfs-tests/tests/functional/inheritance/state015.cfg
index fb1fc3907b76..c8228f080925 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state015.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state015.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state016.cfg b/tests/zfs-tests/tests/functional/inheritance/state016.cfg
index f17154c74519..c830287d2a76 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state016.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state016.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state017.cfg b/tests/zfs-tests/tests/functional/inheritance/state017.cfg
index a993eed5f78c..09d061340af3 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state017.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state017.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state018.cfg b/tests/zfs-tests/tests/functional/inheritance/state018.cfg
index 6fd08c6fb8b1..f718c83395d6 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state018.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state018.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state019.cfg b/tests/zfs-tests/tests/functional/inheritance/state019.cfg
index 67b488f84a09..484e9e02c680 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state019.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state019.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state020.cfg b/tests/zfs-tests/tests/functional/inheritance/state020.cfg
index df8ba7dd5246..5a4ec6a6f7e6 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state020.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state020.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state021.cfg b/tests/zfs-tests/tests/functional/inheritance/state021.cfg
index f61472eff197..231530a14776 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state021.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state021.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state022.cfg b/tests/zfs-tests/tests/functional/inheritance/state022.cfg
index 22462f97839a..990215766aad 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state022.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state022.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state023.cfg b/tests/zfs-tests/tests/functional/inheritance/state023.cfg
index 8219a2abf3c3..4f9091c67908 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state023.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state023.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inheritance/state024.cfg b/tests/zfs-tests/tests/functional/inheritance/state024.cfg
index 848ae1437d06..cd67aaf6728f 100644
--- a/tests/zfs-tests/tests/functional/inheritance/state024.cfg
+++ b/tests/zfs-tests/tests/functional/inheritance/state024.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inuse/inuse.cfg b/tests/zfs-tests/tests/functional/inuse/inuse.cfg
index 631ace7ab795..2514f89e78e5 100644
--- a/tests/zfs-tests/tests/functional/inuse/inuse.cfg
+++ b/tests/zfs-tests/tests/functional/inuse/inuse.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inuse/inuse_001_pos.ksh b/tests/zfs-tests/tests/functional/inuse/inuse_001_pos.ksh
index 25a807025c87..17e1169175e7 100755
--- a/tests/zfs-tests/tests/functional/inuse/inuse_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/inuse/inuse_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inuse/inuse_003_pos.ksh b/tests/zfs-tests/tests/functional/inuse/inuse_003_pos.ksh
index 8c984df3089e..385b88bdc6b6 100755
--- a/tests/zfs-tests/tests/functional/inuse/inuse_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/inuse/inuse_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inuse/inuse_004_pos.ksh b/tests/zfs-tests/tests/functional/inuse/inuse_004_pos.ksh
index 8e051d8b6f73..054c6e5ac8bd 100755
--- a/tests/zfs-tests/tests/functional/inuse/inuse_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/inuse/inuse_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inuse/inuse_005_pos.ksh b/tests/zfs-tests/tests/functional/inuse/inuse_005_pos.ksh
index afe30d059997..f50fd2ff91de 100755
--- a/tests/zfs-tests/tests/functional/inuse/inuse_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/inuse/inuse_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inuse/inuse_006_pos.ksh b/tests/zfs-tests/tests/functional/inuse/inuse_006_pos.ksh
index 2222721afd8d..0d2c2ded0260 100755
--- a/tests/zfs-tests/tests/functional/inuse/inuse_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/inuse/inuse_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inuse/inuse_007_pos.ksh b/tests/zfs-tests/tests/functional/inuse/inuse_007_pos.ksh
index 775f1af63bf1..d3e580a6f533 100755
--- a/tests/zfs-tests/tests/functional/inuse/inuse_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/inuse/inuse_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inuse/inuse_008_pos.ksh b/tests/zfs-tests/tests/functional/inuse/inuse_008_pos.ksh
index d60ebcee1554..68bf19f0abce 100755
--- a/tests/zfs-tests/tests/functional/inuse/inuse_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/inuse/inuse_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inuse/inuse_009_pos.ksh b/tests/zfs-tests/tests/functional/inuse/inuse_009_pos.ksh
index 54d201ad6291..64fe05b422dd 100755
--- a/tests/zfs-tests/tests/functional/inuse/inuse_009_pos.ksh
+++ b/tests/zfs-tests/tests/functional/inuse/inuse_009_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/inuse/setup.ksh b/tests/zfs-tests/tests/functional/inuse/setup.ksh
index 962a0c98dc7e..14cdb6798a9f 100755
--- a/tests/zfs-tests/tests/functional/inuse/setup.ksh
+++ b/tests/zfs-tests/tests/functional/inuse/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/io/cleanup.ksh b/tests/zfs-tests/tests/functional/io/cleanup.ksh
index 0031a26c3cec..5bd79c0070fa 100755
--- a/tests/zfs-tests/tests/functional/io/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/io/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/io/io_uring.ksh b/tests/zfs-tests/tests/functional/io/io_uring.ksh
index 1ee5cee52227..2fa146556358 100755
--- a/tests/zfs-tests/tests/functional/io/io_uring.ksh
+++ b/tests/zfs-tests/tests/functional/io/io_uring.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -40,10 +40,17 @@
verify_runnable "global"
-if [[ $(linux_version) -lt $(linux_version "5.1") ]]; then
+if ! $(grep -q "CONFIG_IO_URING=y" /boot/config-$(uname -r)); then
log_unsupported "Requires io_uring support"
fi
+if [ -e /etc/os-release ] ; then
+ source /etc/os-release
+ if [ -n "$REDHAT_SUPPORT_PRODUCT_VERSION" ] && ((floor($REDHAT_SUPPORT_PRODUCT_VERSION) == 9)) ; then
+ log_unsupported "Disabled on CentOS 9, fails with 'Operation not permitted'"
+ fi
+fi
+
fio --ioengine=io_uring --parse-only || log_unsupported "fio io_uring support required"
function cleanup
diff --git a/tests/zfs-tests/tests/functional/io/libaio.ksh b/tests/zfs-tests/tests/functional/io/libaio.ksh
index ef100209beac..242b2ca8de30 100755
--- a/tests/zfs-tests/tests/functional/io/libaio.ksh
+++ b/tests/zfs-tests/tests/functional/io/libaio.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/io/mmap.ksh b/tests/zfs-tests/tests/functional/io/mmap.ksh
index 742c1f08f1c7..112267ee20d8 100755
--- a/tests/zfs-tests/tests/functional/io/mmap.ksh
+++ b/tests/zfs-tests/tests/functional/io/mmap.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/io/posixaio.ksh b/tests/zfs-tests/tests/functional/io/posixaio.ksh
index c720aef9535f..52331027cdd2 100755
--- a/tests/zfs-tests/tests/functional/io/posixaio.ksh
+++ b/tests/zfs-tests/tests/functional/io/posixaio.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/io/psync.ksh b/tests/zfs-tests/tests/functional/io/psync.ksh
index 8feb87d93a7c..5227fcbdd449 100755
--- a/tests/zfs-tests/tests/functional/io/psync.ksh
+++ b/tests/zfs-tests/tests/functional/io/psync.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/io/setup.ksh b/tests/zfs-tests/tests/functional/io/setup.ksh
index ff72fc3db7c0..82aaf5bc91b5 100755
--- a/tests/zfs-tests/tests/functional/io/setup.ksh
+++ b/tests/zfs-tests/tests/functional/io/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/io/sync.ksh b/tests/zfs-tests/tests/functional/io/sync.ksh
index aaaa126efb1f..76248a38a519 100755
--- a/tests/zfs-tests/tests/functional/io/sync.ksh
+++ b/tests/zfs-tests/tests/functional/io/sync.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/l2arc/l2arc_mfuonly_pos.ksh b/tests/zfs-tests/tests/functional/l2arc/l2arc_mfuonly_pos.ksh
index f2bada0ebbec..89ab940334ee 100755
--- a/tests/zfs-tests/tests/functional/l2arc/l2arc_mfuonly_pos.ksh
+++ b/tests/zfs-tests/tests/functional/l2arc/l2arc_mfuonly_pos.ksh
@@ -80,7 +80,7 @@ log_must fio $FIO_SCRIPTS/mkfiles.fio
log_must fio $FIO_SCRIPTS/random_reads.fio
log_must zpool export $TESTPOOL
-log_must zpool import -d $VDIR $TESTPOOL
+log_must zpool import -N -d $VDIR $TESTPOOL
# Regardless of l2arc_noprefetch, some MFU buffers might be evicted
# from ARC, accessed later on as prefetches and transition to MRU as
diff --git a/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_001_pos.ksh b/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_001_pos.ksh
index 6f7b9aff7c38..a9968723c3ca 100755
--- a/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_001_pos.ksh
@@ -27,15 +27,14 @@
#
# STRATEGY:
# 1. Create pool with a cache device.
-# 2. Export and re-import pool without writing any data.
-# 3. Create a random file in that pool and random read for 10 sec.
-# 4. Export pool.
-# 5. Read the amount of log blocks written from the header of the
+# 2. Create a random file in that pool and random read for 10 sec.
+# 3. Export pool.
+# 4. Read the amount of log blocks written from the header of the
# L2ARC device.
-# 6. Import pool.
-# 7. Read the amount of log blocks rebuilt in arcstats and compare to
+# 5. Import pool.
+# 6. Read the amount of log blocks rebuilt in arcstats and compare to
# (5).
-# 8. Check if the labels of the L2ARC device are intact.
+# 7. Check if the labels of the L2ARC device are intact.
#
# * We can predict the minimum bytes of L2ARC restored if we subtract
# from the effective size of the cache device the bytes l2arc_evict()
@@ -77,10 +76,8 @@ export FILE_SIZE=$(( floor($fill_mb / $NUMJOBS) ))M
log_must truncate -s ${cache_sz}M $VDEV_CACHE
-log_must zpool create -f $TESTPOOL $VDEV cache $VDEV_CACHE
-
-log_must zpool export $TESTPOOL
-log_must zpool import -d $VDIR $TESTPOOL
+log_must zpool create -f -o ashift=12 $TESTPOOL $VDEV
+log_must zpool add $TESTPOOL cache $VDEV_CACHE
log_must fio $FIO_SCRIPTS/mkfiles.fio
log_must fio $FIO_SCRIPTS/random_reads.fio
diff --git a/tests/zfs-tests/tests/functional/large_files/cleanup.ksh b/tests/zfs-tests/tests/functional/large_files/cleanup.ksh
index 3166bd6ec16e..42fe70042d6a 100755
--- a/tests/zfs-tests/tests/functional/large_files/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/large_files/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/large_files/large_files_001_pos.ksh b/tests/zfs-tests/tests/functional/large_files/large_files_001_pos.ksh
index f59603724e76..aebc8b2647d5 100755
--- a/tests/zfs-tests/tests/functional/large_files/large_files_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/large_files/large_files_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/large_files/large_files_002_pos.ksh b/tests/zfs-tests/tests/functional/large_files/large_files_002_pos.ksh
index 255a8f8b5ad6..e0014d64350c 100755
--- a/tests/zfs-tests/tests/functional/large_files/large_files_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/large_files/large_files_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/large_files/setup.ksh b/tests/zfs-tests/tests/functional/large_files/setup.ksh
index 3a45ec8d510d..d617f361b24d 100755
--- a/tests/zfs-tests/tests/functional/large_files/setup.ksh
+++ b/tests/zfs-tests/tests/functional/large_files/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/largest_pool/largest_pool.cfg b/tests/zfs-tests/tests/functional/largest_pool/largest_pool.cfg
index 13c157789dd7..9306c799ec54 100644
--- a/tests/zfs-tests/tests/functional/largest_pool/largest_pool.cfg
+++ b/tests/zfs-tests/tests/functional/largest_pool/largest_pool.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/largest_pool/largest_pool_001_pos.ksh b/tests/zfs-tests/tests/functional/largest_pool/largest_pool_001_pos.ksh
index 7955478502d1..85f25c7618c6 100755
--- a/tests/zfs-tests/tests/functional/largest_pool/largest_pool_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/largest_pool/largest_pool_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/libzfs/cleanup.ksh b/tests/zfs-tests/tests/functional/libzfs/cleanup.ksh
index 3166bd6ec16e..42fe70042d6a 100755
--- a/tests/zfs-tests/tests/functional/libzfs/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/libzfs/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/libzfs/many_fds.c b/tests/zfs-tests/tests/functional/libzfs/many_fds.c
index 34029e0e32d0..6e0b1fd4b4aa 100644
--- a/tests/zfs-tests/tests/functional/libzfs/many_fds.c
+++ b/tests/zfs-tests/tests/functional/libzfs/many_fds.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
diff --git a/tests/zfs-tests/tests/functional/libzfs/setup.ksh b/tests/zfs-tests/tests/functional/libzfs/setup.ksh
index fc5cec3063a6..b756d4e76c83 100755
--- a/tests/zfs-tests/tests/functional/libzfs/setup.ksh
+++ b/tests/zfs-tests/tests/functional/libzfs/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/link_count/cleanup.ksh b/tests/zfs-tests/tests/functional/link_count/cleanup.ksh
index 3166bd6ec16e..42fe70042d6a 100755
--- a/tests/zfs-tests/tests/functional/link_count/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/link_count/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/link_count/link_count_001.ksh b/tests/zfs-tests/tests/functional/link_count/link_count_001.ksh
index 3ab3fbef8df8..d3020c99c95c 100755
--- a/tests/zfs-tests/tests/functional/link_count/link_count_001.ksh
+++ b/tests/zfs-tests/tests/functional/link_count/link_count_001.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/link_count/setup.ksh b/tests/zfs-tests/tests/functional/link_count/setup.ksh
index d275e063b13a..76aa23035dd9 100755
--- a/tests/zfs-tests/tests/functional/link_count/setup.ksh
+++ b/tests/zfs-tests/tests/functional/link_count/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/migration/cleanup.ksh b/tests/zfs-tests/tests/functional/migration/cleanup.ksh
index 79676d79e6fd..c9f1833be10c 100755
--- a/tests/zfs-tests/tests/functional/migration/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/migration/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/migration/migration.cfg b/tests/zfs-tests/tests/functional/migration/migration.cfg
index 308891b86d01..7d606f6d9a12 100644
--- a/tests/zfs-tests/tests/functional/migration/migration.cfg
+++ b/tests/zfs-tests/tests/functional/migration/migration.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/migration/migration.kshlib b/tests/zfs-tests/tests/functional/migration/migration.kshlib
index 0362f0644f6f..7078f93a559b 100644
--- a/tests/zfs-tests/tests/functional/migration/migration.kshlib
+++ b/tests/zfs-tests/tests/functional/migration/migration.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/migration/migration_001_pos.ksh b/tests/zfs-tests/tests/functional/migration/migration_001_pos.ksh
index 3a4a4b7f8f74..8e0cdf8034d9 100755
--- a/tests/zfs-tests/tests/functional/migration/migration_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/migration/migration_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/migration/migration_002_pos.ksh b/tests/zfs-tests/tests/functional/migration/migration_002_pos.ksh
index a522174f11aa..fe8aee004b93 100755
--- a/tests/zfs-tests/tests/functional/migration/migration_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/migration/migration_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/migration/migration_003_pos.ksh b/tests/zfs-tests/tests/functional/migration/migration_003_pos.ksh
index c83883d356c3..3d9ba5691d59 100755
--- a/tests/zfs-tests/tests/functional/migration/migration_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/migration/migration_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/migration/migration_004_pos.ksh b/tests/zfs-tests/tests/functional/migration/migration_004_pos.ksh
index 5a4375410e65..c3b7b73b7e50 100755
--- a/tests/zfs-tests/tests/functional/migration/migration_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/migration/migration_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/migration/migration_005_pos.ksh b/tests/zfs-tests/tests/functional/migration/migration_005_pos.ksh
index f282c37b7a1c..c48c8d6bc57f 100755
--- a/tests/zfs-tests/tests/functional/migration/migration_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/migration/migration_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/migration/migration_006_pos.ksh b/tests/zfs-tests/tests/functional/migration/migration_006_pos.ksh
index a2ebd1f3f2c8..893a9bc50fc5 100755
--- a/tests/zfs-tests/tests/functional/migration/migration_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/migration/migration_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/migration/migration_007_pos.ksh b/tests/zfs-tests/tests/functional/migration/migration_007_pos.ksh
index 40839ecc00a5..80b7749d6805 100755
--- a/tests/zfs-tests/tests/functional/migration/migration_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/migration/migration_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/migration/migration_008_pos.ksh b/tests/zfs-tests/tests/functional/migration/migration_008_pos.ksh
index af60e4bc1f4e..5fdcc5f90c55 100755
--- a/tests/zfs-tests/tests/functional/migration/migration_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/migration/migration_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/migration/migration_009_pos.ksh b/tests/zfs-tests/tests/functional/migration/migration_009_pos.ksh
index e24cfdc96db1..c91946067ef2 100755
--- a/tests/zfs-tests/tests/functional/migration/migration_009_pos.ksh
+++ b/tests/zfs-tests/tests/functional/migration/migration_009_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/migration/migration_010_pos.ksh b/tests/zfs-tests/tests/functional/migration/migration_010_pos.ksh
index f090fed3d83c..62ccccb1613c 100755
--- a/tests/zfs-tests/tests/functional/migration/migration_010_pos.ksh
+++ b/tests/zfs-tests/tests/functional/migration/migration_010_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/migration/migration_011_pos.ksh b/tests/zfs-tests/tests/functional/migration/migration_011_pos.ksh
index 4293c8d8bdc2..9718fefb406d 100755
--- a/tests/zfs-tests/tests/functional/migration/migration_011_pos.ksh
+++ b/tests/zfs-tests/tests/functional/migration/migration_011_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/migration/migration_012_pos.ksh b/tests/zfs-tests/tests/functional/migration/migration_012_pos.ksh
index 675b4a159b68..243136e768bd 100755
--- a/tests/zfs-tests/tests/functional/migration/migration_012_pos.ksh
+++ b/tests/zfs-tests/tests/functional/migration/migration_012_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -55,7 +55,7 @@ log_assert "Migrating test file from $NEWFS_DEFAULT_FS fs to ZFS fs using cp"
log_onexit cleanup
-log_mustprepare $DNAME "cp $BNAME $NONZFS_TESTDIR/cp$$.cp"
-log_mustmigrate $TESTDIR $SUMA $SUMB "cp $NONZFS_TESTDIR/cp$$.cp $BNAME"
+log_must prepare $DNAME "cp $BNAME $NONZFS_TESTDIR/cp$$.cp"
+log_must migrate $TESTDIR $SUMA $SUMB "cp $NONZFS_TESTDIR/cp$$.cp $BNAME"
log_pass "Successfully migrated test file from $NEWFS_DEFAULT_FS fs to ZFS fs".
diff --git a/tests/zfs-tests/tests/functional/migration/setup.ksh b/tests/zfs-tests/tests/functional/migration/setup.ksh
index 4992f954eeee..5aa4d058ce5d 100755
--- a/tests/zfs-tests/tests/functional/migration/setup.ksh
+++ b/tests/zfs-tests/tests/functional/migration/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/mmap/cleanup.ksh b/tests/zfs-tests/tests/functional/mmap/cleanup.ksh
index 3166bd6ec16e..42fe70042d6a 100755
--- a/tests/zfs-tests/tests/functional/mmap/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/mmap/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/mmap/mmap.cfg b/tests/zfs-tests/tests/functional/mmap/mmap.cfg
index 1501c0463015..a331c5b2aa4f 100644
--- a/tests/zfs-tests/tests/functional/mmap/mmap.cfg
+++ b/tests/zfs-tests/tests/functional/mmap/mmap.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/mmap/mmap_libaio_001_pos.ksh b/tests/zfs-tests/tests/functional/mmap/mmap_libaio_001_pos.ksh
index 031d90c3838b..b9e9a8a3c138 100755
--- a/tests/zfs-tests/tests/functional/mmap/mmap_libaio_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/mmap/mmap_libaio_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/mmap/mmap_mixed.ksh b/tests/zfs-tests/tests/functional/mmap/mmap_mixed.ksh
new file mode 100755
index 000000000000..6c8246d48acf
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/mmap/mmap_mixed.ksh
@@ -0,0 +1,86 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by Lawrence Livermore National Security, LLC.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/mmap/mmap.cfg
+
+#
+# DESCRIPTION:
+# Verify mixed buffered and mmap IO.
+#
+# STRATEGY:
+# 1. Create an empty file.
+# 2. Start a background buffered read/write fio to the file.
+# 3. Start a background mmap read/write fio to the file.
+#
+
+verify_runnable "global"
+
+function cleanup
+{
+ log_must rm -f "$tmp_file"
+}
+
+log_assert "Verify mixed buffered and mmap IO"
+
+log_onexit cleanup
+
+mntpnt=$(get_prop mountpoint $TESTPOOL/$TESTFS)
+tmp_file=$mntpnt/file
+bs=$((128 * 1024))
+blocks=64
+size=$((bs * blocks))
+runtime=60
+
+log_must dd if=/dev/zero of=$tmp_file bs=$bs count=$blocks
+
+# Buffered IO writes
+log_must eval "fio --filename=$tmp_file --name=buffer-write \
+ --rw=randwrite --size=$size --bs=$bs --direct=0 --numjobs=1 \
+ --ioengine=sync --fallocate=none --group_reporting --minimal \
+ --runtime=$runtime --time_based --norandommap &"
+
+# Buffered IO reads
+log_must eval "fio --filename=$tmp_file --name=buffer-read \
+ --rw=randread --size=$size --bs=$bs --direct=0 --numjobs=1 \
+ --ioengine=sync --fallocate=none --group_reporting --minimal \
+ --runtime=$runtime --time_based --norandommap &"
+
+# mmap IO writes
+log_must eval "fio --filename=$tmp_file --name=mmap-write \
+ --rw=randwrite --size=$size --bs=$bs --numjobs=1 \
+ --ioengine=mmap --fallocate=none --group_reporting --minimal \
+ --runtime=$runtime --time_based --norandommap &"
+
+# mmap IO reads
+log_must eval "fio --filename=$tmp_file --name=mmap-read \
+ --rw=randread --size=$size --bs=$bs --numjobs=1 \
+ --ioengine=mmap --fallocate=none --group_reporting --minimal \
+ --runtime=$runtime --time_based --norandommap &"
+
+log_must wait
+
+log_pass "Verfied mixed buffered and mmap IO"
diff --git a/tests/zfs-tests/tests/functional/mmap/mmap_read_001_pos.ksh b/tests/zfs-tests/tests/functional/mmap/mmap_read_001_pos.ksh
index 470f10d937bc..acef0676f5cb 100755
--- a/tests/zfs-tests/tests/functional/mmap/mmap_read_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/mmap/mmap_read_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/mmap/mmap_seek_001_pos.ksh b/tests/zfs-tests/tests/functional/mmap/mmap_seek_001_pos.ksh
index 6188549ad8d2..c09746b4b66a 100755
--- a/tests/zfs-tests/tests/functional/mmap/mmap_seek_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/mmap/mmap_seek_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/mmap/mmap_write_001_pos.ksh b/tests/zfs-tests/tests/functional/mmap/mmap_write_001_pos.ksh
index 2f4257993d4a..9de0471a9b69 100755
--- a/tests/zfs-tests/tests/functional/mmap/mmap_write_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/mmap/mmap_write_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/mmap/setup.ksh b/tests/zfs-tests/tests/functional/mmap/setup.ksh
index d275e063b13a..76aa23035dd9 100755
--- a/tests/zfs-tests/tests/functional/mmap/setup.ksh
+++ b/tests/zfs-tests/tests/functional/mmap/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/mmp/mmp.kshlib b/tests/zfs-tests/tests/functional/mmp/mmp.kshlib
index 9dd6f4d53f4a..5071830c489a 100644
--- a/tests/zfs-tests/tests/functional/mmp/mmp.kshlib
+++ b/tests/zfs-tests/tests/functional/mmp/mmp.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/mmp/mmp_write_slow_disk.ksh b/tests/zfs-tests/tests/functional/mmp/mmp_write_slow_disk.ksh
new file mode 100755
index 000000000000..8b118684aa7f
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/mmp/mmp_write_slow_disk.ksh
@@ -0,0 +1,97 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2024, Klara Inc
+#
+
+# DESCRIPTION:
+# Verify that long VDEV probes do not cause MMP checks to suspend pool
+# Note: without PR-15839 fix, this test will suspend the pool.
+#
+# A device that is returning unexpected errors will trigger a vdev_probe.
+# When the device additionally has slow response times, the probe can hold
+# the spa config lock as a writer for a long period of time such that the
+# mmp uberblock updates stall when trying to acquire the spa config lock.
+#
+# STRATEGY:
+# 1. Create a pool with multiple leaf vdevs
+# 2. Enable multihost and multihost_history
+# 3. Delay for MMP writes to occur
+# 4. Verify that a long VDEV probe didn't cause MMP check to suspend pool
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/mmp/mmp.cfg
+. $STF_SUITE/tests/functional/mmp/mmp.kshlib
+
+verify_runnable "both"
+
+function cleanup
+{
+ log_must zinject -c all
+
+ if [[ $(zpool list -H -o health $MMP_POOL) == "SUSPENDED" ]]; then
+ log_must zpool clear $MMP_POOL
+ zpool get state $MMP_POOL $MMP_DIR/file.3
+ zpool events | grep ".fs.zfs." | grep -v "history_event"
+ fi
+
+ poolexists $MMP_POOL && destroy_pool $MMP_POOL
+ log_must rm -r $MMP_DIR
+ log_must mmp_clear_hostid
+}
+
+log_assert "A long VDEV probe doesn't cause a MMP check suspend"
+log_onexit cleanup
+
+MMP_HISTORY_URL=/proc/spl/kstat/zfs/$MMP_POOL/multihost
+
+# Create a multiple drive pool
+log_must zpool events -c
+log_must mkdir -p $MMP_DIR
+log_must truncate -s 128M $MMP_DIR/file.{0,1,2,3,4,5}
+log_must zpool create -f $MMP_POOL \
+ mirror $MMP_DIR/file.{0,1,2} \
+ mirror $MMP_DIR/file.{3,4,5}
+
+# Enable MMP
+log_must mmp_set_hostid $HOSTID1
+log_must zpool set multihost=on $MMP_POOL
+clear_mmp_history
+
+# Inject vdev write error along with a delay
+log_must zinject -f 33 -e io -L pad2 -T write -d $MMP_DIR/file.3 $MMP_POOL
+log_must zinject -f 50 -e io -L uber -T write -d $MMP_DIR/file.3 $MMP_POOL
+log_must zinject -D 2000:4 -T write -d $MMP_DIR/file.3 $MMP_POOL
+
+log_must dd if=/dev/urandom of=/$MMP_POOL/data bs=1M count=5
+sleep 10
+sync_pool $MMP_POOL
+
+# Confirm mmp writes to the non-slow disks have taken place
+for x in {0,1,2,4}; do
+ write_count=$(grep -c file.${x} $MMP_HISTORY_URL)
+ [[ $write_count -gt 0 ]] || log_fail "expecting mmp writes"
+done
+
+# Expect that the pool was not suspended
+log_must check_state $MMP_POOL "" "ONLINE"
+health=$(zpool list -H -o health $MMP_POOL)
+log_note "$MMP_POOL health is $health"
+[[ "$health" == "SUSPENDED" ]] && log_fail "$MMP_POOL $health unexpected"
+
+log_pass "A long VDEV probe doesn't cause a MMP check suspend"
diff --git a/tests/zfs-tests/tests/functional/mount/cleanup.ksh b/tests/zfs-tests/tests/functional/mount/cleanup.ksh
index f20c72841f42..bd6b0e435ed1 100755
--- a/tests/zfs-tests/tests/functional/mount/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/mount/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/mount/setup.ksh b/tests/zfs-tests/tests/functional/mount/setup.ksh
index 8e2edcd24f4b..9b3bc37ce6ae 100755
--- a/tests/zfs-tests/tests/functional/mount/setup.ksh
+++ b/tests/zfs-tests/tests/functional/mount/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/mount/umount_001.ksh b/tests/zfs-tests/tests/functional/mount/umount_001.ksh
index ec4954569961..9e350de66fa3 100755
--- a/tests/zfs-tests/tests/functional/mount/umount_001.ksh
+++ b/tests/zfs-tests/tests/functional/mount/umount_001.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/mv_files/cleanup.ksh b/tests/zfs-tests/tests/functional/mv_files/cleanup.ksh
index 1c170208b574..882f9955a4c2 100755
--- a/tests/zfs-tests/tests/functional/mv_files/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/mv_files/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/mv_files/mv_files.cfg b/tests/zfs-tests/tests/functional/mv_files/mv_files.cfg
index fbab8f6dad7b..2ee7c08d3c43 100644
--- a/tests/zfs-tests/tests/functional/mv_files/mv_files.cfg
+++ b/tests/zfs-tests/tests/functional/mv_files/mv_files.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/mv_files/mv_files_001_pos.ksh b/tests/zfs-tests/tests/functional/mv_files/mv_files_001_pos.ksh
index 209c3509a347..fffe8d285654 100755
--- a/tests/zfs-tests/tests/functional/mv_files/mv_files_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/mv_files/mv_files_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/mv_files/mv_files_002_pos.ksh b/tests/zfs-tests/tests/functional/mv_files/mv_files_002_pos.ksh
index c20831babfab..7eea345d150e 100755
--- a/tests/zfs-tests/tests/functional/mv_files/mv_files_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/mv_files/mv_files_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib b/tests/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib
index 26c2e84ce4ed..c3827198a6ef 100644
--- a/tests/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib
+++ b/tests/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/mv_files/setup.ksh b/tests/zfs-tests/tests/functional/mv_files/setup.ksh
index d459c51e4e57..669a930c6323 100755
--- a/tests/zfs-tests/tests/functional/mv_files/setup.ksh
+++ b/tests/zfs-tests/tests/functional/mv_files/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/nestedfs/cleanup.ksh b/tests/zfs-tests/tests/functional/nestedfs/cleanup.ksh
index c4c369145dfc..8a6521193e66 100755
--- a/tests/zfs-tests/tests/functional/nestedfs/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/nestedfs/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/nestedfs/nestedfs_001_pos.ksh b/tests/zfs-tests/tests/functional/nestedfs/nestedfs_001_pos.ksh
index b576b78c8aa5..84749d60227d 100755
--- a/tests/zfs-tests/tests/functional/nestedfs/nestedfs_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/nestedfs/nestedfs_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/nestedfs/setup.ksh b/tests/zfs-tests/tests/functional/nestedfs/setup.ksh
index 677cb12d79ac..1eeefeaa18c1 100755
--- a/tests/zfs-tests/tests/functional/nestedfs/setup.ksh
+++ b/tests/zfs-tests/tests/functional/nestedfs/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/no_space/cleanup.ksh b/tests/zfs-tests/tests/functional/no_space/cleanup.ksh
index 62b28df8ef5a..d1a731f18372 100755
--- a/tests/zfs-tests/tests/functional/no_space/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/no_space/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/no_space/enospc.cfg b/tests/zfs-tests/tests/functional/no_space/enospc.cfg
index 0b8298c03165..e8e6065bbc81 100644
--- a/tests/zfs-tests/tests/functional/no_space/enospc.cfg
+++ b/tests/zfs-tests/tests/functional/no_space/enospc.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/no_space/enospc_001_pos.ksh b/tests/zfs-tests/tests/functional/no_space/enospc_001_pos.ksh
index 56beb4e71e17..c6d374635c5b 100755
--- a/tests/zfs-tests/tests/functional/no_space/enospc_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/no_space/enospc_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/no_space/enospc_003_pos.ksh b/tests/zfs-tests/tests/functional/no_space/enospc_003_pos.ksh
index 496e2a029c5c..5ac96962546f 100755
--- a/tests/zfs-tests/tests/functional/no_space/enospc_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/no_space/enospc_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/no_space/enospc_ganging.ksh b/tests/zfs-tests/tests/functional/no_space/enospc_ganging.ksh
new file mode 100755
index 000000000000..1d35fba5dbfa
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/no_space/enospc_ganging.ksh
@@ -0,0 +1,86 @@
+#!/bin/ksh
+
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+#
+# DESCRIPTION:
+# Exercise gang block IO paths for non-encrypted and encrypted datasets.
+#
+
+verify_runnable "both"
+log_assert "Verify IO when file system is full and ganging."
+
+function cleanup
+{
+ log_must set_tunable64 METASLAB_FORCE_GANGING $metaslab_force_ganging
+ default_cleanup_noexit
+}
+
+log_onexit cleanup
+
+default_setup_noexit $DISKS
+
+typeset metaslab_force_ganging=$(get_tunable METASLAB_FORCE_GANGING)
+shift=$(random_int_between 15 17)
+log_must set_tunable64 METASLAB_FORCE_GANGING $((2**$shift))
+
+keyfile=/$TESTPOOL/keyencfods
+log_must eval "echo 'password' > $keyfile"
+bs=1024k
+count=512
+
+log_must dd if=/dev/urandom of=$TESTDIR/data bs=$bs count=$count
+data_checksum=$(sha256digest $TESTDIR/data)
+
+# Test common large block configuration.
+log_must zfs create -o recordsize=1m -o primarycache=metadata $TESTPOOL/gang
+mntpnt=$(get_prop mountpoint $TESTPOOL/gang)
+
+log_must dd if=$TESTDIR/data of=$mntpnt/file bs=$bs count=$count
+sync_pool $TESTPOOL
+log_must dd if=$mntpnt/file of=$TESTDIR/out bs=$bs count=$count
+out_checksum=$(sha256digest $TESTDIR/out)
+
+if [[ "$data_checksum" != "$out_checksum" ]]; then
+ log_fail "checksum mismatch ($data_checksum != $out_checksum)"
+fi
+
+log_must rm -f $TESTDIR/out
+log_must zfs destroy $TESTPOOL/gang
+
+# Test common large block configuration with encryption.
+log_must zfs create \
+ -o recordsize=1m \
+ -o primarycache=metadata \
+ -o compression=off \
+ -o encryption=on \
+ -o keyformat=passphrase \
+ -o keylocation=file://$keyfile \
+ -o copies=2 \
+ $TESTPOOL/gang
+mntpnt=$(get_prop mountpoint $TESTPOOL/gang)
+
+log_must dd if=$TESTDIR/data of=$mntpnt/file bs=$bs count=$count
+sync_pool $TESTPOOL
+log_must dd if=$mntpnt/file of=$TESTDIR/out bs=$bs count=$count
+out_checksum=$(sha256digest $TESTDIR/out)
+
+if [[ "$data_checksum" != "$out_checksum" ]]; then
+ log_fail "checksum mismatch ($data_checksum != $out_checksum)"
+fi
+
+log_must rm -f $TESTDIR/out
+log_must zfs destroy $TESTPOOL/gang
+
+log_pass "Verified IO when file system is full and ganging."
diff --git a/tests/zfs-tests/tests/functional/no_space/enospc_rm.ksh b/tests/zfs-tests/tests/functional/no_space/enospc_rm.ksh
index d0f4ff4a08fe..d9582fbe2a76 100755
--- a/tests/zfs-tests/tests/functional/no_space/enospc_rm.ksh
+++ b/tests/zfs-tests/tests/functional/no_space/enospc_rm.ksh
@@ -17,6 +17,7 @@
#
# Copyright (c) 2014, 2016 by Delphix. All rights reserved.
# Copyright (c) 2022 by Lawrence Livermore National Security, LLC.
+# Copyright (c) 2023 Hewlett Packard Enterprise Development LP.
#
. $STF_SUITE/include/libtest.shlib
@@ -51,12 +52,21 @@ log_must zfs create $TESTPOOL/$TESTFS
log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
log_must zfs set compression=off $TESTPOOL/$TESTFS
-log_note "Writing files until ENOSPC."
+log_note "Writing Big(1G) files until ENOSPC."
log_mustnot_expect "No space left on device" fio --name=test \
--fallocate=none --rw=write --bs=1M --size=1G --numjobs=4 \
--sync=1 --directory=$TESTDIR/ --group_reporting
log_must rm $TESTDIR/test.*
log_must test -z "$(ls -A $TESTDIR)"
+sync_pool $TESTPOOL true
+
+log_note "Writing small(10M) files until ENOSPC."
+log_mustnot_expect "No space left on device" fio --name=test \
+ --fallocate=none --rw=write --bs=1M --size=10M --numjobs=200 \
+ --sync=1 --directory=$TESTDIR/ --group_reporting
+
+log_must rm $TESTDIR/test.*
+log_must test -z "$(ls -A $TESTDIR)"
log_pass "All files removed without error"
diff --git a/tests/zfs-tests/tests/functional/no_space/setup.ksh b/tests/zfs-tests/tests/functional/no_space/setup.ksh
index 7ab8f1473d66..458a575ed3c0 100755
--- a/tests/zfs-tests/tests/functional/no_space/setup.ksh
+++ b/tests/zfs-tests/tests/functional/no_space/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/nopwrite/nopwrite.shlib b/tests/zfs-tests/tests/functional/nopwrite/nopwrite.shlib
index 139b4b26e5ed..a6d1eb2c769f 100644
--- a/tests/zfs-tests/tests/functional/nopwrite/nopwrite.shlib
+++ b/tests/zfs-tests/tests/functional/nopwrite/nopwrite.shlib
@@ -57,12 +57,12 @@ function verify_nopwrite
within_percent $origin_used $snap_refer $high || return 1
#
- # The comparisons below should pass regardless of nopwrite. They're
- # here for sanity.
+ # The comparisons below should be within 90% regardless of nopwrite.
+ # They're here for sanity.
#
typeset deadlist=$(zdb -Pddd $clone | awk '/Deadlist:/ {print $2}')
- within_percent $deadlist $clone_written $high || return 1
- within_percent $snap_refer $snap_written $high || return 1
+ within_percent $deadlist $clone_written 90 || return 1
+ within_percent $snap_refer $snap_written 90 || return 1
return 0
}
diff --git a/tests/zfs-tests/tests/functional/online_offline/cleanup.ksh b/tests/zfs-tests/tests/functional/online_offline/cleanup.ksh
index b81a372638e3..a0555aff06c2 100755
--- a/tests/zfs-tests/tests/functional/online_offline/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/online_offline/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/online_offline/online_offline.cfg b/tests/zfs-tests/tests/functional/online_offline/online_offline.cfg
index 6f1121c5e99e..18f197b54d4a 100644
--- a/tests/zfs-tests/tests/functional/online_offline/online_offline.cfg
+++ b/tests/zfs-tests/tests/functional/online_offline/online_offline.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/online_offline/online_offline_001_pos.ksh b/tests/zfs-tests/tests/functional/online_offline/online_offline_001_pos.ksh
index 1d1b1c944cc0..d77103330a30 100755
--- a/tests/zfs-tests/tests/functional/online_offline/online_offline_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/online_offline/online_offline_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/online_offline/online_offline_002_neg.ksh b/tests/zfs-tests/tests/functional/online_offline/online_offline_002_neg.ksh
index a2427f2e1822..33244024284a 100755
--- a/tests/zfs-tests/tests/functional/online_offline/online_offline_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/online_offline/online_offline_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/online_offline/online_offline_003_neg.ksh b/tests/zfs-tests/tests/functional/online_offline/online_offline_003_neg.ksh
index e33db28f8ddb..1ff5b544b62c 100755
--- a/tests/zfs-tests/tests/functional/online_offline/online_offline_003_neg.ksh
+++ b/tests/zfs-tests/tests/functional/online_offline/online_offline_003_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/online_offline/setup.ksh b/tests/zfs-tests/tests/functional/online_offline/setup.ksh
index b1fb6a123897..0327c20a73cc 100755
--- a/tests/zfs-tests/tests/functional/online_offline/setup.ksh
+++ b/tests/zfs-tests/tests/functional/online_offline/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/pam/cleanup.ksh b/tests/zfs-tests/tests/functional/pam/cleanup.ksh
index 8ea9c848b0ab..dbcb175ed069 100755
--- a/tests/zfs-tests/tests/functional/pam/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/pam/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -25,5 +25,6 @@
rmconfig
destroy_pool $TESTPOOL
del_user ${username}
+del_user ${username}rec
del_group pamtestgroup
log_must rm -rf "$runstatedir" $TESTDIRS
diff --git a/tests/zfs-tests/tests/functional/pam/pam_basic.ksh b/tests/zfs-tests/tests/functional/pam/pam_basic.ksh
index eab819ab8d24..dc54b2d253f8 100755
--- a/tests/zfs-tests/tests/functional/pam/pam_basic.ksh
+++ b/tests/zfs-tests/tests/functional/pam/pam_basic.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/pam/pam_change_unmounted.ksh b/tests/zfs-tests/tests/functional/pam/pam_change_unmounted.ksh
new file mode 100755
index 000000000000..91b202f7609d
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/pam/pam_change_unmounted.ksh
@@ -0,0 +1,55 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+. $STF_SUITE/tests/functional/pam/utilities.kshlib
+
+if [ -n "$ASAN_OPTIONS" ]; then
+ export LD_PRELOAD=$(ldd "$(command -v zfs)" | awk '/libasan\.so/ {print $3}')
+fi
+
+log_mustnot ismounted "$TESTPOOL/pam/${username}"
+keystatus unavailable
+
+genconfig "homes=$TESTPOOL/pam runstatedir=${runstatedir}"
+
+printf "testpass\nsecondpass\nsecondpass\n" | pamtester -v ${pamservice} ${username} chauthtok
+
+log_mustnot ismounted "$TESTPOOL/pam/${username}"
+keystatus unavailable
+
+echo "secondpass" | pamtester ${pamservice} ${username} open_session
+references 1
+log_must ismounted "$TESTPOOL/pam/${username}"
+keystatus available
+
+printf "secondpass\ntestpass\ntestpass\n" | pamtester -v ${pamservice} ${username} chauthtok
+
+log_must ismounted "$TESTPOOL/pam/${username}"
+log_must ismounted "$TESTPOOL/pam/${username}"
+keystatus available
+
+log_must pamtester ${pamservice} ${username} close_session
+references 0
+log_mustnot ismounted "$TESTPOOL/pam/${username}"
+keystatus unavailable
+
+log_pass "done."
diff --git a/tests/zfs-tests/tests/functional/pam/pam_nounmount.ksh b/tests/zfs-tests/tests/functional/pam/pam_nounmount.ksh
index 29ce437b40ee..011a873e5bfd 100755
--- a/tests/zfs-tests/tests/functional/pam/pam_nounmount.ksh
+++ b/tests/zfs-tests/tests/functional/pam/pam_nounmount.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/pam/pam_recursive.ksh b/tests/zfs-tests/tests/functional/pam/pam_recursive.ksh
new file mode 100755
index 000000000000..3714b179b852
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/pam/pam_recursive.ksh
@@ -0,0 +1,72 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+. $STF_SUITE/tests/functional/pam/utilities.kshlib
+
+if [ -n "$ASAN_OPTIONS" ]; then
+ export LD_PRELOAD=$(ldd "$(command -v zfs)" | awk '/libasan\.so/ {print $3}')
+fi
+
+username="${username}rec"
+
+# Set up a deeper hierarchy, a mountpoint that doesn't interfere with other tests,
+# and a user which references that mountpoint
+log_must zfs create "$TESTPOOL/pampam"
+log_must zfs create -o mountpoint="$TESTDIR/rec" "$TESTPOOL/pampam/pam"
+echo "recurpass" | zfs create -o encryption=aes-256-gcm -o keyformat=passphrase \
+ -o keylocation=prompt "$TESTPOOL/pampam/pam/${username}"
+log_must zfs unmount "$TESTPOOL/pampam/pam/${username}"
+log_must zfs unload-key "$TESTPOOL/pampam/pam/${username}"
+log_must add_user pamtestgroup ${username} "$TESTDIR/rec"
+
+function keystatus {
+ log_must [ "$(get_prop keystatus "$TESTPOOL/pampam/pam/${username}")" = "$1" ]
+}
+
+log_mustnot ismounted "$TESTPOOL/pampam/pam/${username}"
+keystatus unavailable
+
+function test_session {
+ echo "recurpass" | pamtester ${pamservice} ${username} open_session
+ references 1
+ log_must ismounted "$TESTPOOL/pampam/pam/${username}"
+ keystatus available
+
+ log_must pamtester ${pamservice} ${username} close_session
+ references 0
+ log_mustnot ismounted "$TESTPOOL/pampam/pam/${username}"
+ keystatus unavailable
+}
+
+genconfig "homes=$TESTPOOL/pampam/pam prop_mountpoint runstatedir=${runstatedir}"
+test_session
+
+genconfig "homes=$TESTPOOL/pampam recursive_homes prop_mountpoint runstatedir=${runstatedir}"
+test_session
+
+genconfig "homes=$TESTPOOL recursive_homes prop_mountpoint runstatedir=${runstatedir}"
+test_session
+
+genconfig "homes=* recursive_homes prop_mountpoint runstatedir=${runstatedir}"
+test_session
+
+log_pass "done."
diff --git a/tests/zfs-tests/tests/functional/pam/pam_short_password.ksh b/tests/zfs-tests/tests/functional/pam/pam_short_password.ksh
index 100f279fffed..079608583a72 100755
--- a/tests/zfs-tests/tests/functional/pam/pam_short_password.ksh
+++ b/tests/zfs-tests/tests/functional/pam/pam_short_password.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -52,7 +52,7 @@ log_must ismounted "$TESTPOOL/pam/${username}"
keystatus available
# Change user and dataset password to short one.
-printf "short\nshort\n" | pamtester ${pamservice} ${username} chauthtok
+printf "testpass\nshort\nshort\n" | pamtester -v ${pamservice} ${username} chauthtok
# Unmount and unload key.
log_must pamtester ${pamservice} ${username} close_session
diff --git a/tests/zfs-tests/tests/functional/pam/setup.ksh b/tests/zfs-tests/tests/functional/pam/setup.ksh
index 82370a211fcd..f08758d2f2dc 100755
--- a/tests/zfs-tests/tests/functional/pam/setup.ksh
+++ b/tests/zfs-tests/tests/functional/pam/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/pam/utilities.kshlib.in b/tests/zfs-tests/tests/functional/pam/utilities.kshlib.in
index 29c6ada3dbf3..e118255dbd22 100644
--- a/tests/zfs-tests/tests/functional/pam/utilities.kshlib.in
+++ b/tests/zfs-tests/tests/functional/pam/utilities.kshlib.in
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/pool_checkpoint/checkpoint_discard_busy.ksh b/tests/zfs-tests/tests/functional/pool_checkpoint/checkpoint_discard_busy.ksh
index f970935f5bd0..087aef9027ea 100755
--- a/tests/zfs-tests/tests/functional/pool_checkpoint/checkpoint_discard_busy.ksh
+++ b/tests/zfs-tests/tests/functional/pool_checkpoint/checkpoint_discard_busy.ksh
@@ -38,6 +38,8 @@
verify_runnable "global"
+log_unsupported "Skipping, issue https://github.com/openzfs/zfs/issues/12053"
+
function test_cleanup
{
# reset memory limit to 16M
diff --git a/tests/zfs-tests/tests/functional/pool_names/pool_names_001_pos.ksh b/tests/zfs-tests/tests/functional/pool_names/pool_names_001_pos.ksh
index 45ef2fd67a96..3695feb94931 100755
--- a/tests/zfs-tests/tests/functional/pool_names/pool_names_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/pool_names/pool_names_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/pool_names/pool_names_002_neg.ksh b/tests/zfs-tests/tests/functional/pool_names/pool_names_002_neg.ksh
index 4b6744563d07..2a688b6bfcee 100755
--- a/tests/zfs-tests/tests/functional/pool_names/pool_names_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/pool_names/pool_names_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/poolversion/cleanup.ksh b/tests/zfs-tests/tests/functional/poolversion/cleanup.ksh
index c9777b27e406..05d691313b40 100755
--- a/tests/zfs-tests/tests/functional/poolversion/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/poolversion/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/poolversion/poolversion_001_pos.ksh b/tests/zfs-tests/tests/functional/poolversion/poolversion_001_pos.ksh
index 1f4780ccd387..f759a1099cbc 100755
--- a/tests/zfs-tests/tests/functional/poolversion/poolversion_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/poolversion/poolversion_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/poolversion/poolversion_002_pos.ksh b/tests/zfs-tests/tests/functional/poolversion/poolversion_002_pos.ksh
index 15cd446b6ea6..1d7e42fcf394 100755
--- a/tests/zfs-tests/tests/functional/poolversion/poolversion_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/poolversion/poolversion_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/poolversion/setup.ksh b/tests/zfs-tests/tests/functional/poolversion/setup.ksh
index 660083b9fc00..9532404423d1 100755
--- a/tests/zfs-tests/tests/functional/poolversion/setup.ksh
+++ b/tests/zfs-tests/tests/functional/poolversion/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/privilege/cleanup.ksh b/tests/zfs-tests/tests/functional/privilege/cleanup.ksh
index 99985c670f2f..5acce6dc6555 100755
--- a/tests/zfs-tests/tests/functional/privilege/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/privilege/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/privilege/privilege_001_pos.ksh b/tests/zfs-tests/tests/functional/privilege/privilege_001_pos.ksh
index af4f705679a5..5e8b0d401966 100755
--- a/tests/zfs-tests/tests/functional/privilege/privilege_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/privilege/privilege_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/privilege/privilege_002_pos.ksh b/tests/zfs-tests/tests/functional/privilege/privilege_002_pos.ksh
index ab00e3295250..705c1a60e266 100755
--- a/tests/zfs-tests/tests/functional/privilege/privilege_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/privilege/privilege_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/privilege/setup.ksh b/tests/zfs-tests/tests/functional/privilege/setup.ksh
index 9d48d1961a7b..92b08b209a65 100755
--- a/tests/zfs-tests/tests/functional/privilege/setup.ksh
+++ b/tests/zfs-tests/tests/functional/privilege/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/procfs/cleanup.ksh b/tests/zfs-tests/tests/functional/procfs/cleanup.ksh
index 8fe46577e409..b3fb51695a2b 100755
--- a/tests/zfs-tests/tests/functional/procfs/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/procfs/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/procfs/pool_state.ksh b/tests/zfs-tests/tests/functional/procfs/pool_state.ksh
index d29bfd806913..bae876379177 100755
--- a/tests/zfs-tests/tests/functional/procfs/pool_state.ksh
+++ b/tests/zfs-tests/tests/functional/procfs/pool_state.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -141,7 +141,11 @@ remove_disk $SDISK
# background since the command will hang when the pool gets suspended. The
# command will resume and exit after we restore the missing disk later on.
zpool scrub $TESTPOOL2 &
-sleep 3 # Give the scrub some time to run before we check if it fails
+# Once we trigger the zpool scrub, all zpool/zfs command gets stuck for 180 seconds.
+# Post 180 seconds zpool/zfs commands gets start executing however few more seconds(10s)
+# it take to update the status.
+# hence sleeping for 200 seconds so that we get the correct status.
+sleep 200 # Give the scrub some time to run before we check if it fails
log_must check_all $TESTPOOL2 "SUSPENDED"
diff --git a/tests/zfs-tests/tests/functional/procfs/procfs_list_basic.ksh b/tests/zfs-tests/tests/functional/procfs/procfs_list_basic.ksh
index 18caea3c32cc..8eb35f85da32 100755
--- a/tests/zfs-tests/tests/functional/procfs/procfs_list_basic.ksh
+++ b/tests/zfs-tests/tests/functional/procfs/procfs_list_basic.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/procfs/procfs_list_concurrent_readers.ksh b/tests/zfs-tests/tests/functional/procfs/procfs_list_concurrent_readers.ksh
index fcdd54da3591..59052ae05c0d 100755
--- a/tests/zfs-tests/tests/functional/procfs/procfs_list_concurrent_readers.ksh
+++ b/tests/zfs-tests/tests/functional/procfs/procfs_list_concurrent_readers.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/procfs/procfs_list_stale_read.ksh b/tests/zfs-tests/tests/functional/procfs/procfs_list_stale_read.ksh
index dcc71788682d..be89e3b8c548 100755
--- a/tests/zfs-tests/tests/functional/procfs/procfs_list_stale_read.ksh
+++ b/tests/zfs-tests/tests/functional/procfs/procfs_list_stale_read.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/procfs/setup.ksh b/tests/zfs-tests/tests/functional/procfs/setup.ksh
index 79fa28f4f1ac..f7d07d5d7211 100755
--- a/tests/zfs-tests/tests/functional/procfs/setup.ksh
+++ b/tests/zfs-tests/tests/functional/procfs/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/cleanup.ksh b/tests/zfs-tests/tests/functional/projectquota/cleanup.ksh
index 0440e3d8af8c..fd04aaabc566 100755
--- a/tests/zfs-tests/tests/functional/projectquota/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projectid_001_pos.ksh b/tests/zfs-tests/tests/functional/projectquota/projectid_001_pos.ksh
index 46e79062a0e2..ac5524b49d04 100755
--- a/tests/zfs-tests/tests/functional/projectquota/projectid_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/projectid_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projectid_002_pos.ksh b/tests/zfs-tests/tests/functional/projectquota/projectid_002_pos.ksh
index e382f464046b..ef87a1cb774b 100755
--- a/tests/zfs-tests/tests/functional/projectquota/projectid_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/projectid_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projectid_003_pos.ksh b/tests/zfs-tests/tests/functional/projectquota/projectid_003_pos.ksh
index d6dbaafc217a..93474b53709a 100755
--- a/tests/zfs-tests/tests/functional/projectquota/projectid_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/projectid_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projectquota.cfg b/tests/zfs-tests/tests/functional/projectquota/projectquota.cfg
index 564ab3ef9698..b8a37dbd05bb 100644
--- a/tests/zfs-tests/tests/functional/projectquota/projectquota.cfg
+++ b/tests/zfs-tests/tests/functional/projectquota/projectquota.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projectquota_001_pos.ksh b/tests/zfs-tests/tests/functional/projectquota/projectquota_001_pos.ksh
index 3f8c3d68ce3e..f365bb9df617 100755
--- a/tests/zfs-tests/tests/functional/projectquota/projectquota_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/projectquota_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projectquota_002_pos.ksh b/tests/zfs-tests/tests/functional/projectquota/projectquota_002_pos.ksh
index 66cd1fb9ef71..7a92649ab4ad 100755
--- a/tests/zfs-tests/tests/functional/projectquota/projectquota_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/projectquota_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projectquota_003_pos.ksh b/tests/zfs-tests/tests/functional/projectquota/projectquota_003_pos.ksh
index 44a5b09f9001..5468759f7e12 100755
--- a/tests/zfs-tests/tests/functional/projectquota/projectquota_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/projectquota_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projectquota_004_neg.ksh b/tests/zfs-tests/tests/functional/projectquota/projectquota_004_neg.ksh
index 7ca81c3fbc81..a7a39f8fe7f7 100755
--- a/tests/zfs-tests/tests/functional/projectquota/projectquota_004_neg.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/projectquota_004_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projectquota_005_pos.ksh b/tests/zfs-tests/tests/functional/projectquota/projectquota_005_pos.ksh
index 0736648f1ed6..ecd2bb278561 100755
--- a/tests/zfs-tests/tests/functional/projectquota/projectquota_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/projectquota_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projectquota_006_pos.ksh b/tests/zfs-tests/tests/functional/projectquota/projectquota_006_pos.ksh
index 73554df6a42a..984f4340d922 100755
--- a/tests/zfs-tests/tests/functional/projectquota/projectquota_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/projectquota_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projectquota_007_pos.ksh b/tests/zfs-tests/tests/functional/projectquota/projectquota_007_pos.ksh
index 3572e0118f45..a06551b56c96 100755
--- a/tests/zfs-tests/tests/functional/projectquota/projectquota_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/projectquota_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projectquota_008_pos.ksh b/tests/zfs-tests/tests/functional/projectquota/projectquota_008_pos.ksh
index b045b2c5fce3..20b64995f64a 100755
--- a/tests/zfs-tests/tests/functional/projectquota/projectquota_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/projectquota_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projectquota_009_pos.ksh b/tests/zfs-tests/tests/functional/projectquota/projectquota_009_pos.ksh
index da44e731a92d..52d896577a98 100755
--- a/tests/zfs-tests/tests/functional/projectquota/projectquota_009_pos.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/projectquota_009_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projectquota_common.kshlib b/tests/zfs-tests/tests/functional/projectquota/projectquota_common.kshlib
index a90e001b2407..eea5b5100501 100644
--- a/tests/zfs-tests/tests/functional/projectquota/projectquota_common.kshlib
+++ b/tests/zfs-tests/tests/functional/projectquota/projectquota_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projectspace_001_pos.ksh b/tests/zfs-tests/tests/functional/projectquota/projectspace_001_pos.ksh
index 4005c2a408c6..97cb13b2343a 100755
--- a/tests/zfs-tests/tests/functional/projectquota/projectspace_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/projectspace_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projectspace_002_pos.ksh b/tests/zfs-tests/tests/functional/projectquota/projectspace_002_pos.ksh
index 1d48eccf22d0..6ea68ff32188 100755
--- a/tests/zfs-tests/tests/functional/projectquota/projectspace_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/projectspace_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projectspace_003_pos.ksh b/tests/zfs-tests/tests/functional/projectquota/projectspace_003_pos.ksh
index 8db5d0d89970..07b899c2ff12 100755
--- a/tests/zfs-tests/tests/functional/projectquota/projectspace_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/projectspace_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projectspace_004_pos.ksh b/tests/zfs-tests/tests/functional/projectquota/projectspace_004_pos.ksh
index 51e790348ca6..c928080a36c7 100755
--- a/tests/zfs-tests/tests/functional/projectquota/projectspace_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/projectspace_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projecttree_001_pos.ksh b/tests/zfs-tests/tests/functional/projectquota/projecttree_001_pos.ksh
index 0402e345df2a..2e048868fec6 100755
--- a/tests/zfs-tests/tests/functional/projectquota/projecttree_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/projecttree_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projecttree_002_pos.ksh b/tests/zfs-tests/tests/functional/projectquota/projecttree_002_pos.ksh
index 9942a88cb347..2494b8f7ef49 100755
--- a/tests/zfs-tests/tests/functional/projectquota/projecttree_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/projecttree_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/projecttree_003_neg.ksh b/tests/zfs-tests/tests/functional/projectquota/projecttree_003_neg.ksh
index cbc45857f779..ec122301255a 100755
--- a/tests/zfs-tests/tests/functional/projectquota/projecttree_003_neg.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/projecttree_003_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/projectquota/setup.ksh b/tests/zfs-tests/tests/functional/projectquota/setup.ksh
index 0402d241b100..873d706afc01 100755
--- a/tests/zfs-tests/tests/functional/projectquota/setup.ksh
+++ b/tests/zfs-tests/tests/functional/projectquota/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/pyzfs/pyzfs_unittest.ksh.in b/tests/zfs-tests/tests/functional/pyzfs/pyzfs_unittest.ksh.in
index d55c4f3270ae..7fa14161a538 100755
--- a/tests/zfs-tests/tests/functional/pyzfs/pyzfs_unittest.ksh.in
+++ b/tests/zfs-tests/tests/functional/pyzfs/pyzfs_unittest.ksh.in
@@ -18,6 +18,8 @@
if [ -n "$ASAN_OPTIONS" ]; then
export LD_PRELOAD=$(ldd "$(command -v zfs)" | awk '/libasan\.so/ {print $3}')
+ # ASan reports leaks in CPython 3.10
+ ASAN_OPTIONS="$ASAN_OPTIONS:detect_leaks=false"
fi
#
@@ -30,20 +32,6 @@ fi
#
verify_runnable "global"
-
-# Verify that the required dependencies for testing are installed.
-@PYTHON@ -c "import cffi" 2>/dev/null ||
- log_unsupported "python3-cffi not found by Python"
-
-# We don't just try to "import libzfs_core" because we want to skip these tests
-# only if pyzfs was not installed due to missing, build-time, dependencies; if
-# we cannot load "libzfs_core" due to other reasons, for instance an API/ABI
-# mismatch, we want to report it.
-@PYTHON@ -c '
-import pkgutil, sys
-sys.exit(pkgutil.find_loader("libzfs_core") is None)' ||
- log_unsupported "libzfs_core not found by Python"
-
log_assert "Verify the nvlist and libzfs_core Python unittest run successfully"
# log_must buffers stderr, which interacts badly with
diff --git a/tests/zfs-tests/tests/functional/quota/cleanup.ksh b/tests/zfs-tests/tests/functional/quota/cleanup.ksh
index c4c369145dfc..8a6521193e66 100755
--- a/tests/zfs-tests/tests/functional/quota/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/quota/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/quota/quota.cfg b/tests/zfs-tests/tests/functional/quota/quota.cfg
index 5b19f40163de..5cb6ae002dbd 100644
--- a/tests/zfs-tests/tests/functional/quota/quota.cfg
+++ b/tests/zfs-tests/tests/functional/quota/quota.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/quota/quota.kshlib b/tests/zfs-tests/tests/functional/quota/quota.kshlib
index 12e882d47e34..b4cfde020f3f 100644
--- a/tests/zfs-tests/tests/functional/quota/quota.kshlib
+++ b/tests/zfs-tests/tests/functional/quota/quota.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -95,3 +95,10 @@ function exceed_quota
log_fail "Returned error code: $zret. Expected: $EDQUOT."
return 0
}
+
+function reset_quota
+{
+ typeset FILESYSTEM="$1"
+
+ log_must zfs set quota=none $FILESYSTEM
+}
diff --git a/tests/zfs-tests/tests/functional/quota/quota_001_pos.ksh b/tests/zfs-tests/tests/functional/quota/quota_001_pos.ksh
index d6783e9a43ac..f01008a46bb1 100755
--- a/tests/zfs-tests/tests/functional/quota/quota_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/quota/quota_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -64,6 +64,8 @@ function cleanup
#
wait_freeing $TESTPOOL
sync_pool $TESTPOOL
+
+ reset_quota $TESTPOOL/$TESTFS
}
log_onexit cleanup
diff --git a/tests/zfs-tests/tests/functional/quota/quota_002_pos.ksh b/tests/zfs-tests/tests/functional/quota/quota_002_pos.ksh
index 2f34072dd151..bea2a5a68691 100755
--- a/tests/zfs-tests/tests/functional/quota/quota_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/quota/quota_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -64,6 +64,8 @@ function cleanup
wait_freeing $TESTPOOL
sync_pool $TESTPOOL
+
+ reset_quota $TESTPOOL/$TESTFS
}
log_onexit cleanup
diff --git a/tests/zfs-tests/tests/functional/quota/quota_003_pos.ksh b/tests/zfs-tests/tests/functional/quota/quota_003_pos.ksh
index 6ab25cf2d463..33f6421131fc 100755
--- a/tests/zfs-tests/tests/functional/quota/quota_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/quota/quota_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -67,6 +67,8 @@ function cleanup
#
wait_freeing $TESTPOOL
sync_pool $TESTPOOL
+
+ reset_quota $TESTPOOL/$TESTCTR/$TESTFS1
}
log_onexit cleanup
diff --git a/tests/zfs-tests/tests/functional/quota/quota_004_pos.ksh b/tests/zfs-tests/tests/functional/quota/quota_004_pos.ksh
index 373354438925..682d09f080a4 100755
--- a/tests/zfs-tests/tests/functional/quota/quota_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/quota/quota_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -65,6 +65,8 @@ function cleanup
wait_freeing $TESTPOOL
sync_pool $TESTPOOL
+
+ reset_quota $TESTPOOL/$TESTCTR/$TESTFS1
}
log_onexit cleanup
diff --git a/tests/zfs-tests/tests/functional/quota/quota_005_pos.ksh b/tests/zfs-tests/tests/functional/quota/quota_005_pos.ksh
index e87139a58f69..9c4db81ca270 100755
--- a/tests/zfs-tests/tests/functional/quota/quota_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/quota/quota_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -50,20 +50,19 @@ function cleanup
{
datasetexists $fs_child && destroy_dataset $fs_child
- log_must zfs set quota=$quota_val $fs
+ reset_quota $fs
}
log_onexit cleanup
-log_assert "Verify that quota doesnot inherit its value from parent."
-log_onexit cleanup
+log_assert "Verify that quota does not inherit its value from parent."
fs=$TESTPOOL/$TESTFS
fs_child=$TESTPOOL/$TESTFS/$TESTFS
space_avail=$(get_prop available $fs)
quota_val=$(get_prop quota $fs)
-typeset -i quotasize=$space_avail
+typeset -li quotasize=$space_avail
((quotasize = quotasize * 2 ))
log_must zfs set quota=$quotasize $fs
@@ -72,4 +71,4 @@ quota_space=$(get_prop quota $fs_child)
[[ $quota_space == $quotasize ]] && \
log_fail "The quota of child dataset inherits its value from parent."
-log_pass "quota doesnot inherit its value from parent as expected."
+log_pass "quota does not inherit its value from parent as expected."
diff --git a/tests/zfs-tests/tests/functional/quota/quota_006_neg.ksh b/tests/zfs-tests/tests/functional/quota/quota_006_neg.ksh
index ca5ea5f82f5a..111d771188e3 100755
--- a/tests/zfs-tests/tests/functional/quota/quota_006_neg.ksh
+++ b/tests/zfs-tests/tests/functional/quota/quota_006_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -50,7 +50,7 @@ log_assert "Verify cannot set quota lower than the space currently in use"
function cleanup
{
- log_must zfs set quota=none $TESTPOOL/$TESTFS
+ reset_quota $TESTPOOL/$TESTFS
}
log_onexit cleanup
diff --git a/tests/zfs-tests/tests/functional/quota/setup.ksh b/tests/zfs-tests/tests/functional/quota/setup.ksh
index 99a4cb3493ae..8ff0592c7632 100755
--- a/tests/zfs-tests/tests/functional/quota/setup.ksh
+++ b/tests/zfs-tests/tests/functional/quota/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/raidz/cleanup.ksh b/tests/zfs-tests/tests/functional/raidz/cleanup.ksh
index c92c54c270a7..c5bb8f9b4fa2 100755
--- a/tests/zfs-tests/tests/functional/raidz/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/raidz/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/raidz/raidz_001_neg.ksh b/tests/zfs-tests/tests/functional/raidz/raidz_001_neg.ksh
index 0f88a1a51468..9bd616f3a257 100755
--- a/tests/zfs-tests/tests/functional/raidz/raidz_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/raidz/raidz_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/raidz/raidz_002_pos.ksh b/tests/zfs-tests/tests/functional/raidz/raidz_002_pos.ksh
index e238a881b054..4bd11a94036d 100755
--- a/tests/zfs-tests/tests/functional/raidz/raidz_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/raidz/raidz_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -23,19 +23,39 @@
#
# Copyright (c) 2016 by Gvozden Neskovic. All rights reserved.
# Use is subject to license terms.
+# Copyright (c) 2020 by vStack. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
#
# DESCRIPTION:
-# Call the raidz_test tool with -S to test all supported raidz
-# implementations. This options will test several raidz block geometries
+# Call the raidz_test tool with sweep to test all supported raidz
+# implementations. This will test several raidz block geometries
# and several zio parameters that affect raidz block layout. Data
-# reconstruction performs all combinations of failed disks. Wall time
-# is set to 5min, but actual runtime might be longer.
+# reconstruction performs all combinations of failed disks. Wall
+# time is set to 5 min, but actual runtime might be longer.
#
-log_must raidz_test -S -t 300
-
-log_pass "raidz_test parameter sweep test succeeded."
+case $((RANDOM % 3)) in
+ 0)
+ # Basic sweep test
+ log_must raidz_test -S -t 300
+ log_pass "raidz_test parameter sweep test succeeded."
+ ;;
+ 1)
+ # Using expanded raidz map to test all supported raidz
+ # implementations with expanded map and default reflow offset.
+ log_must raidz_test -S -e -t 300
+ log_pass "raidz_test sweep test with expanded map succeeded."
+ ;;
+ 2)
+ # Using expanded raidz map ('-e') to test all supported raidz
+ # implementations with expanded map and zero reflow offset.
+ log_must raidz_test -S -e -r 0 -t 300
+ log_pass "raidz_test sweep test with expanded map succeeded."
+ ;;
+ *)
+ # avoid shellcheck SC2249
+ ;;
+esac
diff --git a/tests/zfs-tests/tests/functional/raidz/raidz_expand_001_pos.ksh b/tests/zfs-tests/tests/functional/raidz/raidz_expand_001_pos.ksh
new file mode 100755
index 000000000000..063d7fa735df
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/raidz/raidz_expand_001_pos.ksh
@@ -0,0 +1,215 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2020 by vStack. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+#
+# DESCRIPTION:
+# 'zpool attach poolname raidz ...' should attach new device to the pool.
+#
+# STRATEGY:
+# 1. Create block device files for the test raidz pool
+# 2. For each parity value [1..3]
+# - create raidz pool
+# - fill it with some directories/files
+# - attach device to the raidz pool
+# - verify that device attached and the raidz pool size increase
+# - verify resilver by replacing parity devices
+# - verify resilver by replacing data devices
+# - verify scrub by zeroing parity devices
+# - verify scrub by zeroing data devices
+# - verify the raidz pool
+# - destroy the raidz pool
+
+typeset -r devs=6
+typeset -r dev_size_mb=128
+
+typeset -a disks
+
+prefetch_disable=$(get_tunable PREFETCH_DISABLE)
+
+function cleanup
+{
+ log_pos zpool status $TESTPOOL
+
+ poolexists "$TESTPOOL" && log_must_busy zpool destroy "$TESTPOOL"
+
+ for i in {0..$devs}; do
+ log_must rm -f "$TEST_BASE_DIR/dev-$i"
+ done
+
+ log_must set_tunable32 PREFETCH_DISABLE $prefetch_disable
+ log_must set_tunable64 RAIDZ_EXPAND_MAX_REFLOW_BYTES 0
+}
+
+function wait_expand_paused
+{
+ oldcopied='0'
+ newcopied='1'
+ while [[ $oldcopied != $newcopied ]]; do
+ oldcopied=$newcopied
+ sleep 2
+ newcopied=$(zpool status $TESTPOOL | \
+ grep 'copied out of' | \
+ awk '{print $1}')
+ log_note "newcopied=$newcopied"
+ done
+ log_note "paused at $newcopied"
+}
+
+function test_resilver # <pool> <parity> <dir>
+{
+ typeset pool=$1
+ typeset nparity=$2
+ typeset dir=$3
+
+ for (( i=0; i<$nparity; i=i+1 )); do
+ log_must zpool offline $pool $dir/dev-$i
+ done
+
+ log_must zpool export $pool
+
+ for (( i=0; i<$nparity; i=i+1 )); do
+ log_must zpool labelclear -f $dir/dev-$i
+ done
+
+ log_must zpool import -o cachefile=none -d $dir $pool
+
+ for (( i=0; i<$nparity; i=i+1 )); do
+ log_must zpool replace -f $pool $dir/dev-$i
+ done
+
+ log_must zpool wait -t resilver $pool
+
+ log_must check_pool_status $pool "errors" "No known data errors"
+
+ log_must zpool clear $pool
+
+ for (( i=$nparity; i<$nparity*2; i=i+1 )); do
+ log_must zpool offline $pool $dir/dev-$i
+ done
+
+ log_must zpool export $pool
+
+ for (( i=$nparity; i<$nparity*2; i=i+1 )); do
+ log_must zpool labelclear -f $dir/dev-$i
+ done
+
+ log_must zpool import -o cachefile=none -d $dir $pool
+
+ for (( i=$nparity; i<$nparity*2; i=i+1 )); do
+ log_must zpool replace -f $pool $dir/dev-$i
+ done
+
+ log_must zpool wait -t resilver $pool
+
+ log_must check_pool_status $pool "errors" "No known data errors"
+
+ log_must zpool clear $pool
+}
+
+function test_scrub # <pool> <parity> <dir>
+{
+ typeset pool=$1
+ typeset nparity=$2
+ typeset dir=$3
+ typeset combrec=$4
+
+ reflow_size=$(get_pool_prop allocated $pool)
+ randbyte=$(( ((RANDOM<<15) + RANDOM) % $reflow_size ))
+ log_must set_tunable64 RAIDZ_EXPAND_MAX_REFLOW_BYTES $randbyte
+ log_must zpool attach $TESTPOOL ${raid}-0 $dir/dev-$devs
+ wait_expand_paused
+
+ log_must zpool export $pool
+
+ # zero out parity disks
+ for (( i=0; i<$nparity; i=i+1 )); do
+ dd conv=notrunc if=/dev/zero of=$dir/dev-$i \
+ bs=1M seek=4 count=$(($dev_size_mb-4))
+ done
+
+ log_must zpool import -o cachefile=none -d $dir $pool
+
+ log_must zpool scrub -w $pool
+ log_must zpool clear $pool
+ log_must zpool export $pool
+
+ # zero out parity count worth of data disks
+ for (( i=$nparity; i<$nparity*2; i=i+1 )); do
+ dd conv=notrunc if=/dev/zero of=$dir/dev-$i \
+ bs=1M seek=4 count=$(($dev_size_mb-4))
+ done
+
+ log_must zpool import -o cachefile=none -d $dir $pool
+
+ log_must zpool scrub -w $pool
+
+ log_must check_pool_status $pool "errors" "No known data errors"
+
+ log_must zpool clear $pool
+ log_must set_tunable64 RAIDZ_EXPAND_MAX_REFLOW_BYTES 0
+ log_must zpool wait -t raidz_expand $TESTPOOL
+}
+
+log_onexit cleanup
+
+log_must set_tunable32 PREFETCH_DISABLE 1
+
+# Disk files which will be used by pool
+for i in {0..$(($devs - 1))}; do
+ device=$TEST_BASE_DIR/dev-$i
+ log_must truncate -s ${dev_size_mb}M $device
+ disks[${#disks[*]}+1]=$device
+done
+
+# Disk file which will be attached
+log_must truncate -s 512M $TEST_BASE_DIR/dev-$devs
+
+nparity=$((RANDOM%(3) + 1))
+raid=raidz$nparity
+dir=$TEST_BASE_DIR
+
+log_must zpool create -f -o cachefile=none $TESTPOOL $raid ${disks[@]}
+log_must zfs set primarycache=metadata $TESTPOOL
+
+log_must zfs create $TESTPOOL/fs
+log_must fill_fs /$TESTPOOL/fs 1 512 100 1024 R
+
+log_must zfs create -o compress=on $TESTPOOL/fs2
+log_must fill_fs /$TESTPOOL/fs2 1 512 100 1024 R
+
+log_must zfs create -o compress=on -o recordsize=8k $TESTPOOL/fs3
+log_must fill_fs /$TESTPOOL/fs3 1 512 100 1024 R
+
+log_must check_pool_status $TESTPOOL "errors" "No known data errors"
+
+test_scrub $TESTPOOL $nparity $dir
+test_resilver $TESTPOOL $nparity $dir
+
+zpool destroy "$TESTPOOL"
+
+log_pass "raidz expansion test succeeded."
diff --git a/tests/zfs-tests/tests/functional/raidz/raidz_expand_002_pos.ksh b/tests/zfs-tests/tests/functional/raidz/raidz_expand_002_pos.ksh
new file mode 100755
index 000000000000..004f3d1f9255
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/raidz/raidz_expand_002_pos.ksh
@@ -0,0 +1,115 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2020 by vStack. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+#
+# DESCRIPTION:
+# 'zpool attach poolname raidz ...' should attach new devive to the pool.
+#
+# STRATEGY:
+# 1. Create block device files for the test raidz pool
+# 2. For each parity value [1..3]
+# - create raidz pool with minimum block device files required
+# - for each free test block device
+# - attach to the pool
+# - verify the raidz pool
+# - destroy the raidz pool
+
+typeset -r devs=6
+typeset -r dev_size_mb=512
+
+typeset -a disks
+
+prefetch_disable=$(get_tunable PREFETCH_DISABLE)
+
+function cleanup
+{
+ poolexists "$TESTPOOL" && log_must_busy zpool destroy "$TESTPOOL"
+
+ for i in {0..$devs}; do
+ log_must rm -f "$TEST_BASE_DIR/dev-$i"
+ done
+
+ log_must set_tunable32 PREFETCH_DISABLE $prefetch_disable
+}
+
+log_onexit cleanup
+
+log_must set_tunable32 PREFETCH_DISABLE 1
+
+# Disk files which will be used by pool
+for i in {0..$(($devs))}; do
+ device=$TEST_BASE_DIR/dev-$i
+ log_must truncate -s ${dev_size_mb}M $device
+ disks[${#disks[*]}+1]=$device
+done
+
+nparity=$((RANDOM%(3) + 1))
+raid=raidz$nparity
+dir=$TEST_BASE_DIR
+pool=$TESTPOOL
+opts="-o cachefile=none"
+
+log_must zpool create -f $opts $pool $raid ${disks[1..$(($nparity+1))]}
+log_must zfs set primarycache=metadata $pool
+
+log_must zfs create $pool/fs
+log_must fill_fs /$pool/fs 1 512 100 1024 R
+
+log_must zfs create -o compress=on $pool/fs2
+log_must fill_fs /$pool/fs2 1 512 100 1024 R
+
+log_must zfs create -o compress=on -o recordsize=8k $pool/fs3
+log_must fill_fs /$pool/fs3 1 512 100 1024 R
+
+typeset pool_size=$(get_pool_prop size $pool)
+
+for disk in ${disks[$(($nparity+2))..$devs]}; do
+ log_must dd if=/dev/urandom of=/${pool}/FILE-$RANDOM bs=1M \
+ count=64
+
+ log_must zpool attach -w $pool ${raid}-0 $disk
+
+ # Wait some time for pool size increase
+ sleep 5
+
+ # Confirm that disk was attached to the pool
+ log_must zpool get -H path $TESTPOOL $disk
+
+ typeset expand_size=$(get_pool_prop size $pool)
+ if [[ "$expand_size" -le "$pool_size" ]]; then
+ log_fail "pool $pool not expanded"
+ fi
+
+ verify_pool $pool
+
+ pool_size=$expand_size
+done
+
+zpool destroy "$pool"
+
+log_pass "raidz expansion test succeeded."
diff --git a/tests/zfs-tests/tests/functional/raidz/raidz_expand_003_neg.ksh b/tests/zfs-tests/tests/functional/raidz/raidz_expand_003_neg.ksh
new file mode 100755
index 000000000000..4d85c46897b8
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/raidz/raidz_expand_003_neg.ksh
@@ -0,0 +1,102 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2021 by vStack. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+#
+# DESCRIPTION:
+# 'zpool attach poolname raidz ...' should reject device attach if pool
+# is in checkpointed state. If checkpoint creation requested on
+# expanding pool, the request should be rejected.
+
+#
+# STRATEGY:
+# 1. Create block device files for the test raidz pool.
+# 2. Create pool and checkpoint it.
+# 3. Try to expand raidz, ensure that request rejected.
+# 4. Recreate the pool.
+# 5. Apply raidz expansion.
+# 6. Ensure, that checkpoint cannot be created.
+
+typeset -r devs=6
+typeset -r dev_size_mb=512
+
+typeset -a disks
+
+prefetch_disable=$(get_tunable PREFETCH_DISABLE)
+
+function cleanup
+{
+ poolexists "$TESTPOOL" && log_must_busy zpool destroy "$TESTPOOL"
+
+ for i in {0..$devs}; do
+ log_must rm -f "$TEST_BASE_DIR/dev-$i"
+ done
+
+ log_must set_tunable32 PREFETCH_DISABLE $prefetch_disable
+ log_must set_tunable64 RAIDZ_EXPAND_MAX_REFLOW_BYTES 0
+}
+
+log_onexit cleanup
+
+log_must set_tunable32 PREFETCH_DISABLE 1
+
+# Disk files which will be used by pool
+for i in {0..$(($devs))}; do
+ device=$TEST_BASE_DIR/dev-$i
+ log_must truncate -s ${dev_size_mb}M $device
+ disks[${#disks[*]}+1]=$device
+done
+
+nparity=1
+raid=raidz$nparity
+pool=$TESTPOOL
+opts="-o cachefile=none"
+
+# case 1: checkpoint exist, try to expand
+log_must zpool create -f $opts $pool $raid ${disks[1..$(($devs-1))]}
+log_must zfs set primarycache=metadata $pool
+log_must zpool checkpoint $pool
+log_mustnot zpool attach $pool ${raid}-0 ${disks[$devs]}
+log_must zpool destroy $pool
+
+#
+# case 2: expansion in progress, try to checkpoint
+#
+# Sets pause point at 25% of allocated space so that we know an
+# expansion is still in progress when we attempt the checkpoint
+#
+log_must zpool create -f $opts $pool $raid ${disks[1..$(($devs-1))]}
+log_must zfs set primarycache=metadata $pool
+log_must zfs create $pool/fs
+log_must fill_fs /$pool/fs 1 512 100 1024 R
+allocated=$(zpool list -Hp -o allocated $pool)
+log_must set_tunable64 RAIDZ_EXPAND_MAX_REFLOW_BYTES $((allocated / 4))
+log_must zpool attach $pool ${raid}-0 ${disks[$devs]}
+log_mustnot zpool checkpoint $pool
+log_must zpool destroy $pool
+
+log_pass "raidz expansion test succeeded."
diff --git a/tests/zfs-tests/tests/functional/raidz/raidz_expand_003_pos.ksh b/tests/zfs-tests/tests/functional/raidz/raidz_expand_003_pos.ksh
new file mode 100755
index 000000000000..712b25261773
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/raidz/raidz_expand_003_pos.ksh
@@ -0,0 +1,141 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2021 by vStack. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/cli_root/zfs_wait/zfs_wait.kshlib
+
+#
+# DESCRIPTION:
+# Check raidz expansion is able to work correctly under i/o load.
+#
+# STRATEGY:
+# 1. Create block device files for the test raidz pool
+# 2. For each parity value [1..3]
+# - create raidz pool with minimum block device files required
+# - create couple of datasets with different recordsize and fill it
+# - set a max reflow value near pool capacity
+# - wait for reflow to reach this max
+# - verify pool
+# - set reflow bytes to max value to complete the expansion
+
+typeset -r devs=10
+typeset -r dev_size_mb=256
+
+typeset -a disks
+
+embedded_slog_min_ms=$(get_tunable EMBEDDED_SLOG_MIN_MS)
+
+function cleanup
+{
+ poolexists "$TESTPOOL" && zpool status -v "$TESTPOOL"
+ poolexists "$TESTPOOL" && log_must_busy zpool destroy "$TESTPOOL"
+
+ for i in {0..$devs}; do
+ log_must rm -f "$TEST_BASE_DIR/dev-$i"
+ done
+
+ log_must set_tunable32 EMBEDDED_SLOG_MIN_MS $embedded_slog_min_ms
+ log_must set_tunable64 RAIDZ_EXPAND_MAX_REFLOW_BYTES 0
+}
+
+function wait_expand_paused
+{
+ oldcopied='0'
+ newcopied='1'
+ # wait until reflow copied value stops changing
+ while [[ $oldcopied != $newcopied ]]; do
+ oldcopied=$newcopied
+ sleep 1
+ newcopied=$(zpool status $TESTPOOL | \
+ grep 'copied out of' | \
+ awk '{print $1}')
+ done
+}
+
+log_onexit cleanup
+
+log_must set_tunable32 EMBEDDED_SLOG_MIN_MS 99999
+
+# Disk files which will be used by pool
+for i in {0..$(($devs))}; do
+ device=$TEST_BASE_DIR/dev-$i
+ log_must truncate -s ${dev_size_mb}M $device
+ disks[${#disks[*]}+1]=$device
+done
+
+nparity=$((RANDOM%(3) + 1))
+raid=raidz$nparity
+pool=$TESTPOOL
+opts="-o cachefile=none"
+
+log_must zpool create -f $opts $pool $raid ${disks[1..$(($nparity+1))]}
+
+log_must zfs create -o recordsize=8k $pool/fs
+log_must fill_fs /$pool/fs 1 256 100 1024 R
+
+log_must zfs create -o recordsize=128k $pool/fs2
+log_must fill_fs /$pool/fs2 1 256 100 1024 R
+
+for disk in ${disks[$(($nparity+2))..$devs]}; do
+ log_must mkfile -n 400m /$pool/fs/file
+ log_bkgrnd randwritecomp /$pool/fs/file 250
+ pid0=$!
+
+ # start some random writes in the background during expansion
+ log_must mkfile -n 400m /$pool/fs2/file2
+ log_bkgrnd randwritecomp /$pool/fs2/file2 250
+ pid1=$!
+ sleep 10
+
+ # Pause at half total bytes to be copied for expansion
+ reflow_size=$(get_pool_prop allocated $pool)
+ log_note need to reflow $reflow_size bytes
+ pause=$((reflow_size/2))
+ log_must set_tunable64 RAIDZ_EXPAND_MAX_REFLOW_BYTES $pause
+
+ log_must zpool attach $pool ${raid}-0 $disk
+ wait_expand_paused
+
+ kill_if_running $pid0
+ kill_if_running $pid1
+
+ log_must zpool scrub -w $pool
+
+ log_must check_pool_status $pool "errors" "No known data errors"
+ log_must check_pool_status $pool "scan" "with 0 errors"
+ log_must check_pool_status $pool "scan" "repaired 0B"
+
+ # Set pause past largest possible value for this pool
+ pause=$((devs*dev_size_mb*1024*1024))
+ log_must set_tunable64 RAIDZ_EXPAND_MAX_REFLOW_BYTES $pause
+
+ log_must zpool wait -t raidz_expand $pool
+done
+
+log_must zpool destroy "$pool"
+
+log_pass "raidz expansion test succeeded."
+
diff --git a/tests/zfs-tests/tests/functional/raidz/raidz_expand_004_pos.ksh b/tests/zfs-tests/tests/functional/raidz/raidz_expand_004_pos.ksh
new file mode 100755
index 000000000000..2be55dae4254
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/raidz/raidz_expand_004_pos.ksh
@@ -0,0 +1,121 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2021 by vStack. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+#
+# DESCRIPTION:
+# Check device replacement during raidz expansion.
+#
+# STRATEGY:
+# 1. Create block device files for the test raidz pool
+# 2. For each parity value [1..3]
+# - create raidz pool with minimum block device files required
+# - create couple of datasets with different recordsize and fill it
+# - attach new device to the pool
+# - offline and zero vdevs allowed by parity
+# - wait some time and start offlined vdevs replacement
+# - wait replacement completion and verify pool status
+
+typeset -r devs=10
+typeset -r dev_size_mb=128
+
+typeset -a disks
+
+embedded_slog_min_ms=$(get_tunable EMBEDDED_SLOG_MIN_MS)
+original_scrub_after_expand=$(get_tunable SCRUB_AFTER_EXPAND)
+
+function cleanup
+{
+ poolexists "$TESTPOOL" && log_must_busy zpool destroy "$TESTPOOL"
+
+ for i in {0..$devs}; do
+ log_must rm -f "$TEST_BASE_DIR/dev-$i"
+ done
+
+ log_must set_tunable32 EMBEDDED_SLOG_MIN_MS $embedded_slog_min_ms
+ log_must set_tunable32 SCRUB_AFTER_EXPAND $original_scrub_after_expand
+}
+
+log_onexit cleanup
+
+log_must set_tunable32 EMBEDDED_SLOG_MIN_MS 99999
+
+# Disk files which will be used by pool
+for i in {0..$(($devs))}; do
+ device=$TEST_BASE_DIR/dev-$i
+ log_must truncate -s ${dev_size_mb}M $device
+ disks[${#disks[*]}+1]=$device
+done
+
+nparity=$((RANDOM%(3) + 1))
+raid=raidz$nparity
+pool=$TESTPOOL
+opts="-o cachefile=none"
+
+log_must set_tunable32 SCRUB_AFTER_EXPAND 0
+
+log_must zpool create -f $opts $pool $raid ${disks[1..$(($nparity+1))]}
+
+log_must zfs create -o recordsize=8k $pool/fs
+log_must fill_fs /$pool/fs 1 128 100 1024 R
+
+log_must zfs create -o recordsize=128k $pool/fs2
+log_must fill_fs /$pool/fs2 1 128 100 1024 R
+
+for disk in ${disks[$(($nparity+2))..$devs]}; do
+ log_must zpool attach $pool ${raid}-0 $disk
+
+ sleep 10
+
+ for (( i=1; i<=$nparity; i=i+1 )); do
+ log_must zpool offline $pool ${disks[$i]}
+ log_must dd if=/dev/zero of=${disks[$i]} \
+ bs=1024k count=$dev_size_mb conv=notrunc
+ done
+
+ sleep 3
+
+ for (( i=1; i<=$nparity; i=i+1 )); do
+ log_must zpool replace $pool ${disks[$i]}
+ done
+
+ log_must zpool wait -t replace $pool
+ log_must check_pool_status $pool "scan" "with 0 errors"
+
+ log_must zpool wait -t raidz_expand $pool
+
+ log_must zpool clear $pool
+ log_must zpool scrub -w $pool
+
+ log_must zpool status -v
+ log_must check_pool_status $pool "scan" "with 0 errors"
+done
+
+log_must zpool destroy "$pool"
+
+log_pass "raidz expansion test succeeded."
+
diff --git a/tests/zfs-tests/tests/functional/raidz/raidz_expand_005_pos.ksh b/tests/zfs-tests/tests/functional/raidz/raidz_expand_005_pos.ksh
new file mode 100755
index 000000000000..56ee3e9be67c
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/raidz/raidz_expand_005_pos.ksh
@@ -0,0 +1,177 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2021 by vStack. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+#
+# DESCRIPTION:
+# Check device replacement during raidz expansion using expansion pausing.
+#
+# STRATEGY:
+# 1. Create block device files for the test raidz pool
+# 2. For each parity value [1..3]
+# - create raidz pool with minimum block device files required
+# - create couple of datasets with different recordsize and fill it
+# - set raidz expand maximum reflow bytes
+# - attach new device to the pool
+# - wait for reflow bytes to reach the maximum
+# - offline and zero vdevs allowed by parity
+# - wait some time and start offlined vdevs replacement
+# - wait replacement completion and verify pool status
+# - loop thru vdevs replacing with the max reflow bytes increasing
+# - verify pool
+# - set reflow bytes to max value to complete the expansion
+
+typeset -r devs=10
+typeset -r dev_size_mb=128
+
+typeset -a disks
+
+embedded_slog_min_ms=$(get_tunable EMBEDDED_SLOG_MIN_MS)
+original_scrub_after_expand=$(get_tunable SCRUB_AFTER_EXPAND)
+
+function cleanup
+{
+ poolexists "$TESTPOOL" && zpool status -v "$TESTPOOL"
+ poolexists "$TESTPOOL" && log_must_busy zpool destroy "$TESTPOOL"
+
+ for i in {0..$devs}; do
+ log_must rm -f "$TEST_BASE_DIR/dev-$i"
+ done
+
+ log_must set_tunable32 EMBEDDED_SLOG_MIN_MS $embedded_slog_min_ms
+ log_must set_tunable64 RAIDZ_EXPAND_MAX_REFLOW_BYTES 0
+ log_must set_tunable32 SCRUB_AFTER_EXPAND $original_scrub_after_expand
+}
+
+function wait_expand_paused
+{
+ oldcopied='0'
+ newcopied='1'
+ while [[ $oldcopied != $newcopied ]]; do
+ oldcopied=$newcopied
+ sleep 1
+ newcopied=$(zpool status $TESTPOOL | \
+ grep 'copied out of' | \
+ awk '{print $1}')
+ done
+}
+
+log_onexit cleanup
+
+function test_replace # <pool> <devices> <parity>
+{
+ pool=${1}
+ devices=${2}
+ nparity=${3}
+ device_count=0
+
+ log_must echo "devices=$devices"
+
+ for dev in ${devices}; do
+ device_count=$((device_count+1))
+ done
+
+ index=$((RANDOM%(device_count-nparity)))
+ for (( j=1; j<=$nparity; j=j+1 )); do
+ log_must zpool offline $pool ${disks[$((index+j))]}
+ log_must dd if=/dev/zero of=${disks[$((index+j))]} \
+ bs=1024k count=$dev_size_mb conv=notrunc
+ done
+
+ for (( j=1; j<=$nparity; j=j+1 )); do
+ log_must zpool replace $pool ${disks[$((index+j))]}
+ done
+
+ log_must zpool wait -t replace $pool
+ log_must check_pool_status $pool "scan" "with 0 errors"
+
+ log_must zpool clear $pool
+ log_must zpool scrub -w $pool
+
+ log_must zpool status -v
+ log_must check_pool_status $pool "scan" "with 0 errors"
+}
+
+log_must set_tunable32 EMBEDDED_SLOG_MIN_MS 99999
+
+# Disk files which will be used by pool
+for i in {0..$(($devs))}; do
+ device=$TEST_BASE_DIR/dev-$i
+ log_must truncate -s ${dev_size_mb}M $device
+ disks[${#disks[*]}+1]=$device
+done
+
+nparity=$((RANDOM%(3) + 1))
+raid=raidz$nparity
+pool=$TESTPOOL
+opts="-o cachefile=none"
+devices=""
+
+log_must set_tunable32 SCRUB_AFTER_EXPAND 0
+
+log_must zpool create -f $opts $pool $raid ${disks[1..$(($nparity+1))]}
+devices="${disks[1..$(($nparity+1))]}"
+
+log_must zfs create -o recordsize=8k $pool/fs
+log_must fill_fs /$pool/fs 1 128 100 1024 R
+
+log_must zfs create -o recordsize=128k $pool/fs2
+log_must fill_fs /$pool/fs2 1 128 100 1024 R
+
+for disk in ${disks[$(($nparity+2))..$devs]}; do
+ # Set pause to some random value near halfway point
+ reflow_size=$(get_pool_prop allocated $pool)
+ pause=$((((RANDOM << 15) + RANDOM) % reflow_size / 2))
+ log_must set_tunable64 RAIDZ_EXPAND_MAX_REFLOW_BYTES $pause
+
+ log_must zpool attach $pool ${raid}-0 $disk
+ devices="$devices $disk"
+
+ wait_expand_paused
+
+ for (( i=0; i<2; i++ )); do
+ test_replace $pool "$devices" $nparity
+
+ # Increase pause by about 25%
+ pause=$((pause + (((RANDOM << 15) + RANDOM) % \
+ reflow_size) / 4))
+ log_must set_tunable64 RAIDZ_EXPAND_MAX_REFLOW_BYTES $pause
+
+ wait_expand_paused
+ done
+
+ # Set pause past largest possible value for this pool
+ pause=$((devs*dev_size_mb*1024*1024))
+ log_must set_tunable64 RAIDZ_EXPAND_MAX_REFLOW_BYTES $pause
+
+ log_must zpool wait -t raidz_expand $pool
+done
+
+log_must zpool destroy "$pool"
+
+log_pass "raidz expansion test succeeded."
+
diff --git a/tests/zfs-tests/tests/functional/raidz/raidz_expand_006_neg.ksh b/tests/zfs-tests/tests/functional/raidz/raidz_expand_006_neg.ksh
new file mode 100755
index 000000000000..35ba8bde2392
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/raidz/raidz_expand_006_neg.ksh
@@ -0,0 +1,78 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by iXsystems, Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+#
+# DESCRIPTION:
+# 'zpool attach poolname raidz ...' should fail if raidz_expansion
+# feature is not enabled.
+#
+# STRATEGY:
+# 1. Create raidz pool with raidz_expansion feature disabled
+# 2. Attempt to attach a device to the raidz vdev
+# 3. Verify that device attached failed
+# 4. Destroy the raidz pool
+
+typeset -r devs=4
+typeset -r dev_size_mb=128
+typeset -a disks
+
+function cleanup
+{
+ log_pos zpool status "$TESTPOOL"
+
+ poolexists "$TESTPOOL" && log_must_busy zpool destroy "$TESTPOOL"
+
+ for i in {0..$devs}; do
+ log_must rm -f "$TEST_BASE_DIR/dev-$i"
+ done
+}
+
+log_onexit cleanup
+
+for i in {0..$devs}; do
+ device=$TEST_BASE_DIR/dev-$i
+ log_must truncate -s ${dev_size_mb}M "$device"
+ if [[ $i -ne $devs ]]; then
+ disks[${#disks[*]}+1]=$device
+ fi
+done
+
+# create a pool with raidz_expansion feature disabled
+log_must zpool create -f -o cachefile=none -o feature@raidz_expansion=disabled \
+ "$TESTPOOL" raidz1 "${disks[@]}"
+status=$(zpool list -H -o feature@raidz_expansion "$TESTPOOL")
+if [[ "$status" != "disabled" ]]; then
+ log_fail "raidz_expansion feature was not disabled"
+fi
+
+# expecting attach to fail
+log_mustnot_expect "raidz_expansion feature must be enabled" zpool attach -f \
+ "$TESTPOOL" raidz1-0 "$TEST_BASE_DIR/dev-$devs"
+log_must zpool destroy "$TESTPOOL"
+
+log_pass "raidz attach failed with feature disabled as expected"
diff --git a/tests/zfs-tests/tests/functional/raidz/raidz_expand_007_neg.ksh b/tests/zfs-tests/tests/functional/raidz/raidz_expand_007_neg.ksh
new file mode 100755
index 000000000000..78294cb9e516
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/raidz/raidz_expand_007_neg.ksh
@@ -0,0 +1,86 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2023 by iXsystems, Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+#
+# DESCRIPTION:
+# Negative for FreeBSD Only
+#
+# Attempting to expand a RAIDZ should fail if the scratch area on the
+# existing disks contains BTX Server binary (used to boot FreeBSD when
+# using MBR partitions with ZFS).
+#
+# STRATEGY:
+# 1. Create raidz pool
+# 2. Add a BTX header to the reserved boot area
+# 3. Attempt to attach a device to the raidz vdev
+# 4. Verify that device attached failed
+# 5. Destroy the raidz pool
+
+typeset -r devs=4
+typeset -r dev_size_mb=128
+typeset -a disks
+
+function cleanup
+{
+ log_pos zpool status "$TESTPOOL"
+
+ poolexists "$TESTPOOL" && log_must_busy zpool destroy "$TESTPOOL"
+
+ for i in {0..$devs}; do
+ log_must rm -f "$TEST_BASE_DIR/dev-$i"
+ done
+}
+
+log_onexit cleanup
+
+for i in {0..$devs}; do
+ device=$TEST_BASE_DIR/dev-$i
+ # simulate active BTX Server data by inserting a BTX header
+ printf "\xeb\x0e%s\x01\x02\x80" "BTX" | dd of="$device" \
+ bs=512 seek=1024 status=none
+ log_must truncate -s ${dev_size_mb}M "$device"
+ if [[ $i -ne $devs ]]; then
+ disks[${#disks[*]}+1]=$device
+ fi
+done
+
+log_must zpool create -f -o cachefile=none "$TESTPOOL" raidz1 "${disks[@]}"
+
+if is_freebsd; then
+ # expecting attach to fail
+ log_mustnot_expect "the reserved boot area" zpool attach -f \
+ "$TESTPOOL" raidz1-0 "$TEST_BASE_DIR/dev-$devs"
+ log_must zpool destroy "$TESTPOOL"
+ log_pass "raidz attach failed with in-use reserved boot area"
+else
+ # expecting attach to pass everywhere else
+ log_must zpool attach -f "$TESTPOOL" raidz1-0 "$TEST_BASE_DIR/dev-$devs"
+ log_must zpool destroy "$TESTPOOL"
+ log_pass "raidz attach passed with in-use reserved boot area"
+fi
+
diff --git a/tests/zfs-tests/tests/functional/raidz/setup.ksh b/tests/zfs-tests/tests/functional/raidz/setup.ksh
index 4e155d24d544..47821e42915e 100755
--- a/tests/zfs-tests/tests/functional/raidz/setup.ksh
+++ b/tests/zfs-tests/tests/functional/raidz/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/redacted_send/cleanup.ksh b/tests/zfs-tests/tests/functional/redacted_send/cleanup.ksh
index 1a7c142b8551..2c344f0ed3d8 100755
--- a/tests/zfs-tests/tests/functional/redacted_send/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/redacted_send/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/redacted_send/redacted.cfg b/tests/zfs-tests/tests/functional/redacted_send/redacted.cfg
index 3b9e1714dfe9..9608b87f107b 100644
--- a/tests/zfs-tests/tests/functional/redacted_send/redacted.cfg
+++ b/tests/zfs-tests/tests/functional/redacted_send/redacted.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/redacted_send/redacted.kshlib b/tests/zfs-tests/tests/functional/redacted_send/redacted.kshlib
index a3810d55f97c..cc1cf0411027 100644
--- a/tests/zfs-tests/tests/functional/redacted_send/redacted.kshlib
+++ b/tests/zfs-tests/tests/functional/redacted_send/redacted.kshlib
@@ -8,7 +8,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/redacted_send/redacted_many_clones.ksh b/tests/zfs-tests/tests/functional/redacted_send/redacted_many_clones.ksh
index 3386643b295e..f2150be3bc95 100755
--- a/tests/zfs-tests/tests/functional/redacted_send/redacted_many_clones.ksh
+++ b/tests/zfs-tests/tests/functional/redacted_send/redacted_many_clones.ksh
@@ -27,7 +27,6 @@
# second (the last block in the file) is common to them all.
# 2. Verify a redacted stream with a reasonable redaction list length can
# be correctly processed.
-# 3. Verify that if the list is too long, the send fails gracefully.
#
typeset ds_name="many_clones"
@@ -56,13 +55,18 @@ for i in {1..64}; do
log_must zfs snapshot ${clone}$i@snap
done
-# The limit isn't necessarily 32 snapshots. The maximum number of snapshots in
+# The limit isn't necessarily 64 snapshots. The maximum number of snapshots in
# the redacted list is determined in dsl_bookmark_create_redacted_check().
-log_must zfs redact $sendfs@snap book1 $clone{1..32}@snap
+log_must zfs redact $sendfs@snap book1 $clone{1..64}@snap
log_must eval "zfs send --redact book1 $sendfs@snap >$stream"
log_must eval "zfs recv $recvfs <$stream"
compare_files $sendfs $recvfs "f2" "$RANGE8"
-log_mustnot zfs redact $sendfs@snap book2 $clone{1..64}@snap
+rls_value="$(zpool get -H -o value feature@redaction_list_spill $POOL)"
+if [ "$rls_value" = "active" ]; then
+ log_note "redaction_list_spill feature active"
+else
+ log_fail "redaction_list_spill feature not active"
+fi
log_pass "Redacted send can deal with a large redaction list."
diff --git a/tests/zfs-tests/tests/functional/redacted_send/setup.ksh b/tests/zfs-tests/tests/functional/redacted_send/setup.ksh
index 3f537f813db0..6e08bec2e822 100755
--- a/tests/zfs-tests/tests/functional/redacted_send/setup.ksh
+++ b/tests/zfs-tests/tests/functional/redacted_send/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/redundancy/cleanup.ksh b/tests/zfs-tests/tests/functional/redundancy/cleanup.ksh
index ba8d980710ee..1c95d752c5a0 100755
--- a/tests/zfs-tests/tests/functional/redundancy/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/redundancy/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/redundancy/redundancy.cfg b/tests/zfs-tests/tests/functional/redundancy/redundancy.cfg
index 37b93820bc1d..3e7916257ff4 100644
--- a/tests/zfs-tests/tests/functional/redundancy/redundancy.cfg
+++ b/tests/zfs-tests/tests/functional/redundancy/redundancy.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/redundancy/redundancy.kshlib b/tests/zfs-tests/tests/functional/redundancy/redundancy.kshlib
index 78c33d81db26..297c6a073bb9 100644
--- a/tests/zfs-tests/tests/functional/redundancy/redundancy.kshlib
+++ b/tests/zfs-tests/tests/functional/redundancy/redundancy.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -45,28 +45,6 @@ function cleanup
}
#
-# Get random number between min and max number.
-#
-# $1 Minimal value
-# $2 Maximal value
-#
-function random
-{
- typeset -i min=$1
- typeset -i max=$2
- typeset -i value
-
- while true; do
- ((value = RANDOM % (max + 1)))
- if ((value >= min)); then
- break
- fi
- done
-
- echo $value
-}
-
-#
# Get the number of checksum errors for the pool.
#
# $1 Pool
diff --git a/tests/zfs-tests/tests/functional/redundancy/redundancy_draid.ksh b/tests/zfs-tests/tests/functional/redundancy/redundancy_draid.ksh
index 285318853a9e..8208d2b4a398 100755
--- a/tests/zfs-tests/tests/functional/redundancy/redundancy_draid.ksh
+++ b/tests/zfs-tests/tests/functional/redundancy/redundancy_draid.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/redundancy/redundancy_draid1.ksh b/tests/zfs-tests/tests/functional/redundancy/redundancy_draid1.ksh
index 85d420ab0d3a..a59743592eca 100755
--- a/tests/zfs-tests/tests/functional/redundancy/redundancy_draid1.ksh
+++ b/tests/zfs-tests/tests/functional/redundancy/redundancy_draid1.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/redundancy/redundancy_draid2.ksh b/tests/zfs-tests/tests/functional/redundancy/redundancy_draid2.ksh
index 04f1fdfb150d..48c4a24cb496 100755
--- a/tests/zfs-tests/tests/functional/redundancy/redundancy_draid2.ksh
+++ b/tests/zfs-tests/tests/functional/redundancy/redundancy_draid2.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/redundancy/redundancy_draid3.ksh b/tests/zfs-tests/tests/functional/redundancy/redundancy_draid3.ksh
index d4c823ed9b37..8e1ad237b5a2 100755
--- a/tests/zfs-tests/tests/functional/redundancy/redundancy_draid3.ksh
+++ b/tests/zfs-tests/tests/functional/redundancy/redundancy_draid3.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/redundancy/redundancy_draid_damaged1.ksh b/tests/zfs-tests/tests/functional/redundancy/redundancy_draid_damaged1.ksh
index da2d58eef6f3..110c69159eb1 100755
--- a/tests/zfs-tests/tests/functional/redundancy/redundancy_draid_damaged1.ksh
+++ b/tests/zfs-tests/tests/functional/redundancy/redundancy_draid_damaged1.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/redundancy/redundancy_draid_damaged2.ksh b/tests/zfs-tests/tests/functional/redundancy/redundancy_draid_damaged2.ksh
index 8e06db9bad99..b0bb4ef84129 100755
--- a/tests/zfs-tests/tests/functional/redundancy/redundancy_draid_damaged2.ksh
+++ b/tests/zfs-tests/tests/functional/redundancy/redundancy_draid_damaged2.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/redundancy/redundancy_mirror.ksh b/tests/zfs-tests/tests/functional/redundancy/redundancy_mirror.ksh
index b7b791b248ee..3410ac018b83 100755
--- a/tests/zfs-tests/tests/functional/redundancy/redundancy_mirror.ksh
+++ b/tests/zfs-tests/tests/functional/redundancy/redundancy_mirror.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz.ksh b/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz.ksh
index a3ea3e53cb75..83cacda84b09 100755
--- a/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz.ksh
+++ b/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz1.ksh b/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz1.ksh
index a73890e4cc05..5700aa440606 100755
--- a/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz1.ksh
+++ b/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz1.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz2.ksh b/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz2.ksh
index 94b9b8825154..d73d80114b6b 100755
--- a/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz2.ksh
+++ b/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz2.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz3.ksh b/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz3.ksh
index 0a01c47106b3..9839d9b63145 100755
--- a/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz3.ksh
+++ b/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz3.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/redundancy/redundancy_stripe.ksh b/tests/zfs-tests/tests/functional/redundancy/redundancy_stripe.ksh
index b2c4a85febef..774226acda96 100755
--- a/tests/zfs-tests/tests/functional/redundancy/redundancy_stripe.ksh
+++ b/tests/zfs-tests/tests/functional/redundancy/redundancy_stripe.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/redundancy/setup.ksh b/tests/zfs-tests/tests/functional/redundancy/setup.ksh
index e2c04fe5cfbd..0ac48c82a810 100755
--- a/tests/zfs-tests/tests/functional/redundancy/setup.ksh
+++ b/tests/zfs-tests/tests/functional/redundancy/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/refquota/cleanup.ksh b/tests/zfs-tests/tests/functional/refquota/cleanup.ksh
index ea139ae0395b..2f0a02ed8dd3 100755
--- a/tests/zfs-tests/tests/functional/refquota/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/refquota/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/refquota/refquota_001_pos.ksh b/tests/zfs-tests/tests/functional/refquota/refquota_001_pos.ksh
index 411fab8459af..6583210ca3ec 100755
--- a/tests/zfs-tests/tests/functional/refquota/refquota_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/refquota/refquota_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/refquota/refquota_002_pos.ksh b/tests/zfs-tests/tests/functional/refquota/refquota_002_pos.ksh
index e1d3aa82033c..e2c42529c9d4 100755
--- a/tests/zfs-tests/tests/functional/refquota/refquota_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/refquota/refquota_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/refquota/refquota_003_pos.ksh b/tests/zfs-tests/tests/functional/refquota/refquota_003_pos.ksh
index e4def1a0a7b4..7f7c2ba683f1 100755
--- a/tests/zfs-tests/tests/functional/refquota/refquota_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/refquota/refquota_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/refquota/refquota_004_pos.ksh b/tests/zfs-tests/tests/functional/refquota/refquota_004_pos.ksh
index 0691c3630931..8051f9af833c 100755
--- a/tests/zfs-tests/tests/functional/refquota/refquota_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/refquota/refquota_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/refquota/refquota_005_pos.ksh b/tests/zfs-tests/tests/functional/refquota/refquota_005_pos.ksh
index 13977bc3b48f..cfccff5f1af5 100755
--- a/tests/zfs-tests/tests/functional/refquota/refquota_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/refquota/refquota_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/refquota/refquota_006_neg.ksh b/tests/zfs-tests/tests/functional/refquota/refquota_006_neg.ksh
index 39b317512df2..d0d9d12b0813 100755
--- a/tests/zfs-tests/tests/functional/refquota/refquota_006_neg.ksh
+++ b/tests/zfs-tests/tests/functional/refquota/refquota_006_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/refquota/setup.ksh b/tests/zfs-tests/tests/functional/refquota/setup.ksh
index 48bd314cd2dc..aae97e80f7b3 100755
--- a/tests/zfs-tests/tests/functional/refquota/setup.ksh
+++ b/tests/zfs-tests/tests/functional/refquota/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/refreserv/cleanup.ksh b/tests/zfs-tests/tests/functional/refreserv/cleanup.ksh
index ea139ae0395b..2f0a02ed8dd3 100755
--- a/tests/zfs-tests/tests/functional/refreserv/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/refreserv/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/refreserv/refreserv.cfg b/tests/zfs-tests/tests/functional/refreserv/refreserv.cfg
index 8c892db4a3a2..818e7e8283a2 100644
--- a/tests/zfs-tests/tests/functional/refreserv/refreserv.cfg
+++ b/tests/zfs-tests/tests/functional/refreserv/refreserv.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/refreserv/refreserv_001_pos.ksh b/tests/zfs-tests/tests/functional/refreserv/refreserv_001_pos.ksh
index 527949f27c10..82904663b668 100755
--- a/tests/zfs-tests/tests/functional/refreserv/refreserv_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/refreserv/refreserv_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/refreserv/refreserv_002_pos.ksh b/tests/zfs-tests/tests/functional/refreserv/refreserv_002_pos.ksh
index 6b096f5d2010..ed45eb782e12 100755
--- a/tests/zfs-tests/tests/functional/refreserv/refreserv_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/refreserv/refreserv_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/refreserv/refreserv_003_pos.ksh b/tests/zfs-tests/tests/functional/refreserv/refreserv_003_pos.ksh
index 3e5a78cf944f..aa910facb984 100755
--- a/tests/zfs-tests/tests/functional/refreserv/refreserv_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/refreserv/refreserv_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/refreserv/refreserv_004_pos.ksh b/tests/zfs-tests/tests/functional/refreserv/refreserv_004_pos.ksh
index 529d918c3695..ec67ccf44057 100755
--- a/tests/zfs-tests/tests/functional/refreserv/refreserv_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/refreserv/refreserv_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/refreserv/refreserv_005_pos.ksh b/tests/zfs-tests/tests/functional/refreserv/refreserv_005_pos.ksh
index 1ccc9828d4f7..e078e76ad698 100755
--- a/tests/zfs-tests/tests/functional/refreserv/refreserv_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/refreserv/refreserv_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/refreserv/setup.ksh b/tests/zfs-tests/tests/functional/refreserv/setup.ksh
index 48bd314cd2dc..aae97e80f7b3 100755
--- a/tests/zfs-tests/tests/functional/refreserv/setup.ksh
+++ b/tests/zfs-tests/tests/functional/refreserv/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/removal/removal_nopwrite.ksh b/tests/zfs-tests/tests/functional/removal/removal_nopwrite.ksh
index cede81ad60c2..3533c41cac28 100755
--- a/tests/zfs-tests/tests/functional/removal/removal_nopwrite.ksh
+++ b/tests/zfs-tests/tests/functional/removal/removal_nopwrite.ksh
@@ -15,7 +15,7 @@
#
#
-# Copyright (c) 2019 by Delphix. All rights reserved.
+# Copyright (c) 2019, 2022 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
@@ -24,19 +24,35 @@
default_setup_noexit "$DISKS"
log_onexit default_cleanup_noexit
-BLOCKSIZE=8192
+
+#
+# Randomly pick a device to remove
+#
+DISK_TOKENS=( $DISKS )
+DISK_INDEX_TO_REMOVE=$((RANDOM%${#DISK_TOKENS[@]}))
+DISK_TO_REMOVE=${DISK_TOKENS[${DISK_INDEX_TO_REMOVE}]}
origin="$TESTPOOL/$TESTFS"
log_must zfs set compress=on $origin
log_must zfs set checksum=skein $origin
+log_must zfs set copies=1 $origin
log_must zfs set recordsize=8k $origin
dd if=/dev/urandom of=$TESTDIR/file_8k bs=1024k count=$MEGS oflag=sync \
conv=notrunc >/dev/null 2>&1 || log_fail "dd into $TESTDIR/file failed."
+log_must zfs set copies=3 $origin
+dd if=/dev/urandom of=$TESTDIR/file_8k_copies bs=1024k count=$MEGS oflag=sync \
+ conv=notrunc >/dev/null 2>&1 || log_fail "dd into $TESTDIR/file failed."
+
+log_must zfs set copies=1 $origin
log_must zfs set recordsize=128k $origin
dd if=/dev/urandom of=$TESTDIR/file_128k bs=1024k count=$MEGS oflag=sync \
conv=notrunc >/dev/null 2>&1 || log_fail "dd into $TESTDIR/file failed."
+log_must zfs set copies=3 $origin
+dd if=/dev/urandom of=$TESTDIR/file_128k_copies bs=1024k \
+ count=$MEGS oflag=sync conv=notrunc >/dev/null 2>&1 || \
+ log_fail "dd into $TESTDIR/file failed."
zfs snapshot $origin@a || log_fail "zfs snap failed"
log_must zfs clone $origin@a $origin/clone
@@ -44,22 +60,33 @@ log_must zfs clone $origin@a $origin/clone
#
# Verify that nopwrites work prior to removal
#
+log_must zfs set copies=1 $origin/clone
log_must zfs set recordsize=8k $origin/clone
dd if=/$TESTDIR/file_8k of=/$TESTDIR/clone/file_8k bs=1024k \
oflag=sync conv=notrunc >/dev/null 2>&1 || log_fail "dd failed."
log_must verify_nopwrite $origin $origin@a $origin/clone
+log_must zfs set copies=3 $origin/clone
+dd if=/$TESTDIR/file_8k_copies of=/$TESTDIR/clone/file_8k_copies bs=1024k \
+ oflag=sync conv=notrunc >/dev/null 2>&1 || log_fail "dd failed."
+log_must verify_nopwrite $origin $origin@a $origin/clone
+log_must zfs set copies=1 $origin/clone
log_must zfs set recordsize=128k $origin/clone
dd if=/$TESTDIR/file_128k of=/$TESTDIR/clone/file_128k bs=1024k \
oflag=sync conv=notrunc >/dev/null 2>&1 || log_fail "dd failed."
log_must verify_nopwrite $origin $origin@a $origin/clone
+log_must zfs set copies=3 $origin/clone
+dd if=/$TESTDIR/file_128k_copies of=/$TESTDIR/clone/file_128k_copies bs=1024k \
+ oflag=sync conv=notrunc >/dev/null 2>&1 || log_fail "dd failed."
+log_must verify_nopwrite $origin $origin@a $origin/clone
#
# Remove a device before testing nopwrites again
#
-log_must zpool remove $TESTPOOL $REMOVEDISK
+log_note "Removing: $DISK_TO_REMOVE"
+log_must zpool remove $TESTPOOL $DISK_TO_REMOVE
log_must wait_for_removal $TESTPOOL
-log_mustnot vdevs_in_pool $TESTPOOL $REMOVEDISK
+log_mustnot vdevs_in_pool $TESTPOOL $DISK_TO_REMOVE
#
# Normally, we expect nopwrites to avoid allocating new blocks, but
@@ -71,17 +98,27 @@ log_mustnot vdevs_in_pool $TESTPOOL $REMOVEDISK
#
# Perform a direct zil nopwrite test
#
+log_must zfs set copies=1 $origin/clone
log_must zfs set recordsize=8k $origin/clone
dd if=/$TESTDIR/file_8k of=/$TESTDIR/clone/file_8k bs=1024k \
oflag=sync conv=notrunc >/dev/null 2>&1 || log_fail "dd failed."
log_mustnot verify_nopwrite $origin $origin@a $origin/clone
+log_must zfs set copies=3 $origin/clone
+dd if=/$TESTDIR/file_8k_copies of=/$TESTDIR/clone/file_8k_copies bs=1024k \
+ oflag=sync conv=notrunc >/dev/null 2>&1 || log_fail "dd failed."
+log_mustnot verify_nopwrite $origin $origin@a $origin/clone
#
# Perform an indirect zil nopwrite test
#
+log_must zfs set copies=1 $origin/clone
log_must zfs set recordsize=128k $origin/clone
dd if=/$TESTDIR/file_128k of=/$TESTDIR/clone/file_128k bs=1024k \
oflag=sync conv=notrunc >/dev/null 2>&1 || log_fail "dd failed."
log_mustnot verify_nopwrite $origin $origin@a $origin/clone
+log_must zfs set copies=3 $origin/clone
+dd if=/$TESTDIR/file_128k_copies of=/$TESTDIR/clone/file_128k_copies bs=1024k \
+ oflag=sync conv=notrunc >/dev/null 2>&1 || log_fail "dd failed."
+log_mustnot verify_nopwrite $origin $origin@a $origin/clone
log_pass "Remove works with nopwrite."
diff --git a/tests/zfs-tests/tests/functional/removal/removal_with_indirect.ksh b/tests/zfs-tests/tests/functional/removal/removal_with_indirect.ksh
new file mode 100755
index 000000000000..2a7878f4a2d5
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/removal/removal_with_indirect.ksh
@@ -0,0 +1,57 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2014, 2018 by Delphix. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/removal/removal.kshlib
+
+TMPDIR=${TMPDIR:-$TEST_BASE_DIR}
+
+DISK1="$TMPDIR/dsk1"
+DISK2="$TMPDIR/dsk2"
+DISK3="$TMPDIR/dsk3"
+DISK4="$TMPDIR/dsk4"
+DISKS="$DISK1 $DISK2 $DISK3 $DISK4"
+
+log_must mkfile $(($MINVDEVSIZE * 2)) $DISK1
+log_must mkfile $(($MINVDEVSIZE * 2)) $DISK2
+log_must mkfile $(($MINVDEVSIZE * 2)) $DISK3
+log_must mkfile $(($MINVDEVSIZE * 2)) $DISK4
+
+function cleanup
+{
+ default_cleanup_noexit
+ log_must rm -f $DISKS
+}
+
+# Build a zpool with 2 mirror vdevs
+log_must default_setup_noexit "mirror $DISK1 $DISK2 mirror $DISK3 $DISK4"
+log_onexit cleanup
+
+# Remove one of the mirrors
+log_must zpool remove $TESTPOOL mirror-1
+log_must wait_for_removal $TESTPOOL
+
+# Attempt to add a single-device vdev, shouldn't work
+log_mustnot zpool add $TESTPOOL $DISK3
+
+# Force it, should work
+log_must zpool add -f $TESTPOOL $DISK3
+
+log_pass "Prevented from adding a non-mirror vdev on a mirrored zpool w/ indirect vdevs"
diff --git a/tests/zfs-tests/tests/functional/removal/remove_mirror.ksh b/tests/zfs-tests/tests/functional/removal/remove_mirror.ksh
index 06335b70360a..a62479f2a1e4 100755
--- a/tests/zfs-tests/tests/functional/removal/remove_mirror.ksh
+++ b/tests/zfs-tests/tests/functional/removal/remove_mirror.ksh
@@ -49,7 +49,8 @@ log_mustnot zpool remove $TESTPOOL $DISK2
log_must wait_for_removal $TESTPOOL
# Add back the first disk.
-log_must zpool add $TESTPOOL $DISK1
+# We use -f as we're adding a single vdev to zpool with only mirrors.
+log_must zpool add -f $TESTPOOL $DISK1
# Now attempt to remove the mirror.
log_must zpool remove $TESTPOOL mirror-1
diff --git a/tests/zfs-tests/tests/functional/rename_dirs/cleanup.ksh b/tests/zfs-tests/tests/functional/rename_dirs/cleanup.ksh
index 3166bd6ec16e..42fe70042d6a 100755
--- a/tests/zfs-tests/tests/functional/rename_dirs/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/rename_dirs/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rename_dirs/rename_dirs_001_pos.ksh b/tests/zfs-tests/tests/functional/rename_dirs/rename_dirs_001_pos.ksh
index 938a7d391ab5..10e4be0e2581 100755
--- a/tests/zfs-tests/tests/functional/rename_dirs/rename_dirs_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/rename_dirs/rename_dirs_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rename_dirs/setup.ksh b/tests/zfs-tests/tests/functional/rename_dirs/setup.ksh
index fc5cec3063a6..b756d4e76c83 100755
--- a/tests/zfs-tests/tests/functional/rename_dirs/setup.ksh
+++ b/tests/zfs-tests/tests/functional/rename_dirs/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/raidz/raidz_004_pos.ksh b/tests/zfs-tests/tests/functional/renameat2/cleanup.ksh
index 6cd2bf7c9f60..42fe70042d6a 100755
--- a/tests/zfs-tests/tests/functional/raidz/raidz_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/renameat2/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -21,21 +21,14 @@
#
#
-# Copyright (c) 2020 by vStack. All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
#
-. $STF_SUITE/include/libtest.shlib
-
#
-# DESCRIPTION:
-# Call the raidz_test tool with -S and -e to test all supported raidz
-# implementations with expanded map and zero reflow offset.
-# This options will test several raidz block geometries and several zio
-# parameters that affect raidz block layout. Data reconstruction performs
-# all combinations of failed disks. Wall time is set to 5min, but actual
-# runtime might be longer.
+# Copyright (c) 2013 by Delphix. All rights reserved.
#
-log_must raidz_test -S -e -r 0 -t 60
+. $STF_SUITE/include/libtest.shlib
-log_pass "raidz_test parameter sweep test with expanded map succeeded."
+default_cleanup
diff --git a/tests/zfs-tests/tests/functional/renameat2/renameat2_exchange.ksh b/tests/zfs-tests/tests/functional/renameat2/renameat2_exchange.ksh
new file mode 100755
index 000000000000..b9d5d6498bc5
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/renameat2/renameat2_exchange.ksh
@@ -0,0 +1,61 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (C) 2019 Aleksa Sarai <cyphar@cyphar.com>
+# Copyright (C) 2019 SUSE LLC
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+verify_runnable "both"
+
+function cleanup
+{
+ log_must rm -rf $TESTDIR/*
+}
+
+log_assert "ZFS supports RENAME_EXCHANGE."
+log_onexit cleanup
+
+cd $TESTDIR
+echo "foo" > foo
+echo "bar" > bar
+
+# Self-exchange is a no-op.
+log_must renameat2 -x foo foo
+log_must grep '^foo$' foo
+
+# Basic exchange.
+log_must renameat2 -x foo bar
+log_must grep '^bar$' foo
+log_must grep '^foo$' bar
+
+# And exchange back.
+log_must renameat2 -x foo bar
+log_must grep '^foo$' foo
+log_must grep '^bar$' bar
+
+# Exchange with a bad path should fail.
+log_mustnot renameat2 -x bar baz
+
+log_pass "ZFS supports RENAME_EXCHANGE as expected."
diff --git a/tests/zfs-tests/tests/functional/renameat2/renameat2_noreplace.ksh b/tests/zfs-tests/tests/functional/renameat2/renameat2_noreplace.ksh
new file mode 100755
index 000000000000..c8ce12b1ca82
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/renameat2/renameat2_noreplace.ksh
@@ -0,0 +1,51 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (C) 2019 Aleksa Sarai <cyphar@cyphar.com>
+# Copyright (C) 2019 SUSE LLC
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+verify_runnable "both"
+
+function cleanup
+{
+ log_must rm -rf $TESTDIR/*
+}
+
+log_assert "ZFS supports RENAME_NOREPLACE."
+log_onexit cleanup
+
+cd $TESTDIR
+touch foo bar
+
+# Clobbers should always fail.
+log_mustnot renameat2 -n foo foo
+log_mustnot renameat2 -n foo bar
+log_mustnot renameat2 -n bar foo
+
+# Regular renames should succeed.
+log_must renameat2 -n bar baz
+
+log_pass "ZFS supports RENAME_NOREPLACE as expected."
diff --git a/tests/zfs-tests/tests/functional/renameat2/renameat2_whiteout.ksh b/tests/zfs-tests/tests/functional/renameat2/renameat2_whiteout.ksh
new file mode 100755
index 000000000000..7e7a3ba5efeb
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/renameat2/renameat2_whiteout.ksh
@@ -0,0 +1,50 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (C) 2019 Aleksa Sarai <cyphar@cyphar.com>
+# Copyright (C) 2019 SUSE LLC
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+verify_runnable "both"
+
+function cleanup
+{
+ log_must rm -rf $TESTDIR/*
+}
+
+log_assert "ZFS supports RENAME_WHITEOUT."
+log_onexit cleanup
+
+cd $TESTDIR
+echo "whiteout" > whiteout
+
+# Straight-forward rename-with-whiteout.
+log_must renameat2 -w whiteout new
+# Check new file.
+log_must grep '^whiteout$' new
+# Check that the whiteout is actually a {0,0} char device.
+log_must grep '^character special file:0:0$' <<<"$(stat -c '%F:%t:%T' whiteout)"
+
+log_pass "ZFS supports RENAME_WHITEOUT as expected."
diff --git a/tests/zfs-tests/tests/functional/renameat2/setup.ksh b/tests/zfs-tests/tests/functional/renameat2/setup.ksh
new file mode 100755
index 000000000000..9b34b18cd5cd
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/renameat2/setup.ksh
@@ -0,0 +1,37 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (C) 2019 Aleksa Sarai <cyphar@cyphar.com>
+# Copyright (C) 2019 SUSE LLC
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+if ! is_linux ; then
+ log_unsupported "renameat2 is linux-only"
+elif ! renameat2 -C ; then
+ log_unsupported "renameat2 not supported on this (pre-3.15) linux kernel"
+fi
+
+DISK=${DISKS%% *}
+default_setup $DISK
diff --git a/tests/zfs-tests/tests/functional/replacement/attach_rebuild.ksh b/tests/zfs-tests/tests/functional/replacement/attach_rebuild.ksh
index 384a588064b1..8b4cb9da2d23 100755
--- a/tests/zfs-tests/tests/functional/replacement/attach_rebuild.ksh
+++ b/tests/zfs-tests/tests/functional/replacement/attach_rebuild.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/replacement/attach_resilver.ksh b/tests/zfs-tests/tests/functional/replacement/attach_resilver.ksh
index d855ad928b60..724a7865fe69 100755
--- a/tests/zfs-tests/tests/functional/replacement/attach_resilver.ksh
+++ b/tests/zfs-tests/tests/functional/replacement/attach_resilver.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/replacement/cleanup.ksh b/tests/zfs-tests/tests/functional/replacement/cleanup.ksh
index b81a372638e3..a0555aff06c2 100755
--- a/tests/zfs-tests/tests/functional/replacement/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/replacement/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/replacement/detach.ksh b/tests/zfs-tests/tests/functional/replacement/detach.ksh
index 8c8eb1e88331..c563a015ad9a 100755
--- a/tests/zfs-tests/tests/functional/replacement/detach.ksh
+++ b/tests/zfs-tests/tests/functional/replacement/detach.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/replacement/replace_rebuild.ksh b/tests/zfs-tests/tests/functional/replacement/replace_rebuild.ksh
index 19823de1240d..ea1fabdbbeb9 100755
--- a/tests/zfs-tests/tests/functional/replacement/replace_rebuild.ksh
+++ b/tests/zfs-tests/tests/functional/replacement/replace_rebuild.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/replacement/replace_resilver.ksh b/tests/zfs-tests/tests/functional/replacement/replace_resilver.ksh
index f25e8f548b72..bdca3c772584 100755
--- a/tests/zfs-tests/tests/functional/replacement/replace_resilver.ksh
+++ b/tests/zfs-tests/tests/functional/replacement/replace_resilver.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/replacement/replacement.cfg b/tests/zfs-tests/tests/functional/replacement/replacement.cfg
index 271317b1c970..9e82a4ccd502 100644
--- a/tests/zfs-tests/tests/functional/replacement/replacement.cfg
+++ b/tests/zfs-tests/tests/functional/replacement/replacement.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/replacement/setup.ksh b/tests/zfs-tests/tests/functional/replacement/setup.ksh
index b1fb6a123897..0327c20a73cc 100755
--- a/tests/zfs-tests/tests/functional/replacement/setup.ksh
+++ b/tests/zfs-tests/tests/functional/replacement/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/cleanup.ksh b/tests/zfs-tests/tests/functional/reservation/cleanup.ksh
index 3166bd6ec16e..42fe70042d6a 100755
--- a/tests/zfs-tests/tests/functional/reservation/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation.cfg b/tests/zfs-tests/tests/functional/reservation/reservation.cfg
index b4f9af938623..18d0ead30d64 100644
--- a/tests/zfs-tests/tests/functional/reservation/reservation.cfg
+++ b/tests/zfs-tests/tests/functional/reservation/reservation.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation.shlib b/tests/zfs-tests/tests/functional/reservation/reservation.shlib
index 9bac794a9784..911c3a908a17 100644
--- a/tests/zfs-tests/tests/functional/reservation/reservation.shlib
+++ b/tests/zfs-tests/tests/functional/reservation/reservation.shlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation_001_pos.ksh b/tests/zfs-tests/tests/functional/reservation/reservation_001_pos.ksh
index 4f151ef15c1d..dbe4890be86c 100755
--- a/tests/zfs-tests/tests/functional/reservation/reservation_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/reservation_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation_002_pos.ksh b/tests/zfs-tests/tests/functional/reservation/reservation_002_pos.ksh
index e0fed6389c35..eca3f5936580 100755
--- a/tests/zfs-tests/tests/functional/reservation/reservation_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/reservation_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation_003_pos.ksh b/tests/zfs-tests/tests/functional/reservation/reservation_003_pos.ksh
index ee303b53bedd..a6e701dcf381 100755
--- a/tests/zfs-tests/tests/functional/reservation/reservation_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/reservation_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation_004_pos.ksh b/tests/zfs-tests/tests/functional/reservation/reservation_004_pos.ksh
index eb606a762432..2b52cd6a07d9 100755
--- a/tests/zfs-tests/tests/functional/reservation/reservation_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/reservation_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation_005_pos.ksh b/tests/zfs-tests/tests/functional/reservation/reservation_005_pos.ksh
index 535d652dafab..e6cfa88990ac 100755
--- a/tests/zfs-tests/tests/functional/reservation/reservation_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/reservation_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation_006_pos.ksh b/tests/zfs-tests/tests/functional/reservation/reservation_006_pos.ksh
index da0d36a35d3c..ef7b554de1ef 100755
--- a/tests/zfs-tests/tests/functional/reservation/reservation_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/reservation_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation_007_pos.ksh b/tests/zfs-tests/tests/functional/reservation/reservation_007_pos.ksh
index a1fffd362427..d3db1c7cfbeb 100755
--- a/tests/zfs-tests/tests/functional/reservation/reservation_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/reservation_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation_008_pos.ksh b/tests/zfs-tests/tests/functional/reservation/reservation_008_pos.ksh
index cfc30f47421b..2c7c0c04014b 100755
--- a/tests/zfs-tests/tests/functional/reservation/reservation_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/reservation_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation_009_pos.ksh b/tests/zfs-tests/tests/functional/reservation/reservation_009_pos.ksh
index a639abf8960a..7fd19ef50b12 100755
--- a/tests/zfs-tests/tests/functional/reservation/reservation_009_pos.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/reservation_009_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation_010_pos.ksh b/tests/zfs-tests/tests/functional/reservation/reservation_010_pos.ksh
index f3a64a0bea8c..c575dc7c3156 100755
--- a/tests/zfs-tests/tests/functional/reservation/reservation_010_pos.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/reservation_010_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation_011_pos.ksh b/tests/zfs-tests/tests/functional/reservation/reservation_011_pos.ksh
index a6abe9db6a13..d3fcc24bc49d 100755
--- a/tests/zfs-tests/tests/functional/reservation/reservation_011_pos.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/reservation_011_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation_012_pos.ksh b/tests/zfs-tests/tests/functional/reservation/reservation_012_pos.ksh
index 5ab0952b1910..77bf8beb0b92 100755
--- a/tests/zfs-tests/tests/functional/reservation/reservation_012_pos.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/reservation_012_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation_013_pos.ksh b/tests/zfs-tests/tests/functional/reservation/reservation_013_pos.ksh
index 786d5d4d3008..7ef2b61e3c8b 100755
--- a/tests/zfs-tests/tests/functional/reservation/reservation_013_pos.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/reservation_013_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation_014_pos.ksh b/tests/zfs-tests/tests/functional/reservation/reservation_014_pos.ksh
index 3b7f384da365..eeefe182798a 100755
--- a/tests/zfs-tests/tests/functional/reservation/reservation_014_pos.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/reservation_014_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation_015_pos.ksh b/tests/zfs-tests/tests/functional/reservation/reservation_015_pos.ksh
index 7067a7810590..2b9d3f98694b 100755
--- a/tests/zfs-tests/tests/functional/reservation/reservation_015_pos.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/reservation_015_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation_016_pos.ksh b/tests/zfs-tests/tests/functional/reservation/reservation_016_pos.ksh
index 82bbcde4a3b7..84a80e34323e 100755
--- a/tests/zfs-tests/tests/functional/reservation/reservation_016_pos.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/reservation_016_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation_017_pos.ksh b/tests/zfs-tests/tests/functional/reservation/reservation_017_pos.ksh
index bb3af67d24d3..486ad397ca13 100755
--- a/tests/zfs-tests/tests/functional/reservation/reservation_017_pos.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/reservation_017_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/reservation_018_pos.ksh b/tests/zfs-tests/tests/functional/reservation/reservation_018_pos.ksh
index 1f92c8898562..717c8371ff19 100755
--- a/tests/zfs-tests/tests/functional/reservation/reservation_018_pos.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/reservation_018_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/reservation/setup.ksh b/tests/zfs-tests/tests/functional/reservation/setup.ksh
index 731aa6a30680..6b93b4a7e310 100755
--- a/tests/zfs-tests/tests/functional/reservation/setup.ksh
+++ b/tests/zfs-tests/tests/functional/reservation/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rootpool/cleanup.ksh b/tests/zfs-tests/tests/functional/rootpool/cleanup.ksh
index 8f043259fb91..c51a3f27bddc 100755
--- a/tests/zfs-tests/tests/functional/rootpool/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/rootpool/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rootpool/rootpool_002_neg.ksh b/tests/zfs-tests/tests/functional/rootpool/rootpool_002_neg.ksh
index 0d592ad33e58..c6c3bf8a52b1 100755
--- a/tests/zfs-tests/tests/functional/rootpool/rootpool_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/rootpool/rootpool_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rootpool/rootpool_003_neg.ksh b/tests/zfs-tests/tests/functional/rootpool/rootpool_003_neg.ksh
index 3bb5d12edddf..6dbbc7da39ef 100755
--- a/tests/zfs-tests/tests/functional/rootpool/rootpool_003_neg.ksh
+++ b/tests/zfs-tests/tests/functional/rootpool/rootpool_003_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rootpool/rootpool_007_pos.ksh b/tests/zfs-tests/tests/functional/rootpool/rootpool_007_pos.ksh
index e4d4268cc08e..a336e6bbb33f 100755
--- a/tests/zfs-tests/tests/functional/rootpool/rootpool_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/rootpool/rootpool_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rootpool/setup.ksh b/tests/zfs-tests/tests/functional/rootpool/setup.ksh
index d81b3dfbdd40..049bdf066aeb 100755
--- a/tests/zfs-tests/tests/functional/rootpool/setup.ksh
+++ b/tests/zfs-tests/tests/functional/rootpool/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/cleanup.ksh b/tests/zfs-tests/tests/functional/rsend/cleanup.ksh
index 063fe9dd1f61..9a6ad98b3fde 100755
--- a/tests/zfs-tests/tests/functional/rsend/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend.cfg b/tests/zfs-tests/tests/functional/rsend/rsend.cfg
index 99e87d9369ed..9e3422ecad67 100644
--- a/tests/zfs-tests/tests/functional/rsend/rsend.cfg
+++ b/tests/zfs-tests/tests/functional/rsend/rsend.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend.kshlib b/tests/zfs-tests/tests/functional/rsend/rsend.kshlib
index 06886131cf83..26e7c2cc25bc 100644
--- a/tests/zfs-tests/tests/functional/rsend/rsend.kshlib
+++ b/tests/zfs-tests/tests/functional/rsend/rsend.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_001_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_001_pos.ksh
index 3864d8a7d1bd..b73c27656437 100755
--- a/tests/zfs-tests/tests/functional/rsend/rsend_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_002_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_002_pos.ksh
index f2c1e03937e2..111d00eeb63a 100755
--- a/tests/zfs-tests/tests/functional/rsend/rsend_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_003_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_003_pos.ksh
index 2ace6737b14e..fa4479c666d9 100755
--- a/tests/zfs-tests/tests/functional/rsend/rsend_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_004_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_004_pos.ksh
index c0b36b2329e7..522662076d2c 100755
--- a/tests/zfs-tests/tests/functional/rsend/rsend_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_005_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_005_pos.ksh
index 4d156690e38a..2c1ba0c1644a 100755
--- a/tests/zfs-tests/tests/functional/rsend/rsend_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_006_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_006_pos.ksh
index 8c598f4ec29c..5216016e6b71 100755
--- a/tests/zfs-tests/tests/functional/rsend/rsend_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_007_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_007_pos.ksh
index 29e9f1859579..499caff9a71a 100755
--- a/tests/zfs-tests/tests/functional/rsend/rsend_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_008_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_008_pos.ksh
index 8e1821d88a68..fab0a7d9ec7c 100755
--- a/tests/zfs-tests/tests/functional/rsend/rsend_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_009_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_009_pos.ksh
index 5712cb513401..fc5a582f881e 100755
--- a/tests/zfs-tests/tests/functional/rsend/rsend_009_pos.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_009_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -45,13 +45,16 @@
verify_runnable "global"
+BPOOL=bpool_test
+SPOOL=spool_test
+
function cleanup
{
- if datasetexists bpool ; then
- log_must_busy zpool destroy -f bpool
+ if datasetexists $BPOOL ; then
+ log_must_busy zpool destroy -f $BPOOL
fi
- if datasetexists spool ; then
- log_must_busy zpool destroy -f spool
+ if datasetexists $SPOOL ; then
+ log_must_busy zpool destroy -f $SPOOL
fi
}
@@ -60,33 +63,33 @@ log_onexit cleanup
log_must mkfile $MINVDEVSIZE $TESTDIR/bfile
log_must mkfile $SPA_MINDEVSIZE $TESTDIR/sfile
-log_must zpool create -O compression=off bpool $TESTDIR/bfile
-log_must zpool create -O compression=off spool $TESTDIR/sfile
+log_must zpool create -O compression=off $BPOOL $TESTDIR/bfile
+log_must zpool create -O compression=off $SPOOL $TESTDIR/sfile
#
# Test out of space on sub-filesystem
#
-log_must zfs create bpool/fs
-log_must mkfile 30M /bpool/fs/file
+log_must zfs create $BPOOL/fs
+log_must mkfile 30M /$BPOOL/fs/file
-log_must zfs snapshot bpool/fs@snap
-log_must eval "zfs send -R bpool/fs@snap > $BACKDIR/fs-R"
-log_mustnot eval "zfs receive -d -F spool < $BACKDIR/fs-R"
+log_must zfs snapshot $BPOOL/fs@snap
+log_must eval "zfs send -R $BPOOL/fs@snap > $BACKDIR/fs-R"
+log_mustnot eval "zfs receive -d -F $SPOOL < $BACKDIR/fs-R"
-log_must datasetnonexists spool/fs
-log_must ismounted spool
+log_must datasetnonexists $SPOOL/fs
+log_must ismounted $SPOOL
#
# Test out of space on top filesystem
#
-log_must mv /bpool/fs/file /bpool
-log_must_busy zfs destroy -rf bpool/fs
+log_must mv /$BPOOL/fs/file /$BPOOL
+log_must_busy zfs destroy -rf $BPOOL/fs
-log_must zfs snapshot bpool@snap
-log_must eval "zfs send -R bpool@snap > $BACKDIR/bpool-R"
-log_mustnot eval "zfs receive -d -F spool < $BACKDIR/bpool-R"
+log_must zfs snapshot $BPOOL@snap
+log_must eval "zfs send -R $BPOOL@snap > $BACKDIR/bpool-R"
+log_mustnot eval "zfs receive -d -F $SPOOL < $BACKDIR/bpool-R"
-log_must datasetnonexists spool/fs
-log_must ismounted spool
+log_must datasetnonexists $SPOOL/fs
+log_must ismounted $SPOOL
log_pass "zfs receive can handle out of space correctly."
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_010_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_010_pos.ksh
index e76f5c5c8620..a9a7d53819d8 100755
--- a/tests/zfs-tests/tests/functional/rsend/rsend_010_pos.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_010_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_011_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_011_pos.ksh
index 88f79f3e921a..113ef4f6dc85 100755
--- a/tests/zfs-tests/tests/functional/rsend/rsend_011_pos.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_011_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh
index 0608598b8333..0fa40f40bed5 100755
--- a/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_013_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_013_pos.ksh
index 110e56144674..e06e0f3e5e53 100755
--- a/tests/zfs-tests/tests/functional/rsend/rsend_013_pos.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_013_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_025_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_025_pos.ksh
index 99254cccdbcb..95ec9875737e 100755
--- a/tests/zfs-tests/tests/functional/rsend/rsend_025_pos.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_025_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_026_neg.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_026_neg.ksh
index 5248008a18c5..504e5fba811d 100755
--- a/tests/zfs-tests/tests/functional/rsend/rsend_026_neg.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_026_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_027_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_027_pos.ksh
index 645685e690b4..d575ac2676bb 100755
--- a/tests/zfs-tests/tests/functional/rsend/rsend_027_pos.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_027_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_028_neg.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_028_neg.ksh
index e9186d79344f..a6a1cbfc8ee8 100755
--- a/tests/zfs-tests/tests/functional/rsend/rsend_028_neg.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_028_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_029_neg.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_029_neg.ksh
index 7c3a96b71285..28d3826cef60 100755
--- a/tests/zfs-tests/tests/functional/rsend/rsend_029_neg.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_029_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_030_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_030_pos.ksh
new file mode 100755
index 000000000000..a683f5befa3d
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_030_pos.ksh
@@ -0,0 +1,66 @@
+#!/bin/ksh -p
+
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2022 by Nutanix. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/rsend/rsend.kshlib
+
+#
+# Description:
+# Verify resumability of full ZFS send/receive on existing dataset
+#
+# Strategy:
+# 1. Start a full ZFS send with redirect output to a file
+# 2. Mess up the contents of the stream state file on disk
+# 3. Try ZFS receive, which should fail with a checksum mismatch error
+# 4. ZFS send to the stream state file again using the receive_resume_token
+# 5. Verify ZFS receive without "-F" option (force recvflag) fails.
+# 6. Verify ZFS receive with "-F" option completes successfully.
+# 7. Repeat steps on an incremental ZFS send. It should complete
+# successfully without "-F" option.
+#
+
+verify_runnable "both"
+
+sendfs=$POOL/sendfs
+recvfs=$POOL2/recvfs
+streamfs=$POOL/stream
+
+log_assert "Verify resumability of full ZFS send/receive on existing dataset"
+log_onexit resume_cleanup $sendfs $streamfs
+
+test_fs_setup $sendfs $recvfs $streamfs
+
+# Full send/recv on existing dataset
+log_must zfs create -o readonly=on $recvfs
+log_must eval "zfs send -c -v $sendfs@a >/$streamfs/1"
+mess_send_file /$streamfs/1
+log_mustnot eval "zfs recv -suvF $recvfs </$streamfs/1"
+token=$(get_prop receive_resume_token $recvfs)
+log_must eval "zfs send -t $token >/$streamfs/2"
+log_mustnot eval "zfs recv -suv $recvfs </$streamfs/2"
+log_must eval "zfs recv -suvF $recvfs </$streamfs/2"
+file_check $sendfs $recvfs
+
+# Incremental send/recv
+log_must eval "zfs send -c -v -i @a $sendfs@b >/$streamfs/3"
+mess_send_file /$streamfs/3
+log_mustnot eval "zfs recv -suvF $recvfs </$streamfs/3"
+token=$(get_prop receive_resume_token $recvfs)
+log_must eval "zfs send -t $token >/$streamfs/4"
+log_must eval "zfs recv -suv $recvfs </$streamfs/4"
+file_check $sendfs $recvfs
+
+log_pass "Verify resumability of full ZFS send/receive on existing dataset"
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_031_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_031_pos.ksh
new file mode 100755
index 000000000000..119da7150c36
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/rsend/rsend_031_pos.ksh
@@ -0,0 +1,63 @@
+#!/bin/ksh -p
+
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2023 by Delphix. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/rsend/rsend.kshlib
+
+#
+# Description:
+# Verify recursive incremental sends missing snapshots behave correctly.
+#
+# Strategy:
+# 1. Create snapshots on source filesystem.
+# 2. Recursively send snapshots.
+# 3. Delete snapshot on source filesystem
+# 4. Perform incremental recursive send.
+# 5. Verify matching snapshot lists.
+#
+
+verify_runnable "both"
+
+sendfs=$POOL/sendfs
+recvfs=$POOL2/recvfs
+
+function cleanup {
+ rm $BACKDIR/stream1
+ rm $BACKDIR/stream2
+ zfs destroy -r $sendfs
+ zfs destroy -r $recvfs
+}
+
+log_assert "Verify recursive incremental sends missing snapshots behave correctly."
+log_onexit cleanup
+
+log_must zfs create $sendfs
+log_must zfs snapshot $sendfs@A
+log_must zfs snapshot $sendfs@B
+log_must zfs snapshot $sendfs@C
+log_must eval "zfs send -Rpv $sendfs@C > $BACKDIR/stream1"
+log_must eval "zfs receive -F $recvfs < $BACKDIR/stream1"
+log_must zfs list $sendfs@C
+
+log_must zfs destroy $sendfs@C
+log_must zfs snapshot $sendfs@D
+log_must zfs snapshot $sendfs@E
+log_must eval "zfs send -Rpv -I $sendfs@A $sendfs@E > $BACKDIR/stream2"
+log_must eval "zfs receive -Fv $recvfs < $BACKDIR/stream2"
+log_must zfs list $sendfs@D
+log_must zfs list $sendfs@E
+log_mustnot zfs list $sendfs@C
+log_pass "Verify recursive incremental sends missing snapshots behave correctly."
diff --git a/tests/zfs-tests/tests/functional/rsend/send-c_volume.ksh b/tests/zfs-tests/tests/functional/rsend/send-c_volume.ksh
index 988ed91b9918..1bf234823459 100755
--- a/tests/zfs-tests/tests/functional/rsend/send-c_volume.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/send-c_volume.ksh
@@ -29,6 +29,7 @@
function cleanup
{
+ rm $BACKDIR/copy
log_must_busy zfs destroy -r $vol
cleanup_pool $POOL2
}
@@ -60,7 +61,9 @@ log_must eval "zfs recv -d $POOL2 <$BACKDIR/full"
verify_stream_size $BACKDIR/full $vol
verify_stream_size $BACKDIR/full $vol2
-md5=$(dd if=$voldev2 bs=1024k count=$megs 2>/dev/null | md5digest)
+block_device_wait $voldev2
+log_must dd if=$voldev2 of=$BACKDIR/copy bs=1024k count=$megs
+md5=$(md5digest $BACKDIR/copy)
[[ $md5 = $md5_1 ]] || log_fail "md5 mismatch: $md5 != $md5_1"
# Repeat, for an incremental send
@@ -72,7 +75,9 @@ log_must eval "zfs recv -d $POOL2 <$BACKDIR/inc"
verify_stream_size $BACKDIR/inc $vol 90 $vol@snap
verify_stream_size $BACKDIR/inc $vol2 90 $vol2@snap
-md5=$(dd skip=$megs if=$voldev2 bs=1024k count=$megs 2>/dev/null | md5digest)
+block_device_wait $voldev2
+log_must dd skip=$megs if=$voldev2 of=$BACKDIR/copy bs=1024k count=$megs
+md5=$(md5digest $BACKDIR/copy)
[[ $md5 = $md5_2 ]] || log_fail "md5 mismatch: $md5 != $md5_2"
log_pass "Verify compressed send works with volumes"
diff --git a/tests/zfs-tests/tests/functional/rsend/send-c_zstream_recompress.ksh b/tests/zfs-tests/tests/functional/rsend/send-c_zstream_recompress.ksh
new file mode 100755
index 000000000000..dd2a7d02a261
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/rsend/send-c_zstream_recompress.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2022 by Delphix. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/rsend/rsend.kshlib
+. $STF_SUITE/include/math.shlib
+
+#
+# Description:
+# Verify compression features show up in zstream dump
+#
+# Strategy:
+# 1. Create a compressed send stream
+# 2. Recompress the stream with a different algorithm
+# 3. Verify it can be received correctly
+# 4. Verify the contents match the original filesystem
+# 5. Create an uncompressed send stream
+# 6. Compress the send stream
+# 7. Verify that the stream is smaller when compressed
+#
+
+verify_runnable "both"
+
+log_assert "Verify zstream recompress correctly modifies send streams."
+log_onexit cleanup_pool $POOL2
+
+typeset sendfs=$POOL2/fs
+typeset recvfs=$POOL2/fs2
+
+log_must zfs create -o compress=lz4 $sendfs
+typeset dir=$(get_prop mountpoint $sendfs)
+write_compressible $dir 16m
+log_must zfs snapshot $sendfs@snap
+
+log_must eval "zfs send -c $sendfs@snap | zstream recompress gzip-1 | zfs recv $recvfs"
+typeset recvdir=$(get_prop mountpoint $recvfs)
+log_must diff -r $dir $recvdir
+
+log_must eval "zfs send $sendfs@snap >$BACKDIR/uncompressed"
+log_must zstream recompress gzip-1 <$BACKDIR/uncompressed >$BACKDIR/compressed
+typeset uncomp_size=$(wc -c $BACKDIR/uncompressed | awk '{print $1}')
+typeset comp_size=$(wc -c $BACKDIR/compressed | awk '{print $1}')
+[[ "$uncomp_size" -gt "$comp_size" ]] || log_fail "recompressed stream was not smaller"
+
+log_pass "zstream recompress correctly modifies send streams."
diff --git a/tests/zfs-tests/tests/functional/rsend/send_encrypted_freeobjects.ksh b/tests/zfs-tests/tests/functional/rsend/send_encrypted_freeobjects.ksh
new file mode 100755
index 000000000000..92451bd1ab6f
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/rsend/send_encrypted_freeobjects.ksh
@@ -0,0 +1,87 @@
+#!/bin/ksh
+
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2017 by Lawrence Livermore National Security, LLC.
+# Copyright (c) 2023 by Findity AB
+#
+
+. $STF_SUITE/tests/functional/rsend/rsend.kshlib
+
+#
+# Description:
+# Verify that receiving a raw encrypted stream, with a FREEOBJECTS
+# removing all existing objects in a block followed by an OBJECT write
+# to the same block, does not result in a panic.
+#
+# Strategy:
+# 1. Create a new encrypted filesystem
+# 2. Create file f1 as the first object in some block (here object 128)
+# 3. Take snapshot A
+# 4. Create file f2 as the second object in the same block (here object 129)
+# 5. Delete f1
+# 6. Take snapshot B
+# 7. Receive a full raw encrypted send of A
+# 8. Receive an incremental raw send of B
+#
+verify_runnable "both"
+
+function create_object_with_num
+{
+ file=$1
+ num=$2
+
+ tries=100
+ for ((i=0; i<$tries; i++)); do
+ touch $file
+ onum=$(ls -li $file | awk '{print $1}')
+
+ if [[ $onum -ne $num ]] ; then
+ rm -f $file
+ else
+ break
+ fi
+ done
+ if [[ $i -eq $tries ]]; then
+ log_fail "Failed to create object with number $num"
+ fi
+}
+
+log_assert "FREEOBJECTS followed by OBJECT in encrypted stream does not crash"
+
+sendds=sendencfods
+recvds=recvencfods
+keyfile=/$POOL/keyencfods
+f1=/$POOL/$sendds/f1
+f2=/$POOL/$sendds/f2
+
+log_must eval "echo 'password' > $keyfile"
+
+#
+# xattr=sa and dnodesize=legacy for sequential object numbers, see
+# note in send_freeobjects.ksh.
+#
+log_must zfs create -o xattr=sa -o dnodesize=legacy -o encryption=on \
+ -o keyformat=passphrase -o keylocation=file://$keyfile $POOL/$sendds
+
+create_object_with_num $f1 128
+log_must zfs snap $POOL/$sendds@A
+create_object_with_num $f2 129
+log_must rm $f1
+log_must zfs snap $POOL/$sendds@B
+
+log_must eval "zfs send -w $POOL/$sendds@A | zfs recv $POOL/$recvds"
+log_must eval "zfs send -w -i $POOL/$sendds@A $POOL/$sendds@B |" \
+ "zfs recv $POOL/$recvds"
+
+log_pass "FREEOBJECTS followed by OBJECT in encrypted stream did not crash"
diff --git a/tests/zfs-tests/tests/functional/rsend/send_encrypted_incremental.ksh b/tests/zfs-tests/tests/functional/rsend/send_encrypted_incremental.ksh
new file mode 100755
index 000000000000..491ad55db411
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/rsend/send_encrypted_incremental.ksh
@@ -0,0 +1,93 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/rsend/rsend.kshlib
+
+#
+# Description:
+# Incrementally receiving a snapshot to an encrypted filesystem succeeds.
+#
+# Strategy:
+# 1) Create a pool and an encrypted fs
+# 2) Create some files and snapshots
+# 3) Send the first snapshot to a second encrypted as well as an
+# unencrypted fs.
+# 4) Incrementally send the second snapshot to the unencrypted fs.
+# 5) Rollback the second encrypted fs to the first snapshot.
+# 6) Incrementally send the second snapshot from the unencrypted to the
+# second encrypted fs.
+# 7) Incrementally send the third snapshot from the first encrypted to the
+# unencrypted fs.
+# 8) Incrementally send the third snapshot from the unencrypted to the second
+# encrypted fs.
+#
+
+verify_runnable "both"
+
+log_assert "Incrementally receiving a snapshot to an encrypted filesystem succeeds"
+
+function cleanup
+{
+ destroy_pool pool_lb
+ log_must rm -f $TESTDIR/vdev_a
+}
+
+log_onexit cleanup
+
+typeset passphrase="password"
+typeset passphrase2="password2"
+
+typeset file="/pool_lb/encryptme/$TESTFILE0"
+typeset file1="/pool_lb/encryptme/$TESTFILE1"
+typeset file2="/pool_lb/encryptme/$TESTFILE2"
+
+# Create pool
+truncate -s $MINVDEVSIZE $TESTDIR/vdev_a
+log_must zpool create -f pool_lb $TESTDIR/vdev_a
+log_must eval "echo $passphrase > /pool_lb/pwd"
+log_must eval "echo $passphrase2 > /pool_lb/pwd2"
+
+log_must zfs create -o encryption=on -o keyformat=passphrase \
+ -o keylocation=file:///pool_lb/pwd pool_lb/encryptme
+log_must dd if=/dev/urandom of=$file bs=1024 count=1024
+log_must zfs snapshot pool_lb/encryptme@snap1
+log_must dd if=/dev/urandom of=$file1 bs=1024 count=1024
+log_must zfs snapshot pool_lb/encryptme@snap2
+log_must dd if=/dev/urandom of=$file2 bs=1024 count=1024
+log_must zfs snapshot pool_lb/encryptme@snap3
+log_must eval "zfs send -Lc pool_lb/encryptme@snap1 | zfs recv \
+ -o encryption=on -o keyformat=passphrase -o keylocation=file:///pool_lb/pwd2 \
+ pool_lb/encrypttwo"
+log_must eval "zfs send -Lc pool_lb/encryptme@snap1 | zfs recv \
+ pool_lb/unencryptme"
+log_must eval "zfs send -Lc -i pool_lb/encryptme@{snap1,snap2} | zfs recv \
+ pool_lb/unencryptme"
+log_must zfs rollback pool_lb/encrypttwo@snap1
+log_must eval "zfs send -Lc -i pool_lb/unencryptme@{snap1,snap2} | zfs recv \
+ pool_lb/encrypttwo"
+log_must eval "zfs send -Lc -i pool_lb/encryptme@{snap2,snap3} | zfs recv \
+ pool_lb/unencryptme"
+log_must eval "zfs send -Lc -i pool_lb/unencryptme@{snap2,snap3} | zfs recv \
+ -F pool_lb/encrypttwo"
+
+log_pass "Incrementally receiving a snapshot to an encrypted filesystem succeeds"
diff --git a/tests/zfs-tests/tests/functional/rsend/send_encrypted_props.ksh b/tests/zfs-tests/tests/functional/rsend/send_encrypted_props.ksh
index 793904db91ca..c0c7b682def9 100755
--- a/tests/zfs-tests/tests/functional/rsend/send_encrypted_props.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/send_encrypted_props.ksh
@@ -133,6 +133,14 @@ recv_cksum=$(md5digest /$ds/$TESTFILE0)
log_must test "$recv_cksum" == "$cksum"
log_must zfs destroy -r $ds
+# Test that we can override sharesmb property for encrypted raw stream.
+log_note "Must be able to override sharesmb property for encrypted raw stream"
+ds=$TESTPOOL/recv
+log_must eval "zfs send -w $esnap > $sendfile"
+log_must eval "zfs recv -o sharesmb=on $ds < $sendfile"
+log_must test "$(get_prop 'sharesmb' $ds)" == "on"
+log_must zfs destroy -r $ds
+
# Test that we can override encryption properties on a properties stream
# of an unencrypted dataset, turning it into an encryption root.
log_note "Must be able to receive stream with props as encryption root"
diff --git a/tests/zfs-tests/tests/functional/rsend/send_hole_birth.ksh b/tests/zfs-tests/tests/functional/rsend/send_hole_birth.ksh
index 1dfa97e77358..6754fb0f44bb 100755
--- a/tests/zfs-tests/tests/functional/rsend/send_hole_birth.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/send_hole_birth.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/rsend/send_raw_ashift.ksh b/tests/zfs-tests/tests/functional/rsend/send_raw_ashift.ksh
index 3cea334495d9..f238c361134f 100755
--- a/tests/zfs-tests/tests/functional/rsend/send_raw_ashift.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/send_raw_ashift.ksh
@@ -37,6 +37,10 @@ verify_runnable "both"
log_assert "Verify raw sending to pools with greater ashift succeeds"
+if is_freebsd; then
+ log_unsupported "Runs too long on FreeBSD 14 (Issue #14961)"
+fi
+
function cleanup
{
rm -f $BACKDIR/fs@*
diff --git a/tests/zfs-tests/tests/functional/rsend/send_raw_large_blocks.ksh b/tests/zfs-tests/tests/functional/rsend/send_raw_large_blocks.ksh
new file mode 100755
index 000000000000..48a76fca63e1
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/rsend/send_raw_large_blocks.ksh
@@ -0,0 +1,78 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2022, George Amanakis. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/rsend/rsend.kshlib
+
+#
+# Description:
+# Receiving a snapshot with large blocks and raw sending it succeeds.
+#
+# Strategy:
+# 1) Create a set of files each containing some file data in an
+# encrypted filesystem with recordsize=1m.
+# 2) Snapshot and send with large_blocks enabled to a new filesystem.
+# 3) Raw send to a file. If the large_blocks feature is not activated
+# in the filesystem created in (2) the raw send will fail.
+#
+
+verify_runnable "both"
+
+log_assert "Receiving and raw sending a snapshot with large blocks succeeds"
+
+backup=$TEST_BASE_DIR/backup
+raw_backup=$TEST_BASE_DIR/raw_backup
+
+function cleanup
+{
+ log_must rm -f $backup $raw_backup $ibackup $unc_backup
+ destroy_pool pool_lb
+ log_must rm -f $TESTDIR/vdev_a
+}
+
+log_onexit cleanup
+
+typeset passphrase="password"
+typeset file="/pool_lb/fs/$TESTFILE0"
+
+# Create pool
+truncate -s $MINVDEVSIZE $TESTDIR/vdev_a
+log_must zpool create -f -o feature@large_blocks=enabled pool_lb $TESTDIR/vdev_a
+
+log_must eval "echo $passphrase > /pool_lb/pwd"
+
+log_must zfs create -o recordsize=1m pool_lb/fs
+log_must dd if=/dev/urandom of=$file bs=1024 count=1024
+log_must zfs snapshot pool_lb/fs@snap1
+
+log_must eval "zfs send -L pool_lb/fs@snap1 > $backup"
+log_must eval "zfs recv -o encryption=aes-256-ccm -o keyformat=passphrase \
+ -o keylocation=file:///pool_lb/pwd -o primarycache=none \
+ -o recordsize=1m pool_lb/testfs5 < $backup"
+
+log_must eval "zfs send --raw pool_lb/testfs5@snap1 > $raw_backup"
+
+log_pass "Receiving and raw sending a snapshot with large blocks succeeds"
diff --git a/tests/zfs-tests/tests/functional/rsend/setup.ksh b/tests/zfs-tests/tests/functional/rsend/setup.ksh
index dbf4eecede88..5632df3da7f0 100755
--- a/tests/zfs-tests/tests/functional/rsend/setup.ksh
+++ b/tests/zfs-tests/tests/functional/rsend/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/scrub_mirror/cleanup.ksh b/tests/zfs-tests/tests/functional/scrub_mirror/cleanup.ksh
index 92e58996ab62..4854a318dc08 100755
--- a/tests/zfs-tests/tests/functional/scrub_mirror/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/scrub_mirror/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/scrub_mirror/default.cfg b/tests/zfs-tests/tests/functional/scrub_mirror/default.cfg
index 01c90e58f51b..9c027fd2013f 100644
--- a/tests/zfs-tests/tests/functional/scrub_mirror/default.cfg
+++ b/tests/zfs-tests/tests/functional/scrub_mirror/default.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_001_pos.ksh b/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_001_pos.ksh
index cce59737255c..a65375022c78 100755
--- a/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_002_pos.ksh b/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_002_pos.ksh
index d1fb9d2f174c..a2e32e7ca03f 100755
--- a/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_003_pos.ksh b/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_003_pos.ksh
index fa6c3c2f575f..b68e354a3fd2 100755
--- a/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_004_pos.ksh b/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_004_pos.ksh
index 3139b047bb6f..c21c226b9c0c 100755
--- a/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_common.kshlib b/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_common.kshlib
index 4e434ae0b600..72a9dbd4f1ac 100644
--- a/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_common.kshlib
+++ b/tests/zfs-tests/tests/functional/scrub_mirror/scrub_mirror_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/scrub_mirror/setup.ksh b/tests/zfs-tests/tests/functional/scrub_mirror/setup.ksh
index 94b995db53ed..0bed5df6fd7e 100755
--- a/tests/zfs-tests/tests/functional/scrub_mirror/setup.ksh
+++ b/tests/zfs-tests/tests/functional/scrub_mirror/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/simd/simd_supported.ksh b/tests/zfs-tests/tests/functional/simd/simd_supported.ksh
index 1c89824e02fd..79bacc2b8d1e 100755
--- a/tests/zfs-tests/tests/functional/simd/simd_supported.ksh
+++ b/tests/zfs-tests/tests/functional/simd/simd_supported.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/cleanup.ksh b/tests/zfs-tests/tests/functional/slog/cleanup.ksh
index 92bc4aa59d8f..53b5f4c4ab87 100755
--- a/tests/zfs-tests/tests/functional/slog/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/slog/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/setup.ksh b/tests/zfs-tests/tests/functional/slog/setup.ksh
index 4278fc69786d..02f05cc568ec 100755
--- a/tests/zfs-tests/tests/functional/slog/setup.ksh
+++ b/tests/zfs-tests/tests/functional/slog/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog.cfg b/tests/zfs-tests/tests/functional/slog/slog.cfg
index d0d25fde151e..ef32d2fb57ff 100644
--- a/tests/zfs-tests/tests/functional/slog/slog.cfg
+++ b/tests/zfs-tests/tests/functional/slog/slog.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog.kshlib b/tests/zfs-tests/tests/functional/slog/slog.kshlib
index 8bc34d0dac32..98863d6c9882 100644
--- a/tests/zfs-tests/tests/functional/slog/slog.kshlib
+++ b/tests/zfs-tests/tests/functional/slog/slog.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog_001_pos.ksh b/tests/zfs-tests/tests/functional/slog/slog_001_pos.ksh
index a4c35ed9e98e..112d0192f136 100755
--- a/tests/zfs-tests/tests/functional/slog/slog_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/slog/slog_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog_002_pos.ksh b/tests/zfs-tests/tests/functional/slog/slog_002_pos.ksh
index 91904aa612d1..17fb1f6a4841 100755
--- a/tests/zfs-tests/tests/functional/slog/slog_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/slog/slog_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog_003_pos.ksh b/tests/zfs-tests/tests/functional/slog/slog_003_pos.ksh
index 0b4d6ede3e13..678802e99ad2 100755
--- a/tests/zfs-tests/tests/functional/slog/slog_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/slog/slog_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog_004_pos.ksh b/tests/zfs-tests/tests/functional/slog/slog_004_pos.ksh
index 10f28dcc000b..7c29e2c05ce0 100755
--- a/tests/zfs-tests/tests/functional/slog/slog_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/slog/slog_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog_005_pos.ksh b/tests/zfs-tests/tests/functional/slog/slog_005_pos.ksh
index 4836f6f27937..2dad806033fc 100755
--- a/tests/zfs-tests/tests/functional/slog/slog_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/slog/slog_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog_006_pos.ksh b/tests/zfs-tests/tests/functional/slog/slog_006_pos.ksh
index 24143196fd2e..3804c3896da7 100755
--- a/tests/zfs-tests/tests/functional/slog/slog_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/slog/slog_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog_007_pos.ksh b/tests/zfs-tests/tests/functional/slog/slog_007_pos.ksh
index 27ac38606c29..ff54cd781781 100755
--- a/tests/zfs-tests/tests/functional/slog/slog_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/slog/slog_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog_008_neg.ksh b/tests/zfs-tests/tests/functional/slog/slog_008_neg.ksh
index 54587a0c61a7..8f95c6fe3cae 100755
--- a/tests/zfs-tests/tests/functional/slog/slog_008_neg.ksh
+++ b/tests/zfs-tests/tests/functional/slog/slog_008_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog_009_neg.ksh b/tests/zfs-tests/tests/functional/slog/slog_009_neg.ksh
index 222f71a99928..395706b58519 100755
--- a/tests/zfs-tests/tests/functional/slog/slog_009_neg.ksh
+++ b/tests/zfs-tests/tests/functional/slog/slog_009_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog_010_neg.ksh b/tests/zfs-tests/tests/functional/slog/slog_010_neg.ksh
index edd9abea0930..800e6cc054cf 100755
--- a/tests/zfs-tests/tests/functional/slog/slog_010_neg.ksh
+++ b/tests/zfs-tests/tests/functional/slog/slog_010_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog_011_neg.ksh b/tests/zfs-tests/tests/functional/slog/slog_011_neg.ksh
index 3bebc8201713..9953fa55d2d4 100755
--- a/tests/zfs-tests/tests/functional/slog/slog_011_neg.ksh
+++ b/tests/zfs-tests/tests/functional/slog/slog_011_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog_012_neg.ksh b/tests/zfs-tests/tests/functional/slog/slog_012_neg.ksh
index 8d6fb2bffb7f..f1434e10c357 100755
--- a/tests/zfs-tests/tests/functional/slog/slog_012_neg.ksh
+++ b/tests/zfs-tests/tests/functional/slog/slog_012_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog_013_pos.ksh b/tests/zfs-tests/tests/functional/slog/slog_013_pos.ksh
index 89b3aeb4034c..b412b310f5b2 100755
--- a/tests/zfs-tests/tests/functional/slog/slog_013_pos.ksh
+++ b/tests/zfs-tests/tests/functional/slog/slog_013_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog_014_pos.ksh b/tests/zfs-tests/tests/functional/slog/slog_014_pos.ksh
index 9d9bcf885d50..8f1502c71564 100755
--- a/tests/zfs-tests/tests/functional/slog/slog_014_pos.ksh
+++ b/tests/zfs-tests/tests/functional/slog/slog_014_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog_016_pos.ksh b/tests/zfs-tests/tests/functional/slog/slog_016_pos.ksh
index 75f78c800a7c..b69c0c58e38d 100755
--- a/tests/zfs-tests/tests/functional/slog/slog_016_pos.ksh
+++ b/tests/zfs-tests/tests/functional/slog/slog_016_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog_replay_fs_001.ksh b/tests/zfs-tests/tests/functional/slog/slog_replay_fs_001.ksh
index 0b78a9645a60..8f3585a5997f 100755
--- a/tests/zfs-tests/tests/functional/slog/slog_replay_fs_001.ksh
+++ b/tests/zfs-tests/tests/functional/slog/slog_replay_fs_001.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -175,6 +175,29 @@ log_must ln /$TESTPOOL/$TESTFS/link_and_unlink \
/$TESTPOOL/$TESTFS/link_and_unlink.link
log_must rm /$TESTPOOL/$TESTFS/link_and_unlink.link
+# We can't test RENAME_* flags without renameat2(2) support.
+if ! is_linux ; then
+ log_note "renameat2 is linux-only"
+elif ! renameat2 -C ; then
+ log_note "renameat2 not supported on this (pre-3.15) linux kernel"
+else
+ # TX_RENAME_EXCHANGE
+ log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/xchg-a bs=1k count=1
+ log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/xchg-b bs=1k count=1
+ log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/xchg-c bs=1k count=1
+ log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS/xchg-d bs=1k count=1
+ # rotate the files around
+ log_must renameat2 -x /$TESTPOOL/$TESTFS/xchg-{a,b}
+ log_must renameat2 -x /$TESTPOOL/$TESTFS/xchg-{b,c}
+ log_must renameat2 -x /$TESTPOOL/$TESTFS/xchg-{c,a}
+ # exchange same path
+ log_must renameat2 -x /$TESTPOOL/$TESTFS/xchg-{d,d}
+
+ # TX_RENAME_WHITEOUT
+ log_must mkfile 1k /$TESTPOOL/$TESTFS/whiteout
+ log_must renameat2 -w /$TESTPOOL/$TESTFS/whiteout{,-moved}
+fi
+
#
# 4. Copy TESTFS to temporary location (TESTDIR/copy)
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog_replay_fs_002.ksh b/tests/zfs-tests/tests/functional/slog/slog_replay_fs_002.ksh
index 50ccc6089322..a62d229d5057 100755
--- a/tests/zfs-tests/tests/functional/slog/slog_replay_fs_002.ksh
+++ b/tests/zfs-tests/tests/functional/slog/slog_replay_fs_002.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/slog/slog_replay_volume.ksh b/tests/zfs-tests/tests/functional/slog/slog_replay_volume.ksh
index 35cb4b696965..e99d40570c39 100755
--- a/tests/zfs-tests/tests/functional/slog/slog_replay_volume.ksh
+++ b/tests/zfs-tests/tests/functional/slog/slog_replay_volume.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/cleanup.ksh b/tests/zfs-tests/tests/functional/snapshot/cleanup.ksh
index 530a785330dc..4ff6739098a8 100755
--- a/tests/zfs-tests/tests/functional/snapshot/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/clone_001_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/clone_001_pos.ksh
index 819e263b1c5b..697f8f83aa09 100755
--- a/tests/zfs-tests/tests/functional/snapshot/clone_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/clone_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/rollback_001_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/rollback_001_pos.ksh
index 38db22fdfe17..79b00bd3c1b5 100755
--- a/tests/zfs-tests/tests/functional/snapshot/rollback_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/rollback_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/rollback_002_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/rollback_002_pos.ksh
index 571065fdd69b..842d469695e3 100755
--- a/tests/zfs-tests/tests/functional/snapshot/rollback_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/rollback_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/rollback_003_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/rollback_003_pos.ksh
index e707640acd14..3cbc6694ee0c 100755
--- a/tests/zfs-tests/tests/functional/snapshot/rollback_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/rollback_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/setup.ksh b/tests/zfs-tests/tests/functional/snapshot/setup.ksh
index a73d1aff3c53..17d09fa9c196 100755
--- a/tests/zfs-tests/tests/functional/snapshot/setup.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot.cfg b/tests/zfs-tests/tests/functional/snapshot/snapshot.cfg
index 265903fe1469..69b4f3a06fd5 100644
--- a/tests/zfs-tests/tests/functional/snapshot/snapshot.cfg
+++ b/tests/zfs-tests/tests/functional/snapshot/snapshot.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_001_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_001_pos.ksh
index 9a677b036ead..0724216ee561 100755
--- a/tests/zfs-tests/tests/functional/snapshot/snapshot_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_002_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_002_pos.ksh
index a3ed1b548210..d9e44d332e05 100755
--- a/tests/zfs-tests/tests/functional/snapshot/snapshot_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_003_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_003_pos.ksh
index a1357b1551e6..96f7dac0beec 100755
--- a/tests/zfs-tests/tests/functional/snapshot/snapshot_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_004_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_004_pos.ksh
index 683afb5e1a3f..3725de0c1ec6 100755
--- a/tests/zfs-tests/tests/functional/snapshot/snapshot_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_005_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_005_pos.ksh
index a5667badf53a..127b73143893 100755
--- a/tests/zfs-tests/tests/functional/snapshot/snapshot_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_006_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_006_pos.ksh
index 2130ff8901cd..e34a50941470 100755
--- a/tests/zfs-tests/tests/functional/snapshot/snapshot_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_007_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_007_pos.ksh
index bcca2a04a7c4..3f7029f581e7 100755
--- a/tests/zfs-tests/tests/functional/snapshot/snapshot_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_008_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_008_pos.ksh
index 560e846cee9d..299424fc9573 100755
--- a/tests/zfs-tests/tests/functional/snapshot/snapshot_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_009_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_009_pos.ksh
index 1ee7e33c2ac2..ccc0857b077b 100755
--- a/tests/zfs-tests/tests/functional/snapshot/snapshot_009_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_009_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_010_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_010_pos.ksh
index 128b443c6fc9..4aca2854a7d9 100755
--- a/tests/zfs-tests/tests/functional/snapshot/snapshot_010_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_010_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_011_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_011_pos.ksh
index 7fa7aec22d6f..2d5f63b6237c 100755
--- a/tests/zfs-tests/tests/functional/snapshot/snapshot_011_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_011_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_012_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_012_pos.ksh
index 92db9b53a7b8..d2671787975b 100755
--- a/tests/zfs-tests/tests/functional/snapshot/snapshot_012_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_012_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_013_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_013_pos.ksh
index 27408222c80e..a071759beca6 100755
--- a/tests/zfs-tests/tests/functional/snapshot/snapshot_013_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_013_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_014_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_014_pos.ksh
index 55188960b7e3..9c7e64ab6cf0 100755
--- a/tests/zfs-tests/tests/functional/snapshot/snapshot_014_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_014_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_015_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_015_pos.ksh
index 5a4d2ccaf62e..4fdbfce55063 100755
--- a/tests/zfs-tests/tests/functional/snapshot/snapshot_015_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_015_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_016_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_016_pos.ksh
index b66023cc85e6..6058ec1cfe70 100755
--- a/tests/zfs-tests/tests/functional/snapshot/snapshot_016_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_016_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_017_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_017_pos.ksh
index 6e5b8973cf4f..dc234636ec6a 100755
--- a/tests/zfs-tests/tests/functional/snapshot/snapshot_017_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_017_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_018_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_018_pos.ksh
new file mode 100755
index 000000000000..e9a2fbe5c595
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_018_pos.ksh
@@ -0,0 +1,127 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2022 iXsystems, Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/snapshot/snapshot.cfg
+
+#
+# DESCRIPTION:
+# Verify the functionality of snapshots_changed property
+#
+# STRATEGY:
+# 1. Create a pool
+# 2. Verify snapshots_changed property is NULL
+# 3. Create a filesystem
+# 4. Verify snapshots_changed property is NULL
+# 5. Create snapshots for all filesystems
+# 6. Verify snapshots_changed property shows correct time
+# 7. Unmount all filesystems
+# 8. Create a snapshot while unmounted
+# 9. Verify snapshots_changed
+# 10. Mount the filsystems
+# 11. Verify snapshots_changed
+# 12. Destroy the snapshots
+# 13. Verify snapshots_changed
+#
+
+function cleanup
+{
+ create_pool $TESTPOOL $DISKS
+}
+
+verify_runnable "both"
+
+log_assert "Verify snapshots_changed property"
+
+log_onexit cleanup
+
+snap_testpool="$TESTPOOL@v1"
+snap_testfsv1="$TESTPOOL/$TESTFS@v1"
+snap_testfsv2="$TESTPOOL/$TESTFS@v2"
+snapdir=".zfs/snapshot"
+
+# Create filesystems and check snapshots_changed is NULL
+create_pool $TESTPOOL $DISKS
+snap_changed_testpool=$(zfs get -H -o value -p snapshots_changed $TESTPOOL)
+log_must eval "[[ $snap_changed_testpool == - ]]"
+tpool_snapdir=$(get_prop mountpoint $TESTPOOL)/$snapdir
+log_must eval "[[ $(stat_mtime $tpool_snapdir) == 0 ]]"
+
+log_must zfs create $TESTPOOL/$TESTFS
+snap_changed_testfs=$(zfs get -H -o value -p snapshots_changed $TESTPOOL/$TESTFS)
+log_must eval "[[ $snap_changed_testfs == - ]]"
+tfs_snapdir=$(get_prop mountpoint $TESTPOOL/$TESTFS)/$snapdir
+log_must eval "[[ $(stat_mtime $tfs_snapdir) == 0 ]]"
+
+# Create snapshots for filesystems and check snapshots_changed reports correct time
+curr_time=$(date '+%s')
+log_must zfs snapshot $snap_testpool
+snap_changed_testpool=$(zfs get -H -o value -p snapshots_changed $TESTPOOL)
+log_must eval "[[ $snap_changed_testpool -ge $curr_time ]]"
+log_must eval "[[ $(stat_mtime $tpool_snapdir) == $snap_changed_testpool ]]"
+
+curr_time=$(date '+%s')
+log_must zfs snapshot $snap_testfsv1
+snap_changed_testfs=$(zfs get -H -o value -p snapshots_changed $TESTPOOL/$TESTFS)
+log_must eval "[[ $snap_changed_testfs -ge $curr_time ]]"
+log_must eval "[[ $(stat_mtime $tfs_snapdir) == $snap_changed_testfs ]]"
+
+# Unmount the filesystems and check snapshots_changed has correct value after unmount
+log_must zfs unmount $TESTPOOL/$TESTFS
+log_must eval "[[ $(zfs get -H -o value -p snapshots_changed $TESTPOOL/$TESTFS) == $snap_changed_testfs ]]"
+
+# Create snapshot while unmounted
+curr_time=$(date '+%s')
+log_must zfs snapshot $snap_testfsv2
+snap_changed_testfs=$(zfs get -H -o value -p snapshots_changed $TESTPOOL/$TESTFS)
+log_must eval "[[ $snap_changed_testfs -ge $curr_time ]]"
+
+log_must zfs unmount $TESTPOOL
+log_must eval "[[ $(zfs get -H -o value -p snapshots_changed $TESTPOOL) == $snap_changed_testpool ]]"
+
+# Mount back the filesystems and check snapshots_changed still has correct value
+log_must zfs mount $TESTPOOL
+log_must eval "[[ $(zfs get -H -o value -p snapshots_changed $TESTPOOL) == $snap_changed_testpool ]]"
+log_must eval "[[ $(stat_mtime $tpool_snapdir) == $snap_changed_testpool ]]"
+
+log_must zfs mount $TESTPOOL/$TESTFS
+log_must eval "[[ $(zfs get -H -o value -p snapshots_changed $TESTPOOL/$TESTFS) == $snap_changed_testfs ]]"
+log_must eval "[[ $(stat_mtime $tfs_snapdir) == $snap_changed_testfs ]]"
+
+# Destroy the snapshots and check snapshots_changed shows correct time
+curr_time=$(date '+%s')
+log_must zfs destroy $snap_testfsv1
+snap_changed_testfs=$(zfs get -H -o value -p snapshots_changed $TESTPOOL/$TESTFS)
+log_must eval "[[ $snap_changed_testfs -ge $curr_time ]]"
+log_must eval "[[ $(stat_mtime $tfs_snapdir) == $snap_changed_testfs ]]"
+
+curr_time=$(date '+%s')
+log_must zfs destroy $snap_testpool
+snap_changed_testpool=$(zfs get -H -o value -p snapshots_changed $TESTPOOL)
+log_must eval "[[ $snap_changed_testpool -ge $curr_time ]]"
+log_must eval "[[ $(stat_mtime $tpool_snapdir) == $snap_changed_testpool ]]"
+
+log_pass "snapshots_changed property behaves correctly"
diff --git a/tests/zfs-tests/tests/functional/snapused/cleanup.ksh b/tests/zfs-tests/tests/functional/snapused/cleanup.ksh
index 2f536ca588ed..557bfeb213dd 100755
--- a/tests/zfs-tests/tests/functional/snapused/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/snapused/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapused/setup.ksh b/tests/zfs-tests/tests/functional/snapused/setup.ksh
index dfe8696add67..c1e02d843a32 100755
--- a/tests/zfs-tests/tests/functional/snapused/setup.ksh
+++ b/tests/zfs-tests/tests/functional/snapused/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapused/snapused.kshlib b/tests/zfs-tests/tests/functional/snapused/snapused.kshlib
index d7d05bfeef1f..043f54d54fd2 100644
--- a/tests/zfs-tests/tests/functional/snapused/snapused.kshlib
+++ b/tests/zfs-tests/tests/functional/snapused/snapused.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapused/snapused_001_pos.ksh b/tests/zfs-tests/tests/functional/snapused/snapused_001_pos.ksh
index c1277f2b4e2f..6d33f32d6875 100755
--- a/tests/zfs-tests/tests/functional/snapused/snapused_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapused/snapused_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapused/snapused_002_pos.ksh b/tests/zfs-tests/tests/functional/snapused/snapused_002_pos.ksh
index a41ca1d70f19..c78e7cde39b7 100755
--- a/tests/zfs-tests/tests/functional/snapused/snapused_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapused/snapused_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapused/snapused_003_pos.ksh b/tests/zfs-tests/tests/functional/snapused/snapused_003_pos.ksh
index ff54cbaa1aec..940dc0e7bfc5 100755
--- a/tests/zfs-tests/tests/functional/snapused/snapused_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapused/snapused_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapused/snapused_004_pos.ksh b/tests/zfs-tests/tests/functional/snapused/snapused_004_pos.ksh
index 8fb8b6be5b47..d5f97168bd3c 100755
--- a/tests/zfs-tests/tests/functional/snapused/snapused_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapused/snapused_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/snapused/snapused_005_pos.ksh b/tests/zfs-tests/tests/functional/snapused/snapused_005_pos.ksh
index 9d21e1d23d87..fbf7165e7734 100755
--- a/tests/zfs-tests/tests/functional/snapused/snapused_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/snapused/snapused_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/sparse/cleanup.ksh b/tests/zfs-tests/tests/functional/sparse/cleanup.ksh
index 3166bd6ec16e..42fe70042d6a 100755
--- a/tests/zfs-tests/tests/functional/sparse/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/sparse/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/sparse/setup.ksh b/tests/zfs-tests/tests/functional/sparse/setup.ksh
index 3a45ec8d510d..d617f361b24d 100755
--- a/tests/zfs-tests/tests/functional/sparse/setup.ksh
+++ b/tests/zfs-tests/tests/functional/sparse/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/sparse/sparse.cfg b/tests/zfs-tests/tests/functional/sparse/sparse.cfg
index b7e403bce5f1..970dd25177ea 100644
--- a/tests/zfs-tests/tests/functional/sparse/sparse.cfg
+++ b/tests/zfs-tests/tests/functional/sparse/sparse.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/sparse/sparse_001_pos.ksh b/tests/zfs-tests/tests/functional/sparse/sparse_001_pos.ksh
index 6ad252adf325..3e25af39c08a 100755
--- a/tests/zfs-tests/tests/functional/sparse/sparse_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/sparse/sparse_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/stat/cleanup.ksh b/tests/zfs-tests/tests/functional/stat/cleanup.ksh
index 3166bd6ec16e..42fe70042d6a 100755
--- a/tests/zfs-tests/tests/functional/stat/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/stat/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/stat/setup.ksh b/tests/zfs-tests/tests/functional/stat/setup.ksh
index 4fc55cd47803..bc74ee62e075 100755
--- a/tests/zfs-tests/tests/functional/stat/setup.ksh
+++ b/tests/zfs-tests/tests/functional/stat/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/stat/stat_001_pos.ksh b/tests/zfs-tests/tests/functional/stat/stat_001_pos.ksh
index e6f9775f4b8e..e167526f4c3d 100755
--- a/tests/zfs-tests/tests/functional/stat/stat_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/stat/stat_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/suid/cleanup.ksh b/tests/zfs-tests/tests/functional/suid/cleanup.ksh
index 6e41e02faf58..b1aa351587f1 100755
--- a/tests/zfs-tests/tests/functional/suid/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/suid/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/suid/setup.ksh b/tests/zfs-tests/tests/functional/suid/setup.ksh
index d04d5568c003..96e891a5ba1d 100755
--- a/tests/zfs-tests/tests/functional/suid/setup.ksh
+++ b/tests/zfs-tests/tests/functional/suid/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/suid/suid_write_to_none.ksh b/tests/zfs-tests/tests/functional/suid/suid_write_to_none.ksh
index 907c94e3fd9c..984dda6a0208 100755
--- a/tests/zfs-tests/tests/functional/suid/suid_write_to_none.ksh
+++ b/tests/zfs-tests/tests/functional/suid/suid_write_to_none.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/suid/suid_write_to_sgid.ksh b/tests/zfs-tests/tests/functional/suid/suid_write_to_sgid.ksh
index 4554bc3c00a4..41367e0b136d 100755
--- a/tests/zfs-tests/tests/functional/suid/suid_write_to_sgid.ksh
+++ b/tests/zfs-tests/tests/functional/suid/suid_write_to_sgid.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/suid/suid_write_to_suid.ksh b/tests/zfs-tests/tests/functional/suid/suid_write_to_suid.ksh
index 541e1125d539..77d092227ab1 100755
--- a/tests/zfs-tests/tests/functional/suid/suid_write_to_suid.ksh
+++ b/tests/zfs-tests/tests/functional/suid/suid_write_to_suid.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/suid/suid_write_to_suid_sgid.ksh b/tests/zfs-tests/tests/functional/suid/suid_write_to_suid_sgid.ksh
index 57361d2e39a9..51f6775c003f 100755
--- a/tests/zfs-tests/tests/functional/suid/suid_write_to_suid_sgid.ksh
+++ b/tests/zfs-tests/tests/functional/suid/suid_write_to_suid_sgid.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/suid/suid_write_zil_replay.ksh b/tests/zfs-tests/tests/functional/suid/suid_write_zil_replay.ksh
index 8843e67da24b..1d7407000ebf 100755
--- a/tests/zfs-tests/tests/functional/suid/suid_write_zil_replay.ksh
+++ b/tests/zfs-tests/tests/functional/suid/suid_write_zil_replay.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/tmpfile/cleanup.ksh b/tests/zfs-tests/tests/functional/tmpfile/cleanup.ksh
index 3166bd6ec16e..42fe70042d6a 100755
--- a/tests/zfs-tests/tests/functional/tmpfile/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/tmpfile/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/tmpfile/setup.ksh b/tests/zfs-tests/tests/functional/tmpfile/setup.ksh
index bc00a2a22c5a..2b38556c9a78 100755
--- a/tests/zfs-tests/tests/functional/tmpfile/setup.ksh
+++ b/tests/zfs-tests/tests/functional/tmpfile/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/tmpfile/tmpfile_002_pos.c b/tests/zfs-tests/tests/functional/tmpfile/tmpfile_002_pos.c
index 424231d112b2..906b81b4d9b3 100644
--- a/tests/zfs-tests/tests/functional/tmpfile/tmpfile_002_pos.c
+++ b/tests/zfs-tests/tests/functional/tmpfile/tmpfile_002_pos.c
@@ -46,7 +46,6 @@ main(void)
int i, fd;
char spath[1024], dpath[1024];
const char *penv[] = {"TESTDIR", "TESTFILE0"};
- struct stat sbuf;
(void) fprintf(stdout, "Verify O_TMPFILE file can be linked.\n");
@@ -73,12 +72,10 @@ main(void)
run("export");
run("import");
- if (stat(dpath, &sbuf) < 0) {
- perror("stat");
- unlink(dpath);
+ if (unlink(dpath) == -1) {
+ perror("unlink");
exit(5);
}
- unlink(dpath);
return (0);
}
diff --git a/tests/zfs-tests/tests/functional/tmpfile/tmpfile_stat_mode.c b/tests/zfs-tests/tests/functional/tmpfile/tmpfile_stat_mode.c
index 893d2639ae64..8f936d36de1f 100644
--- a/tests/zfs-tests/tests/functional/tmpfile/tmpfile_stat_mode.c
+++ b/tests/zfs-tests/tests/functional/tmpfile/tmpfile_stat_mode.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
@@ -37,18 +37,18 @@
/*
* DESCRIPTION:
- * Verify stat(2) for O_TMPFILE file considers umask.
+ * Verify fstat(2) for O_TMPFILE file considers umask.
*
* STRATEGY:
* 1. open(2) with O_TMPFILE.
* 2. linkat(2).
- * 3. fstat(2)/stat(2) and verify .st_mode value.
+ * 3. fstat(2) and verify .st_mode value.
*/
static void
test_stat_mode(mode_t mask)
{
- struct stat st, fst;
+ struct stat fst;
int i, fd;
char spath[1024], dpath[1024];
const char *penv[] = {"TESTDIR", "TESTFILE0"};
@@ -68,7 +68,7 @@ test_stat_mode(mode_t mask)
err(2, "open(%s)", penv[0]);
if (fstat(fd, &fst) == -1)
- err(3, "open");
+ err(3, "fstat(%s)", penv[0]);
snprintf(spath, sizeof (spath), "/proc/self/fd/%d", fd);
snprintf(dpath, sizeof (dpath), "%s/%s", penv[0], penv[1]);
@@ -78,19 +78,23 @@ test_stat_mode(mode_t mask)
err(4, "linkat");
close(fd);
- if (stat(dpath, &st) == -1)
- err(5, "stat");
- unlink(dpath);
-
- /* Verify fstat(2) result */
+ /* Verify fstat(2) result at old path */
mode = fst.st_mode & 0777;
if (mode != masked)
- errx(6, "fstat(2) %o != %o\n", mode, masked);
+ errx(5, "fstat(2) %o != %o\n", mode, masked);
+
+ fd = open(dpath, O_RDWR);
+ if (fd == -1)
+ err(6, "open(%s)", dpath);
- /* Verify stat(2) result */
- mode = st.st_mode & 0777;
+ if (fstat(fd, &fst) == -1)
+ err(7, "fstat(%s)", dpath);
+
+ /* Verify fstat(2) result at new path */
+ mode = fst.st_mode & 0777;
if (mode != masked)
- errx(7, "stat(2) %o != %o\n", mode, masked);
+ errx(8, "fstat(2) %o != %o\n", mode, masked);
+ close(fd);
}
int
diff --git a/tests/zfs-tests/tests/functional/trim/autotrim_config.ksh b/tests/zfs-tests/tests/functional/trim/autotrim_config.ksh
index 924b56935def..4dba4616e947 100755
--- a/tests/zfs-tests/tests/functional/trim/autotrim_config.ksh
+++ b/tests/zfs-tests/tests/functional/trim/autotrim_config.ksh
@@ -57,7 +57,7 @@ log_onexit cleanup
# Minimum trim size is decreased to verify all trim sizes.
typeset trim_extent_bytes_min=$(get_tunable TRIM_EXTENT_BYTES_MIN)
-log_must set_tunable64 TRIM_EXTENT_BYTES_MIN 4096
+log_must set_tunable64 TRIM_EXTENT_BYTES_MIN 512
# Reduced TRIM_TXG_BATCH to make trimming more frequent.
typeset trim_txg_batch=$(get_tunable TRIM_TXG_BATCH)
@@ -95,6 +95,7 @@ for type in "" "mirror" "raidz2" "draid"; do
# Fill the pool, verify the vdevs are no longer sparse.
file_write -o create -f /$TESTPOOL/file -b 1048576 -c $fill_mb -d R
+ sync_pool $TESTPOOL
verify_vdevs "-ge" "$VDEV_MAX_MB" $VDEVS
# Remove the file, wait for trim, verify the vdevs are now sparse.
diff --git a/tests/zfs-tests/tests/functional/trim/autotrim_integrity.ksh b/tests/zfs-tests/tests/functional/trim/autotrim_integrity.ksh
index e25390339b6c..e139809105df 100755
--- a/tests/zfs-tests/tests/functional/trim/autotrim_integrity.ksh
+++ b/tests/zfs-tests/tests/functional/trim/autotrim_integrity.ksh
@@ -54,7 +54,7 @@ log_onexit cleanup
# Minimum trim size is decreased to verify all trim sizes.
typeset trim_extent_bytes_min=$(get_tunable TRIM_EXTENT_BYTES_MIN)
-log_must set_tunable64 TRIM_EXTENT_BYTES_MIN 4096
+log_must set_tunable64 TRIM_EXTENT_BYTES_MIN 512
# Reduced TRIM_TXG_BATCH to make trimming more frequent.
typeset trim_txg_batch=$(get_tunable TRIM_TXG_BATCH)
diff --git a/tests/zfs-tests/tests/functional/trim/autotrim_trim_integrity.ksh b/tests/zfs-tests/tests/functional/trim/autotrim_trim_integrity.ksh
index ae7ad8d73dd8..53de485b1a8e 100755
--- a/tests/zfs-tests/tests/functional/trim/autotrim_trim_integrity.ksh
+++ b/tests/zfs-tests/tests/functional/trim/autotrim_trim_integrity.ksh
@@ -55,7 +55,7 @@ log_onexit cleanup
# Minimum trim size is decreased to verify all trim sizes.
typeset trim_extent_bytes_min=$(get_tunable TRIM_EXTENT_BYTES_MIN)
-log_must set_tunable64 TRIM_EXTENT_BYTES_MIN 4096
+log_must set_tunable64 TRIM_EXTENT_BYTES_MIN 512
# Reduced TRIM_TXG_BATCH to make trimming more frequent.
typeset trim_txg_batch=$(get_tunable TRIM_TXG_BATCH)
diff --git a/tests/zfs-tests/tests/functional/trim/trim.cfg b/tests/zfs-tests/tests/functional/trim/trim.cfg
index 91adb7624326..02dc77ab57e7 100644
--- a/tests/zfs-tests/tests/functional/trim/trim.cfg
+++ b/tests/zfs-tests/tests/functional/trim/trim.cfg
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/trim/trim_config.ksh b/tests/zfs-tests/tests/functional/trim/trim_config.ksh
index 9a6e19e1c042..c08b5edb5698 100755
--- a/tests/zfs-tests/tests/functional/trim/trim_config.ksh
+++ b/tests/zfs-tests/tests/functional/trim/trim_config.ksh
@@ -57,7 +57,7 @@ log_onexit cleanup
# Minimum trim size is decreased to verify all trim sizes.
typeset trim_extent_bytes_min=$(get_tunable TRIM_EXTENT_BYTES_MIN)
-log_must set_tunable64 TRIM_EXTENT_BYTES_MIN 4096
+log_must set_tunable64 TRIM_EXTENT_BYTES_MIN 512
# Reduced TRIM_TXG_BATCH to make trimming more frequent.
typeset trim_txg_batch=$(get_tunable TRIM_TXG_BATCH)
@@ -94,6 +94,7 @@ for type in "" "mirror" "raidz2" "draid"; do
# Fill the pool, verify the vdevs are no longer sparse.
file_write -o create -f /$TESTPOOL/file -b 1048576 -c $fill_mb -d R
+ sync_pool $TESTPOOL
verify_vdevs "-ge" "$VDEV_MAX_MB" $VDEVS
# Remove the file, issue trim, verify the vdevs are now sparse.
diff --git a/tests/zfs-tests/tests/functional/trim/trim_integrity.ksh b/tests/zfs-tests/tests/functional/trim/trim_integrity.ksh
index 2dff0924f7b1..c67697521ce8 100755
--- a/tests/zfs-tests/tests/functional/trim/trim_integrity.ksh
+++ b/tests/zfs-tests/tests/functional/trim/trim_integrity.ksh
@@ -54,7 +54,7 @@ log_onexit cleanup
# Minimum trim size is decreased to verify all trim sizes.
typeset trim_extent_bytes_min=$(get_tunable TRIM_EXTENT_BYTES_MIN)
-log_must set_tunable64 TRIM_EXTENT_BYTES_MIN 4096
+log_must set_tunable64 TRIM_EXTENT_BYTES_MIN 512
# Reduced TRIM_TXG_BATCH to make trimming more frequent.
typeset trim_txg_batch=$(get_tunable TRIM_TXG_BATCH)
diff --git a/tests/zfs-tests/tests/functional/trim/trim_l2arc.ksh b/tests/zfs-tests/tests/functional/trim/trim_l2arc.ksh
index 0bbd08acdd3f..a93d0b3cc803 100755
--- a/tests/zfs-tests/tests/functional/trim/trim_l2arc.ksh
+++ b/tests/zfs-tests/tests/functional/trim/trim_l2arc.ksh
@@ -67,7 +67,7 @@ typeset VDEV_MIN_MB=$((MINVDEVSIZE * 0.30 / 1024 / 1024))
log_must zpool create -f $TESTPOOL $TRIM_VDEV1 cache $TRIM_VDEV2
verify_vdevs "-le" "$VDEV_MIN_MB" $TRIM_VDEV2
-typeset fill_mb=$(( floor(2 * MINVDEVSIZE) ))
+typeset fill_mb=$(( floor(3 * MINVDEVSIZE) ))
export DIRECTORY=/$TESTPOOL
export NUMJOBS=1
export FILE_SIZE=${fill_mb}
diff --git a/tests/zfs-tests/tests/functional/truncate/cleanup.ksh b/tests/zfs-tests/tests/functional/truncate/cleanup.ksh
index 9756c0fab805..68b56287ed2b 100755
--- a/tests/zfs-tests/tests/functional/truncate/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/truncate/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/truncate/setup.ksh b/tests/zfs-tests/tests/functional/truncate/setup.ksh
index 863492db531d..570c94570ef9 100755
--- a/tests/zfs-tests/tests/functional/truncate/setup.ksh
+++ b/tests/zfs-tests/tests/functional/truncate/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/truncate/truncate.cfg b/tests/zfs-tests/tests/functional/truncate/truncate.cfg
index d852ee63abb5..aca91cda9c64 100644
--- a/tests/zfs-tests/tests/functional/truncate/truncate.cfg
+++ b/tests/zfs-tests/tests/functional/truncate/truncate.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/truncate/truncate_001_pos.ksh b/tests/zfs-tests/tests/functional/truncate/truncate_001_pos.ksh
index 1ae2d74e0d4e..19bf0343e32d 100755
--- a/tests/zfs-tests/tests/functional/truncate/truncate_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/truncate/truncate_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/truncate/truncate_002_pos.ksh b/tests/zfs-tests/tests/functional/truncate/truncate_002_pos.ksh
index cff740e5fbba..17cde7b698ba 100755
--- a/tests/zfs-tests/tests/functional/truncate/truncate_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/truncate/truncate_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/upgrade/cleanup.ksh b/tests/zfs-tests/tests/functional/upgrade/cleanup.ksh
index 1f0c9b63d9f1..5cb5fae1f1a3 100755
--- a/tests/zfs-tests/tests/functional/upgrade/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/upgrade/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/upgrade/setup.ksh b/tests/zfs-tests/tests/functional/upgrade/setup.ksh
index c25d25df6b9e..09fb2fbfe9a3 100755
--- a/tests/zfs-tests/tests/functional/upgrade/setup.ksh
+++ b/tests/zfs-tests/tests/functional/upgrade/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/upgrade/upgrade_common.kshlib b/tests/zfs-tests/tests/functional/upgrade/upgrade_common.kshlib
index 6ffd85b5b1b6..3e1886428620 100644
--- a/tests/zfs-tests/tests/functional/upgrade/upgrade_common.kshlib
+++ b/tests/zfs-tests/tests/functional/upgrade/upgrade_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/upgrade/upgrade_projectquota_001_pos.ksh b/tests/zfs-tests/tests/functional/upgrade/upgrade_projectquota_001_pos.ksh
index 88d09759bfee..2ad37e06a5f1 100755
--- a/tests/zfs-tests/tests/functional/upgrade/upgrade_projectquota_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/upgrade/upgrade_projectquota_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/upgrade/upgrade_userobj_001_pos.ksh b/tests/zfs-tests/tests/functional/upgrade/upgrade_userobj_001_pos.ksh
index b437a0cdfa3d..d4ad8df85242 100755
--- a/tests/zfs-tests/tests/functional/upgrade/upgrade_userobj_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/upgrade/upgrade_userobj_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/user_namespace/cleanup.ksh b/tests/zfs-tests/tests/functional/user_namespace/cleanup.ksh
index 61caf3910042..4895aa23ee4a 100755
--- a/tests/zfs-tests/tests/functional/user_namespace/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/user_namespace/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/user_namespace/setup.ksh b/tests/zfs-tests/tests/functional/user_namespace/setup.ksh
index 354cc9a6b17d..bf6bc8399fd1 100755
--- a/tests/zfs-tests/tests/functional/user_namespace/setup.ksh
+++ b/tests/zfs-tests/tests/functional/user_namespace/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/user_namespace/user_namespace.cfg b/tests/zfs-tests/tests/functional/user_namespace/user_namespace.cfg
index 9e55398e239c..ca94fc4a7ea0 100644
--- a/tests/zfs-tests/tests/functional/user_namespace/user_namespace.cfg
+++ b/tests/zfs-tests/tests/functional/user_namespace/user_namespace.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/user_namespace/user_namespace_001.ksh b/tests/zfs-tests/tests/functional/user_namespace/user_namespace_001.ksh
index 39aad91d0c61..d79828a36e9e 100755
--- a/tests/zfs-tests/tests/functional/user_namespace/user_namespace_001.ksh
+++ b/tests/zfs-tests/tests/functional/user_namespace/user_namespace_001.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/user_namespace/user_namespace_002.ksh b/tests/zfs-tests/tests/functional/user_namespace/user_namespace_002.ksh
index a5f76014ab85..cfc478cd3592 100755
--- a/tests/zfs-tests/tests/functional/user_namespace/user_namespace_002.ksh
+++ b/tests/zfs-tests/tests/functional/user_namespace/user_namespace_002.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -85,7 +85,7 @@ fi
list="$($NSENTER zfs list -r -H -o name | tr '\n' ' ')"
log_must test -z "$list"
log_must zfs zone $proc_ns $TESTPOOL/userns
-proc_ns_added="$ns"
+proc_ns_added="$proc_ns"
# 2. 'zfs list'
list="$($NSENTER zfs list -r -H -o name $TESTPOOL | tr '\n' ' ')"
diff --git a/tests/zfs-tests/tests/functional/user_namespace/user_namespace_003.ksh b/tests/zfs-tests/tests/functional/user_namespace/user_namespace_003.ksh
index 20a7f6677d20..6a746c6d33f6 100755
--- a/tests/zfs-tests/tests/functional/user_namespace/user_namespace_003.ksh
+++ b/tests/zfs-tests/tests/functional/user_namespace/user_namespace_003.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -88,7 +88,7 @@ list="$($NSENTER zfs list -r -H -o name | tr '\n' ' ')"
log_must test -z "$list"
log_must zfs zone $proc_ns $TESTPOOL/userns
log_must zfs zone $proc_ns $TESTPOOL/otheruserns
-proc_ns_added="$ns"
+proc_ns_added="$proc_ns"
# 2. 'zfs list'
list="$($NSENTER zfs list -r -H -o name $TESTPOOL | tr '\n' ' ')"
diff --git a/tests/zfs-tests/tests/functional/user_namespace/user_namespace_004.ksh b/tests/zfs-tests/tests/functional/user_namespace/user_namespace_004.ksh
index 6edb0413c98a..e6ad25f23f93 100755
--- a/tests/zfs-tests/tests/functional/user_namespace/user_namespace_004.ksh
+++ b/tests/zfs-tests/tests/functional/user_namespace/user_namespace_004.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -44,8 +44,6 @@ user_ns_cleanup() {
log_must zfs destroy -r "$TESTPOOL/userns"
}
-log_onexit user_ns_cleanup
-
log_assert "Check zfs zone command handling of non-namespace files"
# Pass if user namespaces are not supported.
@@ -54,6 +52,8 @@ if [ "$?" -ne "0" ]; then
log_unsupported "Failed to create user namespace"
fi
+log_onexit user_ns_cleanup
+
# Create the baseline datasets.
log_must zfs create -o zoned=on "$TESTPOOL/userns"
diff --git a/tests/zfs-tests/tests/functional/user_namespace/user_namespace_common.kshlib b/tests/zfs-tests/tests/functional/user_namespace/user_namespace_common.kshlib
index 8577294d0eaa..e9f1d7c5bd5e 100644
--- a/tests/zfs-tests/tests/functional/user_namespace/user_namespace_common.kshlib
+++ b/tests/zfs-tests/tests/functional/user_namespace/user_namespace_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/13709_reproducer.bz2 b/tests/zfs-tests/tests/functional/userquota/13709_reproducer.bz2
new file mode 100644
index 000000000000..9c3168279461
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/userquota/13709_reproducer.bz2
Binary files differ
diff --git a/tests/zfs-tests/tests/functional/userquota/cleanup.ksh b/tests/zfs-tests/tests/functional/userquota/cleanup.ksh
index 5c8229b1874f..8af203eabde5 100755
--- a/tests/zfs-tests/tests/functional/userquota/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/groupspace_001_pos.ksh b/tests/zfs-tests/tests/functional/userquota/groupspace_001_pos.ksh
index b2c48a6424c4..d6e01fa5c6ea 100755
--- a/tests/zfs-tests/tests/functional/userquota/groupspace_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/groupspace_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/groupspace_002_pos.ksh b/tests/zfs-tests/tests/functional/userquota/groupspace_002_pos.ksh
index 3e9262831229..1885986aecc7 100755
--- a/tests/zfs-tests/tests/functional/userquota/groupspace_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/groupspace_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/groupspace_003_pos.ksh b/tests/zfs-tests/tests/functional/userquota/groupspace_003_pos.ksh
index 6d7f5bad3f35..111187057b83 100755
--- a/tests/zfs-tests/tests/functional/userquota/groupspace_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/groupspace_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/setup.ksh b/tests/zfs-tests/tests/functional/userquota/setup.ksh
index 29cbbeb660d0..79507504711c 100755
--- a/tests/zfs-tests/tests/functional/userquota/setup.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/userquota.cfg b/tests/zfs-tests/tests/functional/userquota/userquota.cfg
index 893428deaf0a..75ecdc309fe8 100644
--- a/tests/zfs-tests/tests/functional/userquota/userquota.cfg
+++ b/tests/zfs-tests/tests/functional/userquota/userquota.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/userquota_001_pos.ksh b/tests/zfs-tests/tests/functional/userquota/userquota_001_pos.ksh
index dd8f6d3552bb..dcd4d5d76ded 100755
--- a/tests/zfs-tests/tests/functional/userquota/userquota_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/userquota_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/userquota_002_pos.ksh b/tests/zfs-tests/tests/functional/userquota/userquota_002_pos.ksh
index 4e13691dac43..9df0dd539a38 100755
--- a/tests/zfs-tests/tests/functional/userquota/userquota_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/userquota_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/userquota_003_pos.ksh b/tests/zfs-tests/tests/functional/userquota/userquota_003_pos.ksh
index c4ac15c0dfe4..99b99874edfa 100755
--- a/tests/zfs-tests/tests/functional/userquota/userquota_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/userquota_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/userquota_004_pos.ksh b/tests/zfs-tests/tests/functional/userquota/userquota_004_pos.ksh
index 896645f7ca0d..f7b87de2093b 100755
--- a/tests/zfs-tests/tests/functional/userquota/userquota_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/userquota_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/userquota_005_neg.ksh b/tests/zfs-tests/tests/functional/userquota/userquota_005_neg.ksh
index b8e956164f73..bcdd12021fa7 100755
--- a/tests/zfs-tests/tests/functional/userquota/userquota_005_neg.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/userquota_005_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/userquota_006_pos.ksh b/tests/zfs-tests/tests/functional/userquota/userquota_006_pos.ksh
index 1c2509c83705..422702cccbe1 100755
--- a/tests/zfs-tests/tests/functional/userquota/userquota_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/userquota_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/userquota_007_pos.ksh b/tests/zfs-tests/tests/functional/userquota/userquota_007_pos.ksh
index 61cfb4661567..ccf4035f87f8 100755
--- a/tests/zfs-tests/tests/functional/userquota/userquota_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/userquota_007_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/userquota_008_pos.ksh b/tests/zfs-tests/tests/functional/userquota/userquota_008_pos.ksh
index c9404cd2868f..368399aec50c 100755
--- a/tests/zfs-tests/tests/functional/userquota/userquota_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/userquota_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/userquota_009_pos.ksh b/tests/zfs-tests/tests/functional/userquota/userquota_009_pos.ksh
index b6f2727806c4..541a6318430a 100755
--- a/tests/zfs-tests/tests/functional/userquota/userquota_009_pos.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/userquota_009_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/userquota_010_pos.ksh b/tests/zfs-tests/tests/functional/userquota/userquota_010_pos.ksh
index 20c9c56ba5ef..e025802196f6 100755
--- a/tests/zfs-tests/tests/functional/userquota/userquota_010_pos.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/userquota_010_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/userquota_011_pos.ksh b/tests/zfs-tests/tests/functional/userquota/userquota_011_pos.ksh
index 8917b3be2865..63b4a491758a 100755
--- a/tests/zfs-tests/tests/functional/userquota/userquota_011_pos.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/userquota_011_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/userquota_012_neg.ksh b/tests/zfs-tests/tests/functional/userquota/userquota_012_neg.ksh
index 12e023134d81..b6d24f6ed75e 100755
--- a/tests/zfs-tests/tests/functional/userquota/userquota_012_neg.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/userquota_012_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/userquota_013_pos.ksh b/tests/zfs-tests/tests/functional/userquota/userquota_013_pos.ksh
index 84f2386af5b8..6938fcc5a032 100755
--- a/tests/zfs-tests/tests/functional/userquota/userquota_013_pos.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/userquota_013_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/userquota_common.kshlib b/tests/zfs-tests/tests/functional/userquota/userquota_common.kshlib
index 40f9184c5254..6599d89973f7 100644
--- a/tests/zfs-tests/tests/functional/userquota/userquota_common.kshlib
+++ b/tests/zfs-tests/tests/functional/userquota/userquota_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/userspace_001_pos.ksh b/tests/zfs-tests/tests/functional/userquota/userspace_001_pos.ksh
index 137dd68662cc..4f38744a686a 100755
--- a/tests/zfs-tests/tests/functional/userquota/userspace_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/userspace_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/userspace_002_pos.ksh b/tests/zfs-tests/tests/functional/userquota/userspace_002_pos.ksh
index 0821bd075f60..e4889e5e4ee9 100755
--- a/tests/zfs-tests/tests/functional/userquota/userspace_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/userspace_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/userspace_003_pos.ksh b/tests/zfs-tests/tests/functional/userquota/userspace_003_pos.ksh
index de7c117af3ab..1d36d515b56e 100755
--- a/tests/zfs-tests/tests/functional/userquota/userspace_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/userquota/userspace_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/userquota/userspace_encrypted_13709.ksh b/tests/zfs-tests/tests/functional/userquota/userspace_encrypted_13709.ksh
new file mode 100755
index 000000000000..9c1d847756d1
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/userquota/userspace_encrypted_13709.ksh
@@ -0,0 +1,45 @@
+#!/bin/ksh -p
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/userquota/userquota_common.kshlib
+
+#
+# DESCRIPTION:
+# Avoid allowing #11294/#13709 to recur a third time.
+#
+# So we hardcode a copy of a pool with this bug, try unlocking it,
+# and fail on error. Simple.
+
+function cleanup
+{
+ destroy_pool $POOLNAME
+ rm -f $FILEDEV
+}
+
+log_onexit cleanup
+
+FILEDEV="$TEST_BASE_DIR/userspace_13709"
+POOLNAME="testpool_13709"
+
+log_assert "ZFS should be able to unlock pools with #13709's failure mode"
+
+log_must bzcat $STF_SUITE/tests/functional/userquota/13709_reproducer.bz2 > $FILEDEV
+
+log_must zpool import -d $FILEDEV $POOLNAME
+
+echo -e 'password\npassword\n' | log_must zfs mount -al
+
+# Cleanup
+cleanup
+
+log_pass "#13709 not happening here"
diff --git a/tests/zfs-tests/tests/functional/vdev_disk/.gitignore b/tests/zfs-tests/tests/functional/vdev_disk/.gitignore
new file mode 100644
index 000000000000..27653e5924fc
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/vdev_disk/.gitignore
@@ -0,0 +1 @@
+page_alignment
diff --git a/tests/zfs-tests/tests/functional/vdev_disk/page_alignment.c b/tests/zfs-tests/tests/functional/vdev_disk/page_alignment.c
new file mode 100644
index 000000000000..5c6d28eb2c44
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/vdev_disk/page_alignment.c
@@ -0,0 +1,413 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or https://opensource.org/licenses/CDDL-1.0.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright (c) 2023, 2024, Klara Inc.
+ */
+
+#include <stdint.h>
+#include <stdio.h>
+#include <stdbool.h>
+#include <sys/param.h>
+#include <stdlib.h>
+
+/*
+ * This tests the vdev_disk page alignment check callback
+ * vdev_disk_check_pages_cb(). For now, this test includes a copy of that
+ * function from module/os/linux/zfs/vdev_disk.c. If you change it here,
+ * remember to change it there too, and add tests data here to validate the
+ * change you're making.
+ */
+
+struct page;
+
+typedef struct {
+ uint32_t bmask;
+ uint32_t npages;
+ uint32_t end;
+} vdev_disk_check_pages_t;
+
+static int
+vdev_disk_check_pages_cb(struct page *page, size_t off, size_t len, void *priv)
+{
+ (void) page;
+ vdev_disk_check_pages_t *s = priv;
+
+ /*
+ * If we didn't finish on a block size boundary last time, then there
+ * would be a gap if we tried to use this ABD as-is, so abort.
+ */
+ if (s->end != 0)
+ return (1);
+
+ /*
+ * Note if we're taking less than a full block, so we can check it
+ * above on the next call.
+ */
+ s->end = (off+len) & s->bmask;
+
+ /* All blocks after the first must start on a block size boundary. */
+ if (s->npages != 0 && (off & s->bmask) != 0)
+ return (1);
+
+ s->npages++;
+ return (0);
+}
+
+typedef struct {
+ /* test name */
+ const char *name;
+
+ /* blocks size mask */
+ uint32_t mask;
+
+ /* amount of data to take */
+ size_t size;
+
+ /* [start offset in page, len to end of page or size] */
+ size_t pages[16][2];
+} page_test_t;
+
+static const page_test_t valid_tests[] = {
+ /* 512B block tests */
+ {
+ "512B blocks, 4K single page",
+ 0x1ff, 0x1000, {
+ { 0x0, 0x1000 },
+ },
+ }, {
+ "512B blocks, 1K at start of page",
+ 0x1ff, 0x400, {
+ { 0x0, 0x1000 },
+ },
+ }, {
+ "512B blocks, 1K at end of page",
+ 0x1ff, 0x400, {
+ { 0x0c00, 0x0400 },
+ },
+ }, {
+ "512B blocks, 1K within page, 512B start offset",
+ 0x1ff, 0x400, {
+ { 0x0200, 0x0e00 },
+ },
+ }, {
+ "512B blocks, 8K across 2x4K pages",
+ 0x1ff, 0x2000, {
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ },
+ }, {
+ "512B blocks, 4K across two pages, 2K start offset",
+ 0x1ff, 0x1000, {
+ { 0x0800, 0x0800 },
+ { 0x0, 0x0800 },
+ },
+ }, {
+ "512B blocks, 16K across 5x4K pages, 512B start offset",
+ 0x1ff, 0x4000, {
+ { 0x0200, 0x0e00 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x0200 },
+ },
+ }, {
+ "512B blocks, 64K data, 8x8K compound pages",
+ 0x1ff, 0x10000, {
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ },
+ }, {
+ "512B blocks, 64K data, 9x8K compound pages, 512B start offset",
+ 0x1ff, 0x10000, {
+ { 0x0200, 0x1e00 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x0200 },
+ },
+ }, {
+ "512B blocks, 64K data, 2x16K compound pages, 8x4K pages",
+ 0x1ff, 0x10000, {
+ { 0x0, 0x8000 },
+ { 0x0, 0x8000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ },
+ }, {
+ "512B blocks, 64K data, mixed 4K/8K/16K pages",
+ 0x1ff, 0x10000, {
+ { 0x0, 0x1000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x8000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x2000 },
+ },
+ }, {
+ "512B blocks, 64K data, mixed 4K/8K/16K pages, 1K start offset",
+ 0x1ff, 0x10000, {
+ { 0x0400, 0x0c00 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x8000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x0400 },
+ },
+ },
+
+ /* 4K block tests */
+ {
+ "4K blocks, 4K single page",
+ 0xfff, 0x1000, {
+ { 0x0, 0x1000 },
+ },
+ }, {
+ "4K blocks, 1K at start of page",
+ 0xfff, 0x400, {
+ { 0x0, 0x1000 },
+ },
+ }, {
+ "4K blocks, 1K at end of page",
+ 0xfff, 0x400, {
+ { 0x0c00, 0x0400 },
+ },
+ }, {
+ "4K blocks, 1K within page, 512B start offset",
+ 0xfff, 0x400, {
+ { 0x0200, 0x0e00 },
+ },
+ }, {
+ "4K blocks, 8K across 2x4K pages",
+ 0xfff, 0x2000, {
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ },
+ }, {
+ "4K blocks, 4K across two pages, 2K start offset",
+ 0xfff, 0x1000, {
+ { 0x0800, 0x0800 },
+ { 0x0, 0x0800 },
+ },
+ }, {
+ "4K blocks, 16K across 5x4K pages, 512B start offset",
+ 0xfff, 0x4000, {
+ { 0x0200, 0x0e00 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x0200 },
+ },
+ }, {
+ "4K blocks, 64K data, 8x8K compound pages",
+ 0xfff, 0x10000, {
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ },
+ }, {
+ "4K blocks, 64K data, 9x8K compound pages, 512B start offset",
+ 0xfff, 0x10000, {
+ { 0x0200, 0x1e00 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x0200 },
+ },
+ }, {
+ "4K blocks, 64K data, 2x16K compound pages, 8x4K pages",
+ 0xfff, 0x10000, {
+ { 0x0, 0x8000 },
+ { 0x0, 0x8000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ },
+ }, {
+ "4K blocks, 64K data, mixed 4K/8K/16K pages",
+ 0xfff, 0x10000, {
+ { 0x0, 0x1000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x8000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x2000 },
+ },
+ }, {
+ "4K blocks, 64K data, mixed 4K/8K/16K pages, 1K start offset",
+ 0xfff, 0x10000, {
+ { 0x0400, 0x0c00 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x2000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x8000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x0400 },
+ },
+ },
+
+ { 0 },
+};
+
+static const page_test_t invalid_tests[] = {
+ {
+ "512B blocks, 16K data, 512 leader (gang block simulation)",
+ 0x1ff, 0x8000, {
+ { 0x0, 0x0200 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x0c00 },
+ },
+ }, {
+ "4K blocks, 32K data, 2 incompatible spans "
+ "(gang abd simulation)",
+ 0xfff, 0x8000, {
+ { 0x0800, 0x0800 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x0800 },
+ { 0x0800, 0x0800 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x1000 },
+ { 0x0, 0x0800 },
+ },
+ },
+ { 0 },
+};
+
+static bool
+run_test(const page_test_t *test, bool verbose)
+{
+ size_t rem = test->size;
+
+ vdev_disk_check_pages_t s = {
+ .bmask = 0xfff,
+ .npages = 0,
+ .end = 0,
+ };
+
+ for (int i = 0; test->pages[i][1] > 0; i++) {
+ size_t off = test->pages[i][0];
+ size_t len = test->pages[i][1];
+
+ size_t take = MIN(rem, len);
+
+ if (verbose)
+ printf(" page %d [off %lx len %lx], "
+ "rem %lx, take %lx\n",
+ i, off, len, rem, take);
+
+ if (vdev_disk_check_pages_cb(NULL, off, take, &s)) {
+ if (verbose)
+ printf(" ABORT: misalignment detected, "
+ "rem %lx\n", rem);
+ return (false);
+ }
+
+ rem -= take;
+ if (rem == 0)
+ break;
+ }
+
+ if (rem > 0) {
+ if (verbose)
+ printf(" ABORT: ran out of pages, rem %lx\n", rem);
+ return (false);
+ }
+
+ return (true);
+}
+
+static void
+run_test_set(const page_test_t *tests, bool want, int *ntests, int *npassed)
+{
+ for (const page_test_t *test = &tests[0]; test->name; test++) {
+ bool pass = (run_test(test, false) == want);
+ if (pass) {
+ printf("%s: PASS\n", test->name);
+ (*npassed)++;
+ } else {
+ printf("%s: FAIL [expected %s, got %s]\n", test->name,
+ want ? "VALID" : "INVALID",
+ want ? "INVALID" : "VALID");
+ run_test(test, true);
+ }
+ (*ntests)++;
+ }
+}
+
+int main(void) {
+ int ntests = 0, npassed = 0;
+
+ run_test_set(valid_tests, true, &ntests, &npassed);
+ run_test_set(invalid_tests, false, &ntests, &npassed);
+
+ printf("\n%d/%d tests passed\n", npassed, ntests);
+
+ return (ntests == npassed ? 0 : 1);
+}
diff --git a/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps.kshlib b/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps.kshlib
index ad5bd9e7f81b..c68a5b2c4c83 100644
--- a/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps.kshlib
+++ b/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps.kshlib
@@ -34,6 +34,10 @@ function get_top_vd_zap # dsk conf
{
get_conf_section "$1" "$2" | awk '/com.delphix:vdev_zap_top: [0-9]+/ {print $2}'
}
+function get_root_vd_zap # conf
+{
+ awk '/com.klarasystems:vdev_zap_root: [0-9]+/ {print $2}' "$1"
+}
function assert_has_sentinel # conf
{
@@ -54,6 +58,15 @@ function assert_zap_common # pool vd lvl zapobj
fi
}
+function assert_root_zap # pool conf
+{
+ typeset pool=$1
+ typeset conf=$2
+
+ root_zap=$(get_root_vd_zap $conf)
+ assert_zap_common $pool "root vdev" "root" $root_zap
+}
+
function assert_top_zap # pool vd conf
{
typeset pool=$1
diff --git a/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_001_pos.ksh b/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_001_pos.ksh
index b67cc6d973e6..bdc8dcd468ae 100755
--- a/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_001_pos.ksh
@@ -21,7 +21,7 @@
#
# Strategy:
# 1. Create a pool with one disk.
-# 2. Verify that the disk has a top and leaf ZAP in its config and the MOS.
+# 2. Verify that the disk has a root, top and leaf ZAP in its config and the MOS.
#
. $STF_SUITE/include/libtest.shlib
@@ -35,6 +35,7 @@ log_must zpool create -f $TESTPOOL $DISK
conf="$TESTDIR/vz001"
log_must eval "zdb -PC $TESTPOOL > $conf"
+assert_root_zap $TESTPOOL "$conf"
assert_top_zap $TESTPOOL $DISK "$conf"
assert_leaf_zap $TESTPOOL $DISK "$conf"
assert_has_sentinel "$conf"
diff --git a/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_002_pos.ksh b/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_002_pos.ksh
index c571973b080b..35c4f64fa463 100755
--- a/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_002_pos.ksh
@@ -36,6 +36,7 @@ conf="$TESTDIR/vz002"
log_must eval "zdb -PC $TESTPOOL > $conf"
assert_has_sentinel "$conf"
+assert_root_zap $TESTPOOL "$conf"
for DISK in $DISKS; do
assert_top_zap $TESTPOOL $DISK "$conf"
assert_leaf_zap $TESTPOOL $DISK "$conf"
diff --git a/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_003_pos.ksh b/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_003_pos.ksh
index 015729576a7d..bb6875c339c3 100755
--- a/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_003_pos.ksh
@@ -37,6 +37,7 @@ conf="$TESTDIR/vz003"
log_must eval "zdb -PC $TESTPOOL > $conf"
assert_has_sentinel "$conf"
+assert_root_zap $TESTPOOL "$conf"
assert_top_zap $TESTPOOL "type: 'mirror'" "$conf"
for DISK in $DISKS; do
assert_leaf_zap $TESTPOOL $DISK "$conf"
diff --git a/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_004_pos.ksh b/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_004_pos.ksh
index 3d0f55d5a9a7..e82e398c6d27 100755
--- a/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_004_pos.ksh
@@ -40,6 +40,7 @@ log_must zpool create -f $TESTPOOL $DISK
conf="$TESTDIR/vz004"
log_must eval "zdb -PC $TESTPOOL > $conf"
assert_has_sentinel "$conf"
+assert_root_zap $TESTPOOL "$conf"
orig_top=$(get_top_vd_zap $DISK $conf)
orig_leaf=$(get_leaf_vd_zap $DISK $conf)
assert_zap_common $TESTPOOL $DISK "top" $orig_top
diff --git a/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_005_pos.ksh b/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_005_pos.ksh
index 1d82218bf283..4b9b45e149d7 100755
--- a/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_005_pos.ksh
@@ -37,6 +37,7 @@ log_must zpool create -f $TESTPOOL $DISK
conf="$TESTDIR/vz005"
log_must eval "zdb -PC $TESTPOOL > $conf"
assert_has_sentinel "$conf"
+assert_root_zap $TESTPOOL "$conf"
orig_top=$(get_top_vd_zap $DISK $conf)
orig_leaf=$(get_leaf_vd_zap $DISK $conf)
assert_zap_common $TESTPOOL $DISK "top" $orig_top
diff --git a/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_006_pos.ksh b/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_006_pos.ksh
index ce94336c7c5d..2ac493b8b0d2 100755
--- a/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_006_pos.ksh
@@ -39,6 +39,7 @@ conf="$TESTDIR/vz006"
log_must eval "zdb -PC $TESTPOOL > $conf"
assert_has_sentinel "$conf"
+assert_root_zap $TESTPOOL "$conf"
orig_top=$(get_top_vd_zap ${DISK_ARR[1]} $conf)
assert_zap_common $TESTPOOL ${DISK_ARR[1]} "top" $orig_top
assert_leaf_zap $TESTPOOL ${DISK_ARR[1]} "$conf"
diff --git a/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_007_pos.ksh b/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_007_pos.ksh
index c7f12c633706..c7a4a62de436 100755
--- a/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/vdev_zaps/vdev_zaps_007_pos.ksh
@@ -39,6 +39,7 @@ conf="$TESTDIR/vz007"
log_must eval "zdb -PC $TESTPOOL > $conf"
assert_has_sentinel "$conf"
+assert_root_zap $TESTPOOL "$conf"
orig_top=$(get_top_vd_zap "type: 'mirror'" $conf)
orig_leaf0=$(get_leaf_vd_zap ${DISK_ARR[0]} $conf)
orig_leaf1=$(get_leaf_vd_zap ${DISK_ARR[1]} $conf)
diff --git a/tests/zfs-tests/tests/functional/write_dirs/cleanup.ksh b/tests/zfs-tests/tests/functional/write_dirs/cleanup.ksh
index aa032084cdce..760356108f58 100755
--- a/tests/zfs-tests/tests/functional/write_dirs/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/write_dirs/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/write_dirs/setup.ksh b/tests/zfs-tests/tests/functional/write_dirs/setup.ksh
index c89cb8678c6a..a74087f9f505 100755
--- a/tests/zfs-tests/tests/functional/write_dirs/setup.ksh
+++ b/tests/zfs-tests/tests/functional/write_dirs/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/write_dirs/write_dirs_001_pos.ksh b/tests/zfs-tests/tests/functional/write_dirs/write_dirs_001_pos.ksh
index f7519eb6dd3b..3b6801288593 100755
--- a/tests/zfs-tests/tests/functional/write_dirs/write_dirs_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/write_dirs/write_dirs_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/write_dirs/write_dirs_002_pos.ksh b/tests/zfs-tests/tests/functional/write_dirs/write_dirs_002_pos.ksh
index 07387017fa08..fc7dac0a6085 100755
--- a/tests/zfs-tests/tests/functional/write_dirs/write_dirs_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/write_dirs/write_dirs_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/xattr/cleanup.ksh b/tests/zfs-tests/tests/functional/xattr/cleanup.ksh
index 625718cfeac8..83837aebe473 100755
--- a/tests/zfs-tests/tests/functional/xattr/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/xattr/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/xattr/setup.ksh b/tests/zfs-tests/tests/functional/xattr/setup.ksh
index 4f0fb1abf493..e7c1f64c5f32 100755
--- a/tests/zfs-tests/tests/functional/xattr/setup.ksh
+++ b/tests/zfs-tests/tests/functional/xattr/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/xattr/xattr.cfg b/tests/zfs-tests/tests/functional/xattr/xattr.cfg
index d61fc46cb08c..9b4c0ef9ca0e 100644
--- a/tests/zfs-tests/tests/functional/xattr/xattr.cfg
+++ b/tests/zfs-tests/tests/functional/xattr/xattr.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/xattr/xattr_001_pos.ksh b/tests/zfs-tests/tests/functional/xattr/xattr_001_pos.ksh
index ffb700438528..ab61211d9fd2 100755
--- a/tests/zfs-tests/tests/functional/xattr/xattr_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/xattr/xattr_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/xattr/xattr_002_neg.ksh b/tests/zfs-tests/tests/functional/xattr/xattr_002_neg.ksh
index 4393774cb1ad..c60be2217dae 100755
--- a/tests/zfs-tests/tests/functional/xattr/xattr_002_neg.ksh
+++ b/tests/zfs-tests/tests/functional/xattr/xattr_002_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/xattr/xattr_003_neg.ksh b/tests/zfs-tests/tests/functional/xattr/xattr_003_neg.ksh
index 852bffc7a173..6c8b895f841f 100755
--- a/tests/zfs-tests/tests/functional/xattr/xattr_003_neg.ksh
+++ b/tests/zfs-tests/tests/functional/xattr/xattr_003_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/xattr/xattr_004_pos.ksh b/tests/zfs-tests/tests/functional/xattr/xattr_004_pos.ksh
index 2ed040d864c4..cd7840843971 100755
--- a/tests/zfs-tests/tests/functional/xattr/xattr_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/xattr/xattr_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/xattr/xattr_005_pos.ksh b/tests/zfs-tests/tests/functional/xattr/xattr_005_pos.ksh
index e5fbe6f18b50..80470e8735b7 100755
--- a/tests/zfs-tests/tests/functional/xattr/xattr_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/xattr/xattr_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/xattr/xattr_006_pos.ksh b/tests/zfs-tests/tests/functional/xattr/xattr_006_pos.ksh
index 56f29c88d8eb..138302d970c3 100755
--- a/tests/zfs-tests/tests/functional/xattr/xattr_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/xattr/xattr_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/xattr/xattr_007_neg.ksh b/tests/zfs-tests/tests/functional/xattr/xattr_007_neg.ksh
index 5189b627271a..3a6897312651 100755
--- a/tests/zfs-tests/tests/functional/xattr/xattr_007_neg.ksh
+++ b/tests/zfs-tests/tests/functional/xattr/xattr_007_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/xattr/xattr_008_pos.ksh b/tests/zfs-tests/tests/functional/xattr/xattr_008_pos.ksh
index 099a61010afd..bf05c681f4eb 100755
--- a/tests/zfs-tests/tests/functional/xattr/xattr_008_pos.ksh
+++ b/tests/zfs-tests/tests/functional/xattr/xattr_008_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/xattr/xattr_009_neg.ksh b/tests/zfs-tests/tests/functional/xattr/xattr_009_neg.ksh
index c9d636ecbca3..ae8cb599d9da 100755
--- a/tests/zfs-tests/tests/functional/xattr/xattr_009_neg.ksh
+++ b/tests/zfs-tests/tests/functional/xattr/xattr_009_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/xattr/xattr_010_neg.ksh b/tests/zfs-tests/tests/functional/xattr/xattr_010_neg.ksh
index 41c7054f23d7..f0bb9f6dd29a 100755
--- a/tests/zfs-tests/tests/functional/xattr/xattr_010_neg.ksh
+++ b/tests/zfs-tests/tests/functional/xattr/xattr_010_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/xattr/xattr_011_pos.ksh b/tests/zfs-tests/tests/functional/xattr/xattr_011_pos.ksh
index 7d7827e135ea..0cb2f8ac5111 100755
--- a/tests/zfs-tests/tests/functional/xattr/xattr_011_pos.ksh
+++ b/tests/zfs-tests/tests/functional/xattr/xattr_011_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/xattr/xattr_012_pos.ksh b/tests/zfs-tests/tests/functional/xattr/xattr_012_pos.ksh
index f5c0ab0c22d0..14f109b32bd5 100755
--- a/tests/zfs-tests/tests/functional/xattr/xattr_012_pos.ksh
+++ b/tests/zfs-tests/tests/functional/xattr/xattr_012_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/xattr/xattr_013_pos.ksh b/tests/zfs-tests/tests/functional/xattr/xattr_013_pos.ksh
index a5a43ff1083c..5420d1943106 100755
--- a/tests/zfs-tests/tests/functional/xattr/xattr_013_pos.ksh
+++ b/tests/zfs-tests/tests/functional/xattr/xattr_013_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/xattr/xattr_common.kshlib b/tests/zfs-tests/tests/functional/xattr/xattr_common.kshlib
index 5ff2b489024c..b50f21c13827 100644
--- a/tests/zfs-tests/tests/functional/xattr/xattr_common.kshlib
+++ b/tests/zfs-tests/tests/functional/xattr/xattr_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/xattr/xattr_compat.ksh b/tests/zfs-tests/tests/functional/xattr/xattr_compat.ksh
index 2f74ffe358b8..c153fb3813d6 100755
--- a/tests/zfs-tests/tests/functional/xattr/xattr_compat.ksh
+++ b/tests/zfs-tests/tests/functional/xattr/xattr_compat.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zap_shrink/cleanup.ksh b/tests/zfs-tests/tests/functional/zap_shrink/cleanup.ksh
new file mode 100755
index 000000000000..42fe70042d6a
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/zap_shrink/cleanup.ksh
@@ -0,0 +1,34 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 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
+
+default_cleanup
diff --git a/tests/zfs-tests/tests/functional/zap_shrink/setup.ksh b/tests/zfs-tests/tests/functional/zap_shrink/setup.ksh
new file mode 100755
index 000000000000..b756d4e76c83
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/zap_shrink/setup.ksh
@@ -0,0 +1,35 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 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
+
+DISK=${DISKS%% *}
+default_setup $DISK
diff --git a/tests/zfs-tests/tests/functional/zap_shrink/zap_shrink_001_pos.ksh b/tests/zfs-tests/tests/functional/zap_shrink/zap_shrink_001_pos.ksh
new file mode 100755
index 000000000000..4dbf579b8ac7
--- /dev/null
+++ b/tests/zfs-tests/tests/functional/zap_shrink/zap_shrink_001_pos.ksh
@@ -0,0 +1,81 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or https://opensource.org/licenses/CDDL-1.0.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2024, Klara Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+#
+# DESCRIPTION:
+# Create a large number of files in a directory. Then remove all files and
+# check that the directory zap was shrunk. Use zdb to check that the zap object
+# contains only one leaf block using zdb.
+#
+
+verify_runnable "global"
+
+DIR=largedir
+
+NR_FILES=100000
+BATCH=1000
+CWD=$PWD
+
+log_assert "Create a large number of files ($NR_FILES) in a directory. " \
+ "Make sure that the directory ZAP object was shrunk."
+
+log_must mkdir $TESTDIR/$DIR
+
+cd $TESTDIR/$DIR
+# In order to prevent arguments overflowing, create NR_FILES in BATCH at once.
+for i in $(seq $(($NR_FILES/$BATCH))); do
+ touch $(seq $((($i-1)*$BATCH+1)) $(($i*$BATCH)));
+done
+cd $CWD
+
+log_must test $NR_FILES -eq $(ls -U $TESTDIR/$DIR | wc -l)
+
+# remove all files in $DIR directory
+cd $TESTDIR/$DIR
+for i in $(seq $(($NR_FILES/$BATCH))); do
+ rm $(seq $((($i-1)*$BATCH+1)) $(($i*$BATCH)))
+done
+cd $CWD
+sync_pool $TESTPOOL
+
+log_must test 0 -eq $(ls -U $TESTDIR/$DIR | wc -l)
+
+# check whether zap_shrink works
+zapobj=$(zdb -v -O $TESTPOOL/$TESTFS $DIR)
+nleafs=$(echo "$zapobj" | grep "Leaf blocks:" | awk -F\: '{print($2);}')
+log_must test 1 -eq $nleafs
+
+log_must zpool export $TESTPOOL
+log_must zpool import $TESTPOOL
+
+# check whether zap_shrink works
+zapobj=$(zdb -v -O $TESTPOOL/$TESTFS $DIR)
+nleafs=$(echo "$zapobj" | grep "Leaf blocks:" | awk -F\: '{print($2);}')
+log_must test 1 -eq $nleafs
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol.cfg b/tests/zfs-tests/tests/functional/zvol/zvol.cfg
index fb2a0385a24c..65ad02ddb76f 100644
--- a/tests/zfs-tests/tests/functional/zvol/zvol.cfg
+++ b/tests/zfs-tests/tests/functional/zvol/zvol.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/cleanup.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/cleanup.ksh
index c9250d4e53e9..6488ad63e6f0 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/setup.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/setup.ksh
index dcdfc86d4e7b..49603d15be9c 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/setup.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/zvol_ENOSPC.cfg b/tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/zvol_ENOSPC.cfg
index 92650c5e050e..bbafacff72a8 100644
--- a/tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/zvol_ENOSPC.cfg
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/zvol_ENOSPC.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/zvol_ENOSPC_001_pos.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/zvol_ENOSPC_001_pos.ksh
index f19fa9df3bf4..47a5eb9277f4 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/zvol_ENOSPC_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_ENOSPC/zvol_ENOSPC_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_cli/cleanup.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_cli/cleanup.ksh
index 79836c2e5d18..29af4a43ff78 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_cli/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_cli/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_cli/setup.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_cli/setup.ksh
index c24933df2fbc..14da78868cc4 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_cli/setup.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_cli/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli.cfg b/tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli.cfg
index 92650c5e050e..bbafacff72a8 100644
--- a/tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli.cfg
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli_001_pos.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli_001_pos.ksh
index 847443ac0e95..1bc76517eaef 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli_002_pos.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli_002_pos.ksh
index 7b8749751b05..22152e2ae1d8 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli_003_neg.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli_003_neg.ksh
index 779a0baaa091..fa588c6b5f8d 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli_003_neg.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_cli/zvol_cli_003_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_common.shlib b/tests/zfs-tests/tests/functional/zvol/zvol_common.shlib
index c04559fe337b..29ac84d6d151 100644
--- a/tests/zfs-tests/tests/functional/zvol/zvol_common.shlib
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_common.shlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/cleanup.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/cleanup.ksh
index 7714530ff4cb..c6296275503c 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/setup.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/setup.ksh
index 6b2cc821792c..e08f058fb2d6 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/setup.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_001_neg.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_001_neg.ksh
index 25325ddda694..6a9d2d685668 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_001_neg.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_001_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_002_pos.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_002_pos.ksh
index 16ff1f5f87db..5b89eb7806b9 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_003_neg.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_003_neg.ksh
index 2b8e5099312b..c7db9ed14a5f 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_003_neg.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_003_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_004_pos.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_004_pos.ksh
index 0f8dbb1bcfff..c335b869f9bf 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_005_neg.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_005_neg.ksh
index b4a6f1248579..456008ded021 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_005_neg.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_005_neg.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_006_pos.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_006_pos.ksh
index 08726a7c37e6..62f4adf64235 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_common.kshlib b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_common.kshlib
index da8a494b4a64..93355d0b3ded 100644
--- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_common.kshlib
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_common.kshlib
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_fua.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_fua.ksh
index e44107030f3c..619d8d0e8f07 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_fua.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_fua.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -45,6 +45,15 @@ fi
if ! is_linux ; then
log_unsupported "Only linux supports dd with oflag=dsync for FUA writes"
+else
+ if [[ $(linux_version) -gt $(linux_version "6.2") ]]; then
+ log_unsupported "Disabled while issue #14872 is being worked"
+ fi
+
+ # Disabled for the CentOS 9 kernel
+ if [[ $(linux_version) -eq $(linux_version "5.14") ]]; then
+ log_unsupported "Disabled while issue #14872 is being worked"
+ fi
fi
typeset datafile1="$(mktemp zvol_misc_fua1.XXXXXX)"
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_snapdev.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_snapdev.ksh
index 9d3fb05da4b0..1fc2d2780b1c 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_snapdev.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_snapdev.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_trim.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_trim.ksh
index 2e417a0e6676..c0b191aafd45 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_trim.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_trim.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -44,6 +44,15 @@
verify_runnable "global"
if is_linux ; then
+ if [[ $(linux_version) -gt $(linux_version "6.2") ]]; then
+ log_unsupported "Disabled while issue #14872 is being worked"
+ fi
+
+ # Disabled for the CentOS 9 kernel
+ if [[ $(linux_version) -eq $(linux_version "5.14") ]]; then
+ log_unsupported "Disabled while issue #14872 is being worked"
+ fi
+
# We need '--force' here since the prior tests may leave a filesystem
# on the zvol, and blkdiscard will see that filesystem and print a
# warning unless you force it.
@@ -83,6 +92,7 @@ function do_test {
# Write to zvol
log_must dd if=$datafile1 of=$zvolpath conv=fsync
+ sync_pool
# Record how much space we've used (should be 5MB, with 128k
# of tolerance).
@@ -122,14 +132,13 @@ log_must zfs set compression=off $TESTPOOL/$TESTVOL
# Remove old data from previous tests
log_must $trimcmd $zvolpath
-
set_blk_mq 1
-log_must zpool export $TESTPOOL
+log_must_busy zpool export $TESTPOOL
log_must zpool import $TESTPOOL
do_test
set_blk_mq 0
-log_must zpool export $TESTPOOL
+log_must_busy zpool export $TESTPOOL
log_must zpool import $TESTPOOL
do_test
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_volmode.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_volmode.ksh
index af808dc30764..05287674da66 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_volmode.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_volmode.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_zil.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_zil.ksh
index a393606d0fa9..16b22150b3e8 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_zil.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_zil.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_stress/cleanup.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_stress/cleanup.ksh
index b81a372638e3..a0555aff06c2 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_stress/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_stress/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_stress/setup.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_stress/setup.ksh
index 9e70fc47b89b..2abf3411fd07 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_stress/setup.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_stress/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_stress/zvol_stress.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_stress/zvol_stress.ksh
index c1aadcac3bf5..3431d33d97d0 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_stress/zvol_stress.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_stress/zvol_stress.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
@@ -151,6 +151,7 @@ for DISK in $DISKS ; do
log_must zinject -d $DISK -f 10 -e io -T write $TESTPOOL
done
log_must dd if=/dev/zero of=$ZVOL_DEVDIR/$TESTPOOL/testvol1 bs=512 count=50
+sync_pool $TESTPOOL
log_must zinject -c all
# We should see write errors
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_swap/cleanup.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_swap/cleanup.ksh
index f1457b72199e..0befaf15ef8e 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_swap/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_swap/cleanup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_swap/setup.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_swap/setup.ksh
index 6c6ca2b3b6f8..b837211aaebd 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_swap/setup.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_swap/setup.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap.cfg b/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap.cfg
index b6501da9c5c7..b25ce80c20d5 100644
--- a/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap.cfg
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap.cfg
@@ -6,7 +6,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_001_pos.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_001_pos.ksh
index 854859aa6f1b..3f4cb928529e 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_001_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_002_pos.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_002_pos.ksh
index 6106f7ee7d33..8e4a983c7cf3 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_002_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_003_pos.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_003_pos.ksh
index 588663dba278..8a58a1f4be60 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_003_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_004_pos.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_004_pos.ksh
index 83bf465b633a..a4f24bf5b807 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_004_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_005_pos.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_005_pos.ksh
index b22bfdb16507..021c0e3c2761 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_005_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_006_pos.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_006_pos.ksh
index 5788a8643487..4a519e6b7547 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_006_pos.ksh
@@ -7,7 +7,7 @@
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
+# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
diff --git a/tests/zfs-tests/tests/perf/perf.shlib b/tests/zfs-tests/tests/perf/perf.shlib
index 27c40bd52946..5555e910d722 100644
--- a/tests/zfs-tests/tests/perf/perf.shlib
+++ b/tests/zfs-tests/tests/perf/perf.shlib
@@ -485,7 +485,6 @@ function get_system_config
printf " \"tunables\": {\n" >>$config
for tunable in \
zfs_arc_max \
- zfs_arc_meta_limit \
zfs_arc_sys_free \
zfs_dirty_data_max \
zfs_flags \
diff --git a/tests/zfs-tests/tests/perf/regression/random_readwrite.ksh b/tests/zfs-tests/tests/perf/regression/random_readwrite.ksh
index 3a358774f565..e0626c0b42f3 100755
--- a/tests/zfs-tests/tests/perf/regression/random_readwrite.ksh
+++ b/tests/zfs-tests/tests/perf/regression/random_readwrite.ksh
@@ -60,7 +60,7 @@ export TOTAL_SIZE=$(($(get_prop avail $PERFPOOL) * 3 / 2))
# Variables specific to this test for use by fio.
export PERF_NTHREADS=${PERF_NTHREADS:-'32 64'}
export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
-export PERF_IOSIZES='' # bssplit used instead
+export PERF_IOSIZES='bssplit' # bssplit used instead of fixed sizes
export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'}
# Layout the files to be used by the readwrite tests. Create as many files