From nobody Wed Apr 22 08:19:47 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4g0sbD6kzzz6bk9Z for ; Wed, 22 Apr 2026 08:19:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g0sbD1SFdz3d71 for ; Wed, 22 Apr 2026 08:19:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776845992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lo19Wh9vuec8T7qYL7o+TAAI7yUMclqSLB7DCSQzl4A=; b=eQbm2MdT0oFIX2ERr40ebLODxwClViyzgvK7MHhj+sdbrWHmVxY76lYdwlV9EdetdHu8FJ biKemTigJUEo+t5jxE8pQLtIXr4xeTCTxrLsOUHRZHln3FT2O9WlReUFFULJwUxwRM+hxq Tcfxg9UtOljoYMgif4PrIGyZFHOJtkdLm1xThlTREgwBWjuF2VNsFKLRFdvI9B35nBjsTQ w6MQwp2vICdzSbbFckuo0U9nQ1lUmmvbPMJQ9Vi7TyP9DdaaBT0YGLBYDD9aGi6fi7yplF f+D/KUV/1mLUB+R5jQ9i/cmsBdVUfwG2fvJnLhl71lBpdQkUKBnyG9cePIYpVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776845992; a=rsa-sha256; cv=none; b=vTUYrLrg7sFKcfgCNpkNTAgXPqHgDBMNVcPYDMXyx0eMfiy5yghDg1KCXdqJPWqKZBpLV3 PyTs5SZlmyUXibRKcqZVcFHQ4yXXiOO2i1vLmJ+ffMYmg3eTduCk+qZUkeAZ5p1NG0Y48Y 5S+djOuXHKWHOdkBtjKZTtmJ+/BKdd5lOnFZv19St+481YIuAXxZvN+vVtuGKpl+9BpQtg UQf4qt2NFav+0Tjh8xahJKw8D6/A0e5kp4qH2V4jpE26+HjZpg8pmc+COwFtYi/871Ya15 AqEhrrAQMrh/aRq+NtO/EiHg4zEB4/qza+jCXZru16CYwZm4St9OgavfK1gVaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776845992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lo19Wh9vuec8T7qYL7o+TAAI7yUMclqSLB7DCSQzl4A=; b=pXn+muIc7XgwiPhnCJFdXyNMNc5JUUqB8RWPA6Laj9f29SP4Af3r0qiMuopDael4252rS0 jtPWWHxqjJlZ5gY6T18wn1MgnySZdNt1OjzBwn5yKJfjfFbYcoQx0mkh1Zfbqv8AM9lO9t dj1+ETlMScjQB0CPW4yDqu3tNlv/oqSDlizQ1LIpn92xsFZ5YlFUFuFA9Nsb4Fz9BJUtFj /09gdLiv5vg64Q3/7kCLVbvetcB1fypaesqtIXIzC4DObjB6yW843OSdNRf/KOspEvKsG3 i90I7ZtubFiQromuadj5L+vcwH+sAGS5dfqQ5rsXXp+Sv3JKe5CQUOz5Pcu8cQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g0sbD0vHMz6bv for ; Wed, 22 Apr 2026 08:19:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25a45 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 22 Apr 2026 08:19:47 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 3d00db6b8b73 - main - tests.7: Provide better examples List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3d00db6b8b73ef7f89654a2928d247d62d39ee29 Auto-Submitted: auto-generated Date: Wed, 22 Apr 2026 08:19:47 +0000 Message-Id: <69e884a3.25a45.60151f73@gitrepo.freebsd.org> The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=3d00db6b8b73ef7f89654a2928d247d62d39ee29 commit 3d00db6b8b73ef7f89654a2928d247d62d39ee29 Author: Dag-Erling Smørgrav AuthorDate: 2026-04-22 08:19:32 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-04-22 08:19:32 +0000 tests.7: Provide better examples Previous authors appear to have prioritized brevity over clarity. This unfortunately resulted in a manual page that left its reader with the false impression that Kyua is difficult to use. Attempt to correct this by providing more and simpler examples with longer explanations. While here, correct outdated information about where Kyua stores its logs and results. MFC after: 1 week Reviewed by: ziaee, ngie Differential Revision: https://reviews.freebsd.org/D56475 --- share/man/man7/tests.7 | 102 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 89 insertions(+), 13 deletions(-) diff --git a/share/man/man7/tests.7 b/share/man/man7/tests.7 index 61b0789b9149..97cc6beba4dc 100644 --- a/share/man/man7/tests.7 +++ b/share/man/man7/tests.7 @@ -25,7 +25,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 1, 2025 +.Dd April 17, 2026 .Dt TESTS 7 .Os .Sh NAME @@ -97,37 +97,107 @@ third-party packages or manual modifications to configuration files) do not introduce unexpected failures. .El .Ss Running the tests -Use the following command to run the whole test suite: +By default, Kyua looks for tests in the current directory. +To run the whole test suite, either use the +.Fl k +option to specify the top-level +.Pa Kyuafile : .Bd -literal -offset indent $ kyua test -k /usr/tests/Kyuafile .Ed .Pp +or just change to the test suite root before running Kyua: +.Bd -literal -offset indent +$ cd /usr/tests +$ kyua test +.Ed +.Pp The above will iterate through all test programs in .Pa /usr/tests recursively, execute them, store their results and debugging data in Kyua's database (by default in -.Pa ~/.kyua/store.db ) , +.Pa ~/.kyua/store/ ) , and print a summary of the results. This summary includes a brief count of all total tests run and how many of them failed. .Pp -It is possible to restrict which tests to run by providing their names in -the command line. -For example, this would execute the tests for the +It is possible to restrict which tests to run by providing their +names, or a portion of their path, on the command line. +For example, this would execute all of the tests provided for the .Xr cp 1 and -.Xr cut 1 +.Xr stat 1 utilities: .Bd -literal -offset indent -$ kyua test -k /usr/tests/Kyuafile bin/cp usr.bin/cut +$ cd /usr/tests +$ kyua test bin/cp usr.bin/stat +.Ed +.Pp +This would execute only one of the two test programs provided for +.Xr stat 1 : +.Bd -literal -offset indent +$ cd /usr/tests +$ kyua test usr.bin/stat/stat_test +.Ed +.Pp +This would execute just a single test case: +.Bd -literal -offset indent +$ cd /usr/tests +$ kyua test usr.bin/stat/stat_test:t_flag +.Ed +.Pp +Finally, this would execute that test case in debug mode: +.Bd -literal -offset indent +$ cd /usr/tests +$ kyua debug -p usr.bin/stat/stat_test:t_flag .Ed +.Pp +The +.Fl p +option tells Kyua to pause before cleanup so you can inspect the +temporary directory to better understand why the test failed. +.Pp +Note that some tests may require root privileges to execute: +.Bd -literal -offset indent +$ cd /usr/tests +$ kyua debug usr.bin/stat/stat_test:h_flag +usr.bin/stat/stat_test:h_flag -> skipped: Requires root privileges +$ sudo kyua debug usr.bin/stat/stat_test:h_flag +[...] +usr.bin/stat/stat_test:h_flag -> passed +.Ed +.Pp +Conversely, some tests will only work correctly if run as an +unprivileged user. +This will normally be noted in the test's metadata, causing Kyua to +automatically drop privileges before running the test. .Ss Obtaining reports of the tests execution Additional information about the test results can be retrieved by using Kyua's various reporting commands. -For example, the following would print a plain-text report of the executed -tests and show which ones failed: +For example, the following would print a plain-text report of the +tests executed in the latest test run and show which ones failed: +.Bd -literal -offset indent +$ kyua report --verbose +.Ed +.Pp +To show the results of an arbitrary test run, use the +.Fl r +option to specify which results file to read: +.Bd -literal -offset indent +$ kyua report --verbose \\ + -r ~/.kyua/store/results.usr_tests.20260417-173009-335060.db +.Ed +.Pp +Keep in mind that if the tests were run as root, the results will have +been stored in root's +.Pa kyua +directory, and the easiest way to access them will be to run the +.Cm report +command as root as well: .Bd -literal -offset indent -$ kyua report --verbose -r <.db file from output of test> +$ cd /usr/tests +$ sudo kyua test usr.bin/stat +$ sudo kyua report --verbose .Ed .Pp This example would generate an HTML report ready to be published on a @@ -207,8 +277,14 @@ System-wide configuration file for User-specific configuration file for .Xr kyua 1 ; overrides the system file. -.It Pa ~/.kyua/store.db -Default result database used by Kyua. +.It Pa ~/.kyua/logs/ +Default location of Kyua debug logs (one +.Pa .log +file per test run). +.It Pa ~/.kyua/store/ +Default location of Kyua test results (one +.Pa .db +file per test run). .It Pa /usr/tests/ Location of the .Fx