]> git.proxmox.com Git - mirror_zfs.git/blobdiff - tests/zfs-tests/tests/functional/cli_root/zdb/zdb_003_pos.ksh
Update ZTS to work on FreeBSD
[mirror_zfs.git] / tests / zfs-tests / tests / functional / cli_root / zdb / zdb_003_pos.ksh
index 3c444ae983dcffc0c02a615bea57f91c5fa7911c..36f1929dd193a8d8eba35437fd6bfefd4f57583c 100755 (executable)
@@ -34,8 +34,17 @@ log_onexit cleanup
 function cleanup
 {
        datasetexists $TESTPOOL && destroy_pool $TESTPOOL
+       if is_freebsd ; then
+               log_must sysctl kern.geom.debugflags=$saved_debugflags
+       fi
 }
 
+if is_freebsd ; then
+       # FreeBSD won't allow writing to an in-use device without this set
+       saved_debugflags=$(sysctl -n kern.geom.debugflags)
+       log_must sysctl kern.geom.debugflags=16
+fi
+
 verify_runnable "global"
 verify_disk_count "$DISKS" 2