Commit Graph

11 Commits

Author SHA1 Message Date
Darrick J. Wong a860a167d8 common: kill _supported_os
fstests only supports Linux, so get rid of this unnecessary predicate.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2020-09-21 01:16:50 +08:00
Darrick J. Wong 66dd0c19da xfs: wrap xfs_db calls to the test device
Create a _test_xfs_db analogue to _scratch_xfs_db so that we can
encapsulate whatever strange test fs options were fed to us by the test
runner.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2020-09-21 00:47:27 +08:00
Darrick J. Wong ee3677a868 xfs/016: calculate minimum log size and end locations
xfs/016 looks for corruption in the log when the log wraps.  However,
it hardcodes the minimum log size and the "95%" point where it wants to
start the "nudge and check for corruption" part of the test.  New
features require larger logs, which causes the test to fail when it
can't mkfs with the smaller log size and when that 95% point doesn't put
us within 20x "_log_traffic 2"s of the end of the log.

Fix the first problem by using the new min log size helper and replace
the 95% figure with an estimate of where we need to be to guarantee that
the 20x loop wraps the log.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Allison Collins <allison.henderson@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2019-07-13 12:21:13 +08:00
Dave Chinner 2529c9486a xfs: convert tests to SPDX license tags
Fully scripted conversion, see script in initial SPDX license commit
message.

tests/xfs/044 was hand massaged to remove duplicate copyright and
divider lines before running the script.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
2018-06-09 11:35:45 +10:00
Eryu Guan 69eb6281a9 fstests: _fail test by default when _scratch_mount fails
Previously _scratch_mount didn't check the mount status and most
tests continue to run even if the mount failed (unless test checks
for the mount status explicitly). This would result in running tests
on the underlying filesystem (usually rootfs) and implicit test
failures, and such failures can be annoying and are usually hard to
debug.

Now _fail test by default if _scratch_mount failed and introduce
_try_scratch_mount for tests that need to check mount results
themselves.

Suggested-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2018-02-22 14:02:44 +08:00
Eric Sandeen 27d077ec0b common: use mount/umount helpers everywhere
Replace every explicit mount/umount of scratch or test devices with
helper functions. This allows the next patch to add in hooks to these
functions in order to set up & tear down overlayfs on every mount/umount

(also adds _test_unmount(), which didn't exist prior)

[Eryu Guan rebased the patch agains latest master and replaced more
mount/umount with helpers]

Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2015-12-21 18:07:43 +11:00
Brian Foster bb4074a31a xfstests: use minimum log size in xfs/016
Test xfs/016 fails to run due to invalid mkfs options. The log size
is reported as too small according to the minimum log size
calculation:

log size 512 blocks too small, minimum size is 853 blocks

Update log_size to the currently specified minimum.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2013-10-22 16:08:35 -05:00
Rich Johnston 0efd4f4d48 xfstests: cleanup duplicates in all tests
There are duplicate blank lines, comment hash and lines
containing duplicate seqres= declarations, remove them.

Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
2013-04-04 06:55:21 -05:00
Dave Chinner 8c4905a42e xfstests: introduce a common directory
Introduce a top level common directory and move all the common.*
files into it.  Because there is now a directory named common, the
prefix can be dropped from all the files. Convert all the tests to
use this new directory for including common files.

for f in common.*; do \
	git mv `echo -n "$f " ; echo $f | sed -e 's;n\.;n/;'` \
done

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
[rjohnston@sgi.com reworked for TOT changes]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2013-03-26 21:44:05 -05:00
Dave Chinner 1d5d46db80 xfstests: convert tests to use new results directory
Essentially the change is simply this. Converting:

... >> $seq.????

to:

.... >> $RESULT_DIR/$seq.????

so that output files are directed to the defined output directory.

sed to the rescue:

$ sed -i -e '/^seq=.*$/a seqres=$RESULT_DIR/$seq' -e 's/seq.full/seqres.full/' tests/*/*

will do most of the work automatically.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
[rjohnston@sgi.com reworked for TOT changes]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2013-03-26 21:38:47 -05:00
Dave Chinner fc48dfb966 xfstests: move xfs specific tests out of top directory
And into tests/xfs. Tests found and moved via:

$ grep "supported_fs xfs$" [0-2]* | cut -d : -f 1 > xfs.tests
$ for i in `cat xfs.tests`; do
> git mv $i* tests/xfs/
> grep ^$i group >> tests/xfs/group
> sed -i -e "/^$i/d" group
> done

Output now looks like:

 sudo ./check -g quick -r
FSTYP         -- xfs (debug)
PLATFORM      -- Linux/x86_64 test-1 3.5.0-rc5-dgc+
MKFS_OPTIONS  -- -f -bsize=4096 /dev/vdb
MOUNT_OPTIONS -- /dev/vdb /mnt/scratch

xfs/170  4s
generic/120      16s
generic/248      0s
generic/213      0s
generic/256      39s
xfs/121  6s
xfs/026  11s
generic/131      1s
xfs/187  1s
generic/135      0s
....

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
[rjohnston@sgi.com did not move test 032, belongs in shared]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2013-03-26 18:27:34 -05:00