Skip to content
master
Go to file
Code
This branch is 45 commits ahead, 2959 commits behind amir73il:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
lib
 
 
ltp
 
 
m4
 
 
 
 
src
 
 
 
 
 
 
001
 
 
 
 
002
 
 
 
 
003
 
 
 
 
004
 
 
 
 
005
 
 
 
 
006
 
 
 
 
007
 
 
 
 
008
 
 
 
 
009
 
 
 
 
010
 
 
 
 
011
 
 
 
 
012
 
 
 
 
013
 
 
 
 
014
 
 
 
 
015
 
 
 
 
016
 
 
 
 
017
 
 
 
 
018
 
 
 
 
 
 
 
 
019
 
 
 
 
020
 
 
 
 
021
 
 
 
 
022
 
 
 
 
023
 
 
 
 
024
 
 
 
 
025
 
 
 
 
026
 
 
 
 
027
 
 
 
 
028
 
 
 
 
029
 
 
 
 
030
 
 
 
 
031
 
 
 
 
032
 
 
 
 
033
 
 
 
 
034
 
 
 
 
035
 
 
 
 
036
 
 
 
 
037
 
 
 
 
038
 
 
 
 
039
 
 
 
 
040
 
 
 
 
 
 
041
 
 
 
 
042
 
 
 
 
043
 
 
 
 
044
 
 
 
 
045
 
 
 
 
046
 
 
 
 
047
 
 
 
 
048
 
 
 
 
049
 
 
 
 
050
 
 
 
 
051
 
 
 
 
052
 
 
 
 
053
 
 
 
 
054
 
 
 
 
055
 
 
 
 
056
 
 
 
 
057
 
 
 
 
058
 
 
 
 
059
 
 
060
 
 
061
 
 
 
 
062
 
 
 
 
063
 
 
 
 
064
 
 
 
 
065
 
 
 
 
066
 
 
 
 
067
 
 
 
 
068
 
 
 
 
069
 
 
 
 
070
 
 
 
 
071
 
 
 
 
072
 
 
 
 
073
 
 
 
 
074
 
 
 
 
075
 
 
 
 
076
 
 
 
 
077
 
 
 
 
078
 
 
 
 
079
 
 
 
 
080
 
 
 
 
081
 
 
 
 
082
 
 
 
 
 
 
 
 
083
 
 
 
 
084
 
 
 
 
085
 
 
 
 
086
 
 
 
 
087
 
 
 
 
088
 
 
 
 
089
 
 
 
 
090
 
 
 
 
091
 
 
 
 
092
 
 
 
 
093
 
 
 
 
094
 
 
 
 
095
 
 
 
 
096
 
 
 
 
 
 
097
 
 
 
 
 
 
098
 
 
 
 
099
 
 
 
 
100
 
 
 
 
101
 
 
 
 
102
 
 
 
 
103
 
 
 
 
104
 
 
 
 
105
 
 
 
 
106
 
 
 
 
107
 
 
 
 
108
 
 
 
 
109
 
 
 
 
110
 
 
 
 
111
 
 
 
 
112
 
 
 
 
113
 
 
 
 
114
 
 
 
 
115
 
 
 
 
116
 
 
 
 
117
 
 
 
 
118
 
 
 
 
119
 
 
 
 
120
 
 
 
 
121
 
 
 
 
122
 
 
 
 
123
 
 
 
 
124
 
 
 
 
125
 
 
 
 
126
 
 
 
 
127
 
 
 
 
128
 
 
 
 
129
 
 
 
 
130
 
 
 
 
131
 
 
 
 
132
 
 
 
 
133
 
 
 
 
134
 
 
 
 
135
 
 
 
 
136
 
 
 
 
137
 
 
 
 
138
 
 
 
 
139
 
 
 
 
140
 
 
 
 
141
 
 
 
 
142
 
 
 
 
143
 
 
 
 
144
 
 
 
 
145
 
 
 
 
146
 
 
 
 
147
 
 
 
 
148
 
 
 
 
149
 
 
 
 
150
 
 
 
 
151
 
 
 
 
152
 
 
 
 
153
 
 
 
 
154
 
 
 
 
155
 
 
 
 
156
 
 
 
 
157
 
 
 
 
158
 
 
 
 
159
 
 
 
 
160
 
 
 
 
161
 
 
 
 
162
 
 
 
 
163
 
 
 
 
164
 
 
 
 
165
 
 
 
 
166
 
 
 
 
167
 
 
 
 
168
 
 
 
 
169
 
 
 
 
170
 
 
 
 
171
 
 
 
 
172
 
 
 
 
173
 
 
 
 
174
 
 
 
 
175
 
 
 
 
176
 
 
 
 
177
 
 
 
 
178
 
 
 
 
179
 
 
 
 
180
 
 
 
 
181
 
 
 
 
182
 
 
 
 
183
 
 
 
 
184
 
 
 
 
185
 
 
 
 
186
 
 
 
 
187
 
 
 
 
188
 
 
 
 
189
 
 
 
 
190
 
 
 
 
191
 
 
 
 
192
 
 
 
 
193
 
 
 
 
194
 
 
 
 
195
 
 
 
 
196
 
 
 
 
197
 
 
 
 
198
 
 
 
 
199
 
 
 
 
200
 
 
 
 
201
 
 
 
 
202
 
 
 
 
203
 
 
 
 
204
 
 
 
 
205
 
 
 
 
206
 
 
 
 
207
 
 
 
 
208
 
 
 
 
209
 
 
 
 
210
 
 
 
 
211
 
 
 
 
212
 
 
 
 
213
 
 
 
 
214
 
 
 
 
215
 
 
 
 
216
 
 
 
 
217
 
 
 
 
218
 
 
 
 
219
 
 
 
 
220
 
 
 
 
221
 
 
 
 
222
 
 
 
 
223
 
 
 
 
224
 
 
 
 
225
 
 
 
 
226
 
 
 
 
227
 
 
 
 
228
 
 
 
 
229
 
 
 
 
230
 
 
 
 
231
 
 
 
 
232
 
 
 
 
233
 
 
 
 
234
 
 
 
 
235
 
 
 
 
236
 
 
 
 
237
 
 
 
 
238
 
 
 
 
239
 
 
 
 
240
 
 
 
 
241
 
 
 
 
242
 
 
 
 
243
 
 
 
 
244
 
 
 
 
245
 
 
 
 
246
 
 
 
 
247
 
 
 
 
248
 
 
 
 
249
 
 
 
 
250
 
 
 
 
251
 
 
 
 
252
 
 
 
 
253
 
 
 
 
254
 
 
 
 
255
 
 
 
 
256
 
 
 
 
257
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
new
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README

_______________________
BUILDING THE FSQA SUITE
_______________________

Building Linux:
	- cd into the xfstests directory and run make.
	
Building IRIX:
	- cd into the xfstests directory 
	- set the ROOT and TOOLROOT env variables for IRIX appropriately
	- run ./make_irix

______________________
USING THE FSQA SUITE
______________________

Preparing system for tests (IRIX and Linux):

    - compile XFS into your kernel or load XFS modules
    - install user tools including mkfs.xfs, xfs_db & xfs_bmap
    - If you wish to run the udf components of the suite install 
      mkfs_udf and udf_db for IRIX and mkudffs for Linux. Also download and 
      build the Philips UDF Verification Software from 
      http://www.extra.research.philips.com/udf/, then copy the udf_test 
      binary to xfstests/src/. If you wish to disable UDF verification test
      set the environment variable DISABLE_UDF_TEST to 1.
	
    
    - create one or two partitions to use for testing
        - one TEST partition
            - format as XFS, mount & optionally populate with 
              NON-IMPORTANT stuff
        - one SCRATCH partition (optional)
            - leave empty and expect this partition to be clobbered
              by some tests.  If this is not provided, many tests will
              not be run.
              
        (these must be two DIFFERENT partitions)
              
    - setup your environment
        - setenv TEST_DEV "device containing TEST PARTITION"
        - setenv TEST_DIR "mount point of TEST PARTITION"   
       	- optionally:
             - setenv SCRATCH_DEV "device containing SCRATCH PARTITION"
             - setenv SCRATCH_MNT "mount point for SCRATCH PARTITION"
             - setenv TAPE_DEV "tape device for testing xfsdump"
             - setenv RMT_TAPE_DEV "remote tape device for testing xfsdump"
             - setenv RMT_IRIXTAPE_DEV "remote IRIX tape device for testing xfsdump"
	     - setenv SCRATCH_LOGDEV "device for scratch-fs external log"
             - setenv SCRATCH_RTDEV "device for scratch-fs realtime data"
	     - setenv TEST_LOGDEV "device for test-fs external log"
             - setenv TEST_RTDEV "device for test-fs realtime data"
             - if TEST_LOGDEV and/or TEST_RTDEV, these will always be used.
             - if SCRATCH_LOGDEV and/or SCRATCH_RTDEV, the USE_EXTERNAL
               environment variable set to "yes" will enable their use.
        - or add a case to the switch in common.config assigning
          these variables based on the hostname of your test
          machine
	- or add these variables to a file called local.config and keep that
	  file in your workarea.

    - if testing xfsdump, make sure the tape devices have a
      tape which can be overwritten.
          
    - make sure $TEST_DEV is a mounted XFS partition
    - make sure that $SCRATCH_DEV contains nothing useful
    
Running tests:

    - cd xfstests
    - By default the tests suite will run xfs tests:
    - ./check 001 002 003 ... or you can explicitly run a filesystem: 
      ./check -xfs [test(s)]
    - You can run a range of tests: ./check 067-078
    - Groups of tests maybe ran by: ./check -g [group(s)]
      See the 'group' file for details on groups
    - for udf tests: ./check -udf [test(s)]
      Running all the udf tests: ./check -udf -g udf
    - for running nfs tests: ./check -nfs [test(s)]
    - To randomize test order: ./check -r [test(s)]

    
    The check script tests the return value of each script, and
    compares the output against the expected output. If the output
    is not as expected, a diff will be output and an .out.bad file
    will be produced for the failing test.
    
    Unexpected console messages, crashes and hangs may be considered
    to be failures but are not necessarily detected by the QA system.

__________________________ 
ADDING TO THE FSQA SUITE
__________________________


Creating new tests scripts:

    Use the "new" script.

Test script environment:

    When developing a new test script keep the following things in
    mind.  All of the environment variables and shell procedures are
    available to the script once the "common.rc" file has been
    sourced.

     1. The tests are run from an arbitrary directory.  If you want to
	do operations on an XFS filesystem (good idea, eh?), then do
	one of the following:

	(a) Create directories and files at will in the directory
	    $TEST_DIR ... this is within an XFS filesystem and world
	    writeable.  You should cleanup when your test is done,
	    e.g. use a _cleanup shell procedure in the trap ... see
	    001 for an example.  If you need to know, the $TEST_DIR
	    directory is within the filesystem on the block device
	    $TEST_DEV.

	(b) mkfs a new XFS filesystem on $SCRATCH_DEV, and mount this
	    on $SCRATCH_MNT. Call the the _require_scratch function 
            on startup if you require use of the scratch partition.
            _require_scratch does some checks on $SCRATCH_DEV & 
            $SCRATCH_MNT and makes sure they're unmounted. You should 
            cleanup when your test is done, and in particular unmount 
            $SCRATCH_MNT.
	    Tests can make use of $SCRATCH_LOGDEV and $SCRATCH_RTDEV
	    for testing external log and realtime volumes - however,
	    these tests need to simply "pass" (e.g. cat $seq.out; exit
	    - or default to an internal log) in the common case where
	    these variables are not set.

     2. You can safely create temporary files that are not part of the
	filesystem tests (e.g. to catch output, prepare lists of things
	to do, etc.) in files named $tmp.<anything>.  The standard test
	script framework created by "new" will initialize $tmp and
	cleanup on exit.

     3. By default, tests are run as the same uid as the person
	executing the control script "check" that runs the test scripts.

	If you need to be root, add a call to the shell procedure
	_need_to_be_root ... this will do nothing or exit with an
	error message depending on your current uid.

     4. Some other useful shell procedures:

	_get_fqdn		- echo the host's fully qualified
				  domain name

	_get_pids_by_name	- one argument is a process name, and
				  return all of the matching pids on
				  standard output

	_within_tolerance	- fancy numerical "close enough is good
				  enough" filter for deterministic
				  output ... see comments in
				  common.filter for an explanation

	_filter_date		- turn ctime(3) format dates into the
				  string DATE for deterministic
				  output

	_cat_passwd,		- dump the content of the password
	_cat_group		  or group file (both the local file
				  and the content of the NIS database
				  if it is likely to be present)

     4. General recommendations, usage conventions, etc.:
	- When the content of the password or group file is
	  required, get it using the _cat_passwd and _cat_group
	  functions, to ensure NIS information is included if NIS
	  is active.
	- When calling getfacl in a test, pass the "-n" argument so
	  that numeric rather than symbolic identifiers are used in
	  the output.

Verified output:

    Each test script has a numerical name, e.g. 007, and an associated
    verified output, e.g. 007.out.

    It is important that the verified output is deterministic, and
    part of the job of the test script is to filter the output to
    make this so.  Examples of the sort of things that need filtering:

    - dates
    - pids
    - hostnames
    - filesystem names
    - timezones
    - variable directory contents
    - imprecise numbers, especially sizes and times

    Use the "remake" script to recreate the verified output for one
    or more tests.

Pass/failure:

    The script "check" may be used to run one or more tests.

    Test number $seq is deemed to "pass" when:
    (a) no "core" file is created,
    (b) the file $seq.notrun is not created,
    (c) the exit status is 0, and
    (d) the output matches the verified output.

    In the "not run" case (b), the $seq.notrun file should contain a
    short one-line summary of why the test was not run.  The standard
    output is not checked, so this can be used for a more verbose
    explanation and to provide feedback when the QA test is run
    interactively.


    To force a non-zero exit status use:
	status=1
	exit

    Note that:
	exit 1
    won't have the desired effect because of the way the exit trap
    works.

    The recent pass/fail history is maintained in the file "check.log".
    The elapsed time for the most recent pass for each test is kept
    in "check.time".

About

XFS tests source tree

Resources

Releases

No releases published
You can’t perform that action at this time.