Commit Graph

113 Commits

Author SHA1 Message Date
Mark Johnston
31768cc105 tst.kpriv.ksh fails because DTrace privilege levels are unimplemented.
MFC after:	1 week
2016-10-16 19:46:55 +00:00
Alexander Motin
41b9077ef6 MFV r302660: 6314 buffer overflow in dsl_dataset_name
illumos/illumos-gate@9adfa60d48
https://github.com/illumos/illumos-gate/commit/9adfa60d484ce2435f5af77cc99dcd4e6
92b6660

https://www.illumos.org/issues/6314
  Callers of dsl_dataset_name pass a buffer of size ZFS_MAXNAMELEN, but
  dsl_dataset_name copies the datasets' name PLUS the snapshot name to it,
  resulting in a max of 2 * ZFS_MAXNAMELEN + '@'.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>
2016-09-01 15:08:27 +00:00
Bryan Drewery
1eb4ec9c62 DIRDEPS_BUILD: Add some missing dirctories to the build.
Sponsored by:	EMC / Isilon Storage Division
2016-08-31 19:30:59 +00:00
Bryan Drewery
776d5e11e9 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-08-31 19:30:46 +00:00
Enji Cooper
47d6e5cb86 Remove redundant declarations and simplify ../ in pathing
- TESTSBASE and LOCALBASE are already defined in bsd.tests.mk
- TESTSDIR is automatically divined as ${TESTSBASE}${RELDIR:H} after
  r289158.
- Replace SRCDIR with SRCTOP

MFC after:	1 week
X-MFC with:	r305019
Sponsored by:	EMC / Isilon Storage Division
2016-08-29 19:10:58 +00:00
Enji Cooper
68aee22c0e Remove unnecessary variable (SRCDIR) replaced by SRCTOP in Makefile.common
MFC after:	1 week
X-MFC with:	r305018
Sponsored by:	EMC / Isilon Storage Division
2016-08-29 19:07:48 +00:00
Enji Cooper
17a7f5c474 Use SRCTOP instead of a homegrown definition for it (SRCDIR)
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-08-29 19:06:40 +00:00
Dimitry Andric
3323aadf23 Fix the zfsd unittest:
* TESTSDIR is supposed to be under cddl/usr.sbin, not cddl/sbin
* DevdCtl::EventBuffer no longer exists, so remove its forward
  declaration

MFC after:	3 days
X-MFC-With:	r305013
2016-08-29 18:55:06 +00:00
Dimitry Andric
895897884f Add an empty virtual destructor to zfsd's Vdev class. This is needed
because the class has virtual functions, and the compiler-generated
default destructor is non-virtual.

Reviewed by:	asomers
MFC after:	3 days
2016-08-29 18:51:49 +00:00
Mark Johnston
5968c00154 Regenerate DTrace tests. 2016-08-16 02:34:25 +00:00
Mark Johnston
ed12504ac7 dtraceUtil/tst.DataModel32.d.ksh passes on amd64. 2016-08-15 19:47:04 +00:00
Enji Cooper
08dde4d421 Highball memory requirement (4GB) with common/{raise,safety}
Both test suites require more memory than my amd64 VM using
GENERIC-NODEBUG can provide and reliably panic it with OOM issues in
dtrace(4).

Some of the testcases fail, but this at least bypasses the panic behavior
on platforms that don't have enough resources

MFC after: 2 weeks
Discussed with: markj
Sponsored by: EMC / Isilon Storage Division
2016-08-10 03:10:34 +00:00
Alan Somers
92c6a88b76 Coverity fixes for r300906
lib/libdevdctl/consumer.cc
	In Consumer::DisconnectFromDevd, don't close the socket if it's
	already closed.

cddl/usr.sbin/zfsd/case_file.cc
lib/libdevdctl/consumer.h
	Delete dead code leftover from before devd(8) gained SOCK_SEQPACKET
	support

Reported by:	Coverity
CID:		1356155, 1356169
Sponsored by:	Spectra Logic Corp
2016-05-31 23:26:45 +00:00
Pedro F. Giffuni
0f2297b1bf zfsd: Remove a redundant semicolon, 2016-05-31 21:23:57 +00:00
Pedro F. Giffuni
52832d772e zfsd: minor spelling fix. 2016-05-30 19:32:56 +00:00
Bryan Drewery
fdd9048a63 Avoid more literal-suffix errors with C++11 2016-05-29 00:40:29 +00:00
Alan Somers
7a0c41d5d7 zfsd(8), the ZFS fault management daemon
Add zfsd, which deals with hard drive faults in ZFS pools. It manages
hotspares and replements in drive slots that publish physical paths.

cddl/usr.sbin/zfsd
	Add zfsd(8) and its unit tests

cddl/usr.sbin/Makefile
	Add zfsd to the build

lib/libdevdctl
	A C++ library that helps devd clients process events

lib/Makefile
share/mk/bsd.libnames.mk
share/mk/src.libnames.mk
	Add libdevdctl to the build. It's a private library, unusable by
	out-of-tree software.

etc/defaults/rc.conf
	By default, set zfsd_enable to NO

etc/mtree/BSD.include.dist
	Add a directory for libdevdctl's include files

etc/mtree/BSD.tests.dist
	Add a directory for zfsd's unit tests

etc/mtree/BSD.var.dist
	Add /var/db/zfsd/cases, where zfsd stores case files while it's shut
	down.

etc/rc.d/Makefile
etc/rc.d/zfsd
	Add zfsd's rc script

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
	Fix the resource.fs.zfs.statechange message. It had a number of
	problems:

	It was only being emitted on a transition to the HEALTHY state.
	That made it impossible for zfsd to take actions based on drives
	getting sicker.

	It compared the new state to vdev_prevstate, which is the state that
	the vdev had the last time it was opened.  That doesn't make sense,
	because a vdev can change state multiple times without being
	reopened.

	vdev_set_state contains logic that will change the device's new
	state based on various conditions.  However, the statechange event
	was being posted _before_ that logic took effect.  Now it's being
	posted after.

Submitted by:	gibbs, asomers, mav, allanjude
Reviewed by:	mav, delphij
Relnotes:	yes
Sponsored by:	Spectra Logic Corp, iX Systems
Differential Revision:	https://reviews.freebsd.org/D6564
2016-05-28 17:43:40 +00:00
Ruslan Bukin
fed1ca4b71 Add initial DTrace support for RISC-V.
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-05-24 16:41:37 +00:00
George V. Neville-Neil
18849b5da0 Remove the old version of the DTraceToolkit from the source tree.
The DTraceToolkit is part of the Open DTrace effort and is supported
on FreeBSD as a port (sysutils/DTraceToolkit) which has been updated
to properly track toolkit development upstream.

Sponsored by:	DARPA, AFRL
2016-05-19 19:51:39 +00:00
Mark Johnston
aac4e902e1 Fix DTrace test ATF wrapper generation. 2016-05-10 20:25:49 +00:00
Enji Cooper
430f7286a5 Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed
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
2016-05-04 23:20:53 +00:00
Glen Barber
49dae58b28 Fix including Kyuafile in packaged base system.
Fix a related typo while here.

Note, this change results in the Kyuafile inclusion in the runtime
package, which needs to be fixed, however addresses the PR as far
as I can tell in my tests.

PR:		209114
Submitted by:	ngie
Sponsored by:	The FreeBSD Foundation
2016-04-29 05:28:40 +00:00
Glen Barber
7d536dc855 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-10 21:16:01 +00:00
Bryan Drewery
15c433351f DIRDEPS_BUILD: Connect MK_TESTS.
Sponsored by:	EMC / Isilon Storage Division
2016-03-09 22:46:01 +00:00
Glen Barber
72c3aa02dc MFH
Sponsored by:	The FreeBSD Foundation
2016-02-18 00:37:58 +00:00
Bryan Drewery
d3157f0915 Test directories can build in parallel fine.
Sponsored by:	EMC / Isilon Storage Division
2016-02-16 02:13:59 +00:00
Glen Barber
43faedc133 First pass to fix the 'tests' packages.
Sponsored by:	The FreeBSD Foundation
2016-02-02 22:26:49 +00:00
Baptiste Daroussin
1be9a78b26 Reduce zfs utilities overlinking 2015-12-24 11:56:37 +00:00
Mark Johnston
8405751cec Fix a discrepancy in r291738.
The script that generates these makefiles was changed to modify LIBADD
rather than LDADD/DPADD, but the makefile itself was also changed in a
slightly different way.
2015-12-07 21:57:36 +00:00
Mark Johnston
a476e3a567 Update DTrace test suite makefiles after r291963. 2015-12-07 21:51:50 +00:00
Bryan Drewery
eacae6dc66 Fix LDADD/DPADD that should be LIBADD.
Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:47 +00:00
Bryan Drewery
60648601bf Reduce overlinking of libdtrace consumers with libctf, libelf, libproc.
The proper place for this list is _DP_dtrace.

Due to removing the LDADD_dtrace, more LIBADD are needed in
cddl/usr.sbin/dtrace to prevent underlinking.

This fixes overlinking in cddl/usr.sbin/lockstat and
cddl/usr.sbin/plockstat.

Sponsored by:	EMC / Isilon Storage Division
2015-12-02 00:49:49 +00:00
Bryan Drewery
a9dfc956d6 Fully connect cddl/usr.sbin/plockstat.
There seems to be no reason to keep this so private.

Also add missing optional MK_CDDL files.

Sponsored by:	EMC / Isilon Storage Division
2015-12-02 00:49:45 +00:00
Bryan Drewery
a0eb270b12 META MODE: Fix userland/cddl.
MK_CTF controls whether ctfmerge is ran against the binaries, not
whether CTF tools should be built.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:22:10 +00:00
Bryan Drewery
b16fc49e73 Rename Makefile.inc1 to dtrace.test.mk to avoid clash with top-level Makefile.inc1.
Discussed with:	ngie, markj
Sponsored by:	EMC / Isilon Storage Division
2015-11-25 20:43:45 +00:00
Enji Cooper
7c49f4218a Reduce the Makefile snippet complexity a bit
- Set BINDIR to TESTSDIR globally (and subsequently, remove all
  `${FILESGROUP}DIR` setting because BINDIR is set to `TESTSDIR`)
- Set MAN to "" globally, instead of per-PROG

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-11-09 02:29:38 +00:00
Bryan Drewery
ca8d93fc70 Remove unneeded _RECURSING_PROGS check.
It is definitely not needed after r288158, and is a private variable as well
that should not be checked here.

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-10-30 21:23:14 +00:00
Enji Cooper
b2d48be1bc Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and
netbsd-tests.test.mk (r289151)

- Eliminate explicit OBJTOP/SRCTOP setting
- Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk
- Remove unnecessary TESTSDIR setting
- Use SRCTOP where possible for clarity

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Divison
2015-10-12 08:16:03 +00:00
Mark Johnston
b22ef02080 Update DTrace test makefiles after r288415. 2015-09-30 05:25:39 +00:00
Bryan Drewery
54c7d75a06 META_MODE: Remove DEP_RELDIR from Makefile.depend files.
This has not been needed since r284171 in projects/bmake.

Sponsored by:	EMC / Isilon Storage Division
2015-09-25 19:26:08 +00:00
Mark Johnston
d912066c36 Add a src.conf option to build and install the DTrace test suite.
Reviewed by:	gnn, ngie
Differential Revision:	https://reviews.freebsd.org/D3195
2015-08-02 00:37:33 +00:00
Ruslan Bukin
b78ee15e9f First cut of DTrace for AArch64.
Reviewed by:	andrew, emaste
Sponsored by:	ARM Limited
Differential Revision:	https://reviews.freebsd.org/D2738
2015-07-01 15:51:11 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Enji Cooper
6b32ba6294 Build cddl/{sbin,usr.bin,usr.sbin} in parallel as all of the applications are
freestanding (they require libraries build via make libraries in buildworld)

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-05-20 12:26:09 +00:00
Baptiste Daroussin
738dbe7419 Reduce overlinking.
Because of libdtrace there is still a bit a overlinking but nothing we can deal
with easily
2015-05-19 22:29:11 +00:00
Baptiste Daroussin
53d5099dfd Correctly link libdtrace and convert to LIBADD
Make dtrace only link to libdtrace
2015-05-19 22:24:19 +00:00
Mark Johnston
6bd8f7ee09 Fix a typo that snuck in with r283024, and remove the EXFAIL annotation from
a test which now passes as a result of that change.
2015-05-17 23:09:58 +00:00
Mark Johnston
41aeaf2a30 Replace dtest.pl, the upstream DTrace test suite harness, with a shell
script. This reimplementation is much simpler than dtest.pl and is more
amenable to being run under Kyua - dtest.pl writes error output to a
temporary directory that is deleted when the run finishes, making it hard
to debug test failures. This change also removes the test suite's dependency
on perl.
2015-03-30 04:01:49 +00:00