RUN(1)
β¨ RUN(1) β¨
okay so this is the manual page for run from the General Commands Manual β she's giving very main character energy and honestly? deserved. π
πΈ NAME πΈ
run β find, execute, and log the results of tests π§ͺβ¨
π SYNOPSIS π
run [-dgq] [-o outputdir] [-pP script] [-t -seconds] [-uxX username]
pathnameβ¦
run -w runfile [-gq] [-o outputdir] [-pP script] [-t -seconds]
[-uxX username] pathnameβ¦
run -c runfile [-dq]
run [-h]
π DESCRIPTION π
so run has three basic modes of operation, and likeβ¦ which one you get depends on your flags. no cap. π«Ά
With neither -c nor -w, run processes the arguments you handed it on the command line, adding them to the list for this run. If a pathname you specified is an executable file, it gets added as a test. If a pathname is a directory, the behavior depends on whether -g is hanging around:
- if
-gis specified, the directory is treated as a test group β see the section on Test Groups below bestie, it's right there π - without
-g,runsimply descends into the directory looking for executable files
Then the tests are executed, and the results are logged. that's it, that's the vibe. β¨
With -w, run finds tests in the manner described above. But instead of executing the tests and logging the results, the test configuration is stored in a runfile, which you can use in future invocations, or edit to modify which tests are executed and which options are applied. Options you included on the command line alongside -w become defaults in the runfile. π
With -c, run parses a runfile, which can specify a series of tests and test groups to be executed. The tests are then executed, and the results are logged. periodt. π₯
π¦ Test Groups π¦
A test group is comprised of a set of executable files, all of which exist in one directory. The options specified on the command line or in a runfile apply to individual tests in the group. The exception? Options pertaining to pre and post scripts, which act on all tests as a group. Rather than running before and after each test, these scripts are run only once each at the start and end of the test group. iconic behavior honestly π
π Test Execution π
The specified tests run serially, and are typically assigned results according to exit values. Tests that exit zero and non-zero are marked PASS and FAIL, respectively. πβ€οΈ
When a pre script fails for a test group, only the post script is executed, and the remaining tests are marked SKIPPED. Any test that exceeds its timeout is terminated, and marked KILLED. ππ
By default, tests are executed with the credentials of the run script. Executing tests with other credentials is done via sudo(1m), which must be configured to allow execution without prompting for a password. Environment variables from the calling shell are available to individual tests. During test execution, the working directory is changed to outputdir. π§
π Output Logging π
By default, run will print one line on standard output at the conclusion of each test indicating the test name, result and elapsed time. slay.
Additionally, for each invocation of run, a directory is created using the ISO 8601 date format. Within this directory is a file named log containing all the test output with timestamps, and a directory for each test. Within the test directories, there is one file each for standard output, standard error and merged output. The default location for the outputdir is /var/tmp/test_results. π
π Runfiles π
The runfile is an INI-style configuration file that describes a test run. The file has one section named DEFAULT, which contains configuration option names and their values in name = value format. The values in this section apply to all the subsequent sections, unless they are also specified there, in which case the default is overridden. The remaining section names are the absolute pathnames of files and directories, describing tests and test groups respectively. πβ¨
The legal option names are:
outputdir = pathnameβ The name of the directory that holds test logs. ποΈpre = scriptβ Run script prior to the test or test group.pre_user = usernameβ Execute the pre script as username.post = scriptβ Run script after the test or test group.post_user = usernameβ Execute the post script as username.quiet = True|Falseβ IfTrue, only the results summary is printed to standard out. π€«tests = ['filename', β¦]β Specify a list of filenames for this test group. Only the basename of the absolute path is required. This option is only valid for test groups, and each filename must be single quoted.timeout = nβ A timeout value ofnseconds. β°user = usernameβ Execute the test or test group as username.
β¨ OPTIONS β¨
-c runfileβ Specify a runfile to be consumed by theruncommand. π₯-dβ Dry run mode. Execute no tests, but print a description of each test that would have been run. manifesting without the commitment π-mβ Enable kmemleak reporting (Linux only). π§-gβ Create test groups from any directories found while searching for tests. π―-o outputdirβ Specify the directory in which to write test results.-p scriptβ Run script prior to any test or test group.-P scriptβ Run script after any test or test group.-qβ Print only the results summary to the standard output. π€-s scriptβ Run script as a failsafe after any test is killed. π-S usernameβ Execute the failsafe script as username.-t nβ Specify a timeout value ofnseconds per test. β³-u usernameβ Execute tests or test groups as username.-w runfileβ Specify the name of the runfile to create. π-x usernameβ Execute the pre script as username.-X usernameβ Execute the post script as username.
π EXAMPLES π
Example 1: Running ad-hoc tests.
This example demonstrates the simplest invocation of run. π
% run my-tests
Test: /home/jkennedy/my-tests/test-01 [00:02] [PASS]
Test: /home/jkennedy/my-tests/test-02 [00:04] [PASS]
Test: /home/jkennedy/my-tests/test-03 [00:01] [PASS]
Results Summary
PASS 3
Running Time: 00:00:07
Percent passed: 100.0%
Log directory: /var/tmp/test_results/20120923T180654
Example 2: Creating a runfile for future use.
This example demonstrates creating a runfile with non-default options. π
% run -p setup -x root -g -w new-tests.run new-tests
% cat new-tests.run
[DEFAULT]
pre = setup
post_user =
quiet = False
user =
timeout = 60
post =
pre_user = root
outputdir = /var/tmp/test_results
[/home/jkennedy/new-tests]
tests = ['test-01', 'test-02', 'test-03']
π SEE ALSO π
sudo(1m)
okay bestie that's the whole page, you ate that π β¨ go run some tests fr fr π§ͺπ
this masterpiece was brought to you by OpenZFS, dated May 26, 2021 β yeah it's vintage but it's still iconic, no cap π«Άπ
π¦ where this page comes from
- alpine 3.22: zfs-doc 2.3.9-r0 Β· CDDL-1.0
- alpine 3.23: zfs-doc 2.4.4-r0 Β· CDDL-1.0
- alpine 3.24: zfs-doc 2.4.4-r0 Β· CDDL-1.0
- debian trixie: zfs-test 2.3.9-0+deb13u1 Β· CDDL-1.0
- nixos 26.05: zfs-user 2.4.4
- nixpkgs unstable: zfs-user 2.4.4
- ubuntu questing: zfs-test 2.3.4-1ubuntu2
- ubuntu resolute: zfs-test 2.4.1-1ubuntu5 Β· CDDL-1.0
- ubuntu resolute: zfs-test 2.4.1-1ubuntu5.1 Β· CDDL-1.0
- ubuntu stonking: zfs-test 2.4.4-1ubuntu4 Β· CDDL-1.0
- π the page's license: CDDL-1.0
- Copyright (c) 2012 by Delphix. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms