aboutsummaryrefslogtreecommitdiff
path: root/tests/sys/cddl
Commit message (Collapse)AuthorAgeFilesLines
* src.conf: Add a MK_ZFS_TESTS knobMark Johnston2025-11-191-1/+1
| | | | | | | | | | | | | | | | | The in-tree ZFS test suite is somewhat outdated and I see a number of failures there. I tend to think that we want to integrate the OpenZFS test suite somehow, replacing the legacy one, though it's also possible to run that as a separate test suite. In any case, if one wants to run the OpenZFS test suite separately, it's useful to be able to disable installation of the legacy ZFS test suite, so let's provide a src.conf option to do that. Reviewed by: asomers MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46476 (cherry picked from commit 24affded3d4ec5fafb6b22f773ec1e20d73b9b03)
* zfsd: fault disks that generate too many I/O delay eventsAlan Somers2024-01-193-0/+132
| | | | | | | | | | | | | If ZFS reports that a disk had at least 8 I/O operations over 60s that were each delayed by at least 30s (implying a queue depth > 4 or I/O aggregation, obviously), fault that disk. Disks that respond this slowly can degrade the entire system's performance. Sponsored by: Axcient Reviewed by: delphij Differential Revision: https://reviews.freebsd.org/D42825 (cherry picked from commit d565784a7ebaa59e26febdcfd4a60329786ea5f5)
* mkfile: getopt() returns an int, not a char.Dag-Erling Smørgrav2023-09-141-1/+1
| | | | | | | | MFC after: 3 days Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D41804 (cherry picked from commit ef8abddf103d9dfd5660d50d15e6dbfbb2f47f62)
* Multiple fixes to the zfsd test suiteAlan Somers2023-09-067-72/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Wait for gnop devices to disappear after "gnop destroy". Apparently that process is asynchronous now, or maybe it's just slower than it used to be. Also, after removing a gnop wait for its pool to be degraded. That isn't instant. * The zfsd tests no longer require camcontrol. This was a harmless oversight from 11ed0a95bfa76791dc6428eb2d47a986c0c6f8a3 * Fix the zfsd_degrade_001_pos test for recent zfs versions. ZFS now rate limits checksum errors to about 20 per second. But zfsd's threshold for degrading a disk is 50 per minute. So we must alternately corrupt and scrub the pool to ensure that checksum errors are generated in multiple 1-second windows, so that zfsd will see enough of them. * Fix the zfsd_fault_001_pos test in VMs And, for that matter, when using NVME or SATA disks. As originally written, the test used the da driver to inject errors. Rewrite it to use gnop vdevs. gnop can also inject errors. It works on top of any disk device, and it's also faster than using da. Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D39437 (cherry picked from commit dba2e89ea7a13469ee2e47a2a1d627ca28bb94c2)
* Fix the zfsd_autoreplace_001_neg testAlan Somers2023-09-061-3/+4
| | | | | | | | | | | | | It only ever worked by accident. * Actually set autoreplace=off as stated in the description * Wait for the removed device to disappear from the pool before proceeding. * In the assertion, verify that the new disk does not get added, as described in the description. Sponsored by: Axcient (cherry picked from commit be092bcde96bdcfde9013d60e442cca023bfbd1b)
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-231418-2693/+0
| | | | | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/ Similar commit in main: (cherry picked from commit d0b2dbfa0ecf)
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-2319-19/+0
| | | | | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/ Similar commit in main: (cherry picked from commit 42b388439bd3)
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-232-4/+0
| | | | | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/ Similar commit in main: (cherry picked from commit b3e7694832e8)
* Merge fix for zfs readmmap test from CheriBSDDimitry Andric2022-07-191-0/+1
| | | | | | | | | | | | | | | Merge commit 1737d8397a0 by Brooks Davis: time() is declared in time.h This fixes a -Werror warning from clang 15: tests/sys/cddl/zfs/bin/readmmap.c:97:9: error: call to undeclared function 'time'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] Obtained from: https://github.com/CTSRD-CHERI/cheribsd/commit/1737d8397a0 MFC after: 3 days (cherry picked from commit 47be48457393ba6747cc3144272b1f4d8b9077fb)
* zfs: Update test format strings to match variable typtesEd Maste2022-03-084-10/+10
| | | | | | | | | | | | | And drop stray 'd' from the end of some printed numbers. I assume this was the result of someone thinking u is a printf length modifier for d, not a format specifier itself. Reviewed by: kevans, rew MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34387 (cherry picked from commit f27fb06cadc6a8e75ebebd3b60c8a9dc9ae1b833)
* tests/sys/cddl: correctly quote atf_set "require.progs"Alex Richardson2021-03-17106-705/+705
| | | | | | | | | | | | The argument has to be a single whitespace-separate value. While touching all these lines also add ksh93, since `atf_set "require.progs"` overrides the default value specified in the Kyuafile. This then results in tests being executed despite ksh93 not being installed. Reviewed By: asomers Differential Revision: https://reviews.freebsd.org/D29066 (cherry picked from commit 0b86424c31ece31190c94d55feb5d190be4de5df)
* build: provide a default WARNS for all in-tree buildsKyle Evans2020-09-182-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | The current default is provided in various Makefile.inc in some top-level directories and covers a good portion of the tree, but doesn't cover parts of the build a little deeper (e.g. libcasper). Provide a default in src.sys.mk and set WARNS to it in bsd.sys.mk if that variable is defined. This lets us relatively cleanly provide a default WARNS no matter where you're building in the src tree without breaking things outside of the tree. Crunchgen has been updated as a bootstrap tool to work on this change because it needs r365605 at a minimum to succeed. The cleanup necessary to successfully walk over this change on WITHOUT_CLEAN builds has been added. There is a supplemental project to this to list all of the warnings that are encountered when the environment has WARNS=6 NO_WERROR=yes: https://warns.kevans.dev -- this project will hopefully eventually go away in favor of CI doing a much better job than it. Reviewed by: emaste, brooks, ngie (all earlier version) Reviewed by: emaste, arichardson (depend-cleanup.sh change) Differential Revision: https://reviews.freebsd.org/D26455 Notes: svn path=/head/; revision=365887
* Skip zpool_clear_005_pos test until bug fixedRyan Moeller2020-08-251-0/+1
| | | | | | | | | | | | | | Messing with gnop devices under a zpool fails in this test, causing the pool to be suspended and eventually the system to deadlock. Skip the test for now until the issue is resolved. PR: tests/248910 Discussed with: lwhsu Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=364783
* Merge OpenZFS support in to HEAD.Matt Macy2020-08-251-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The primary benefit is maintaining a completely shared code base with the community allowing FreeBSD to receive new features sooner and with less effort. I would advise against doing 'zpool upgrade' or creating indispensable pools using new features until this change has had a month+ to soak. Work on merging FreeBSD support in to what was at the time "ZFS on Linux" began in August 2018. I first publicly proposed transitioning FreeBSD to (new) OpenZFS on December 18th, 2018. FreeBSD support in OpenZFS was finally completed in December 2019. A CFT for downstreaming OpenZFS support in to FreeBSD was first issued on July 8th. All issues that were reported have been addressed or, for a couple of less critical matters there are pull requests in progress with OpenZFS. iXsystems has tested and dogfooded extensively internally. The TrueNAS 12 release is based on OpenZFS with some additional features that have not yet made it upstream. Improvements include: project quotas, encrypted datasets, allocation classes, vectorized raidz, vectorized checksums, various command line improvements, zstd compression. Thanks to those who have helped along the way: Ryan Moeller, Allan Jude, Zack Welch, and many others. Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25872 Notes: svn path=/head/; revision=364746
* zfs: multiple improvements to the zpool_add testsAlan Somers2019-10-1013-168/+59
| | | | | | | | | | | | | | | | | | | | | | * Don't partition a disk if too few are available. Just rely on Kyua to ensure that the tests aren't run with insufficient disks. * Remove redundant cleanup steps * In zpool_add_003_pos, store the temporary file in $PWD so Kyua will automatically clean it up. * Update zpool_add_005_pos to use dumpon instead of dumpadm. This test had never been ported to FreeBSD. * In zpool_add_005_pos, don't format the dump disk with UFS. That was pointless. MFC after: 2 weeks Sponsored by: Axcient Notes: svn path=/head/; revision=353379
* ZFS: fix the zpool_add_010_pos testAlan Somers2019-10-091-1/+1
| | | | | | | | | | | | The test is necessarily racy, because it depends on being able to complete a "zpool add" before a previous resilver finishes. But it was racier than it needed to be. Move the first "zpool add" to before the resilver starts. MFC after: 2 weeks Sponsored by: Axcient Notes: svn path=/head/; revision=353366
* ZFS: in the tests, don't override PWDAlan Somers2019-10-091-1/+0
| | | | | | | | | | | | The ZFS test suite was overriding the common $PWD variable with the path to the pwd command, even though no test wanted to use it that way. Most tests didn't notice, because ksh93 eventually restored it to its proper meaning. MFC after: 2 weeks Sponsored by: Axcient Notes: svn path=/head/; revision=353361
* ZFS: multiple fixes to the zpool_import testsAlan Somers2019-10-095-87/+22
| | | | | | | | | | | | | | | | | | | | | | | * Don't create a UFS mountpoint just to store some temporary files. The tests should always be executed with a sufficiently large TMPDIR. Creating the UFS mountpoint is not only unneccessary, but it slowed zpool_import_missing_002_pos greatly, because that test moves large files between TMPDIR and the UFS mountpoint. This change also allows many of the tests to be executed with just a single test disk, instead of two. * Move zpool_import_missing_002_pos's backup device dir from / to $PWD to prevent cross-device moves. On my system, these two changes improved that test's speed by 39x. It should also prevent ENOSPC errors seen in CI. * If insufficient disks are available, don't try to partition one of them. Just rely on Kyua to skip the test. Users who care will configure Kyua with sufficient disks. MFC after: 2 weeks Sponsored by: Axcient Notes: svn path=/head/; revision=353360
* zfs: fix the zfsd_hotspare_007_pos testAlan Somers2019-10-081-0/+3
| | | | | | | | | | | It was trying to destroy the pool while zfsd was detaching the spare, and "zpool destroy" failed. Fix by waiting until the spare has fully detached. MFC after: 2 weeks Sponsored by: Axcient Notes: svn path=/head/; revision=353310
* zfs: fix the zfsd_autoreplace_003_pos testAlan Somers2019-10-081-5/+5
| | | | | | | | | | | The test declared that it only needed 5 disks, but actually tried to use 6. Fix it to use just 5, which is all it really needs. MFC after: 2 weeks Sponsored by: Axcient Notes: svn path=/head/; revision=353309
* ZFS: fix the redundancy testsAlan Somers2019-10-073-10/+6
| | | | | | | | | | | | | | | | | * Fix force_sync_path, which ensures that a file is fully flushed to disk. Apparently "zpool history"'s performance has improved, but exporting and importing the pool still works. * Fix file_dva by using undocumented zdb syntax to clarify that we're interested in the pool's root file system, not the pool itself. This should also fix the zpool_clear_001_pos test. * Remove a redundant cleanup step MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D21901 Notes: svn path=/head/; revision=353289
* ZFS: mark hotspare_scrub_002_pos as an expected failureAlan Somers2019-10-071-0/+1
| | | | | | | | | | | "zpool scrub" doesn't detect all errors on active spares in raidz arrays PR: 241069 MFC after: 2 weeks Sponsored by: Axcient Notes: svn path=/head/; revision=353288
* ZFS: fix the delegate testsAlan Somers2019-10-0710-296/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These tests have never worked correctly * Replace runwattr with sudo * Fix a scoping bug with the "dtst" variable * Cleanup user properties created during tests * Eliminate the checks for refreservation and send support. They will always be supported. * Fix verify_fs_snapshot. It seemed to assume that permissions would not yet be delegated, but that's not how it's actually used. * Combine verify_fs_promote with verify_vol_promote * Remove some useless sleeps * Fix backwards condition in verify_vol_volsize * Remove some redundant cleanup steps in the tests. cleanup.ksh will handle everything. * Disable some parts of the tests that FreeBSD doesn't support: * Creating snapshots with mkdir * devices * shareisci * sharenfs * xattr * zoned The sharenfs parts could probably be reenabled with more work to remove the Solarisms. MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D21898 Notes: svn path=/head/; revision=353287
* zfs: skip the zfsd tests if zfsd is not runningAlan Somers2019-10-071-0/+22
| | | | | | | | | MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D21878 Notes: svn path=/head/; revision=353286
* zfs: fix the zdb_001_neg testAlan Somers2019-10-071-1/+1
| | | | | | | | | | | The test needed to be updated for r331701 (MFV illumos 8671400), which added a "-k" option. MFC after: 2 weeks Sponsored by: Axcient Notes: svn path=/head/; revision=353285
* ZFS: fix the zpool_get_002_pos testAlan Somers2019-10-072-2/+6
| | | | | | | | | | | | ZFS has grown some additional properties that hadn't been added to the config file yet. While I'm here, improve the error message, and remove a superfluous command. MFC after: 2 weeks Sponsored by: Axcient Notes: svn path=/head/; revision=353284
* zfs: fix the slog_012_neg testAlan Somers2019-10-071-1/+3
| | | | | | | | | | | | | This test attempts to corrupt a file-backed vdev by deleting it and then recreating it with truncate. But that doesn't work, because the pool already has the vdev open, and it happily hangs on to the open-but-deleted file. Fix by truncating the file without deleting it. MFC after: 2 weeks Sponsored by: Axcient Notes: svn path=/head/; revision=353282
* ZFS: fix several zvol_misc testsAlan Somers2019-10-072-9/+7
| | | | | | | | | | | | | * Adapt zvol_misc_001_neg to use dumpon instead of Solaris's dumpadm * Disable zvol_misc_003_neg, zvol_misc_005_neg, and zvol_misc_006_pos, because they involve using a zvol as a dump device, which FreeBSD does not yet support. MFC after: 2 weeks Sponsored by: Axcient Notes: svn path=/head/; revision=353281
* ZFS: fix several of the "zpool create" testsAlan Somers2019-10-0511-564/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove zpool_create_013_neg. FreeBSD doesn't have an equivalent of Solaris's metadevices. GEOM would be the equivalent, but since all geoms are the same from ZFS's perspective, this test would be redundant with zpool_create_012_neg * Remove zpool_create_014_neg. FreeBSD does not support swapping to regular files. * Remove zpool_create_016_pos. This test is redundant with literally every other test that creates a disk-backed pool. * s:/etc/vfstab:/etc/fstab in zpool_create_011_neg * Delete the VTOC-related portion of zpool_create_008_pos. FreeBSD doesn't use VTOC. * Replace dumpadm with dumpon and swap with swapon in multiple tests. * In zpool_create_015_neg, don't require "zpool create -n" to fail. It's reasonable for that variant to succeed, because it doesn't actually open the zvol. * Greatly simplify zpool_create_012_neg. Make it safer, too, but not interfering with the system's regular swap devices. * Expect zpool_create_011_neg to fail (PR 241070) * Delete some redundant cleanup steps in various tests * Remove some unneeeded ATF timeout specifications. The default is fine. PR: 241070 MFC after: 2 weeks Sponsored by: Axcient Notes: svn path=/head/; revision=353118
* ZFS: the hotspare_add_004_neg test needs at least two disksAlan Somers2019-10-051-1/+1
| | | | | | | | MFC after: 2 weeks Sponsored by: Axcient Notes: svn path=/head/; revision=353117
* Remove duplicate `${PACKAGE}FILES+= cleanup.ksh` lineEnji Cooper2019-03-161-1/+0
| | | | | | | | | | | | This mutes the duplicate target warning emitted via bsd.files.mk each build. MFC after: 1 week Reviewed by: asomers Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D19603 Notes: svn path=/head/; revision=345216
* Strip trailing / from TESTSDIREd Maste2018-05-115-5/+5
| | | | | | | | | | Otherwise makefs gets upset: makefs: ./usr/tests/sys/cddl/zfs/tests/exec/: empty leaf element Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=333495
* ZFS test suite: fix uses of illumos /dev/[r]dsk/ and /dev/zvol/[r]dsk/Andriy Gapon2018-03-2734-66/+66
| | | | Notes: svn path=/head/; revision=331613
* zfs test suite: move definition of DISK to the cfg file in zpool_getAndriy Gapon2018-03-152-1/+2
| | | | | | | | | | The variable is used not only by the setup script but also by the atf test bodies. Another one that should have been in r331001. Notes: svn path=/head/; revision=331004
* zfs test suite: add new pool properties / features to the zpool_get listAndriy Gapon2018-03-151-0/+3
| | | | Notes: svn path=/head/; revision=331003
* zfs test suite: move definition of DISK to the cfg file in zpool_getAndriy Gapon2018-03-152-2/+2
| | | | | | | | | | The variable is used not only by the setup script but also by the atf test bodies. This should have been in r331001. Notes: svn path=/head/; revision=331002
* zfs test suite: move definition of DISK to the cfg file in zpool_exportAndriy Gapon2018-03-152-2/+2
| | | | | | | | The variable is used not only by the setup script but also by the atf test bodies. Notes: svn path=/head/; revision=331001
* zfs test suite: support device paths with intermediate directoriesAndriy Gapon2018-03-153-7/+3
| | | | | | | | | The code assumed that disks (devices) used for testing are always named like /dev/foo, but there is no reason for that restriction and we can easily support paths like /dev/stripe/bar. Notes: svn path=/head/; revision=330996
* zfs test suite: fix a typo, TESTPOOL vs TESTPOOL2Andriy Gapon2018-03-151-1/+1
| | | | Notes: svn path=/head/; revision=330995
* zfs test suite: destroy old gnops before creating new onesAndriy Gapon2018-03-151-0/+1
| | | | Notes: svn path=/head/; revision=330994
* zfs test suite: align zfs_destroy_005_neg: with upstreamAndriy Gapon2018-03-151-3/+33
| | | | | | | | | | The change is to account for a different order in which the recursive destroy may be attempted. If we first try a dataset that can be destroyed then it will be destroyed, but if we first try a dataset that cannot be destroyed then we will not attempt to destroy the other dataset. Notes: svn path=/head/; revision=330993
* zfs test suite: fix a typo, da0 vs $diskAndriy Gapon2018-03-151-1/+1
| | | | Notes: svn path=/head/; revision=330992
* re-enable zfs_copies_006_pos test after a fix in r330977Andriy Gapon2018-03-151-1/+0
| | | | | | | | | The test was disabled in r329408. PR: 225960 Notes: svn path=/head/; revision=330979
* re-enable zpool_upgrade_007_pos test after the fix in r330974Andriy Gapon2018-03-151-1/+0
| | | | | | | | | The test was disabled in r329248. PR: 225877 Notes: svn path=/head/; revision=330975
* Add the ZFS test suiteAlan Somers2018-02-231503-0/+139082
It was originally written by Sun as part of the STF (Solaris test framework). They open sourced it in OpenSolaris, then HighCloud partially ported it to FreeBSD, and Spectra Logic finished the port. We also added many testcases, fixed many broken ones, and converted them all to the ATF framework. We've had help along the way from avg, araujo, smh, and brd. By default most of the tests are disabled. Set the disks Kyua variable to enable them. Submitted by: asomers, will, justing, ken, brd, avg, araujo, smh Sponsored by: Spectra Logic Corp, HighCloud Notes: svn path=/head/; revision=329867