]> git.proxmox.com Git - mirror_zfs.git/commitdiff
ZTS: Skip cross-fs bclone tests if FreeBSD < 14.0
authorTony Hutter <hutter2@llnl.gov>
Fri, 16 Feb 2024 16:59:56 +0000 (08:59 -0800)
committerTony Hutter <hutter2@llnl.gov>
Fri, 16 Feb 2024 17:33:26 +0000 (09:33 -0800)
Skip cross filesystem block cloning tests on FreeBSD if running
less than version 14.0.  Cross filesystem copy_file_range() was
added in FreeBSD 14.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #15901

tests/test-runner/bin/zts-report.py.in
tests/zfs-tests/include/libtest.shlib
tests/zfs-tests/tests/functional/bclone/bclone_common.kshlib
tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_cross_dataset.ksh
tests/zfs-tests/tests/functional/block_cloning/block_cloning_cross_enc_dataset.ksh

index edfdd47ee6d7cbfb221b09570a194d351e83121a..ecc50f4871526848c0eeb820f361bf6d95c8c696 100755 (executable)
@@ -138,7 +138,11 @@ 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'
-cfr_cross_reason = 'copy_file_range(2) cross-filesystem needs kernel 5.3+'
+
+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
@@ -268,6 +272,22 @@ if sys.platform.startswith('freebsd'):
         '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({
index b4d2b91dd47662364e85c2b62005046e4bf03b74..dfab48d2cdafe3589c77ff86781e69b7455d4d73 100644 (file)
@@ -61,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"
 
@@ -83,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
index beba01c0ed26eb2339b3cb874ba1706e8ea0e5b1..3b8eaea5bb5459e7a6e9c1bc0b8b878234b68793 100644 (file)
@@ -42,6 +42,12 @@ 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.
index 43323c207a625ca7891ecb3fc4dbcb68e80f0c83..ad83d30291ac80efa388ef93a39d29972140e137 100755 (executable)
 
 . $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"
 
-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
+verify_crossfs_block_cloning
 
 claim="The copy_file_range syscall can clone across datasets."
 
index 34d3d2692555a67e82afb65f060d427677066687..702e23267f7eb3d094f4e0e976b0608de0d95bcd 100755 (executable)
 
 . $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"
 
-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
+verify_crossfs_block_cloning
 
 claim="Block cloning across encrypted datasets."