Commit graph

106 commits

Author SHA1 Message Date
Ryan Libby 7affbeeab1 virstor: basic functional test
Reviewed by:	asomers, markj
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D45535
2024-06-10 10:32:22 -07:00
Mariusz Zaborski 4b3141f5d5 geli: allocate a UMA pool earlier
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
2024-05-19 14:53:17 +02:00
Gleb Smirnoff 96950419f1 tests: don't run atf_* in a subshell
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:			ea82362219
2023-11-27 13:15:59 -08:00
Yan-Hao Wang 55141f2c89
Add tests for gunion(8)
Reviewed by:	mckusick (earlier version)
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D41645
2023-11-16 16:15:33 +08:00
Mark Johnston c4b927c341 geli tests: Use shorter passphrases in setkey_passphrase
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:		2b7b09ac96 ("geli tests: Add a regression test for geli setkey -J")
2023-10-02 16:57:51 -04:00
Warner Losh ea82362219 tests: Skip all tests that require mdconfig when /dev/mdctl missing
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
2023-09-02 13:16:22 -06:00
Mark Johnston 2b7b09ac96 geli tests: Add a regression test for geli setkey -J
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
2023-08-28 11:06:42 -04:00
Warner Losh d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh 2a63c3be15 Remove $FreeBSD$: one-line .c comment pattern
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
2023-08-16 11:54:29 -06:00
Warner Losh 42b388439b Remove $FreeBSD$: one-line .h pattern
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
2023-08-16 11:54:23 -06:00
Mark Johnston 15e564e408 ggate tests: Serialize 2023-07-31 11:01:53 -04:00
Mark Johnston 9c3f6368b1 gmirror tests: Serialize 2023-07-31 11:01:49 -04:00
Mark Johnston 9c0467929a geli tests: Add a regression test for PR 271766
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
2023-06-12 12:52:24 -04:00
Warner Losh 4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
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
2023-05-12 10:44:03 -06:00
Li-Wen Hsu 8e03a75086
Skip sys.geom.class.multipath.failloop.failloop if dtrace fails to run
This test case depends on dtrace and sometimes gets affected if dtrace
has issues.  Make it report skipped instead of failure when dtrace fails
to run.

Sponsored by:	The FreeBSD Foundation
2022-03-08 18:12:40 +08:00
Mark Johnston d7412bcac8 gmultipath tests: Re-enable the failloop test in CI
Sponsored by:	The FreeBSD Foundation
2022-03-07 10:43:19 -05:00
Li-Wen Hsu d33158471a
Temporarily skip sys.geom.class.multipath.failloop.failloop in CI
This test case uses `dtrace -c` but it has some issues at the moment so
disable it until dtrace fixed.

From markj:

This is the CTF type ID limit which has come up quite a few times
lately.  It'll be fixed with the introduction of CTFv3.

PR:		258763
Sponsored by:	The FreeBSD Foundation
2022-02-24 06:28:24 +08:00
Mark Johnston 69f7649b71 gmultipath tests: Re-enable the failloop test in CI
PR:		258763
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2021-10-04 12:28:27 -04:00
Li-Wen Hsu b9b5a4dd59
gmultipath failloop test: Put the dtrace sanity checker in right place
Check if dtrace excution is successful or not right after execution.

Sponsored by:	The FreeBSD Foundation
2021-09-29 02:38:34 +08:00
Li-Wen Hsu 38dac71d0a
Fix typo
Reported by:	swills
Sponsored by:	The FreeBSD Foundation
2021-09-29 02:28:01 +08:00
Li-Wen Hsu 819961c580
Temporarily skip sys.geom.class.multipath.failloop.failloop in CI
This test case uses `dtrace -c` but it has some issues at the moment

While here, add a checker for dtrace executes successfully or not to provide
a more informative error message.

PR:             258763
Sponsored by:   The FreeBSD Foundation
2021-09-29 02:02:27 +08:00
Alan Somers f5c6c43d4c Add a regression test for ggatec remote code execution
Tests that ggatec appropriately handles unsupported BIO operations,
rather than overflowing a buffer.

Submitted by:	Johannes Bruelltuete <johannes@jo-t.de>
PR:		213479
Reviewed by:	asomers
Differential Revision: https://reviews.freebsd.org/D31318
2021-08-27 14:52:45 -06:00
Mark Johnston 86461b646d gconcat: Add some simple regression tests for the new append verb
Sponsored by:	The FreeBSD Foundation
2021-06-14 17:31:28 -04:00
Alan Somers 420dbe763f gmultipath: make physpath distinct from the underlying providers'
zfsd uses a device's physical path attribute to automatically replace a
missing ZFS disk when a blank disk is inserted into the same physical
slot.  Currently gmultipath passes through its underlying providers'
physical path attribute.  That may cause zfsd to replace a missing
gmultipath provider with a newly arrived, single-path disk.  That would
be bad.

This commit fixes that problem by simply appending "/mp" to the
underlying providers' physical path, in a manner similar to what geli
already does.

Sponsored by:	Axcient
MFC after:	3 weeks
Differential Revision: https://reviews.freebsd.org/D29941
2021-05-06 12:32:27 -06:00
Kyle Evans fe815331bb build: provide a default WARNS for all in-tree builds
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
2020-09-18 17:17:46 +00:00
Bryan Drewery 3cee7cb269 Limit gmirror failpoint tests to the test worker
This avoids injecting errors into the test system's mirrors.

gnop seems like a good solution here but it injects errors at the wrong
place vs where these tests expect and does not support a 'max global count'
like the failpoints do with 'n*' syntax.

Reviewed by:	cem, vangyzen
Sponsored by:	Dell EMC Isilon
2020-07-23 23:29:50 +00:00
Li-Wen Hsu 5f2d3b42de Fix sys.geom.class.eli.onetime_test.onetime after r363402
PR:		247954
X-MFC with:	r363402
Sponsored by:	The FreeBSD Foundation
2020-07-22 17:37:11 +00:00
Alan Somers aafaa8b794 Fix geli's null cipher, and add a test case
PR:		247954
Submitted by:	jhb (sys), asomers (tests)
Reviewed by:	jhb (tests), asomers (sys)
MFC after:	2 weeks
Sponsored by:	Axcient
2020-07-21 19:18:29 +00:00
Alan Somers 6f818c1fb0 geli: enable direct dispatch
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
2020-07-08 17:12:12 +00:00
Li-Wen Hsu f29bf91a23 Temporarily skip unstable sys.geom.class.gate.ggate_test.ggated on i386 in CI
PR:		244737
Sponsored by:	The FreeBSD Foundation
2020-06-24 07:25:54 +00:00
Li-Wen Hsu f9777376b9 Revert 357780, dtrace -c has been fixed in head`
PR:		244053
Sponsored by:	The FreeBSD Foundation
2020-05-18 23:43:48 +00:00
Alan Somers 8bebfe076d Reenable sys.geom.class.gate.ggate_test.ggated in CI
Should be fixed by r360613

PR:		244737
Reported by:	lwhsu
2020-05-17 02:41:50 +00:00
Alan Somers deed14f451 Fix the sys.geom.class.multipath.misc.fail_on_error test on stable/12
This test uses a gnop feature (delay probability) that isn't available on
stable/12.  But it's unnecessary; the test works fine without it.  Removing
it simplifies the test and, once MFCed, will allow it to pass on stable/12.

PR:		244158
Reported by:	lwhsu
MFC after:	2 weeks
2020-05-08 02:42:15 +00:00
Alan Somers 4abfd5bd93 Fix intermittent cleanup failures in the ggated test
MFC after:	2 weeks
2020-05-03 18:10:54 +00:00
Ed Maste de1ca57386 geli tests require OpenSSL - exclude them under WITHOUT_OPENSSL
PR:		245931
Submitted by:	The FreeBSD Foundation
2020-04-30 21:09:01 +00:00
Li-Wen Hsu f95988cc0e Temporarily skip sys.geom.class.gate.ggate_test.ggated in CI
PR:		244737
Sponsored by:	The FreeBSD Foundation
2020-03-11 10:42:05 +00:00
Li-Wen Hsu 0c556b7f98 Temporarily skip sys.geom.class.multipath.failloop.failloop in CI
This case uses `dtrace -c` but it has some issues at the moment

PR:		244053
Sponsored by:	The FreeBSD Foundation
2020-02-11 22:21:22 +00:00
Alan Somers 95e6640be2 geli: add a test case for attaching multiple providers with 1 command
Reviewed by:	cem
MFC after:	2 weeks
Sponsored by:	Axcient
Differential Revision:	https://reviews.freebsd.org/D23400
2020-01-28 18:32:19 +00:00
Li-Wen Hsu 061838233a Revert r355861 because the issue has been fixed in r356443
PR:		242689
Notified by:	markj
Sponsored by:	The FreeBSD Foundation
2020-01-07 17:49:49 +00:00
Li-Wen Hsu 00488f54de Temporarily skip failing sys.geom.class.multipath.failloop.failloop on i386 CI
PR:		242689
Sponsored by:	The FreeBSD Foundation
2019-12-17 19:01:09 +00:00
Alan Somers 67f72211dd gmultipath: add ATF tests
Add ATF tests for most gmultipath operations. Add some dtrace probes too,
primarily for configuration changes that happen in response to provider
errors.

PR:		178473
MFC after:	2 weeks
Sponsored by:	Axcient
Differential Revision:	https://reviews.freebsd.org/D22235
2019-12-06 00:12:14 +00:00
Li-Wen Hsu dff3f7f89b Remove tests for the deprecated algorithms in r348206
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
2019-05-31 04:29:29 +00:00
Olivier Cochard 9583ab8aa3 Skip test component_selection:run_latest_genid if gmirror/gnop GEOM classes
aren't available

PR:		237051
Reviewed by:	asomers, imp, ngie, emaste (IRC)
Approved by:	ngie
MFC after:	 1 month
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D19958
2019-04-23 21:07:47 +00:00
Enji Cooper 724ec8989b Fix geli device cleanup
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
2019-04-09 16:20:36 +00:00
Pawel Jakub Dawidek d9eb18ace9 Implement tests for online expansion:
- 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
2019-04-04 00:05:36 +00:00
Pawel Jakub Dawidek 1e560a0ca4 Update configure tests after addition of the online expansion.
Obtained from:	Fudo Security
2019-04-03 23:58:58 +00:00
Alan Somers 809a8352dd Drop "All rights reserved" from the files I own
Also, add SPDX tags where needed.

MFC after:	2 weeks
2019-03-11 22:23:56 +00:00
Conrad Meyer af7dcae0e2 gmirror: Evaluate mirror components against newest metadata copy
Re-apply r341665 with format strings fixed.

If we happen to taste a stale mirror component first, don't reject valid,
newer components that have differing metadata from the stale component
(during STARTING).  Instead, update our view of the most recent metadata as
we taste components.

Like mediasize beforehand, remove some checks from g_mirror_check_metadata
which would evict valid components due to metadata that can change over a
mirror's lifetime.  g_mirror_check_metadata is invoked long before we check
genid/syncid and decide which component(s) are newest and whether or not we
have quorum.

Before checking if we can enter RUNNING (i.e., we have quorum) after a NEW
component is added, first remove any known stale or inconsistent disks from
the mirrorset, rather than removing them *after* deciding we have quorum.
Check if we have quorum after removing these components.

Additionally, add a knob, kern.geom.mirror.launch_mirror_before_timeout, to
force gmirrors to wait out the full timeout (kern.geom.mirror.timeout)
before transitioning from STARTING to RUNNING.  This is a kludge to help
ensure all eligible, boot-time available mirror components are tasted before
RUNNING a gmirror.

Add a basic test case for STARTING -> RUNNING startup behavior around stale
genids.

PR:		232671, 232835
Submitted by:	Cindy Yang <cyang AT isilon.com> (previous version)
Reviewed by:	markj (kernel portions)
Discussed with:	asomers, Cindy Yang
Tested by:	pho
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D18062
2018-12-07 02:44:04 +00:00
Conrad Meyer c4e87bdfc1 Revert r341665 due to tinderbox breakage
I didn't notice that some format strings were non-portable.  Will fix and
re-commit later.
2018-12-07 00:47:05 +00:00
Alan Somers a9ebbf33ea geom tests: Fix cleanup of ATF tests since r341392
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
2018-12-07 00:27:38 +00:00