KTEST(8) | Maintenance Commands and Procedures | KTEST(8) |
ktest
— list and
run kernel tests
ktest |
ktest |
[-H ] [[-p ]
-o field[,...]]
[triple...] |
ktest |
[-H ] [-n ]
[[-p ] -o
field[,...]] [-i input]
triple... |
ktest |
[-a ] [name] |
ktest |
[-a ] [name] |
The ktest
facility provides in situ kernel
testing by running test code in kernel context; essentially unit tests for
the kernel. The ktest
command is used to list or run
registered kernel tests. The ktest
command interacts
with the in-kernel ktest facility by way of the
/dev/ktest pseudo device. A process must run in the
Global Zone and have the
PRIV_SYS_DEVICES
privilege in order to access the device.
ktest help
The list
and run
subcommands share the options described in
OUTPUT OPTIONS.
ktest
list
[-H
] [[-p
]
-o
field[,...]]
[triple...]
ktest
run
[-H
] [-n
]
[[-p
] -o
field[,...]] [-i
file] triple...
ktest
load
[-a
] [name]
list
and run
.
-a
ktest
unload
[-a
] [name]
-a
Available tests and the results of running said tests are emitted
by the list
and run
commands, respectively.
Output from the list
and
run
commands is controlled by the following
options:
-H
-o
field[,...]The available fields and their contents are described in FIELDS section below.
-p
run
command.
The -o
option is required with
-p
.
The following is a list of output fields used by the
ktest
command along with their meanings.
run
command.
The different types of results that a test can produce.
The following exit values are returned:
List all tests registered with the ktest framework.
ktest list
Run all tests registered with the ktest framework.
ktest run '*'
This example runs only tests registered under the mac test module. This includes all suites under the mac module and all tests under each suite.
ktest run 'mac::'
Execute a specific test which requires an input stream.
ktest run -i data.pcap mac:checksum:mac_sw_cksum_ipv4_snoop_test
The command syntax is Uncommitted. The output format is Uncommitted.
February 12, 2025 | OmniOS |