pub/scm/linux/kernel/git/brauner/xfstests-dev.git  about / heads / tags
brauner's fork of xfstests-dev.git
$ git log --pretty=format:'%h %s (%cs)%d'
bb04d5774 fstests: add some missing _require_loop's (2022-04-29)
	(HEAD -> master)
298f60c81 generic/673: Add separate sgid stripping sub-tests (2022-04-28)
ab47e281b fsstress: remove ALLOCSP and FREESP operations entirely (2022-04-28)
987700db3 fstests: btrfs: test setting compression via xattr on nodatacow files (2022-04-27)
7753e08d2 fstests: remove xfs/144 (2022-04-27)
5528f7843 generic/681, generic/682: add debugging information to $seqreq.full (2022-04-27)
0fd8e2614 chown: fix ownership format string (2022-04-27)
31c01ce18 generic: add test for tmpfs POSIX ACLs (2022-04-27)
e81417a09 generic: ensure we drop suid after fallocate (2022-04-27)
7f27a290a xfs: make sure syncfs(2) passes back super_operations.sync_fs errors (2022-04-27)

$ git cat-file blob HEAD:README

Ubuntu or Debian

1. Make sure that package list is up-to-date and install all necessary packages:

   $ sudo apt-get update
   $ sudo apt-get install acl attr automake bc dbench dump e2fsprogs fio gawk \
        gcc git indent libacl1-dev libaio-dev libcap-dev libgdbm-dev libtool \
        libtool-bin liburing-dev libuuid1 lvm2 make psmisc python3 quota sed \
        uuid-dev uuid-runtime xfsprogs linux-headers-$(uname -r) sqlite3

2. Install packages for the filesystem(s) being tested:

   $ sudo apt-get install exfatprogs f2fs-tools ocfs2-tools udftools xfsdump \

   For OverlayFS install:
    - see


1. Install all necessary packages from standard repository:

   $ sudo yum install acl attr automake bc dbench dump e2fsprogs fio gawk gcc \
        gdbm-devel git indent kernel-devel libacl-devel libaio-devel \
        libcap-devel libtool liburing-devel libuuid-devel lvm2 make psmisc \
        python3 quota sed sqlite udftools  xfsprogs

2. Install packages for the filesystem(s) being tested:

    $ sudo yum install btrfs-progs exfatprogs f2fs-tools ocfs2-tools xfsdump \

   For OverlayFS build and install:
    - see

RHEL or CentOS

1. Enable EPEL repository:
    - see

2. Install all necessary packages which are available from standard repository
   and EPEL:

   $ sudo yum install acl attr automake bc dbench dump e2fsprogs fio gawk gcc \
        gdbm-devel git indent kernel-devel libacl-devel libaio-devel \
        libcap-devel libtool libuuid-devel lvm2 make psmisc python3 quota sed \
        sqlite udftools xfsprogs

   Or, EPEL packages could be compiled from sources, see:

3. Build and install 'liburing':
    - see

4. Install packages for the filesystem(s) being tested:

    For XFS install:
     $ sudo yum install xfsdump xfsprogs-devel

    For exfat install:
     $ sudo yum install exfatprogs

    For f2fs build and install:
     - see

    For ocfs2 build and install:
     - see

    For OverlayFS build and install:
     - see

Build and install test, libs and utils

$ git clone git://
$ cd xfstests-dev
$ make
$ sudo make install

Setup Environment

1. Compile XFS/EXT4/BTRFS/etc. into your kernel or load as module. For example,
   for XFS, enable XFS_FS in your kernel configuration, or compile it as a
   module and load it with 'sudo modprobe xfs'. Most of the distributions will
   have these filesystems already in the kernel/as module.

2. Create TEST device:
    - format as the filesystem type you wish to test.
    - should be at least 10GB in size.
    - optionally populate with destroyable data.
    - device contents may be destroyed.

3. (optional) Create SCRATCH device.
    - many tests depend on the SCRATCH device existing.
    - not need to be formatted.
    - should be at least 10GB in size.
    - must be different to TEST device.
    - device contents will be destroyed.

4. (optional) Create SCRATCH device pool.
    - needed for BTRFS testing
    - specifies 3 or more independent SCRATCH devices via the SCRATCH_DEV_POOL
      variable e.g SCRATCH_DEV_POOL="/dev/sda /dev/sdb /dev/sdc"
    - device contents will be destroyed.
    - SCRATCH device should be left unset, it will be overridden
      by the SCRATCH_DEV_POOL implementation.

5. Copy local.config.example to local.config and edit as needed. The TEST_DEV
   and TEST_DIR are required.

6. (optional) Create fsgqa test users and groups:

   $ sudo useradd -m fsgqa
   $ sudo useradd 123456-fsgqa
   $ sudo useradd fsgqa2
   $ sudo groupadd fsgqa

   The "123456-fsgqa" user creation step can be safely skipped if your system
   doesn't support names starting with digits, only a handful of tests require

7. (optional) If you wish to run the udf components of the suite install
   mkudffs. Also download and build the Philips UDF Verification Software from, then copy the udf_test
   binary to xfstests/src/.

For example, to run the tests with loopback partitions:

    # xfs_io -f -c "falloc 0 10g" test.img
    # xfs_io -f -c "falloc 0 10g" scratch.img
    # mkfs.xfs test.img
    # losetup /dev/loop0 ./test.img
    # losetup /dev/loop1 ./scratch.img
    # mkdir -p /mnt/test && mount /dev/loop0 /mnt/test
    # mkdir -p /mnt/scratch

The config for the setup above is:

    $ cat local.config
    export TEST_DEV=/dev/loop0
    export TEST_DIR=/mnt/test
    export SCRATCH_DEV=/dev/loop1
    export SCRATCH_MNT=/mnt/scratch

From this point you can run some basic tests, see 'USING THE FSQA SUITE' below.

Additional Setup

Some tests require additional configuration in your local.config. Add these
variables to a local.config and keep that file in your workarea. Or add a case
to the switch in common/config assigning these variables based on the hostname
of your test machine. Or use 'setenv' to set them.

Extra TEST device specifications:
 - Set TEST_LOGDEV to "device for test-fs external log"
 - Set TEST_RTDEV to "device for test-fs realtime data"
 - If TEST_LOGDEV and/or TEST_RTDEV, these will always be used.
 - Set FSTYP to "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'

Extra SCRATCH device specifications:
 - Set SCRATCH_LOGDEV to "device for scratch-fs external log"
 - Set SCRATCH_RTDEV to "device for scratch-fs realtime data"

Tape device specification for xfsdump testing:
 - Set TAPE_DEV to "tape device for testing xfsdump".
 - Set RMT_TAPE_DEV to "remote tape device for testing xfsdump"
   variable set to "yes" will enable their use.
 - Note that if testing xfsdump, make sure the tape devices have a tape which
   can be overwritten.

Extra XFS specification:
 - 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
 - Set FORCE_XFS_CHECK_PROG=yes to have _check_xfs_filesystem run xfs_check
   to check the filesystem. As of August 2021, xfs_repair finds all
   filesystem corruptions found by xfs_check, and more, which means that
   xfs_check is no longer run by default.
 - xfs_scrub, if present, will always check the test and scratch
   filesystems if they are still online at the end of the test. It is no
   longer necessary to set TEST_XFS_SCRUB.

Tools specification:
 - dump:
    - Set DUMP_CORRUPT_FS=1 to record metadata dumps of XFS, ext* or
      btrfs filesystems if a filesystem check fails.
    - Set DUMP_COMPRESSOR to a compression program to compress metadumps of
      filesystems. This program must accept '-f' and the name of a file to
      compress; and it must accept '-d -f -k' and the name of a file to
      decompress. In other words, it must emulate gzip.
 - dmesg:
    - Set KEEP_DMESG=yes to keep dmesg log after test
 - kmemleak:
    - Set USE_KMEMLEAK=yes to scan for memory leaks in the kernel after every
      test, if the kernel supports kmemleak.
 - fsstress:
    - Set 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.

Kernel/Modules related configuration:
 - Set TEST_FS_MODULE_RELOAD=1 to unload the module and reload it between
   test invocations. This assumes that the name of the module is the same
   as FSTYP.
 - Set MODPROBE_PATIENT_RM_TIMEOUT_SECONDS to specify the amount of time we
   should try a patient module remove. The default is 50 seconds. Set this
   to "forever" and we'll wait forever until the module is gone.
 - Set KCONFIG_PATH to specify your preferred location of kernel config
   file. The config is used by tests to check if kernel feature is enabled.

 - If you wish to disable UDF verification test set the environment variable
 - Set LOGWRITES_DEV to a block device to use for power fail testing.
 - Set PERF_CONFIGNAME to a arbitrary string to be used for identifying
   the test setup for running perf tests. This should be different for
   each type of performance test you wish to run so that relevant results
   are compared. For example 'spinningrust' for configurations that use
   spinning disks and 'nvme' for tests using nvme drives.
 - Set MIN_FSSIZE to specify the minimal size (bytes) of a filesystem we
   can create. Setting this parameter will skip the tests creating a
   filesystem less than MIN_FSSIZE.
 - Set DIFF_LENGTH to "number of diff lines to print from a failed test",
   by default 10, set to 0 to print the full diff
 - set IDMAPPED_MOUNTS=true to run all tests on top of idmapped mounts. While
   this option is supported for all filesystems currently only -overlay is
   expected to run without issues. For other filesystems additional patches
   and fixes to the test suite might be needed.


Running tests:

    - cd xfstests
    - By default the tests suite will run all the tests in the auto group. These
      are the tests that are expected to function correctly as regression tests,
      and it excludes tests that exercise conditions known to cause machine
      failures (i.e. the "dangerous" tests).
    - ./check '*/001' '*/002' '*/003'
    - ./check '*/06?'
    - Groups of tests maybe ran by: ./check -g [group(s)]
      See the tests/*/group.list files after building xfstests to learn about
      each test's group memberships.
    - If you want to run all tests regardless of what group they are in
      (including dangerous tests), use the "all" group: ./check -g all
    - To randomize test order: ./check -r [test(s)]
    - You can explicitly specify NFS/CIFS/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 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
    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.


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/preamble" file has been
    sourced and the "_begin_fstest" function has been called.

     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

	(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
	    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
				  common/filter for an explanation

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

	_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)

     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
	  is active.
	- 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.

     6. Test group membership: Each test can be associated with any number
	of groups for convenient selection of subsets of tests.  Group names
	can be any sequence of non-whitespace characters.  Test authors
	associate a test with groups by passing the names of those groups as
	arguments to the _begin_fstest function.  For example, the code:

	_begin_fstest auto quick subvol snapshot

	associates the current test with the "auto", "quick", "subvol", and
	"snapshot" groups.  It is not necessary to specify the "all" group
	in the list because that group is computed at run time.

	The build process scans test files for _begin_fstest invocations and
	compiles the group list from that information.  In other words, test
	files must call _begin_fstest or they will not be run.

Verified output:

    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
    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


    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

    To force a non-zero exit status use:

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

    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.


Send patches to the fstests mailing list at

# heads (aka `branches'):
$ git for-each-ref --sort=-creatordate refs/heads \
	--format='%(HEAD) %(refname:short) %(subject) (%(creatordate:short))'
  b4/fstests-check-user common: check user and group existence via id (2023-09-26)
  fstests.setgid.v6.2 generic: update setgid tests (2023-01-05)
  fstests.setgid.v6.2.v2 generic: update setgid tests (2023-01-04) generic: overlay group ownership changing test (2022-09-20) generic/692: test group ownership change (2022-06-21) generic/692: test group ownership change (2022-06-14) generic/692: test group ownership change (2022-06-13)
  fstests.vfstest vfs/idmapped-mounts: remove invalid test (2022-05-12)
  fs.idmapped.rename vfstest: split out remaining idmapped mount tests (2022-05-12)
* master       fstests: add some missing _require_loop's (2022-04-29)

# tags:
$ git for-each-ref --sort=-creatordate refs/tags \
	--format='%(refname:short) %(subject) (%(creatordate:short))'
fstests.vfstest.for-next fstests.vfstest.for-next (2022-05-12) tar.gz
fs.idmapped.overlay.v4 fs.idmapped.overlay.v4 (2022-04-04) tar.gz
fs.idmapped.overlay.v3 fs.idmapped.overlay.v3 (2022-03-31) tar.gz
fs.idmapped.overlay.v2 fs.idmapped.overlay.v2 (2022-03-30) tar.gz
fs.idmapped.overlay.v1 fs.idmapped.overlay.v1 (2022-03-28) tar.gz
v1.1.0       1.1.0 release (2011-10-14) tar.gz

# associated public inboxes:
# (number on the left is used for dev purposes)
      11340 fstests
       7625 linux-xfs
       2190 linux-btrfs
        659 linux-ext4
        559 linux-unionfs
        449 linux-fsdevel
        369 lkml
        167 linux-fscrypt
        163 linux-f2fs-devel
         90 qemu-devel
         84 linux-arm-kernel
         79 u-boot
         78 netdev
         67 nvdimm
         65 linux-nvdimm
         62 linux-nfs
         55 linux-mm
         55 stable
         55 linux-api
         53 linux-devicetree
         48 ocfs2-devel
         40 dri-devel
         40 intel-gfx
         39 ceph-devel
         37 dpdk-dev
         34 git
         32 kvm
         27 linux-block
         27 xen-devel
         27 linuxppc-dev
         27 buildroot
         26 linux-cifs
         25 alsa-devel
         22 linux-media
         22 linux-man
         21 containers
         20 linux-omap
         20 openembedded-core
         19 linux-wireless
         19 linux-mtd
         19 linux-rdma
         18 linux-arm-msm
         18 amd-gfx
         18 openembedded-devel
         16 dm-devel
         15 bpf
         15 linux-mips
         15 linux-pci
         14 netfilter-devel
         14 linux-scsi
         14 linux-arch
         13 kvmarm
         13 linux-tegra
         12 linux-samsung-soc
         11 linux-pm
         11 io-uring
         11 linux-doc
         11 linux-s390
         10 linux-erofs
         10 linux-gpio
         10 kernel-janitors
         10 linux-bcachefs
          9 linux-input
          9 linux-iio
          9 linux-mmc
          9 ltp
          8 linux-mediatek
          8 linux-acpi
          8 linux-iommu
          8 linux-kselftest
          8 linux-bluetooth
          8 linux-serial
          7 linux-crypto
          7 linux-i2c
          7 virtualization
          7 keyrings
          7 linux-sh
          7 linux-patches
          7 intel-wired-lan
          7 cluster-devel
          6 linux-nvme
          6 driverdev-devel
          6 selinux
          6 linux-rockchip
          6 linux-perf-users
          6 sparclinux
          6 virtio-fs
          6 ../../../../../../../igt-dev
          5 linux-riscv
          5 linux-renesas-soc
          5 linux-clk
          5 linux-security-module
          5 linux-watchdog
          5 lttng-dev
          5 linux-kbuild
          5 linux-raid
          5 lustre-devel
          5 nouveau
          5 bitbake-devel
          5 linux-ia64
          4 linux-amlogic
          4 linux-usb
          4 linux-ide
          4 linux-trace-devel
          4 linux-hyperv
          4 linux-fbdev
          4 linux-cxl
          4 ofono
          4 yocto
          4 yocto-meta-freescale
          4 yocto-docs
          4 yocto-meta-ti
          4 qemu-riscv
          4 lvm-devel
          3 linux-rtc
          3 kernel-hardening
          3 linux-parisc
          3 linux-rt-users
          3 selinux-refpolicy
          3 util-linux
          3 linux-spi
          3 linux-pwm
          3 linux-can
          3 platform-driver-x86
          3 phone-devel
          3 soc
          3 linux-staging
          3 linux-coco
          3 yocto-meta-arago
          3 outreachy
          3 kexec
          3 fsverity
          3 poky
          3 grub-devel
          3 cgroups
          3 kvm-ppc
          3 linux-sound
          3 u-boot-amlogic
          2 linux-efi
          2 linux-integrity
          2 linux-snps-arc
          2 dmaengine
          2 linux-leds
          2 linux-modules
          2 workflows
          2 linux-wpan
          2 backports
          2 linux-kernel-mentees
          2 cip-dev
          2 linux-remoteproc
          2 linux-bcache
          2 linux-sparse
          2 openbmc
          2 linux-sctp
          2 target-devel
          2 ath10k
          2 mptcp
          2 regressions
          2 ath9k-devel
          2 llvm
          2 fio
          2 iwd
          2 yocto-toaster
          2 yocto-meta-arm
          2 yocto-meta-virtualization
          2 xenomai
          2 openrisc
          2 loongarch
          2 batman
          2 intel-xe
          2 linux-um
          2 virtio-comment
          2 gfs2
          2 hail-devel
          2 linux-alpha
          2 linux-hexagon
          2 reiserfs-devel
          2 linux-metag
          2 linux-nilfs
          2 netfilter
          2 perfbook
          2 ../../../../../../../fuego
          1 cocci
          1 live-patching
          1 linux-edac
          1 linux-hwmon
          1 linux-next
          1 kernelnewbies
          1 linux-sgx
          1 rcu
          1 linux-m68k
          1 linux-i3c
          1 linux-spdx
          1 ksummit-discuss
          1 wireguard
          1 linux-csky
          1 tpmdd-devel
          1 linux-firmware
          1 linux-audit
          1 linux-dash
          1 mm-commits
          1 linux-fpga
          1 xdp-newbies
          1 linux-hardening
          1 dash
          1 rust-for-linux
          1 ath11k
          1 linux-phy
          1 linux-sunxi
          1 ksummit
          1 b43-dev
          1 linux-nfc
          1 ntfs3
          1 linux-ppp
          1 ell
          1 chrome-platform
          1 ntb
          1 damon
          1 asahi
          1 imx
          1 ath12k
          1 b4-sent
          1 linux-trace-kernel
          1 oe-linux-nfc
          1 oe-kbuild-all
          1 oe-chipsec
          1 virtio-dev
          1 v9fs
          1 ecryptfs
          1 kbd
          1 autofs
          1 cpufreq
          1 dccp
          1 devicetree-spec
          1 devicetree-compiler
          1 initramfs
          1 kvm-ia64
          1 linux-8086
          1 kernel-testers
          1 linux-btrace
          1 linux-embedded
          1 linux-hams
          1 linux-hotplug
          1 linux-laptop
          1 trinity
          1 linux-x25
          1 lvs-devel
          1 linux-oxnas
          1 lm-sensors
          1 acpica-devel
          1 bridge
          1 smatch
          1 ../../../../../../../wireless-regdb
          1 ../../../../../../../powertop

git clone