aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/cmd/dtrace/test
Commit message (Collapse)AuthorAgeFilesLines
* Address compiler warnings in C code used by the DTrace test suite.Mark Johnston2020-09-1933-112/+105
| | | | | | | | Reported by: Jenkins MFC after: 1 week Notes: svn path=/head/; revision=365907
* Fix dtrace test case after r351423 due to ping6(8) options changedLi-Wen Hsu2019-08-311-1/+1
| | | | | | | | | | Failure test case: cddl.usr.sbin.dtrace.common.ip.t_dtrace_contrib.tst_ipv6localicmp_ksh Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=351644
* Fix tests use /etc/motd after r350184 by using an always existing fileLi-Wen Hsu2019-08-313-3/+3
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=351643
* DTrace: create an amd64 test suitMariusz Zaborski2019-06-053-0/+161
| | | | | | | | | | | | | Create two tests checking if we can read urgs registers and if the rax register returns a correct number. Reviewed by: markj Discussed with: lwhsu MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20364 Notes: svn path=/head/; revision=348706
* Add a trailing empty line to match the test code outputLi-Wen Hsu2019-04-291-0/+1
| | | | | | | | | | | This is added for letting these long failing test case pass, and for consistency. The test code should be fixed later to not output this extra empty line. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=346873
* Some test scripts use ncat --sctp --listen port to run an SCTP discardMichael Tuexen2019-04-282-36/+68
| | | | | | | | | | | | | | | | | | | server in the background. However, when running in the background, stdin is closed and ncat initiates a graceful shutdown of the SCTP association. This is not expected by the client. Therefore, the ncat-based discard server is replaced by a perl-based one. In addition, to remove the dependency from ncat, which needs to be installed via the nmap port, also the code testing for a free SCTP port is changed to use the perl-based client. Finally, remove some debug output from the report generated. Reviewed by: lwhsu@ Differential Revision: https://reviews.freebsd.org/D20086 Notes: svn path=/head/; revision=346854
* Ensure that we use a 64-bit value for the last mmap() argument.Mark Johnston2019-03-201-1/+2
| | | | | | | | | | | | When using __syscall(2), the offset argument is passed on the stack on amd64. Previously only 32 bits were written, so the upper 32 bits were garbage and could cause the test to fail. MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=345355
* Add support for send, receive and state-change DTrace providers forMichael Tuexen2018-08-229-7/+623
| | | | | | | | | | | | SCTP. They are based on what is specified in the Solaris DTrace manual for Solaris 11.4. Reviewed by: 0mp, dteske, markj Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16839 Notes: svn path=/head/; revision=338213
* Add a dtrace provider for UDP-Lite.Michael Tuexen2018-07-314-0/+250
| | | | | | | | | | | | | | The dtrace provider for UDP-Lite is modeled after the UDP provider. This fixes the bug that UDP-Lite packets were triggering the UDP provider. Thanks to dteske@ for providing the dwatch module. Reviewed by: dteske@, markj@, rrs@ Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16377 Notes: svn path=/head/; revision=337018
* Improve TCP related tests for dtrace.Michael Tuexen2018-07-224-43/+37
| | | | | | | | | | | | | | Ensure that the TCP connections are terminated gracefully as expected by the test. Use appropriate numbers for sent/received packets. In addition, enable tst.localtcpstate.ksh, which should pass, but doesn't until https://reviews.freebsd.org/D16369 is committed. Reviewed by: markj@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D16288 Notes: svn path=/head/; revision=336597
* Test that the dtrace UDP receive probe fires.Michael Tuexen2018-07-202-6/+14
| | | | | | | | | | | | | This test ensures that the fix committed in https://svnweb.freebsd.org/changeset/base/336551 actually works. Reviewed by: dteske@, markj@, rrs@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D16046 Notes: svn path=/head/; revision=336552
* Adjust comment to reality since r286171.Michael Tuexen2018-07-151-2/+1
| | | | | | | Sponsored by: Netflix, Inc. Notes: svn path=/head/; revision=336317
* Don't require a local sshd for the local TCP state dtrace testMichael Tuexen2018-07-151-6/+17
| | | | | | | | | | | | | | This change is similar to the one done in r286171 for tst.ipv4localtcp.ksh. This not only reduces the requirements on the system used for testing but results also in a graceful teardown of the TCP connection. Reviewed by: gnn@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D16276 Notes: svn path=/head/; revision=336316
* Fix the UDP tests for dtrace.Michael Tuexen2018-07-152-11/+59
| | | | | | | | | | | | | | | | | The code imported from opensolaris was depending on ping supporting UDP for sending probes. Since this is not supported by ping on FreeBSD use a perl script instead. The remote test requires the usage of ksh93, so state that in the sheband. Enable the local test, but keep the remote test disabled, since it requires a remote machine on the LAN. Reviewed by: markj@, gnn@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D16268 Notes: svn path=/head/; revision=336315
* Return the intended return code.Michael Tuexen2018-07-141-1/+1
| | | | | | | | | | This bug was spotted by markj@ in D16268 because I copied this code part and used it there. So fix it. Sponsored by: Netflix, Inc. Notes: svn path=/head/; revision=336293
* Fix shebangs and execute bit of test scripts.Michael Tuexen2018-07-148-8/+8
| | | | | | | | | | | | | | Since we don't have /usr/bin/ksh, use a generic way of specifying ksh. Some of the tests only run with ksh93, so use this shell for these tests. Two of the tests don't have the execute bit set, so fix this, too. Reviewed by: markj@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D16270 Notes: svn path=/head/; revision=336291
* Use __syscall(2) rather than syscall(2) in syscall/tst.args.c.Mark Johnston2018-03-181-1/+1
| | | | | | | | | Some of mmap(2)'s arguments are 64 bits wide. MFC after: 3 days Notes: svn path=/head/; revision=331135
* Add "jid" and "jailname" variables to DTrace.Mark Johnston2018-01-122-0/+88
| | | | | | | | | | | | | | | | | These return the jail ID and jail name for the traced process, respectively, and are analogous to "zonename" on Solaris/illumos. "zonename" is now aliased to "jailname". Also add some stress tests for the new variables. Submitted by: Domagoj Stolfa <domagoj.stolfa@gmail.com> Reviewed by: dteske (previous version) MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D13877 Notes: svn path=/head/; revision=327888
* Add a regression test for r327794.Mark Johnston2018-01-102-0/+36
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=327795
* Complete support for dtrace's -x setenv option.Mark Johnston2017-12-0312-0/+225
| | | | | | | | | | | | | | This allows one to override the environment for processes created with dtrace -c. By default, the environment is inherited. This support was originally merged from illumos in r249367 but was lost when the commit was later reverted and then brought back piecemeal. Reported by: Samuel Lepetit <slepetit@apple.com> MFC after: 2 weeks Notes: svn path=/head/; revision=326499
* Revert r326181 for now.Mark Johnston2017-11-271-1/+1
| | | | | | | | | We can't link an executable using -m32 until the lib32 phase of a buildworld, though the build works fine when executing make from cddl/usr.sbin/dtrace/tests. Some other solution will need to be found. Notes: svn path=/head/; revision=326285
* Compile one of the uctf test programs with -m32.Mark Johnston2017-11-241-1/+1
| | | | | | | | | The err.user64mode.ksh test expects it to run as a 32-bit process. MFC after: 1 week Notes: svn path=/head/; revision=326181
* Don't assume that we can resolve "main" in the ksh executable.Mark Johnston2017-11-211-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=326061
* Fix the raise tests.Bryan Drewery2017-09-156-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | - The exit probe was not appropriately filtered to only the known pid so it was firing on any random process that would exit rather the only the one we cared about. - The dtest script executes the tst.raise*.exe in the background from POSIX sh without jobs control. POSIX mandates that SIGINT be set to SIG_IGN in this case. The test executable never actually tested that SIGINT could be caught despite trying to block and delay the signal. So the SIGINT sent from raise() is never actually received since it is ignored. This could be fixed by calling 'trap - INT' from dtest before running the executable but I've opted to just use SIGUSR1 instead in these specific tests rather than adding more logic to test that SIGINT is not ignored at startup. These 2 issues meant that the tests would randomly work but only if a process coincidentally exited during the test. Reviewed by: markj MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=323620
* Fix DTrace test tst_inet_ntop_d: remove definitions are already in libdtraceLi-Wen Hsu2017-09-121-3/+0
| | | | | | | | | | | We have D definitions for the named values in socket.h after r323253. Remove them in test script to prevent compiling failure. Reviewed by: markj, gnn Differential Revision: https://reviews.freebsd.org/D12334 Notes: svn path=/head/; revision=323499
* Use an updated copy of the CDDL header boilerplate from illumos.Mark Johnston2017-08-211-18/+8
| | | | | | | | Reported by: Yuri Pankov <yuripv@gmx.com> X-MFC with: r322774 Notes: svn path=/head/; revision=322775
* Add a regression test for r322773.Mark Johnston2017-08-211-0/+35
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=322774
* Add an auxiliary subroutine to generate some events for testingLi-Wen Hsu2017-07-261-0/+14
| | | | | | | | | | | This test is also timeout on a quiet system because there is nobody triggering read probefunc while test execution. Reviewed by: gnn, markj, ngie Differential Revision: https://reviews.freebsd.org/D11731 Notes: svn path=/head/; revision=321518
* Modify glob patterns and expected output to match FreeBSD's implementation.Li-Wen Hsu2017-07-252-7/+15
| | | | | | | | Reviewed by: gnn, markj, ngie Differential Revision: https://reviews.freebsd.org/D11713 Notes: svn path=/head/; revision=321470
* Make this test case accepts basename() in D script returns "" or "."Li-Wen Hsu2017-07-252-4/+22
| | | | | | | | | | | | | | | In Solaris, basename(1) and basename(3) both return "." while being given an empty string (""), while in BSD (and Linux) basename(1) returns "" and basename(3) returns "." While here, also change #!/usr/bin/ksh to #!/usr/bin/env ksh to find ksh in $PATH Reviewed by: gnn, markj (earlier version), ngie (earlier version) Differential Revision: https://reviews.freebsd.org/D11707 Notes: svn path=/head/; revision=321469
* Explicitly set dynamic variable buffer size.Li-Wen Hsu2017-07-251-0/+1
| | | | | | | | | | | | | We added too many variable assignments in BEGIN block, which will run out of default auto-configured variable buffer space. The test VM has 4G RAM which should be enough for most cases so it's reasonable to increase limitation to these case. Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D11676 Notes: svn path=/head/; revision=321468
* Explicitly set dynamic variable buffer size.Li-Wen Hsu2017-07-251-0/+1
| | | | | | | | | | | | | We added too many variable assignments in BEGIN block, which will run out of default auto-configured variable buffer space. The test VM has 4G RAM which should be enough for most cases so it's reasonable to increase limitation to these case. Reviewed by: gnn, markj, ngie Differential Revision: https://reviews.freebsd.org/D11674 Notes: svn path=/head/; revision=321467
* Add an auxiliary subroutine to generate read(2) event while testing.Li-Wen Hsu2017-07-251-0/+13
| | | | | | | | Reviewed by: gnn, ngie Differential Revision: https://reviews.freebsd.org/D11673 Notes: svn path=/head/; revision=321466
* Add a simple script which calls open(2) and others to generate events forLi-Wen Hsu2017-07-252-0/+31
| | | | | | | | | | | | | testing. This test times-out on a quiet system because there is nobody triggers syscall::open:entry or syscall::: probe while test execution. Reviewed by: gnn, markj (earlier version) Differential Revision: https://reviews.freebsd.org/D11671 Notes: svn path=/head/; revision=321465
* Add a simple program which calls sigtimedwait(2) to generate events for testingLi-Wen Hsu2017-07-252-0/+48
| | | | | | | | | | | This test timeout on a quiet system because there is nobody triggers 'syscall::*wait*:entry' probe while test execution. Reviewed by: gnn, markj, ngie Differential Revision: https://reviews.freebsd.org/D11668 Notes: svn path=/head/; revision=321464
* Fix whitespace on a line in fix(..) accidentally missed in r321424Enji Cooper2017-07-241-1/+1
| | | | | | | | MFC after: 1 month MFC with: r321424 Notes: svn path=/head/; revision=321425
* Style cleanup: delete spurious trailing whitespaceEnji Cooper2017-07-241-4/+4
| | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=321424
* Don't use incorrect hardcoded path to ksh -- use /usr/bin/envEnji Cooper2017-07-231-1/+1
| | | | | | | | | to find ksh instead MFC after: 1 month Notes: svn path=/head/; revision=321387
* MFV r319744,r319745: 8269 dtrace stddev aggregation is normalized incorrectlyAndriy Gapon2017-06-092-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@79809f9cf402f130667349b2d4007ecd65d63c6f https://github.com/illumos/illumos-gate/commit/79809f9cf402f130667349b2d4007ecd65d63c6f https://www.illumos.org/issues/8269 It seems that currently normalization of stddev aggregation is done incorrectly. We divide both the sum of values and the sum of their squares by the normalization factor. But we should divide the sum of squares by the normalization factor squared to scale the original values properly. FreeBSD note: the actual change was committed in r316853, this commit adds the test files and record merge information. Reviewed by: Bryan Cantrill <bryan@joyent.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Andriy Gapon <avg@FreeBSD.org> MFC after: 1 week Sponsored by: Panzura Notes: svn path=/head/; revision=319746
* Add a little helper program for tst.exitcore.ksh.Mark Johnston2017-05-222-9/+39
| | | | | | | | | | | sleep(1) is capsicumized, which means that we cannot rely on it to dump core as required by the test. MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318680
* Search for _DTRACE_VERSION in sys/sdt.h rather than unistd.h.Mark Johnston2017-02-051-3/+3
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=313265
* Avoid using Sun compiler-specific flags.Mark Johnston2017-02-051-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=313264
* Use the correct path to date(1).Mark Johnston2016-12-073-3/+3
| | | | | | | | MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=309700
* Use the native data model instead of forcing ILP32 in tst.provregex3.ksh.Mark Johnston2016-12-071-1/+1
| | | | | | | | MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=309699
* Fix tst.args1.c on LP64 platforms.Mark Johnston2016-10-161-2/+2
| | | | | | | | | | The untyped probe arguments have a width larger than int on such platforms, so printing their value without a cast can give unexpected results. MFC after: 1 week Notes: svn path=/head/; revision=307401
* MFV r304057:Mark Johnston2016-08-168-2/+251
| | | | | | | | | | | | | | | | | | | | | | | 7085 add support for "if" and "else" statements in dtrace illumos/illumos-gate@c3bd3abd8856e8e75d820f65c58031cd6cbac818 Add syntactic sugar to dtrace: "if" and "else" statements. The sugar is baked down to standard dtrace features by adding additional clauses with the appropriate predicates. Reviewed by: Adam Leventhal <ahl@delphix.com> Reviewed by: Sebastien Roy <sebastien.roy@delphix.com> Reviewed by: Paul Dagnelie <pcd@delphix.com> Reviewed by: Bryan Cantrill <bryan@joyent.com> Approved by: Richard Lowe <richlowe@richlowe.net> Author: Matthew Ahrens <mahrens@delphix.com> MFC after: 2 weeks Relnotes: yes Notes: svn path=/head/; revision=304200
* MFV r296989:Mark Johnston2016-08-162-0/+61
| | | | | | | | | | | | | | | 6734 dtrace_canstore_statvar() fails for some valid static variables Reviewed by: Dan McDonald <danmcd@omniti.com> Approved by: Richard Lowe <richlowe@richlowe.net> Author: Bryan Cantrill <bryan@joyent.com> illumos/illumos-gate@d65f2bb4e50559c6c375a2aa9f728cbc34379015 MFC after: 2 weeks Notes: svn path=/head/; revision=304196
* Add a trailing newline to the expected output for tst.walltimestamp.ksh.Mark Johnston2015-12-071-0/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=291966
* MFV r289003:Mark Johnston2015-12-072-0/+103
| | | | | | | | | | | | | | | 6271 dtrace caused excessive fork time Author: Bryan Cantrill <bryan@joyent.com> Reviewed by: Adam Leventhal <ahl@delphix.com> Reviewed by: Dan McDonald <danmcd@omniti.com> Reviewed by: Richard Lowe <richlowe@richlowe.net> Approved by: Gordon Ross <gwr@nexenta.com> illumos/illumos-gate@7bd3c1d12d0c764e1517c3aca62c634409356764 Notes: svn path=/head/; revision=291963
* MFV r288408:Mark Johnston2015-09-303-0/+164
| | | | | | | | | | | | | | | | 6266 harden dtrace_difo_chunksize() with respect to malicious DIF illumos/illumos-gate@395c7a3dcfc66b8b671dc4b3c4a2f0ca26449922 Reviewed by: Alex Wilson <alex.wilson@joyent.com> Reviewed by: Dan McDonald <danmcd@omniti.com> Approved by: Garrett D'Amore <garrett@damore.org> Author: Bryan Cantrill <bryan@joyent.com> MFC after: 1 week Notes: svn path=/head/; revision=288415