2004-08-12 07:31:30 +00:00
|
|
|
_______________________
|
|
|
|
|
BUILDING THE FSQA SUITE
|
|
|
|
|
_______________________
|
|
|
|
|
|
|
|
|
|
Building Linux:
|
2012-05-15 10:48:43 -05:00
|
|
|
- cd into the xfstests directory
|
2014-12-12 10:55:29 +11:00
|
|
|
- install prerequisite packages
|
|
|
|
|
For example, for Ubuntu:
|
2016-02-08 09:27:15 +11:00
|
|
|
"sudo apt-get install xfslibs-dev uuid-dev libtool-bin e2fsprogs
|
|
|
|
|
automake gcc libuuid1 quota attr libattr1-dev make
|
2014-12-12 10:55:29 +11:00
|
|
|
libacl1-dev libaio-dev xfsprogs libgdbm-dev gawk fio dbench"
|
2012-05-15 10:48:43 -05:00
|
|
|
- run make
|
|
|
|
|
- run make install
|
2014-12-12 10:55:29 +11:00
|
|
|
- create fsgqa test user ("sudo useradd fsgqa")
|
2015-12-21 18:07:37 +11:00
|
|
|
- create 123456-fsgqa test user ("sudo useradd 123456-fsgqa")
|
2004-08-12 07:31:30 +00:00
|
|
|
|
|
|
|
|
Building IRIX:
|
2004-10-22 14:38:06 +00:00
|
|
|
- cd into the xfstests directory
|
|
|
|
|
- set the ROOT and TOOLROOT env variables for IRIX appropriately
|
|
|
|
|
- run ./make_irix
|
2004-08-12 07:31:30 +00:00
|
|
|
|
2001-01-15 05:01:19 +00:00
|
|
|
______________________
|
2004-08-12 07:31:30 +00:00
|
|
|
USING THE FSQA SUITE
|
2001-01-15 05:01:19 +00:00
|
|
|
______________________
|
|
|
|
|
|
2004-08-12 07:31:30 +00:00
|
|
|
Preparing system for tests (IRIX and Linux):
|
2001-01-15 05:01:19 +00:00
|
|
|
|
|
|
|
|
- compile XFS into your kernel or load XFS modules
|
|
|
|
|
- install user tools including mkfs.xfs, xfs_db & xfs_bmap
|
2004-08-12 07:31:30 +00:00
|
|
|
- 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
|
2004-09-15 05:57:50 +00:00
|
|
|
binary to xfstests/src/. If you wish to disable UDF verification test
|
|
|
|
|
set the environment variable DISABLE_UDF_TEST to 1.
|
2004-08-12 07:31:30 +00:00
|
|
|
|
2001-01-15 05:01:19 +00:00
|
|
|
|
2009-06-03 13:11:35 -05:00
|
|
|
- create one or two partitions to use for testing
|
2001-01-15 05:01:19 +00:00
|
|
|
- one TEST partition
|
|
|
|
|
- format as XFS, mount & optionally populate with
|
|
|
|
|
NON-IMPORTANT stuff
|
2009-06-03 13:11:35 -05:00
|
|
|
- one SCRATCH partition (optional)
|
2001-01-15 05:01:19 +00:00
|
|
|
- leave empty and expect this partition to be clobbered
|
2009-06-03 13:11:35 -05:00
|
|
|
by some tests. If this is not provided, many tests will
|
|
|
|
|
not be run.
|
2011-10-20 23:41:19 +08:00
|
|
|
(SCRATCH and TEST must be two DIFFERENT partitions)
|
|
|
|
|
OR
|
|
|
|
|
- for btrfs only: some btrfs test cases will need 3 or more independent
|
|
|
|
|
SCRATCH disks which should be set using SCRATCH_DEV_POOL (for eg:
|
|
|
|
|
SCRATCH_DEV_POOL="/dev/sda /dev/sdb /dev/sdc") with which
|
|
|
|
|
SCRATCH_DEV should be unused by the tester, and for the legacy
|
|
|
|
|
support SCRATCH_DEV will be set to the first disk of the
|
|
|
|
|
SCRATCH_DEV_POOL by xfstests script.
|
2001-01-15 05:01:19 +00:00
|
|
|
|
|
|
|
|
- setup your environment
|
|
|
|
|
- setenv TEST_DEV "device containing TEST PARTITION"
|
|
|
|
|
- setenv TEST_DIR "mount point of TEST PARTITION"
|
2003-05-22 04:16:45 +00:00
|
|
|
- optionally:
|
2011-10-20 23:41:19 +08:00
|
|
|
- setenv SCRATCH_DEV "device containing SCRATCH PARTITION" OR
|
|
|
|
|
(btrfs only) setenv SCRATCH_DEV_POOL "to 3 or more SCRATCH disks for
|
|
|
|
|
testing btrfs raid concepts"
|
2009-06-03 13:11:35 -05:00
|
|
|
- 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"
|
2003-05-22 04:16:45 +00:00
|
|
|
- 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.
|
2013-01-23 11:14:33 +00:00
|
|
|
- setenv DIFF_LENGTH "number of diff lines to print from a failed test",
|
|
|
|
|
by default 10, set to 0 to print the full diff
|
2014-01-24 12:05:01 +11:00
|
|
|
- setenv FSTYP "the filesystem you want to test", the filesystem
|
|
|
|
|
type is devised from the TEST_DEV device, but you may want to
|
|
|
|
|
override it; if unset, the default is 'xfs'
|
2014-04-22 10:46:49 +10:00
|
|
|
- setenv FSSTRESS_AVOID and/or FSX_AVOID, which contain options
|
|
|
|
|
added to the end of fsstresss and fsx invocations, respectively,
|
|
|
|
|
in case you wish to exclude certain operational modes from these
|
|
|
|
|
tests.
|
|
|
|
|
|
2013-03-29 04:49:55 +00:00
|
|
|
- or add a case to the switch in common/config assigning
|
2001-01-15 05:01:19 +00:00
|
|
|
these variables based on the hostname of your test
|
|
|
|
|
machine
|
2004-08-12 07:31:30 +00:00
|
|
|
- or add these variables to a file called local.config and keep that
|
|
|
|
|
file in your workarea.
|
2001-01-15 05:01:19 +00:00
|
|
|
|
|
|
|
|
- if testing xfsdump, make sure the tape devices have a
|
|
|
|
|
tape which can be overwritten.
|
|
|
|
|
|
|
|
|
|
- make sure $TEST_DEV is a mounted XFS partition
|
2011-10-20 23:41:19 +08:00
|
|
|
- make sure that $SCRATCH_DEV or $SCRATCH_DEV_POOL contains nothing useful
|
2001-01-15 05:01:19 +00:00
|
|
|
|
|
|
|
|
Running tests:
|
|
|
|
|
|
2004-01-14 02:29:30 +00:00
|
|
|
- cd xfstests
|
2004-08-12 07:31:30 +00:00
|
|
|
- By default the tests suite will run xfs tests:
|
2013-06-27 11:57:36 -04:00
|
|
|
- ./check '*/001' '*/002' '*/003'
|
|
|
|
|
- ./check '*/06?'
|
2014-09-08 22:26:52 +10:00
|
|
|
- You can explicitly specify NFS/CIFS/UDF, otherwise the filesystem type will
|
|
|
|
|
be autodetected from $TEST_DEV:
|
2013-06-27 11:57:36 -04:00
|
|
|
./check -nfs [test(s)]
|
2004-08-12 07:31:30 +00:00
|
|
|
- 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)]
|
2014-09-08 22:26:52 +10:00
|
|
|
- for running cifs/smb3 tests: ./check -cifs [test(s)]
|
2005-12-02 05:03:41 +00:00
|
|
|
- To randomize test order: ./check -r [test(s)]
|
2004-08-12 07:31:30 +00:00
|
|
|
|
2001-01-15 05:01:19 +00:00
|
|
|
|
|
|
|
|
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
|
2004-08-12 07:31:30 +00:00
|
|
|
to be failures but are not necessarily detected by the QA system.
|
2001-01-15 05:01:19 +00:00
|
|
|
|
|
|
|
|
__________________________
|
2004-08-12 07:31:30 +00:00
|
|
|
ADDING TO THE FSQA SUITE
|
2001-01-15 05:01:19 +00:00
|
|
|
__________________________
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
2013-03-29 04:49:55 +00:00
|
|
|
available to the script once the "common/rc" file has been
|
2001-01-15 05:01:19 +00:00
|
|
|
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
|
2004-08-12 07:31:30 +00:00
|
|
|
directory is within the filesystem on the block device
|
2001-01-15 05:01:19 +00:00
|
|
|
$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.
|
|
|
|
|
|
|
|
|
|
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
|
2013-03-29 04:49:55 +00:00
|
|
|
common/filter for an explanation
|
2001-01-15 05:01:19 +00:00
|
|
|
|
|
|
|
|
_filter_date - turn ctime(3) format dates into the
|
|
|
|
|
string DATE for deterministic
|
|
|
|
|
output
|
|
|
|
|
|
2010-08-02 17:51:00 +00:00
|
|
|
_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)
|
|
|
|
|
|
2013-03-23 13:29:51 +00:00
|
|
|
5. General recommendations, usage conventions, etc.:
|
2010-08-02 17:51:00 +00:00
|
|
|
- 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.
|
2015-04-02 09:23:10 +11:00
|
|
|
- When creating a new test, it is possible to enter a custom name
|
|
|
|
|
for the file. Filenames are in form NNN-custom-name, where NNN
|
|
|
|
|
is automatically added by the ./new script as an unique ID,
|
|
|
|
|
and "custom-name" is the optional string entered into a prompt
|
|
|
|
|
in the ./new script. It can contain only alphanumeric characters
|
|
|
|
|
and dash. Note the "NNN-" part is added automatically.
|
2010-08-02 17:51:00 +00:00
|
|
|
|
2001-01-15 05:01:19 +00:00
|
|
|
Verified output:
|
|
|
|
|
|
2015-04-02 09:23:10 +11:00
|
|
|
Each test script has a name, e.g. 007, and an associated
|
2001-01-15 05:01:19 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
|
|
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
|
2004-08-12 07:31:30 +00:00
|
|
|
won't have the desired effect because of the way the exit trap
|
2001-01-15 05:01:19 +00:00
|
|
|
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".
|