generic: hole punching followed by writes in the same range
[xfstests-dev.git] / README
diff --git a/README b/README
index 5367be640a526e9963e13a809d5e62f37e36c030..fd491e4a86b055085839f84ca99525c71f5ae0d1 100644 (file)
--- a/README
+++ b/README
@@ -3,7 +3,25 @@ BUILDING THE FSQA SUITE
 _______________________
 
 Building Linux:
-       - cd into the xfstests directory and run make.
+       - cd into the xfstests directory
+       - install prerequisite packages
+         For example, for Ubuntu:
+               sudo apt-get install xfslibs-dev uuid-dev libtool-bin \
+               e2fsprogs automake gcc libuuid1 quota attr libattr1-dev make \
+               libacl1-dev libaio-dev xfsprogs libgdbm-dev gawk fio dbench \
+               uuid-runtime
+         For Fedora, RHEL, or CentOS:
+               yum install acl attr automake bc dbench dump e2fsprogs fio \
+               gawk gcc indent libtool lvm2 make psmisc quota sed \
+               xfsdump xfsprogs \
+               libacl-devel libattr-devel libaio-devel libuuid-devel \
+               xfsprogs-devel btrfs-progs-devel
+               (Older distributions may require xfsprogs-qa-devel as well.)
+               (Note that for RHEL and CentOS, you may need the EPEL repo.)
+       - run make
+       - run make install
+       - create fsgqa test user ("sudo useradd fsgqa")
+       - create 123456-fsgqa test user ("sudo useradd 123456-fsgqa")
        
 Building IRIX:
        - cd into the xfstests directory 
@@ -17,8 +35,8 @@ ______________________
 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 
+    - install administrative tools specific to the filesystem you wish to test
+    - 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 
@@ -34,14 +52,25 @@ Preparing system for tests (IRIX and Linux):
             - 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)
+              (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.
               
     - setup your environment
+       Quick start:
+       - copy local.config.example to local.config and edit as needed
+       Or:
         - 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_DEV "device containing SCRATCH PARTITION" OR
+               (btrfs only) setenv SCRATCH_DEV_POOL "to 3 or more SCRATCH disks for
+               testing btrfs raid concepts"
              - 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"
@@ -53,7 +82,24 @@ Preparing system for tests (IRIX and Linux):
              - 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
+             - setenv DIFF_LENGTH "number of diff lines to print from a failed test",
+               by default 10, set to 0 to print the full diff
+             - 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'
+             - 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.
+             - set TEST_XFS_REPAIR_REBUILD=1 to have _check_xfs_filesystem
+               run xfs_repair -n to check the filesystem; xfs_repair to rebuild
+               metadata indexes; and xfs_repair -n (a third time) to check the
+               results of the rebuilding.
+             - set TEST_XFS_SCRUB=1 to have _check_xfs_filesystem run
+               xfs_scrub -vd to scrub the filesystem metadata online before
+               unmounting to run the offline check.
+
+        - 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
@@ -63,21 +109,26 @@ Preparing system for tests (IRIX and Linux):
       tape which can be overwritten.
           
     - make sure $TEST_DEV is a mounted XFS partition
-    - make sure that $SCRATCH_DEV contains nothing useful
+    - make sure that $SCRATCH_DEV or $SCRATCH_DEV_POOL 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
+    - ./check '*/001' '*/002' '*/003'
+    - ./check '*/06?'
     - 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)]
+    - You can explicitly specify NFS/CIFS/UDF/OVERLAY, otherwise
+      the filesystem type will be autodetected from $TEST_DEV:
+        - for running nfs tests: ./check -nfs [test(s)]
+        - for running cifs/smb3 tests: ./check -cifs [test(s)]
+        - for udf tests: ./check -udf [test(s)]
+          Running all the udf tests: ./check -udf -g udf
+        - for overlay tests: ./check -overlay [test(s)]
+          The TEST and SCRATCH partitions should be pre-formatted
+          with another base fs, where the overlay dirs will be created
 
     
     The check script tests the return value of each script, and
@@ -101,7 +152,7 @@ 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
+    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
@@ -138,10 +189,6 @@ Test script environment:
      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
@@ -154,7 +201,7 @@ Test script environment:
        _within_tolerance       - fancy numerical "close enough is good
                                  enough" filter for deterministic
                                  output ... see comments in
-                                 common.filter for an explanation
+                                 common/filter for an explanation
 
        _filter_date            - turn ctime(3) format dates into the
                                  string DATE for deterministic
@@ -165,7 +212,7 @@ Test script environment:
                                  and the content of the NIS database
                                  if it is likely to be present)
 
-     4. General recommendations, usage conventions, etc.:
+     5. 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
@@ -173,10 +220,16 @@ Test script environment:
        - When calling getfacl in a test, pass the "-n" argument so
          that numeric rather than symbolic identifiers are used in
          the output.
+       - 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.
 
 Verified output:
 
-    Each test script has a numerical name, e.g. 007, and an associated
+    Each test script has a name, e.g. 007, and an associated
     verified output, e.g. 007.out.
 
     It is important that the verified output is deterministic, and
@@ -191,9 +244,6 @@ Verified output:
     - 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.
@@ -223,3 +273,12 @@ Pass/failure:
     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".
+
+    The compare-failures script in tools/ may be used to compare failures
+    across multiple runs, given files containing stdout from those runs.
+
+__________________
+SUBMITTING PATCHES
+__________________
+
+Send patches to the fstests mailing list at fstests@vger.kernel.org.