aboutsummaryrefslogtreecommitdiff
path: root/tests/sys/geom/class/eli
Commit message (Collapse)AuthorAgeFilesLines
* tests: Increase timeoutJose Luis Duran2026-01-072-1/+2
| | | | | | | | | | Bump the timeout value, to avoid cutoff on emulated architectures on ci.freebsd.org. Reported by: Jenkins Reviewed by: ngie MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54550
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* geli: allocate a UMA pool earlierMariusz Zaborski2024-05-191-0/+29
| | | | | | | | | | | | | | | | | | | The functions g_eli_init_uma and g_eli_fini_uma are used to trace the number of devices in GELI. There is an issue where the g_eli_create function may fail before g_eli_init_uma is called, however g_eli_fini_uma is still executed in the fail path. This can incorrectly decrease the device count to zero, potentially leading to the UMA pool being freed. Accessing the device after the pool has been freed causes a system panic. This commit resolves the issue by ensuring devices count is increassed eariler. PR: 278828 Reported by: Andre Albsmeier <mail@fbsd2.e4m.org> Reviewed by: asomers MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45225
* tests: don't run atf_* in a subshellGleb Smirnoff2023-11-2712-34/+36
| | | | | | | | | | | | | Shell limitation is that a classic function call via $() is a subshell and atf-sh(3) commands won't work as epxected there. Subsequently, atf_skip inside a function won't skip a test. The test will fail later. A working approach is to pass desired variable name as argument to a function and don't run subshell. Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D42646 Fixes: ea82362219ee715cfbb195b2114e73fdc8599fa5
* geli tests: Use shorter passphrases in setkey_passphraseMark Johnston2023-10-021-3/+3
| | | | | | | | | There is an undocumented limit on the length of a GELI passphrase, and the test exceeded that. Most of the time it worked because a nul terminator would appear early enough in the string. Reported by: Jenkins Fixes: 2b7b09ac9675 ("geli tests: Add a regression test for geli setkey -J")
* tests: Skip all tests that require mdconfig when /dev/mdctl missingWarner Losh2023-09-021-0/+1
| | | | | | | | | | When run in a jail, /dev/mdctl is missing. So skip any tests that use mdconfig or mdmfs with md in this case: they can't possibly work. This is in line with other tests that test for presence of required features and skip if they aren't present. I did this instead of checking for jails so they can still run in jails that allow creation of md devices. Sponsored by: Netflix
* geli tests: Add a regression test for geli setkey -JMark Johnston2023-08-281-0/+59
| | | | | | | | | Make sure that it can be used to change the passphrase of both attached and detached providers. PR: 254966 MFC after: 1 week Sponsored by: The FreeBSD Foundation
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-1617-17/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-161-1/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* geli tests: Add a regression test for PR 271766Mark Johnston2023-06-123-2/+170
| | | | | | | | | | This test case catches both of the bugs reported there. PR: 271766 Reviewed by: imp MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40469
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* build: provide a default WARNS for all in-tree buildsKyle Evans2020-09-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix sys.geom.class.eli.onetime_test.onetime after r363402Li-Wen Hsu2020-07-221-1/+1
| | | | | | | | | PR: 247954 X-MFC with: r363402 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=363423
* Fix geli's null cipher, and add a test caseAlan Somers2020-07-211-0/+45
| | | | | | | | | | | PR: 247954 Submitted by: jhb (sys), asomers (tests) Reviewed by: jhb (tests), asomers (sys) MFC after: 2 weeks Sponsored by: Axcient Notes: svn path=/head/; revision=363402
* geli: enable direct dispatchAlan Somers2020-07-082-0/+70
| | | | | | | | | | | | | | | geli does all of its crypto operations in a separate thread pool, so g_eli_start, g_eli_read_done, and g_eli_write_done don't actually do very much work. Enabling direct dispatch eliminates the g_up/g_down bottlenecks, doubling IOPs on my system. This change does not affect the thread pool. Reviewed by: markj MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D25587 Notes: svn path=/head/; revision=363014
* geli: add a test case for attaching multiple providers with 1 commandAlan Somers2020-01-281-0/+31
| | | | | | | | | | Reviewed by: cem MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D23400 Notes: svn path=/head/; revision=357211
* Remove tests for the deprecated algorithms in r348206Li-Wen Hsu2019-05-312-18/+1
| | | | | | | | | | | | | The tests are failing because the return value and output have changed, but before test code structure adjusted, removing these test cases help people be able to focus on more important cases. Discussed with: emaste MFC with: r348206 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=348454
* Fix geli device cleanupEnji Cooper2019-04-091-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Final cleanup routines shouldn't be called from testcases; it should be called from the testcase cleanup routine. Furthermore, `geli_test_cleanup` should take care of cleaning up geli providers and the memory disks used for the geli providers. `geli_test_cleanup` will always be executed whereas the equivalent logic in `geli_test_body`, may not have been executed if the test failed prior to the logic being run. Prior to this change, the test case was trying to clean up `$md` twice: once in at the end of the test case body function, and the other in the cleanup function. The cleanup function logic was failing because there wasn't anything to clean up in the cleanup function and the errors weren't being ignored. This fixes FreeBSD test suite runs after r345864. PR: 237128 Reviewed by: asomers, pjd Approved by: emaste (mentor) MFC with: r345864 Differential Revision: https://reviews.freebsd.org/D19854 Notes: svn path=/head/; revision=346057
* Implement tests for online expansion:Pawel Jakub Dawidek2019-04-042-0/+197
| | | | | | | | | | | | | | | | | | | - init, init -R - onetime, onetime -R - 512 and 4k sectors - encryption only - encryption and authentication - configure -r/-R for detached providers - configure -r/-R for attached providers - all keys allocated (10, 20 and 30MB provider sizes) - keys allocated on demand (10, 20 and 30PB provider sizes) - reading and writing to provider after expansion (10-30MB only) - checking if metadata in old location is cleared. Obtained from: Fudo Security Notes: svn path=/head/; revision=345864
* Update configure tests after addition of the online expansion.Pawel Jakub Dawidek2019-04-031-6/+6
| | | | | | | Obtained from: Fudo Security Notes: svn path=/head/; revision=345863
* Drop "All rights reserved" from the files I ownAlan Somers2019-03-111-1/+2
| | | | | | | | | Also, add SPDX tags where needed. MFC after: 2 weeks Notes: svn path=/head/; revision=345034
* geom tests: Fix cleanup of ATF tests since r341392Alan Somers2018-12-071-1/+0
| | | | | | | | | | | | | | r341392 changed common test cleanup routines in a way that allowed them to be used by TAP tests as well as ATF tests. However, a late change made during code review resulted in cleanup being broken for ATF tests, which source geom_subr.sh separately during the body and cleanup phases of the test. The result was that md(4) devices wouldn't get cleaned up. MFC after: 2 weeks X-MFC-With: 341392 Notes: svn path=/head/; revision=341667
* Unbreak geli/gmirror testcases if their geom classes cannot be loadedAlan Somers2018-12-0212-70/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem with the logic prior to this commit was twofold: 1. The wrong set of idioms (TAP-compatible) were being applied to the ATF testcases when run, resulting in confusing ATF failure results on setup. 2. The cleanup subroutines were broken when the geom classes could not be loaded as they exited with 0 unexpectedly. This commit changes the test code to source the class-specific configuration (conf.sh) once globally, instead of sourcing it per testcase and per cleanup subroutine, and to call the ATF-specific setup subroutine(s) inline in the testcases. The refactoring done is effectively a no-op for the TAP testcases, modulo any refactoring done to create common code between the ATF and TAP testcases. This unbreaks the geli testcases converted to ATF in r327662 and r327683, and the gmirror testcases added in r327780, respectively, when the geom class could not be loaded. tests/sys/geom/class/mirror/... While here, ignore errors when turning debug failpoint sysctl off, which could occur if the gmirror class was not loaded. Submitted by: ngie MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd/pull/241 Notes: svn path=/head/; revision=341392
* Remove some dead code from the geli testsAlan Somers2018-12-021-4/+0
| | | | | | | | | This is detritus in the Makefile, leftover from 327662. MFC after: 2 weeks Notes: svn path=/head/; revision=341390
* geli: append "/eli" to the underlying provider's physical pathAlan Somers2018-02-142-0/+178
| | | | | | | | | | | | | If the underlying provider's physical path is null, then the geli device's physical path will be, too. Otherwise, it will append "/eli". This will make geli work better with zfsd(8). PR: 224962 MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D13979 Notes: svn path=/head/; revision=329273
* Remove the executable bit from some recently added test scripts.Mark Johnston2018-01-104-0/+0
| | | | Notes: svn path=/head/; revision=327769
* geli: optimize testsAlan Somers2018-01-083-17/+32
| | | | | | | | | | | | | | | | Reduce the geli tests' runtime by about a third: * In integrity_test:copy, use a file-backed md(4) device instead of a malloc'd one. That way we can corrupt the underlying storage without needing to detach and reattach the geli device. * In integrity_test:{copy, hmac, data} and onetime_test:{onetime, onetime_a}, move reads of /dev/random out of the loop. MFC after: 2 weeks Notes: svn path=/head/; revision=327685
* geli: convert remaining TAP tests to ATFAlan Somers2018-01-079-166/+203
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=327683
* Fix typo from r327666Alan Somers2018-01-071-1/+1
| | | | | | | | MFC after: 13 days X-MFC-With: 327666 Notes: svn path=/head/; revision=327682
* geli: fix parallel execution of testsAlan Somers2018-01-073-42/+38
| | | | | | | | | | | The trick is not to destroy an md(4) device during a test. That can create a "double-free" situation, because we also destroy md devices during test cleanup. MFC after: 2 weeks Notes: svn path=/head/; revision=327666
* geli: convert most tests from TAP to ATFAlan Somers2018-01-0725-1366/+1077
| | | | | | | | | | | | | I'm leaving readonly_test and nokey_test alone for now. In a future commit they should be broken up into several smaller test cases and distributed between multiple files. Reviewed by: ngie MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D13717 Notes: svn path=/head/; revision=327662
* geli: fix the resize test on arm64Alan Somers2017-12-291-8/+7
| | | | | | | | | | | | | The resize test used bsdlabel(8), which is not available on all architectures. Change it to use gpart(8) instead, which should be available everywhere. PR: 221763 Reported by: andrew MFC after: 2 weeks Notes: svn path=/head/; revision=327353
* Fix a harmless typo from r310786Alan Somers2017-12-291-1/+1
| | | | | | | | | I copy/pasted a reference to an undefined shell variable. MFC after: 2 weeks Notes: svn path=/head/; revision=327352
* geli: factor out some common code in the geli testsAlan Somers2017-12-298-31/+12
| | | | | | | | | | No functional change. MFC after: 2 weeks Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=327347
* Fix potential TOCTTOU bug in the geli testsAlan Somers2017-12-2922-290/+288
| | | | | | | | | | | | | | | This change mostly reverts r293436, which introduced the bug due to a belief that geli(8) would allocate md(4) devices by itself. However, that belief is incorrect. Instead of using linear probing to find available md(4) numbers, it's best to use the existing attach_md function. Reviewed by: ngie MFC after: 2 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13666 Notes: svn path=/head/; revision=327346
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-0/+8
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Check the exit code from fsck_ffs instead of relying on MODIFIED being in ↵Enji Cooper2017-10-101-17/+16
| | | | | | | | | | | | | | | | | | | the output ^/head@r323923 changed when MODIFIED is printed at exit. It's better to follow the documented way of determining whether or not a filesystem is clean per fsck_ffs, i.e., ensure that the exit code is either 0 or 7. The pass/fail determination is brittle prior to this commit, and ^/head@r323923 made the issue apparent -- thus this needs to be fixed independent of ^/head@r323923. PR: 222780 MFC after: 1 week MFC with: r323923 Reported by: Jenkins Notes: svn path=/head/; revision=324478
* Make test scripts under tests/... non-executableEnji Cooper2017-08-082-0/+0
| | | | | | | | | | Executable bits should be set at install time instead of in the repo. Setting executable bits on files triggers false positives with Phabricator. MFC after: 2 months Notes: svn path=/head/; revision=322214
* Fix buildworld broken in r315230 when /sys doesn't point into a rightGleb Smirnoff2017-03-151-1/+1
| | | | | | | | | source tree. Usage of SYSDIR is apparently wrong here. Discussed with: allanjude Notes: svn path=/head/; revision=315292
* Move .../sys/geom/eli/pbkdf2... to .../sys/geom/class/eli/...Enji Cooper2017-03-144-0/+1260
| | | | | | | | | | | | | | | | | | | This change moves the tests added in r313962 to an existing directory structure used by the geli TAP tests. It also, renames the test from pbkdf2 to pbkdf2_test . The changes to ObsoleteFiles.inc are being committed separately as they aren't needed for the MFC to ^/stable/11, etc, if the MFC for the tests is done all in one commit. MFC after: 2 weeks X-MFC with: r313962, r313972-r313973 Reviewed by: allanjude Sponsored by: Dell EMC Isilon Differential Revision: D9985 Notes: svn path=/head/; revision=315230
* Reduce the runtime of the GELI testsAlan Somers2016-12-2910-335/+352
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no reduction in test coverage. On my system runtime is reduced from 38m32s to 6m24s. tests/sys/geom/class/eli/conf.sh tests/sys/geom/class/eli/init_a_test.sh tests/sys/geom/class/eli/init_test.sh tests/sys/geom/class/eli/integrity_copy_test.sh tests/sys/geom/class/eli/integrity_data_test.sh tests/sys/geom/class/eli/integrity_hmac_test.sh tests/sys/geom/class/eli/onetime_a_test.sh tests/sys/geom/class/eli/onetime_test.sh Move the looping code into common functions in conf.sh, and remove alias ciphers from the list. tests/sys/geom/class/eli/init_a_test.sh tests/sys/geom/class/eli/init_test.sh tests/sys/geom/class/eli/integrity_copy_test.sh tests/sys/geom/class/eli/integrity_data_test.sh tests/sys/geom/class/eli/integrity_hmac_test.sh tests/sys/geom/class/eli/onetime_a_test.sh Move a few commands that don't need to be in the inner loop out. tests/sys/geom/class/eli/init_test.sh tests/sys/geom/class/eli/onetime_a_test.sh Reduce the sector count tests/sys/geom/class/eli/Makefile tests/sys/geom/class/eli/init_alias_test.sh Add a test for initializing a GELI device using one of the cipher aliases, and check that the alias is correctly interpreted. MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8814 Notes: svn path=/head/; revision=310786
* Increase timeouts for geli tests. It takes 2-3x more time to proceed theRuslan Bukin2016-09-281-7/+7
| | | | | | | | | | tests on MIPS64EB in QEMU. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Notes: svn path=/head/; revision=306395
* Use bsdlabel as we don't have hardlink disklabel -> bsdlabelRuslan Bukin2016-09-221-1/+1
| | | | | | | | | | | | on some platforms. Reviewed by: ngie Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D7968 Notes: svn path=/head/; revision=306188
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedEnji Cooper2016-05-041-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=299094
* MFHGlen Barber2016-03-101-0/+11
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=296625
| * DIRDEPS_BUILD: Connect MK_TESTS.Bryan Drewery2016-03-091-0/+11
| | | | | | | | | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=296587
* | More 'tests' packaging fixes.Glen Barber2016-02-031-0/+4
|/ | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295216
* IntegrateEnji Cooper2016-01-1322-0/+1735
tools/regression/geom_{concat,eli,gate,mirror,nop,raid3,shsec,stripe,uzip} in to the FreeBSD test suite as tests/sys/geom/class/{concat,eli,gate,mirror,nop,raid3,shsec,stripe,uzip} The tools/regression/geom and tools/regression/geom_part testcases are being left alone because both test sets are both currently broken. The majority of this work was done on ^/user/ngie/more-tests2 . The differences are as follows: - tests/sys/geom/class/Makefile.inc is not present; it was inlined into the class's Makefiles for explicitness. - The testcases officially require root via kyua - The geom_gate(4) tests don't use the pidfile changes proposed in https://reviews.freebsd.org/D4836 . MFC after: 1 month Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=293821