$ git log --pretty=format:'%h %s (%cs)%d'
9157237c8 generic: test using fs-verity and fscrypt simultaneously (2018-04-18)
(HEAD -> master)
655cf5314 generic: test fs-verity elide and patch extensions (2018-04-18)
681bd1dbc generic: test that fs-verity is using the correct measurement values (2018-04-18)
f5c61adf5 generic: test corrupting fs-verity files (2018-04-18)
4644ea889 generic: test fs-verity footer validation (2018-04-18)
fec85e07a generic: test fs-verity access control (2018-04-18)
2d2de3e49 generic: test general semantics of fs-verity files (2018-04-18)
af940afa9 verity: add common functions for testing fs-verity (2018-04-18)
fdf6d4bc8 xfs/187: fix ftype brokenness (2018-04-14)
858c39281 generic: test for fsync after fallocate (2018-04-13)
...
$ git cat-file blob HEAD:README
_______________________
BUILDING THE FSQA SUITE
_______________________
- 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 python sqlite3
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 python sqlite
(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 fsgqa group ("sudo groupadd fsgqa")
- create 123456-fsgqa test user ("sudo useradd 123456-fsgqa")
______________________
USING THE FSQA SUITE
______________________
Preparing system for tests:
- compile XFS into your kernel or load XFS modules
- install administrative tools specific to the filesystem you wish to test
- If you wish to run the udf components of the suite install
mkudffs. 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.
(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" 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"
- 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.
- 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.
- 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.
- setenv LOGWRITES_DEV to a block device to use for power fail
testing.
- setenv 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.
- 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 or $SCRATCH_DEV_POOL contains nothing useful
Running tests:
- cd xfstests
- By default the tests suite will run xfs tests:
- ./check '*/001' '*/002' '*/003'
- ./check '*/06?'
- Groups of tests maybe ran by: ./check -g [group(s)]
See the 'group' file for details on groups
- 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.
__________________________
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.
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)
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.
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
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".
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.
# heads (aka `branches'):
$ git for-each-ref --sort=-creatordate refs/heads \
--format='%(HEAD) %(refname:short) %(subject) (%(creatordate:short))'
fsverity generic: test that fs-verity inodes are unpinned on deletion (2018-04-23)
* master generic: test using fs-verity and fscrypt simultaneously (2018-04-18)
# tags:
$ git for-each-ref --sort=-creatordate refs/tags \
--format='%(refname:short) %(subject) (%(creatordate:short))'
# no tags, yet...
# associated public inboxes:
# (number on the left is used for dev purposes)
12044 fstests
7835 linux-xfs
2370 linux-btrfs
659 linux-ext4
561 linux-unionfs
462 linux-fsdevel
372 ../../../../../../../lkml
171 linux-f2fs-devel
167 linux-fscrypt
91 qemu-devel
85 linux-arm-kernel
80 u-boot
79 netdev
68 nvdimm
65 linux-nvdimm
64 linux-nfs
58 linux-mm
56 stable
55 linux-api
54 linux-devicetree
48 ocfs2-devel
41 dri-devel
41 intel-gfx
40 ceph-devel
38 dpdk-dev
35 git
33 kvm
28 linux-block
28 xen-devel
28 linuxppc-dev
28 buildroot
27 linux-cifs
26 alsa-devel
23 linux-media
23 linux-man
21 linux-omap
21 containers
21 openembedded-core
20 linux-wireless
20 linux-mtd
20 linux-rdma
19 linux-arm-msm
19 amd-gfx
19 openembedded-devel
17 dm-devel
16 bpf
16 linux-mips
16 linux-pci
16 fsverity
15 netfilter-devel
15 linux-scsi
15 io-uring
15 linux-arch
14 kvmarm
14 linux-tegra
13 linux-samsung-soc
12 linux-pm
12 linux-doc
12 linux-s390
11 linux-erofs
11 linux-gpio
11 kernel-janitors
10 linux-input
10 linux-iio
10 linux-mmc
10 linux-bcachefs
10 ltp
9 linux-mediatek
9 linux-acpi
9 linux-iommu
9 linux-kselftest
9 linux-bluetooth
9 linux-serial
8 linux-crypto
8 linux-i2c
8 virtualization
8 keyrings
8 linux-sh
8 linux-patches
7 linux-nvme
7 selinux
7 linux-rockchip
7 linux-perf-users
7 sparclinux
7 intel-wired-lan
7 cluster-devel
7 igt-dev
6 linux-riscv
6 driverdev-devel
6 linux-renesas-soc
6 linux-clk
6 linux-security-module
6 linux-watchdog
6 linux-kbuild
6 linux-raid
6 nouveau
6 bitbake-devel
6 virtio-fs
5 linux-amlogic
5 linux-usb
5 linux-ide
5 linux-hyperv
5 lttng-dev
5 linux-fbdev
5 linux-cxl
5 lustre-devel
5 ofono
5 yocto
5 yocto-meta-ti
5 qemu-riscv
5 linux-ia64
4 linux-rtc
4 linux-parisc
4 linux-rt-users
4 linux-trace-devel
4 linux-spi
4 linux-pwm
4 linux-can
4 platform-driver-x86
4 phone-devel
4 soc
4 linux-staging
4 linux-coco
4 yocto-meta-freescale
4 yocto-docs
4 yocto-meta-arago
4 kexec
4 b4-sent
4 grub-devel
4 linux-sound
4 u-boot-amlogic
4 lvm-devel
3 linux-efi
3 linux-integrity
3 linux-snps-arc
3 kernel-hardening
3 dmaengine
3 linux-leds
3 linux-modules
3 selinux-refpolicy
3 util-linux
3 backports
3 cip-dev
3 linux-remoteproc
3 linux-sparse
3 openbmc
3 mptcp
3 llvm
3 fio
3 iwd
3 yocto-meta-arm
3 yocto-meta-virtualization
3 outreachy
3 xenomai
3 openrisc
3 loongarch
3 intel-xe
3 linux-um
3 poky
3 cgroups
3 kvm-ppc
3 linux-alpha
3 linux-hexagon
3 perfbook
2 linux-edac
2 linux-hwmon
2 workflows
2 rcu
2 linux-m68k
2 linux-i3c
2 linux-wpan
2 wireguard
2 linux-kernel-mentees
2 linux-csky
2 linux-firmware
2 linux-bcache
2 linux-fpga
2 linux-hardening
2 dash
2 linux-sctp
2 target-devel
2 rust-for-linux
2 ath10k
2 linux-phy
2 linux-sunxi
2 regressions
2 ath9k-devel
2 linux-ppp
2 yocto-toaster
2 imx
2 linux-trace-kernel
2 oe-kbuild-all
2 batman
2 virtio-comment
2 v9fs
2 gfs2
2 hail-devel
2 reiserfs-devel
2 linux-metag
2 linux-nilfs
2 netfilter
2 fuego
1 cocci
1 live-patching
1 linux-next
1 kernelnewbies
1 linux-sgx
1 linux-spdx
1 ksummit-discuss
1 tpmdd-devel
1 linux-audit
1 linux-dash
1 mm-commits
1 xdp-newbies
1 ath11k
1 ksummit
1 b43-dev
1 linux-nfc
1 ntfs3
1 ell
1 chrome-platform
1 ntb
1 damon
1 asahi
1 ath12k
1 oe-linux-nfc
1 oe-chipsec
1 virtio-dev
1 ecryptfs
1 kdevops
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 netfs
1 powertop
1 dtrace
1 yocto-patches
1 ../../../../../../../barebox
1 ../../../../../../../linux-aspeed
git clone https://yhbt.net/lore/pub/scm/linux/kernel/git/mhalcrow/xfstests.git