1 _______________________
2 BUILDING THE FSQA SUITE
3 _______________________
6 - cd into the xfstests directory and run make.
9 - cd into the xfstests directory
10 - set the ROOT and TOOLROOT env variables for IRIX appropriately
13 ______________________
15 ______________________
17 Preparing system for tests (IRIX and Linux):
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.
29 - create one or two partitions to use for testing
31 - format as XFS, mount & optionally populate with
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
38 (these must be two DIFFERENT partitions)
40 - setup your environment
41 - setenv TEST_DEV "device containing TEST PARTITION"
42 - setenv TEST_DIR "mount point of TEST PARTITION"
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
59 - or add these variables to a file called local.config and keep that
60 file in your workarea.
62 - if testing xfsdump, make sure the tape devices have a
63 tape which can be overwritten.
65 - make sure $TEST_DEV is a mounted XFS partition
66 - make sure that $SCRATCH_DEV contains nothing useful
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)]
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.
88 Unexpected console messages, crashes and hangs may be considered
89 to be failures but are not necessarily detected by the QA system.
91 __________________________
92 ADDING TO THE FSQA SUITE
93 __________________________
96 Creating new tests scripts:
100 Test script environment:
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
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:
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
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
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.
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
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.
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.
145 4. Some other useful shell procedures:
147 _get_fqdn - echo the host's fully qualified
150 _get_pids_by_name - one argument is a process name, and
151 return all of the matching pids on
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
159 _filter_date - turn ctime(3) format dates into the
160 string DATE for deterministic
165 Each test script has a numerical name, e.g. 007, and an associated
166 verified output, e.g. 007.out.
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:
177 - variable directory contents
178 - imprecise numbers, especially sizes and times
180 Use the "remake" script to recreate the verified output for one
185 The script "check" may be used to run one or more tests.
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.
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
200 To force a non-zero exit status use:
206 won't have the desired effect because of the way the exit trap
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