xref: /dflybsd-src/share/man/man9/tbridge.9 (revision 0e84c0db0d0bcd6d681bc30fd16e96c26bb92db2)
1ae9799f1SAlex Hornung.\"
2ae9799f1SAlex Hornung.\" Copyright (c) 2011
3ae9799f1SAlex Hornung.\"	The DragonFly Project.  All rights reserved.
4ae9799f1SAlex Hornung.\"
5ae9799f1SAlex Hornung.\" Redistribution and use in source and binary forms, with or without
6ae9799f1SAlex Hornung.\" modification, are permitted provided that the following conditions
7ae9799f1SAlex Hornung.\" are met:
8ae9799f1SAlex Hornung.\"
9ae9799f1SAlex Hornung.\" 1. Redistributions of source code must retain the above copyright
10ae9799f1SAlex Hornung.\"    notice, this list of conditions and the following disclaimer.
11ae9799f1SAlex Hornung.\" 2. Redistributions in binary form must reproduce the above copyright
12ae9799f1SAlex Hornung.\"    notice, this list of conditions and the following disclaimer in
13ae9799f1SAlex Hornung.\"    the documentation and/or other materials provided with the
14ae9799f1SAlex Hornung.\"    distribution.
15ae9799f1SAlex Hornung.\" 3. Neither the name of The DragonFly Project nor the names of its
16ae9799f1SAlex Hornung.\"    contributors may be used to endorse or promote products derived
17ae9799f1SAlex Hornung.\"    from this software without specific, prior written permission.
18ae9799f1SAlex Hornung.\"
19ae9799f1SAlex Hornung.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20ae9799f1SAlex Hornung.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21ae9799f1SAlex Hornung.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22ae9799f1SAlex Hornung.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
23ae9799f1SAlex Hornung.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24ae9799f1SAlex Hornung.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
25ae9799f1SAlex Hornung.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26ae9799f1SAlex Hornung.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27ae9799f1SAlex Hornung.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28ae9799f1SAlex Hornung.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29ae9799f1SAlex Hornung.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30ae9799f1SAlex Hornung.\" SUCH DAMAGE.
31ae9799f1SAlex Hornung.\"
32ae9799f1SAlex Hornung.Dd November 18, 2011
33ae9799f1SAlex Hornung.Dt TBRIDGE 9
34ae9799f1SAlex Hornung.Os
35ae9799f1SAlex Hornung.Sh NAME
36ae9799f1SAlex Hornung.Nm tbridge_printf ,
37ae9799f1SAlex Hornung.Nm tbridge_test_done
38ae9799f1SAlex Hornung.Nd kernel test bridge for dfregress
39ae9799f1SAlex Hornung.Sh SYNOPSIS
40ae9799f1SAlex Hornung.In sys/systm.h
41ae9799f1SAlex Hornung.In sys/kernel.h
42ae9799f1SAlex Hornung.In sys/module.h
43ae9799f1SAlex Hornung.In sys/tbridge.h
44ae9799f1SAlex Hornung.Pp
45ae9799f1SAlex HornungFunctions:
46ae9799f1SAlex Hornung.Ft int
47*0e84c0dbSAlex Hornung.Fn tbridge_printf "const char *fmt" "..."
48ae9799f1SAlex Hornung.Ft void
49ae9799f1SAlex Hornung.Fn tbridge_test_done "int result"
50ae9799f1SAlex Hornung.Pp
51ae9799f1SAlex HornungMacros:
52ae9799f1SAlex Hornung.Fn TBRIDGE_TESTCASE_MODULE "name" "struct tbridge_testcase *testcase"
53ae9799f1SAlex Hornung.Pp
54ae9799f1SAlex HornungDefines:
55ae9799f1SAlex Hornung.Dv RESULT_TIMEOUT ,
56ae9799f1SAlex Hornung.Dv RESULT_SIGNALLED ,
57ae9799f1SAlex Hornung.Dv RESULT_NOTRUN ,
58ae9799f1SAlex Hornung.Dv RESULT_FAIL ,
59ae9799f1SAlex Hornung.Dv RESULT_PASS ,
60ae9799f1SAlex Hornung.Dv RESULT_UNKNOWN
61ae9799f1SAlex Hornung.Pp
62ae9799f1SAlex HornungCallbacks:
63ae9799f1SAlex Hornung.Ft typedef int
64ae9799f1SAlex Hornung.Fn tbridge_abort_t ""
65ae9799f1SAlex Hornung.Ft typedef void
66ae9799f1SAlex Hornung.Fn tbridge_run_t "void *"
67ae9799f1SAlex Hornung.Sh DESCRIPTION
68ae9799f1SAlex HornungTo create a new kernel testcase
69ae9799f1SAlex Hornung.Sq testfoo
70ae9799f1SAlex Hornungthe following is required:
71ae9799f1SAlex Hornung.Bd -literal
72ae9799f1SAlex HornungTBRIDGE_TESTCASE_MODULE(testfoo, &testfoo_case);
73ae9799f1SAlex Hornung
74ae9799f1SAlex Hornungstruct tbridge_testcase testfoo_case = {
75ae9799f1SAlex Hornung	.tb_run = testfoo_run,
76ae9799f1SAlex Hornung
77ae9799f1SAlex Hornung	/* The following are optional */
78ae9799f1SAlex Hornung	.tb_abort = testfoo_abort
79ae9799f1SAlex Hornung};
80ae9799f1SAlex Hornung.Ed
81ae9799f1SAlex Hornung.Pp
82ae9799f1SAlex HornungThe
83ae9799f1SAlex Hornung.Fa tb_run
84ae9799f1SAlex Hornungcallback is called from a separate kernel thread to start testcase
85ae9799f1SAlex Hornungexecution.
86ae9799f1SAlex Hornung.Pp
87ae9799f1SAlex HornungThe
88ae9799f1SAlex Hornung.Fa tb_abort
89ae9799f1SAlex Hornungcallback is optional, but highly recommended.
90ae9799f1SAlex HornungIt is called whenever a testcase execution times out, so that the
91ae9799f1SAlex Hornungtestcase can clean up and abort all running tasks, if possible.
92*0e84c0dbSAlex HornungIf this is not applicable to your test because it is impossible
93ae9799f1SAlex Hornungto interrupt, set to
94ae9799f1SAlex Hornung.Dv NULL .
95ae9799f1SAlex Hornung.Sh FUNCTIONS
96ae9799f1SAlex HornungThe
97ae9799f1SAlex Hornung.Fn TBRIDGE_TESTCASE_MODULE
98ae9799f1SAlex Hornungmacro declares a
99ae9799f1SAlex Hornung.Nm
100ae9799f1SAlex Hornungtestcase kernel module.
101ae9799f1SAlex Hornung.Fa testcase
102ae9799f1SAlex Hornungis a structure of type
103ae9799f1SAlex Hornung.Ft struct tbridge_testcase ,
104ae9799f1SAlex Hornungas described above.
105ae9799f1SAlex Hornung.Pp
106ae9799f1SAlex HornungThe
107ae9799f1SAlex Hornung.Fn tbridge_printf
108ae9799f1SAlex Hornungfunction acts as a kprintf replacement that will log all the output
109ae9799f1SAlex Hornunginto the testcase metadata that is passed back to userland upon completion.
110ae9799f1SAlex HornungIts syntax is equivalent to that of
111ae9799f1SAlex Hornung.Xr kprintf 9 .
112ae9799f1SAlex Hornung.Pp
113ae9799f1SAlex HornungThe
114ae9799f1SAlex Hornung.Fn tbridge_test_done
115ae9799f1SAlex Hornungfunction should be called whenever a result for the testcase is available.
116ae9799f1SAlex HornungThe parameter
117ae9799f1SAlex Hornung.Fa result
118ae9799f1SAlex Hornungshould be set to one of the
119ae9799f1SAlex Hornung.Dv RESULT_
120ae9799f1SAlex Hornungdefines.
121ae9799f1SAlex Hornung.Sh SEE ALSO
122ae9799f1SAlex Hornung.Xr dfregress 8
123ae9799f1SAlex Hornung.Sh HISTORY
124ae9799f1SAlex HornungThe
125ae9799f1SAlex Hornung.Nm
126ae9799f1SAlex Hornungmodule first appeared in
127ae9799f1SAlex Hornung.Dx 2.13 .
128ae9799f1SAlex Hornung.Sh AUTHORS
129ae9799f1SAlex HornungThe
130ae9799f1SAlex Hornung.Nm
131ae9799f1SAlex Hornungmodule was written by
132ae9799f1SAlex Hornung.An Alex Hornung .
133