xref: /aosp_15_r20/external/ltp/doc/old/User-Guidelines.asciidoc (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1LTP User Guidelines
2===================
3
4For compiling, installing and running the tests see `README.md`.
5For running LTP network tests see `testcases/network/README.md`.
6
71. Library environment variables
8--------------------------------
9
10Following environment variables are expected to be set by LTP users. Therefore,
11with some exceptions, they have 'LTP_' prefix. Environment variables with 'TST_'
12prefix are used inside LTP shell API and should *not* be set by users.
13
14|==============================================================================
15| 'KCONFIG_PATH'        | The path to the kernel config file, (if not set, it tries
16                          the usual paths '/boot/config-RELEASE' or '/proc/config.gz').
17| 'KCONFIG_SKIP_CHECK'  | Skip kernel config check if variable set (not set by default).
18| 'LTPROOT'             | Prefix for installed LTP.  **Should be always set**
19                          as some tests need it for path to test data files
20                          ('LTP_DATAROOT'). LTP is by default installed into '/opt/ltp'.
21| 'LTP_COLORIZE_OUTPUT' | By default LTP colorizes it's output unless it's redirected
22                          to a pipe or file.  Force colorized output behaviour:
23                          'y' or '1': always colorize, 'n' or '0': never colorize.
24| 'LTP_DEV'             | Path to the block device to be used
25                          (C: '.needs_device = 1', shell: 'TST_NEEDS_DEVICE=1').
26| 'LTP_SINGLE_FS_TYPE'  | Testing only - specifies filesystem instead all
27                          supported (for tests with '.all_filesystems').
28| 'LTP_DEV_FS_TYPE'     | Filesystem used for testing (default: 'ext2').
29| 'LTP_TIMEOUT_MUL'     | Multiplies timeout, must be number >= 0.1 (> 1 is useful for
30                          slow machines to avoid unexpected timeout).
31                          Variable is also used in shell tests, but ceiled to int.
32| 'LTP_RUNTIME_MUL'     | Multiplies maximal test iteration runtime. Tests
33                          that run for more than a second or two are capped on
34                          runtime. You can scale the default runtime both up
35                          and down with this multiplier. NOTE: Not yet implemented
36                          in shell API.
37| 'LTP_VIRT_OVERRIDE'   | Overrides virtual machine detection in the test
38                          library. Setting it to empty string tell the library
39                          that system is not a virtual machine. Other possible
40                          values are 'kvm', 'xen', 'zvm' and 'microsoft' that
41                          describe different types supervisors.
42| 'PATH'                | It's required to addjust path:
43                          `PATH="$PATH:$LTPROOT/testcases/bin"`
44| 'TMPDIR'              | Base directory for template directory (C: '.needs_tmpdir = 1'
45                          and others, which imply it, shell: 'TST_NEEDS_TMPDIR=1').
46                          Must be an absolute path (default: '/tmp').
47| 'LTP_NO_CLEANUP'      | Disable running test cleanup (defined in 'TST_CLEANUP').
48                          Shell API only.
49| 'LTP_ENABLE_DEBUG'    | Enable debug info (value '1' or 'y').
50|==============================================================================
51
522. Test execution time and timeout
53----------------------------------
54
55The limit on how long a test can run does compose of two parts max_runtime and
56timeout. The limit does apply to a single test variant, that means for example
57that tests that run for all available filesystems will apply this limit for a
58single filesystem only.
59
60The max_runtime is a cap on how long the run() function can take, for most
61testcases this part is set to zero. For tests that do run for more than a
62second or two the max_runtime has to be defined and the run() function has to
63check actively how much runtime is left.
64
65Test runtime can be scaled up and down with 'LTP_RUNTIME_MUL' environment
66variable or set on a commandline by the '-I' parameter. Hoewever be vary that
67setting the runtime too low will cause long running tests to exit prematurely
68possibly before the have a chance actually test anyting.
69
70The timeout part is a limit for the test setup and cleanup and also safety
71margin for the runtime accounting. It's currently set to 30 seconds but may
72change later. If your target machine is too slow it can be scaled up with the
73'LTP_TIMEOUT_MUL' environment variable.
74