xfstests: have getfacl(1) report numeric id's
[xfstests-dev.git] / README
1 _______________________
2 BUILDING THE FSQA SUITE
3 _______________________
4
5 Building Linux:
6         - cd into the xfstests directory and run make.
7         
8 Building IRIX:
9         - cd into the xfstests directory 
10         - set the ROOT and TOOLROOT env variables for IRIX appropriately
11         - run ./make_irix
12
13 ______________________
14 USING THE FSQA SUITE
15 ______________________
16
17 Preparing system for tests (IRIX and Linux):
18
19     - compile XFS into your kernel or load XFS modules
20     - install user tools including mkfs.xfs, xfs_db & xfs_bmap
21     - If you wish to run the udf components of the suite install 
22       mkfs_udf and udf_db for IRIX and mkudffs for Linux. Also download and 
23       build the Philips UDF Verification Software from 
24       http://www.extra.research.philips.com/udf/, then copy the udf_test 
25       binary to xfstests/src/. If you wish to disable UDF verification test
26       set the environment variable DISABLE_UDF_TEST to 1.
27         
28     
29     - create one or two partitions to use for testing
30         - one TEST partition
31             - format as XFS, mount & optionally populate with 
32               NON-IMPORTANT stuff
33         - one SCRATCH partition (optional)
34             - leave empty and expect this partition to be clobbered
35               by some tests.  If this is not provided, many tests will
36               not be run.
37               
38         (these must be two DIFFERENT partitions)
39               
40     - setup your environment
41         - setenv TEST_DEV "device containing TEST PARTITION"
42         - setenv TEST_DIR "mount point of TEST PARTITION"   
43         - optionally:
44              - setenv SCRATCH_DEV "device containing SCRATCH PARTITION"
45              - setenv SCRATCH_MNT "mount point for SCRATCH PARTITION"
46              - setenv TAPE_DEV "tape device for testing xfsdump"
47              - setenv RMT_TAPE_DEV "remote tape device for testing xfsdump"
48              - setenv RMT_IRIXTAPE_DEV "remote IRIX tape device for testing xfsdump"
49              - setenv SCRATCH_LOGDEV "device for scratch-fs external log"
50              - setenv SCRATCH_RTDEV "device for scratch-fs realtime data"
51              - setenv TEST_LOGDEV "device for test-fs external log"
52              - setenv TEST_RTDEV "device for test-fs realtime data"
53              - if TEST_LOGDEV and/or TEST_RTDEV, these will always be used.
54              - if SCRATCH_LOGDEV and/or SCRATCH_RTDEV, the USE_EXTERNAL
55                environment variable set to "yes" will enable their use.
56         - or add a case to the switch in common.config assigning
57           these variables based on the hostname of your test
58           machine
59         - or add these variables to a file called local.config and keep that
60           file in your workarea.
61
62     - if testing xfsdump, make sure the tape devices have a
63       tape which can be overwritten.
64           
65     - make sure $TEST_DEV is a mounted XFS partition
66     - make sure that $SCRATCH_DEV contains nothing useful
67     
68 Running tests:
69
70     - cd xfstests
71     - By default the tests suite will run xfs tests:
72     - ./check 001 002 003 ... or you can explicitly run a filesystem: 
73       ./check -xfs [test(s)]
74     - You can run a range of tests: ./check 067-078
75     - Groups of tests maybe ran by: ./check -g [group(s)]
76       See the 'group' file for details on groups
77     - for udf tests: ./check -udf [test(s)]
78       Running all the udf tests: ./check -udf -g udf
79     - for running nfs tests: ./check -nfs [test(s)]
80     - To randomize test order: ./check -r [test(s)]
81
82     
83     The check script tests the return value of each script, and
84     compares the output against the expected output. If the output
85     is not as expected, a diff will be output and an .out.bad file
86     will be produced for the failing test.
87     
88     Unexpected console messages, crashes and hangs may be considered
89     to be failures but are not necessarily detected by the QA system.
90
91 __________________________ 
92 ADDING TO THE FSQA SUITE
93 __________________________
94
95
96 Creating new tests scripts:
97
98     Use the "new" script.
99
100 Test script environment:
101
102     When developing a new test script keep the following things in
103     mind.  All of the environment variables and shell procedures are
104     available to the script once the "common.rc" file has been
105     sourced.
106
107      1. The tests are run from an arbitrary directory.  If you want to
108         do operations on an XFS filesystem (good idea, eh?), then do
109         one of the following:
110
111         (a) Create directories and files at will in the directory
112             $TEST_DIR ... this is within an XFS filesystem and world
113             writeable.  You should cleanup when your test is done,
114             e.g. use a _cleanup shell procedure in the trap ... see
115             001 for an example.  If you need to know, the $TEST_DIR
116             directory is within the filesystem on the block device
117             $TEST_DEV.
118
119         (b) mkfs a new XFS filesystem on $SCRATCH_DEV, and mount this
120             on $SCRATCH_MNT. Call the the _require_scratch function 
121             on startup if you require use of the scratch partition.
122             _require_scratch does some checks on $SCRATCH_DEV & 
123             $SCRATCH_MNT and makes sure they're unmounted. You should 
124             cleanup when your test is done, and in particular unmount 
125             $SCRATCH_MNT.
126             Tests can make use of $SCRATCH_LOGDEV and $SCRATCH_RTDEV
127             for testing external log and realtime volumes - however,
128             these tests need to simply "pass" (e.g. cat $seq.out; exit
129             - or default to an internal log) in the common case where
130             these variables are not set.
131
132      2. You can safely create temporary files that are not part of the
133         filesystem tests (e.g. to catch output, prepare lists of things
134         to do, etc.) in files named $tmp.<anything>.  The standard test
135         script framework created by "new" will initialize $tmp and
136         cleanup on exit.
137
138      3. By default, tests are run as the same uid as the person
139         executing the control script "check" that runs the test scripts.
140
141         If you need to be root, add a call to the shell procedure
142         _need_to_be_root ... this will do nothing or exit with an
143         error message depending on your current uid.
144
145      4. Some other useful shell procedures:
146
147         _get_fqdn               - echo the host's fully qualified
148                                   domain name
149
150         _get_pids_by_name       - one argument is a process name, and
151                                   return all of the matching pids on
152                                   standard output
153
154         _within_tolerance       - fancy numerical "close enough is good
155                                   enough" filter for deterministic
156                                   output ... see comments in
157                                   common.filter for an explanation
158
159         _filter_date            - turn ctime(3) format dates into the
160                                   string DATE for deterministic
161                                   output
162
163 Verified output:
164
165     Each test script has a numerical name, e.g. 007, and an associated
166     verified output, e.g. 007.out.
167
168     It is important that the verified output is deterministic, and
169     part of the job of the test script is to filter the output to
170     make this so.  Examples of the sort of things that need filtering:
171
172     - dates
173     - pids
174     - hostnames
175     - filesystem names
176     - timezones
177     - variable directory contents
178     - imprecise numbers, especially sizes and times
179
180     Use the "remake" script to recreate the verified output for one
181     or more tests.
182
183 Pass/failure:
184
185     The script "check" may be used to run one or more tests.
186
187     Test number $seq is deemed to "pass" when:
188     (a) no "core" file is created,
189     (b) the file $seq.notrun is not created,
190     (c) the exit status is 0, and
191     (d) the output matches the verified output.
192
193     In the "not run" case (b), the $seq.notrun file should contain a
194     short one-line summary of why the test was not run.  The standard
195     output is not checked, so this can be used for a more verbose
196     explanation and to provide feedback when the QA test is run
197     interactively.
198
199
200     To force a non-zero exit status use:
201         status=1
202         exit
203
204     Note that:
205         exit 1
206     won't have the desired effect because of the way the exit trap
207     works.
208
209     The recent pass/fail history is maintained in the file "check.log".
210     The elapsed time for the most recent pass for each test is kept
211     in "check.time".