|Tested on openSUSE||Recommended articles||Related articles|
How to run xfstests on openSUSE.
The XFS team brought xfstests with them from SGI in the early 2000's.
Since then it has been enhanced to include filesystem tests for a number of linux filesystems, but it has retained the original name.
It is not packaged for openSUSE, but it certainly can be downloaded, installed and run with little effort.
Instructions for new xfstests testers:
These instructions are customized for openSUSE, but originally come from these 2 sources:
First you need to get xfstests running:
First make sure you have the basic tools and packages (for SLE you need the SDK repos):
$ zypper install git gcc libtool automake gettext-tools libattr-devel libacl-devel libuuid-devel libblkid-devel btrfsprogs
Then install the basic xfs sources:
$ mkdir xfs_playground; cd xfs_playground $ git clone git://oss.sgi.com/xfs/cmds/xfsprogs $ git clone git://oss.sgi.com/xfs/cmds/xfstests
(You can use git clone https://github.com/adityadani/xfstests to get the one which has snapshot testing utility in it)
(If you are tracking the current version, use git pull from time to time to get the latest work)
$ cd xfsprogs $ make $ sudo make install-qa # try 'make install-dev' if this fails, it installs xfs header files $ cd ../xfstests $ make
Once the ‘make’ is successful you need to setup certain environment variables. You need to have two different partitions on your machine : 1] One as a test device. 2] One as a scratch device. (A scratch device is not mandatory. However certain tests need a scratch device.) Setting up the environment variables :
export TEST_DEV=test_device-name export TEST_DIR=test_device-mount-point export SCRATCH_DEV=scratch_device-name export SCRATCH_MNT=scratch_device-mount-point export FSTYP=btrfs
(Yes, the variable names are inconsistent. And assumes you are testing btrfs.)
At a minimum, btrfs, xfs, and ext4 are supported by xfstests.
Running Tests :
$ cd xfstests $ ./check -g auto
The above command by default runs many of the tests in the xfs test suite. If you leave off the -g arg, it will try to run them all. There is also a quick group (-g quick) that should run in under 5 minutes. See the file "group" in the xfstests directory for a breakdown of which tests are in which group.
In order to run a specific test say test no : 102 then,
$ ./check 102 $ ./check 001 002 003 ….
(The check script tests the return value of each ‘test script’ and compares its
value with the expected output. If the test fails then it generates a diff in the file .out.bad )
Running Snapshot Tests :
Currently there exists only one test 256. You will need to get test 256 directly from the next4 team as it is still in development or use the following link https://github.com/adityadani/xfstests
In order to run the test : To run the tests both the devices/partitions need to be mounted.
Both btrfs and ext4dev are supported currently, but ext4dev takes undocumented tweaks to get working. Therefore try with btrfs first:
1] First set the environment variables as mentioned above.
2] Mount the device on the specified mount point.
mkfs.btrfs $TEST_DEV mkfs.btrfs $SCRATCH_DEV mount $TEST_DEV $TEST_DIR mount $SCRATCH_DEV $SCRATCH_MNT
3] Run the test number 256
$ ./check 256
Please note the above test is still under development and hence has certain bugs.