1 ========================================
2 TESTING FOR REQUIREMENTS IN TEST SCRIPTS
3 ========================================
5 Test scripts need to indicate to the infrastructure what sorts of requirements
6 they have. This is done with _require_<xxx> macros, which may take parameters.
8 (1) General requirements.
10 _require_command "$<NAME_PROG>" <name>
12 _require_test_program <name>
13 _require_xfs_io_command <name> [<switch>]
15 (2) Filesystem capability requirements.
17 _require_chattr <letters>
20 (3) System call requirements.
29 _require_command "$NAME_PROG" name
31 The test requires an external command, called 'name' be present on the
32 system and that '$VAR' should be set with the path to that command. $VAR
33 should then be used to refer to the command when executing it. For
36 _require_command "KILLALL_PROG" killall
38 to locate the killall command and then:
40 $KILLALL_PROG -q $FSSTRESS_PROG
47 The test requires that the block device specified by $TEST_DEV be mounted
51 _require_test_program <name>
53 The test requires a program by the name of 'name' be present and built in
54 the src/ directory. For example:
56 _require_test_program "stat_test"
58 requires that src/stat_test be built.
61 _require_xfs_io_command <name> [<switch>]
63 The test requires that the xfs_io command be available, that it supports
64 command <name> and, optionally, that that command supports the specified
67 _require_xfs_io_command "falloc"
68 _require_xfs_io_command "chattr" "+/-x"
70 The first requires that xfs_io support the falloc command and the second
71 that it supports the chattr command and that the chattr command supports
72 the +x and -x arguments (DAX attribute).
75 ==================================
76 FILESYSTEM CAPABILITY REQUIREMENTS
77 ==================================
79 _require_chattr <letters>
81 The test requires that the filesystem attribute set by the chattr command
82 with +<letters> as an argument be available and supported by the $TEST_DEV
83 filesystem. No check is made of the scratch filesystem. For example:
87 tests to see if setting the append-only and immutable attributes on a file
88 (chattr +a +i) is supported.
92 The test requires that the $TEST_DEV filesystem supports NFS export.
93 The test also requires the use of the open_by_handle_at() system call and
94 will be skipped if it isn't available in the kernel.
97 ========================
98 SYSTEM CALL REQUIREMENTS
99 ========================
103 The test requires the use of the statx() system call and will be skipped
104 if it isn't available in the kernel.