Module Name:    src
Committed By:   jmmv
Date:           Mon Feb 25 02:02:41 UTC 2013

Modified Files:
        src/share/man/man7: Makefile
Added Files:
        src/share/man/man7: tests.atf.7 tests.kyua.7
Removed Files:
        src/share/man/man7: tests.7

Log Message:
Provide Kyua instructions in tests(7) when MKKYUA!=no.

I was first going to do this by doing automatic replacements of special
macros within the tests.7 file, but that turned out to be too complex
and confusing.

Instead, just rename the previous tests.7 to tests.atf.7 and add a new
tests.kyua.7 file.  Choose which one to install as tests(7) depending on
the MKKYUA knob.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/share/man/man7/Makefile
cvs rdiff -u -r1.9 -r0 src/share/man/man7/tests.7
cvs rdiff -u -r0 -r1.1 src/share/man/man7/tests.atf.7 \
    src/share/man/man7/tests.kyua.7

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man7/Makefile
diff -u src/share/man/man7/Makefile:1.28 src/share/man/man7/Makefile:1.29
--- src/share/man/man7/Makefile:1.28	Sat Sep 24 17:04:38 2011
+++ src/share/man/man7/Makefile	Mon Feb 25 02:02:41 2013
@@ -1,6 +1,8 @@
-#	$NetBSD: Makefile,v 1.28 2011/09/24 17:04:38 christos Exp $
+#	$NetBSD: Makefile,v 1.29 2013/02/25 02:02:41 jmmv Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/5/93
 
+.include <bsd.init.mk>
+
 # missing: eqnchar.7 man.7 ms.7 term.7
 
 MAN=	ascii.7 c.7 environ.7 glob.7 hier.7 hostname.7 intro.7 mailaddr.7 \
@@ -8,6 +10,15 @@ MAN=	ascii.7 c.7 environ.7 glob.7 hier.7
 	security.7 script.7 setuid.7 signal.7 sticky.7 symlink.7 sysctl.7 \
 	tests.7
 
+CLEANFILES=	tests.7
+.if ${MKKYUA} != "no"
+tests.7: tests.kyua.7
+	cp ${.ALLSRC} ${.TARGET}
+.else
+tests.7: tests.atf.7
+	cp ${.ALLSRC} ${.TARGET}
+.endif
+
 MLINKS+=c.7 c78.7 \
 	c.7 c89.7 \
 	c.7 c90.7 \

Added files:

Index: src/share/man/man7/tests.atf.7
diff -u /dev/null src/share/man/man7/tests.atf.7:1.1
--- /dev/null	Mon Feb 25 02:02:41 2013
+++ src/share/man/man7/tests.atf.7	Mon Feb 25 02:02:41 2013
@@ -0,0 +1,221 @@
+.\"	$NetBSD: tests.atf.7,v 1.1 2013/02/25 02:02:41 jmmv Exp $
+.\"
+.\" Copyright (c) 2010 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
+.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd August 5, 2011
+.Dt TESTS 7
+.Os
+.Sh NAME
+.Nm tests
+.Nd introduction to the NetBSD test suite
+.Sh DESCRIPTION
+The
+.Nx
+test suite provides a collection of automated tests for two major purposes.
+On the one hand, the test suite aids
+.Em developers
+in catching bugs and regressions in the code when they performing modifications
+to the source tree.
+On the other hand, the test suite allows
+.Em end users
+(and, in particular, system administrators) to verify that fresh installations
+of the
+.Nx
+operating system behave correctly in their hardware platform and also to ensure
+that the system does not suffer from regressions during regular system
+operation and maintenance.
+.Pp
+The
+.Nx
+tests are implemented using the
+.Em Automated Testing Framework (ATF) ,
+a third-party package shipped with
+.Nx ;
+see
+.Xr atf 7
+for details.
+The
+.Nx
+test suite is distributed as a separate installation set, named
+.Pa tests.tgz ,
+and the test programs are all installed under the
+.Pa /usr/tests
+hierarchy.
+.Pp
+This manual page describes how to execute the test suite and how to configure
+some of its optional features.
+.Ss When to run the tests?
+Before diving into the details of how to run the test suite, here are some
+scenarios in which you should be running them:
+.Bl -bullet -offset indent
+.It
+After a fresh installation of
+.Nx
+to ensure that the system works correctly on your hardware platform.
+.It
+After an upgrade of
+.Nx
+to a different version to ensure that the new code works well on your
+hardware platform and that the upgrade did not introduce regressions in your
+configuration.
+.It
+After performing changes to the source tree to catch any bugs and/or regressions
+introduced by the modifications.
+.It
+Periodically, maybe from a
+.Xr cron 8
+job, to ensure that any changes to the system (such as the installation of
+third-party packages or manual modifications to configuration files) do not
+introduce unexpected failures.
+.El
+.Ss Installing the tests
+If you chose to install the
+.Pa tests.tgz
+distribution set while setting up your
+.Nx
+system, the tests are already available in
+.Pa /usr/tests .
+Otherwise, install the set now by running:
+.Bd -literal -offset indent
+# cd /
+# tar xzpf /path/to/tests.tgz
+.Ed
+.Ss Running the tests
+Use the following commands to run the whole test suite:
+.Bd -literal -offset indent
+$ cd /usr/tests
+$ atf-run | atf-report
+.Ed
+.Pp
+The above will go through all test programs in
+.Pa /usr/tests
+recursively, execute them, and, at the very end, show a report of
+the results of the test suite.
+These results include the count of tests that succeeded (passed), the names of
+the tests that failed, and the count of the tests that were not executed
+(skipped) because the system configuration did not meet their requirements.
+.Pp
+If you are interested in saving the whole output of the test suite execution so
+that you can later investigate failures, use the following idiom instead:
+.Bd -literal -offset indent
+$ cd /usr/tests
+$ atf-run | tee ~/tests.log | atf-report
+.Ed
+.Pp
+The above command will save the raw output of the test suite in
+.Pa ~/tests.log ,
+which you can later inspect manually to look for failures.
+Note that the file contains a copy of the
+.Sq stdout
+and
+.Sq stderr
+of each test case, which becomes valuable during debugging.
+.Pp
+It is also possible to restrict which tests to execute so that only a small
+subsystem is tested; see
+.Xr atf-run 1
+for details.
+Additionally, it is also possible to run the test programs themselves by hand;
+see
+.Xr atf-test-program 1
+for more details, but be aware that you should only be doing this if you are
+debugging failing tests.
+.Ss Configuring the tests
+Some test cases in the
+.Nx
+test suite require the administrator to manually set up some configuration
+properties before they can run.
+Unless these properties are defined, the tests that require them will be marked
+as skipped and thus they will not be really executed.
+.Pp
+Each test suite is configured through a separate file that lives under
+.Pa /etc/atf/
+and that carries the name of the test suite.
+Henceforth, to configure the properties that affect the execution of the
+.Nx
+test suite, you need to edit
+.Pa /etc/atf/NetBSD.conf .
+The suite-specific configuration file implicitly depends on
+.Pa /etc/atf/common.conf ,
+which contains properties shared among all test suites.
+These files conform to the configuration file format described in
+.Xr atf-formats 5 .
+.Pp
+The following configuration variables are available in the
+.Nx
+test suite:
+.Bl -tag -width "unprivileged-user"
+.It fstype
+When set to a filesystem type, restrict tests programs from the
+.Pa /usr/tests/fs/vfs/
+tree to only run test cases for the given type.
+.It unprivileged-user
+This variable allows setting an unprivileged user login name to be used by
+tests.
+Defaults to
+.Sq _tests .
+.El
+.Ss What to do if something fails?
+If there is
+.Em any failure
+during the execution of the test suite, please considering reporting it to the
+.Nx
+developers so that the failure can be analyzed and fixed.
+To do so, either send a message to the appropriate mailing list or file a
+problem report.
+For more details please refer to:
+.Bl -bullet -offset indent -compact
+.It
+.Lk http://www.netbsd.org/mailinglists/ "NetBSD mailing lists"
+.It
+.Lk http://www.netbsd.org/support/send-pr.html "NetBSD Problem Reports"
+.El
+.Sh FILES
+.Bl -tag -compact -width etcXatfXNetBSDXconfXX
+.It Pa /etc/atf/NetBSD.conf
+Configuration file for the
+.Nx
+test suite.
+.It Pa /etc/atf/common.conf
+Configuration file for all test suites.
+.It Pa /usr/tests/
+Location of the test suites.
+.El
+.Sh SEE ALSO
+.Xr atf 7
+.Sh HISTORY
+The
+.Nm
+manual page first appeared in
+.Nx 6.0 .
+.Pp
+The ATF testing framework was first distributed with
+.Nx 5.0
+and the collection of test programs in
+.Pa /usr/tests
+has been growing since then.
+.Sh AUTHORS
+.An Julio Merino Aq j...@netbsd.org
Index: src/share/man/man7/tests.kyua.7
diff -u /dev/null src/share/man/man7/tests.kyua.7:1.1
--- /dev/null	Mon Feb 25 02:02:41 2013
+++ src/share/man/man7/tests.kyua.7	Mon Feb 25 02:02:41 2013
@@ -0,0 +1,232 @@
+.\"	$NetBSD: tests.kyua.7,v 1.1 2013/02/25 02:02:41 jmmv Exp $
+.\"
+.\" Copyright (c) 2010 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
+.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd February 24, 2013
+.Dt TESTS 7
+.Os
+.Sh NAME
+.Nm tests
+.Nd introduction to the NetBSD test suite
+.Sh DESCRIPTION
+The
+.Nx
+test suite provides a collection of automated tests for two major purposes.
+On the one hand, the test suite aids
+.Em developers
+in catching bugs and regressions in the code when they performing modifications
+to the source tree.
+On the other hand, the test suite allows
+.Em end users
+(and, in particular, system administrators) to verify that fresh installations
+of the
+.Nx
+operating system behave correctly in their hardware platform and also to ensure
+that the system does not suffer from regressions during regular system
+operation and maintenance.
+.Pp
+The
+.Nx
+test suite is distributed as a separate installation set, named
+.Pa tests.tgz ,
+and the test programs are all installed under the
+.Pa /usr/tests
+hierarchy.
+.Pp
+This manual page describes how to execute the test suite and how to configure
+some of its optional features.
+.Ss When to run the tests?
+Before diving into the details of how to run the test suite, here are some
+scenarios in which you should be running them:
+.Bl -bullet -offset indent
+.It
+After a fresh installation of
+.Nx
+to ensure that the system works correctly on your hardware platform.
+.It
+After an upgrade of
+.Nx
+to a different version to ensure that the new code works well on your
+hardware platform and that the upgrade did not introduce regressions in your
+configuration.
+.It
+After performing changes to the source tree to catch any bugs and/or regressions
+introduced by the modifications.
+.It
+Periodically, maybe from a
+.Xr cron 8
+job, to ensure that any changes to the system (such as the installation of
+third-party packages or manual modifications to configuration files) do not
+introduce unexpected failures.
+.El
+.Ss Installing the tests
+If you chose to install the
+.Pa tests.tgz
+distribution set while setting up your
+.Nx
+system, the tests are already available in
+.Pa /usr/tests .
+Otherwise, install the set now by running:
+.Bd -literal -offset indent
+# cd /
+# tar xzpf /path/to/tests.tgz
+.Ed
+.Ss Running the tests
+Use the following command to run the whole test suite:
+.Bd -literal -offset indent
+$ kyua test -k /usr/tests/Kyuafile
+.Ed
+.Pp
+The above will go through all test programs in
+.Pa /usr/tests
+recursively, execute them, store their results and debugging data in Kyua
+database (by default in
+.Pa ~/.kyua/store.db ) ,
+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
+.Xr cp 1
+and
+.Xr cut 1
+utilities:
+.Bd -literal -offset indent
+$ kyua test -k /usr/tests/Kyuafile bin/cp usr.bin/cut
+.Ed
+.Ss Obtaining reports of the tests execution
+Additional information of the results of the execution can be later extracted
+from the database by using the various reporting commands of Kyua.
+For example, the following would extract a plain-text report of the executed
+tests and show which ones failed:
+.Bd -literal -offset indent
+$ kyua report
+.Ed
+.Pp
+This other example would generate an HTML report ready to be published on a
+web server, possibly the built-in
+.Xr httpd 8 :
+.Bd -literal -offset indent
+$ kyua report-html --output ~/public_html/tests
+.Ed
+.Pp
+For further details on the command-line interface of Kyua, please refer
+to its manual page
+.Xr kyua 1 .
+.Ss Configuring the tests
+Some test cases in the
+.Nx
+test suite require the administrator to manually set up some configuration
+properties before they can run.
+Unless these properties are defined, the tests that require them will be marked
+as skipped and thus they will not be really executed.
+.Pp
+Test suites are configured by defining the values to their configuration
+variables in
+.Pa /etc/kyua/kyua.conf .
+The format of this file is detailed in
+.Xr kyua.conf 5 .
+.Pp
+The following configuration variables are available in the
+.Nx
+test suite:
+.Bl -tag -width "fstype"
+.It fstype
+When set to a filesystem type, restrict tests programs from the
+.Pa /usr/tests/fs/vfs/ .
+.Ss What to do if something fails?
+If there is
+.Em any failure
+during the execution of the test suite, please considering reporting it to the
+.Nx
+developers so that the failure can be analyzed and fixed.
+To do so, either send a message to the appropriate mailing list or file a
+problem report.
+For more details please refer to:
+.Bl -bullet -offset indent -compact
+.It
+.Lk http://www.netbsd.org/mailinglists/ "NetBSD mailing lists"
+.It
+.Lk http://www.netbsd.org/support/send-pr.html "NetBSD Problem Reports"
+.El
+.Sh FILES
+.Bl -tag -compact -width etcXatfXNetBSDXconfXX
+.It Pa /etc/kyua/kyua.conf
+System-wide configuration file for
+.Xr kyua 1 .
+.It Pa ~/.kyua/kyua.conf
+User-specific configuration file for
+.Xr kyua 1 ;
+overrides the system file.
+.It Pa ~/.kyua/store.db
+Default database used by Kyua to maintain the data of the executed tests.
+.It Pa /usr/tests/
+Location of the
+.Nx
+test suite.
+.It Pa /usr/tests/Kyuafile
+Top-level test suite definition file.
+.El
+.Sh SEE ALSO
+.Xr kyua 1 ,
+.Xr kyua-report 1 ,
+.Xr kyua-test 1
+.Sh HISTORY
+The collection of test programs in
+.Pa /usr/tests
+first appeared in
+.Nx 5.0
+and has been growing since then.
+.Pp
+The
+.Nm
+manual page first appeared in
+.Nx 6.0
+and was updated in
+.Nx 7.0
+to describe the execution of the tests with Kyua rather than with ATF.
+.Pp
+The ATF testing framework was first distributed with
+.Nx 5.0
+and the runtime tools of this framework are being phased out in
+.Nx 7.0 .
+Note that the
+.Em libraries
+that ship with ATF are still in active use and are not deprecated.
+.Pp
+The Kyua testing toolkit was first distributed with
+.Nx 7.0 .
+The
+.Xr atf-run 1
+and
+.Xr atf-report 1
+tools were replaced as part of this import to be backwards-compatibility
+wrappers around
+.Xr kyua 1 .
+.Sh AUTHORS
+.An Julio Merino Aq j...@netbsd.org

Reply via email to