Christoph Hellwig [Mon, 15 Feb 2010 09:01:21 +0000 (10:01 +0100)]
xfstests: use blkid raw mode
blkid without options usually gets no probe results at all just after
creating a filesystem. This problem is due to the cache that blkid
uses in it's default mode, and is unlikely to get fixed. Use the -p
option to bypass the cache layer.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <david@fromorbit.com>
Alex Elder [Wed, 3 Feb 2010 19:54:04 +0000 (19:54 +0000)]
xfstests: 219: fix awk filter for duplicate users
The filter I added for removing duplicate users from the
output of repquota didn't do the job very well. This
fixes that, making it so the first time a user is seen
its line is printed, not thereafter.
Signed-off-by: Alex Elder <aelder@sgi.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Eric Sandeen [Tue, 9 Feb 2010 17:59:23 +0000 (11:59 -0600)]
xfstests: fix up fs_perms test used by 126
Test 126 was failing intermittently for Ted & I; it seems that
this is because we were passing an unterminated string to
fopen for the mode; I'm not certain why this made it fail,
but it's pretty clearly not a good thing to do, and fixing
it fixes the test.
Rather than passing around characters, do things string-wise,
since that is what is ultimately used in fopen().
Reported-by: Theodore Tso <tytso@mit.edu> Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Christoph Hellwig <hch@lst.de>
Eric Sandeen [Wed, 3 Feb 2010 16:43:53 +0000 (10:43 -0600)]
xfstests: 223 - test file alignment on stripe geometry
A first-cut test to ensure that files are well-aligned on filesystems
with stripe geometry.
Several sizes of stripe units are mkfs'd, and then files are written
and fallocated in various multiples of those stripe sizes.
Each file is checked to ensure that the first block is
stripe-aligned.
(Ideally, for any fragmented files, we should ensure that each
fragment start is well-aligned, but this does not do that yet)
(slightly unrelated: don't send scratch mkfs output to /dev/null,
we'd like to see mkfs output and direct it to $seq.full - this
more or less matches _scratch_mkfs_xfs behavior and doesn't
break any tests that I can see)
Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Christoph Hellwig <hch@lst.de>
Dave Chinner [Tue, 26 Jan 2010 03:22:35 +0000 (14:22 +1100)]
xfstests: Automatic build dependency calculations
Currently the xfstest builds do not have any automatic dependency
calculations. It relies on a separate make depend run to build or
update dependency information. It also relies on an external
makedepend binary. If that binary does not exist, the dependencies
do not get calculated.
To remove the dependency on makedepend, gcc can be used instead as
it has a command to generate dependency information. This patch
changes the dependency rule building to use gcc.
In case anyone uses an old (several years) gcc compiler or a
compiler that doesn't support gcc compatible dependency generation,
a new configure check is added to turn off dependency checking so
builds can still be done.
To use the dependencies automatically, we need to use a special
include makefile directive to include the build dependencies into
the current makefile. Essentially once the dependencies are
calculated, they can be included into the makefile and make will
recalculate the build dependencies automatically based on that
information.
Hence we get a build that automatically calculates and keeps
dependencies up to date without dependence on any external tools.
Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Dave Chinner [Tue, 26 Jan 2010 03:21:47 +0000 (14:21 +1100)]
xfstests: rebuild aclocal.m4
The local m4 configuration has not been built in a long time.
Trying to rebuild it results in failures with dmapi library
detection and libxfs.h detection macros. Fix the errors and rebuild
it.
Note: the new format for the aclocal.m4 file uses m4_include
directives which means it is much smaller than before and won't
need updating unless we include new m4 macro files.
Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Dave Chinner [Tue, 26 Jan 2010 03:26:42 +0000 (14:26 +1100)]
xfstests: deprecate busted log printing tests
Tests 018, 081 and 082 read the contents of the log and assume that the
contents will always be the same. They are trying to ensure that the
contents of the log don't change for a given fixed load.
This has several problems - high level changes to the filesystem and
VFS code can change the order and contents of the log. Changes to
the way we sync the filesystem will change the contents of the log.
background writeback occurring in the middle of the test will change
the contents of the log by allowing the tail to move. Even changes
to the default mkfs parameters can break them!
The tests also assume that unmount leaves a dirty log behind. We've
fixed lots of problems in sync and the unmount paths over recent
times, so now a clean unmount leaves a clean log behind. That is,
there is nothing left in the log print output for these tests to
check. IOWs, major surgery is required for these tests to be
returned to their former break-when-something-changes behaviour.
However, these tests are a maintenance nightmare. They spend more
time broken and failing than they do passing, and then it's not long
before they get broken again. They have to cover all sorts of
different permutations of log configurations and that will continue
to grow and increase the complexity of making these tests continue
to work. And to top it all off, I can't remember a bug actually ever
being found by these tests. Hence I think we should just stop using
them altogether.
So this patch deprecates 018, 081 and 082 rather than fixes them.
It introduces a "deprecated" test group and puts them in it. That
means the tests can still be run on older systems where they may
have some use, but will not be run automatically any more, nor
will any attempt be made to keep them up to date or working.
Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Dave Chinner [Wed, 20 Jan 2010 21:54:38 +0000 (08:54 +1100)]
xfstests: kill in 131 needs to be quiet
If the kill fails because the processes have already terminates,
the output from kill (no such process) will cause the test to
fail. Make sure kill doesn't output anything.
Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Dave Chinner [Wed, 20 Jan 2010 21:53:53 +0000 (08:53 +1100)]
xfstests: Don't use tempnam in growfiles.c
tempnam() generates a compiler warning as a dangerous function.
This code doesn't care about security issues with tempnam, so
remove it and just manually build the filenames without the
randomness of tempnam.
Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Dave Chinner [Tue, 19 Jan 2010 23:28:24 +0000 (10:28 +1100)]
xfsqa: Fix signal usage in aio-dio test code
Using signal() to set up signal handlers doesn't always do what you
want. A recent upgrade made test 208 fail because wait() was not
getting interrupted by a SIGALRM. Tracing showed that signal() was
being converted to a sigaction(SA_RESTART) handler, which allows
syscalls that return ERESTARTSYS to immediately restart without
returning EINTR to the calling process. The kernel code returns
ERESTARTSYS to signal interruptions while in wait().
Replace the use of signal with sigaction() to ensure that the
SA_RESTART flag is not set and the EINTR is delivered to the process
sitting in wait(). This makes test 208 terminate at 200s again.
Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Dave Chinner [Tue, 19 Jan 2010 23:27:08 +0000 (10:27 +1100)]
xfstests: Convert all tests to use /bin/bash
While most tests use /bin/sh, they are dependent on /bin/sh being a
bash shell. Convert all the tests to execute via /bin/bash as it is
much, much simpler than trying to debug and remove all the bashisms
throughout the test code.
Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Dave Chinner [Tue, 19 Jan 2010 23:26:10 +0000 (10:26 +1100)]
xfstests: Use common rules to build binaries
Remove explicit target-per-file rules in the subdirectories being
built and replace them with target based rules using the buildrules
hooks for doing this. This results in the makefiles being simpler,
smaller and more consistent. It does mean that all binaries are
linked against the common set of libraries but this does not cause
any harm.
This patch does not address the dmapi subdirectory of the xfstests
build system.
Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Dave Chinner [Tue, 19 Jan 2010 23:26:01 +0000 (10:26 +1100)]
xfstests: Clean up build output
We don't need to see every compiler command line for every file that
is compiled. This makes it hard to see warnings and errors during
compile. For progress notification, we really only need to see the
directory/file being operated on.
Turn down the verbosity of output by suppressing various make output
and provide better overall visibility of which directory is being
operated on, what the operation is and what is being done to the
files by the build/clean process.
This patch only addresses the top level makefile and build rules; it
does not clean up the subdirectories - these will be addressed by a
followup patch. It also does not touch the dmapi section of the
xfstests build system.
The old style verbose builds can still be run via "make V=1 ..."
Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Alex Elder [Tue, 19 Jan 2010 20:26:16 +0000 (14:26 -0600)]
xfstests 219: ignore duplicates reported by repquota
Arrange to ignore duplicate entries reported by the repquota command.
This can happen if an id is used more than once (such as when two user
names are assigned the same uid).
Do this here by simply dropping any reported entries whose id number
has already been seen in the output.
Signed-off-by: Alex Elder <aelder@sgi.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Alex Elder [Tue, 19 Jan 2010 20:26:20 +0000 (14:26 -0600)]
xfstests 050: ignore duplicates reported by repquota
Arrange to ignore duplicate entries reported by the "repquota"
xfs_quota command. This can happen if an id is used more than once
(such as when two user names are assigned the same uid).
Since we are already sorting the output we can accomplish this by
adding the "-u" (unique) option to the sort command. Shorten some
long lines while we're at it.
Signed-off-by: Alex Elder <aelder@sgi.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Eric Sandeen [Sun, 17 Jan 2010 16:35:23 +0000 (10:35 -0600)]
xfstests 073: unmount source image in cleanup
Test 073 is currently failing w/ xfs_repair problems, and when
it does, the whole series stops because the test dir still has
a loopback mounted filesystem on it, and it can't unmount.
Fix that.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Christoph Hellwig <hch@lst.de>
Dave Chinner [Tue, 12 Jan 2010 21:51:47 +0000 (22:51 +0100)]
add simple xfs_fsr test
We have very little fsr test coverage in the test suite right now.
042 is the only test that runs it, and it only defragments a single
file.
Improve the coverage by simply running xfs_fsr of the test
filesystem. This gives xfs_fsr a wide variety of inodes to try to
defragment. A simple test like this would have tripped over the
attr2 fork offset problems in the swap extents ioctl long ago
thanks to the varied nature of inodes the test suite leaves around
in this filesystem.
Signed-off-by: Dave Chinner <david@fromorbit.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Dave Chinner [Tue, 12 Jan 2010 21:49:57 +0000 (22:49 +0100)]
filter log size in 206
With the log size now going past 128MB, test 206 creates a filesystem
with a much larger log than 128MB. The golden output expects at
128MB log size, so the test breaks. Filter the log size out of the
mkfs output and golden output so that the test works on both older and
newer mkfs binaries.
Signed-off-by: Dave Chinner <david@fromorbit.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Christoph Hellwig [Tue, 12 Jan 2010 21:45:26 +0000 (22:45 +0100)]
test quota log replay in 087
By mounting the filesystem with quotas enabled in 087 we exercise the
replay of the quota log items in this tests, which we otherwise don't
test in xfstests. OSS bugzilla #855 is an example of something caught
by this.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <david@fromorbit.com>
Eric Sandeen [Wed, 6 Jan 2010 19:00:18 +0000 (13:00 -0600)]
[PATCH] xfstests: add another fallocate test to 214
ext4 had a regression where it double-accounted used blocks
if you fallocated on top of delalloc blocks. Ted sent a
c program to exploit it (see "fsstress-induced corruption reproduced"
on linux-ext4 on 12/31/2009) and it's trivial to do the same thing
within the xfstests framework using xfs_io.
This also changes the handcrafted xfs_io tests to use the
_require_xfs_io_falloc helper, not sure how that got missed.
Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Eric Sandeen [Thu, 3 Dec 2009 16:30:11 +0000 (10:30 -0600)]
commit bd53c922 added src/aio-dio-regress to the top-level
Makefile so that it would get caught on make install, but
doing this unconditionally means that we tried to build that
subdir even if libaio headers weren't found.
Fix this up to do a properly chained make install through
the subdirs...
Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Christoph Hellwig <hch@lst.de>
Christoph Hellwig [Fri, 30 Oct 2009 05:41:33 +0000 (06:41 +0100)]
test 220: double inode free in xfs_dqrele_inode
Trivial test case that mounts a filesystem with user quotas, then turns
quotas off an unmounts. Based on a testcase in a bug report from
Utako Kusaka <u-kusaka@wm.jp.nec.com>.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alex Elder <aelder@sgi.com>
Jaroslav Barton [Wed, 16 Sep 2009 12:55:59 +0000 (09:55 -0300)]
_check_generic_filesystem support for fsck parameters
_check_generic_filesystem now support fsck parameters. Fsck parameters
can be passed by FSCK_OPTIONS environmental variable. Default values
will be used if FSCK_OPTIONS is missing or empty (same mechanism as
MOUNT_OPTIONS and MKFS_OPTIONS).
_check_extN_filesystem function is no longer needed, extN filesystem are
properly handled by default values in _check_generic_filesystem.
Theodore Ts'o [Thu, 27 Aug 2009 21:17:32 +0000 (18:17 -0300)]
add ext2/3/4-specific _check_extN_filesystem function
The _check_generic_filesystem function doesn't force a full filesystem
check, so filesystem inconsistencies after a test wouldn't be noticed.
To fix this, I added an extN specific check filesystem function.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Christoph Hellwig <hch@lst.de>
Eric Sandeen [Mon, 10 Aug 2009 18:10:26 +0000 (13:10 -0500)]
Test a few very basic defragmentation scenarios.
This test creates some files, runs defrag on them,
and compares the before/after fragmentation as well
as file md5sums and timestamps.
The test currently expects to find e4defrag in
/usr/bin
It should be relatively easy to add more interestingly
fragmented files to the tests, as well as to test
that memory-mapped files aren't touched, etc -
but this gives us a framework.
V2: remount before checking file contents, and create
common.defrag.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Christoph Hellwig <hch@lst.de>
Christian Kujau [Mon, 20 Jul 2009 09:31:39 +0000 (11:31 +0200)]
don't fail if nslookup is not found
When nslookup is not available, execution would stop. This patch moves the
check for nslookup and the _get_fqdn function into the ./new script (since
this is the only place where it's used) and we don't fail any more but try
to find out our FQDN without nslookup.
Signed-off-by: Christian Kujau <lists@nerdbynature.de> Signed-off-by: Christoph Hellwig <hch@lst.de>
Christoph Hellwig [Tue, 7 Jul 2009 10:35:56 +0000 (12:35 +0200)]
xfstests: test c/mtime updates through mapped writes
Check that we correctly update the timestamps when writing to a file
through an mmap mapping. Currently fails for XFS due a VFS bug but
succeeds for many other filesystems.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
New test to test basic mixed fallocate + read & write,
includes a couple regression tests for bugs that ext4
hit. Uses xfs_io to generate fallocate calls, so requires
git xfsprogs and very recent glibc at this point.
Ext4 folks, this is hopefully a reasonable example of
how to add a new test. :)
Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Christoph Hellwig <hch@lst.de>
Theodore Ts'o [Sat, 20 Jun 2009 17:14:14 +0000 (19:14 +0200)]
fix common.config to allow SCRATCH_DEV and SCRATCH_MNT to be optional
Commit 3ae9f2f8 purports to allow SCRATCH_DEV and SCRATCH_MNT to be
optional, but tests in common.config will cause check to exit with an
error if these environment variables are not defined. Fix this problem.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Christoph Hellwig <hch@lst.de>
Theodore Ts'o [Sat, 20 Jun 2009 17:05:45 +0000 (19:05 +0200)]
fix _require_scratch test for extN, resierfs, gfs2, and btrfs
The extN, reiserfs, gfs2, and btrfs filesysytem types should use the
same check for a block device as XFS and UDF, and not the test for
NFS, which was checking for host:/foo/bar/baz when checking for a
scratch device.
Also, the NFS logic was also incorrect, in that it would allow a
zero-length SCRATCH_DEV to continue.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Felix Blyakher <felixb@sgi.com>
Theodore Ts'o [Sat, 20 Jun 2009 17:01:43 +0000 (19:01 +0200)]
skip _check_test_fs unless a test is actually run
Running _check_test_fs can take a non-trivial amount of time, and if a
test has been skipped because it doesn't work on Linux, or it doesn't
work of for ext4, it's pointless to re-run _check_test_fs. So move
the call to _check_test_fs so it is only run if a test is actually run.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Felix Blyakher <felixb@sgi.com>
Eric Sandeen [Wed, 10 Jun 2009 20:05:04 +0000 (15:05 -0500)]
Skip dump _cleanup if filesystem is not xfs
Many/most dump tests include common.dump before checking
supported fs, and this means that even if the dump tests
are skipped, the sleep & filesystem check in _cleanup
gets run, which makes it take rather a long time to
skip these tests for non-xfs filesystems.
Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Eric Sandeen [Tue, 9 Jun 2009 18:35:28 +0000 (13:35 -0500)]
Enable still more tests for generic filesystems
Make the following tests _supported_fs generic:
088 - test out CAP_DAC_OVERRIDE and CAP_DAC_SEARCH code
089 - Emulate the way Linux mount manipulates /etc/mtab
113 - aio-stress (explicitly mark as generic)
126 - tests various file permission options
129 - looptests
These all pass on ext3, ext4, btrfs, and gfs2 as well
as xfs.
Also remove "generic" group from "groups," which was
accidentally added.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Christoph Hellwig <hch@lst.de>
Eric Sandeen [Mon, 8 Jun 2009 16:27:23 +0000 (11:27 -0500)]
Allow fsx tests to run on generic filesystems
There is already logic in 075 to gracefully skip nfs for fsx
invocations with -x (xfs-specific preallocation) - just extend
this to any non-xfs filesystem, and add to test 112 as well.
Later we can change this behavior to use fallocate and include
more filesystems but this gets some fsx coverage for now.
Test 127 doesn't seem to have anything xfs-specific, so mark
that as generic too.
Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Felix Blyakher [Fri, 5 Jun 2009 20:41:14 +0000 (15:41 -0500)]
Add GPL license plate to SGI's files.
Signed-off-by: Felix Blyakher <felixb@sgi.com> Reviewed-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Felix Blyakher <felixb@sgi.com>
Eric Sandeen [Thu, 4 Jun 2009 21:32:24 +0000 (16:32 -0500)]
aio-dio-regress: fix aio-dio-extend-stat on s390
This patch:
o Changes the BUFSIZE to 4096 so that we can successfully perform direct
I/O on devices that have a sector size of 4k, such as the virtual disks
found on the s390 architecture.
o Removes an unused variable.
o Checks the proper field in the ioevent to determine if there was an
error in the I/O submission.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Zach Brown <zach.brown@oracle.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Jeff Moyer [Wed, 3 Jun 2009 20:13:53 +0000 (15:13 -0500)]
Hi,
So, the xfs test suite does a mount, followed by running the test, then
an unmount after the test exits. aio-dio-invalidate-failure spawns two
children, and will kill them off before it exits. The problem is that
it doesn't wait for them to exit before returning, so the xfs test
harness ends up failing the umount as the mount point is still busy.
The fix is to simply wait for each of the children exits before
returning from the parent.
(Eric Sandeen: add one more waitpid to error case)
Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Jeff Moyer [Wed, 3 Jun 2009 20:11:24 +0000 (15:11 -0500)]
aio-dio-regress: fix aio-dio-extend-stat on s390
Hi,
The following patch queries the sector size of the underlying device so
that we can size the write buffer appropriately. Without this patch, we
try to do an O_DIRECT write of 1KB to a device that has a sector size of
4KB. This returns EINVAL, of course. I also noticed that the test was
not checking the right fields for the return code. It was checking the
original iocb's nbytes field instead of event->res. So, I fixed that.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Jeff Moyer [Wed, 3 Jun 2009 20:09:34 +0000 (15:09 -0500)]
aio-dio-regress: align I/O buffers to 4k for 4k sector devices
(and virtual devices as found on s390)
Without this patch, these tests can randomly fail on s390 systems which
use a virtual block device with sector size of 4k. Testing confirms
that this patch resolves the issue.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Eric Sandeen [Tue, 2 Jun 2009 20:42:21 +0000 (22:42 +0200)]
enable generic filesystems to be checked
This includes a fair bit of rearranging to avoid code duplication,
but the goal is to allow 'fsck -n -t $FSTYP $device' to be run on
any generic filesystem.
Any FS for which this doesn't work will need it's own fsck routine.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Signed-off-by: Christoph Hellwig <hch@lst.de>