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.
24 (4) Device mapper requirement.
33 _require_command "$NAME_PROG" name
35 The test requires an external command, called 'name' be present on the
36 system and that '$VAR' should be set with the path to that command. $VAR
37 should then be used to refer to the command when executing it. For
40 _require_command "KILLALL_PROG" killall
42 to locate the killall command and then:
44 $KILLALL_PROG -q $FSSTRESS_PROG
51 The test requires that the block device specified by $TEST_DEV be mounted
55 _require_test_program <name>
57 The test requires a program by the name of 'name' be present and built in
58 the src/ directory. For example:
60 _require_test_program "stat_test"
62 requires that src/stat_test be built.
65 _require_xfs_io_command <name> [<switch>]
67 The test requires that the xfs_io command be available, that it supports
68 command <name> and, optionally, that that command supports the specified
71 _require_xfs_io_command "falloc"
72 _require_xfs_io_command "chattr" "+/-x"
74 The first requires that xfs_io support the falloc command and the second
75 that it supports the chattr command and that the chattr command supports
76 the +x and -x arguments (DAX attribute).
79 ==================================
80 FILESYSTEM CAPABILITY REQUIREMENTS
81 ==================================
83 _require_chattr <letters>
85 The test requires that the filesystem attribute set by the chattr command
86 with +<letters> as an argument be available and supported by the $TEST_DEV
87 filesystem. No check is made of the scratch filesystem. For example:
91 tests to see if setting the append-only and immutable attributes on a file
92 (chattr +a +i) is supported.
96 The test requires that the $TEST_DEV filesystem supports NFS export.
97 The test also requires the use of the open_by_handle_at() system call and
98 will be skipped if it isn't available in the kernel.
101 ========================
102 SYSTEM CALL REQUIREMENTS
103 ========================
107 The test requires the use of the statx() system call and will be skipped
108 if it isn't available in the kernel.
111 ==========================
112 DEVICE MAPPER REQUIREMENTS
113 ==========================
115 _require_dm_target <name>
117 The test requires the use of the device mapper target and will be skipped
118 if it isn't available in the kernel.
122 The test requires the use of the device mapper target log-writes.
123 The test also requires the test program log-writes/replay-log is built
124 and will be skipped if either isn't available.
126 ======================
127 PERF TEST REQUIREMENTS
128 ======================
132 This test requires the supporting tools for saving and comparing fio based