tests: remove udf/101
[xfstests-dev.git] / doc / requirement-checking.txt
1                    ========================================
2                    TESTING FOR REQUIREMENTS IN TEST SCRIPTS
3                    ========================================
4
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.
7
8  (1) General requirements.
9
10         _require_command "$<NAME_PROG>" <name>
11         _require_test
12         _require_test_program <name>
13         _require_xfs_io_command <name> [<switch>]
14
15  (2) Filesystem capability requirements.
16
17         _require_chattr <letters>
18         _require_exportfs
19
20  (3) System call requirements.
21
22         _require_statx
23
24
25 ====================
26 GENERAL REQUIREMENTS
27 ====================
28
29 _require_command "$NAME_PROG" name
30
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
34      example:
35
36         _require_command "KILLALL_PROG" killall
37
38      to locate the killall command and then:
39
40         $KILLALL_PROG -q $FSSTRESS_PROG
41
42      to make use of it.
43
44
45 _require_test
46
47      The test requires that the block device specified by $TEST_DEV be mounted
48      on $TEST_DIR.
49
50
51 _require_test_program <name>
52
53      The test requires a program by the name of 'name' be present and built in
54      the src/ directory.  For example:
55
56         _require_test_program "stat_test"
57
58      requires that src/stat_test be built.
59
60
61 _require_xfs_io_command <name> [<switch>]
62
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
65      switch.  For example:
66
67         _require_xfs_io_command "falloc"
68         _require_xfs_io_command "chattr" "+/-x"
69
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).
73
74
75 ==================================
76 FILESYSTEM CAPABILITY REQUIREMENTS
77 ==================================
78
79 _require_chattr <letters>
80
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:
84
85         _require_chattr ai
86
87      tests to see if setting the append-only and immutable attributes on a file
88      (chattr +a +i) is supported.
89
90 _require_exportfs
91
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.
95
96
97 ========================
98 SYSTEM CALL REQUIREMENTS
99 ========================
100
101 _require_statx
102
103      The test requires the use of the statx() system call and will be skipped
104      if it isn't available in the kernel.