Commit Graph

61 Commits

Author SHA1 Message Date
Stefan Behrens 0150222d1c xfstests: redirect output in btrfs/003
This test failed for me with output from 'btrfs balance':
     QA output created by 003
    +Done, had to relocate 4 out of 4 chunks
    +Done, had to relocate 5 out of 5 chunks
     Silence is golden

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2013-08-16 10:53:51 -05:00
Zheng Liu 060dd14cc8 xfstests: add a new test case for ext4 indirect-based file
After applied this commit (864688d3), xfstests #255 will not test a
file system that cannot support fallocate(2), such as a indirect-based
file in ext4.  So we need to add a new generic test case to test it.

The difference between #255 and this test case is only to use pwrite to
allocate blocks.  Other filesystems should survive in this test case.
In the mean time, a new argument '-u' is added into _test_generic_punch
not to run unwritten tests.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2013-08-16 08:54:43 -05:00
Josef Bacik 617491caf4 Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: xfstests: make the scratch device for generic/256 slightly larger
Date: Tue, 02 Jul 2013 19:17:18 -0000
From: Josef Bacik <jbacik@fusionio.com>
X-Patchwork-Id: 5816
Message-Id: <1372792638-23957-1-git-send-email-jbacik@fusionio.com>
To: <linux-btrfs@vger.kernel.org>, <xfs@oss.sgi.com>

This is similar to a previous fix I sent.  1 gig makes us do mixed file block
groups for btrfs, so these enospc tests will usually fail because we don't have
space for metadata, which is the case for this test.  So jack the size up to
1.5gig so that btrfs can do its normal thing and pass the test.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
2013-08-15 13:57:38 -05:00
Josef Bacik f3df3fab7d xfstests: btrfs/009: regression test for subvol delete
We were allowing users to delete their default subvolume, which is problematic.
This test is a regression test to make sure we don't let that happen in the
future.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>

[rjohnston: renumbered test from 003 to 009]
2013-08-14 15:42:59 -05:00
Josef Bacik 6ef348f857 xfstests: btrfs/008, another send regression test
This is a regression test for a problem we had where we'd assume we had created
a directory if it only had subvols inside of it.  This was happening because
subvols would have lower inode numbers than our current send progress because
their inode numbers are based off of a different counter.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>

[rjohnston: renumbered test from 002 to 008]
2013-08-14 14:54:34 -05:00
Jan Schmidt af86f5668e xfstests btrfs/007: test send / receive
Basic send / receive functionality test for btrfs. Requires current
version of fsstress built (-x support). Relies on fssum tool but can
skip the test if it failed to build.

Signed-off-by: Jan Schmidt <list.xfs@jan-o-sch.net>
Reviewed-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>

[rjohnston: renumbered test from 316 to 007]
2013-08-13 17:17:03 -05:00
David Sterba aab6d4e47d xfstests: renumber existing btrfs tests to start with 1
Current numbering is inheried from the single testsuite series. There
are only 6 btrfs-specific tests and it makes more sense to start adding
new ones at a more natural place than 300-something. There's no overlap
with the old and new numbers and I hope there' will be no confusion when
referencing them.

Signed-off-by: David Sterba <dsterba@suse.cz>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2013-08-13 16:16:27 -05:00
Josef Bacik 54d6adf7c9 xfstests: generic/315: allow a little tolerance for our used check
So df in btrfs is tricky at best, and relying on it for accurate information is
not great, but it's the best way to verify this test.  To get around btrfs being
inconsistent sometimes just use _within_tolerance to check our new df value to
make sure that our truncate did something.  With this patch I no longer see
transient failures of this test.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
2013-07-30 13:37:11 -05:00
Josef Bacik f2c8cf5b3a xfstests: generic/314 filter out total from ls -l output
ls -l will show the nblocks for the directory, and this made it into the golden
output for 314.  The problem is nblocks is 0 for btrfs directories because we're
awesome, which makes us fail this test.  So filter out the "total blah" line of
ls -l so btrfs can pass this test too.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
2013-07-26 11:15:42 -05:00
Jie Liu 6fe0ad6faf xfstests: generic/315, verify preallocated disk space is released per truncate
Introduce generic test 315 to verify if the disk space is
released after truncating a preallocated file back to the
old smaller size.  Before Linux-3.10, Btrfs/OCFS2 test
failed in this case.

The test file is fallocated with FALLOC_FL_KEEP_SIZE option.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
2013-07-19 17:16:27 -05:00
David Sterba 31955a27b5 xfstests: skip generic/192 if noatime is set
Test generic/192 fails if noatime is set

generic/192
    -delta1 - access time after sleep in-core: 40
    -delta2 - access time after sleep on-disk: 40
    +delta1 - access time after sleep in-core: 0
    +delta2 - access time after sleep on-disk: 0

but it's pointless to test atime effects with noatime.

Signed-off-by: David Sterba <dsterba@suse.cz>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
2013-07-19 15:50:09 -05:00
Carlos Maiolino dcc683c9ab xfstests: generic/314, test sgid inheritance on subdirs
Tests if subdirectories created on the filesystem will properly inherit sgid bit
when this is set on the parent directory, once the process has the properly
permissions to create a subdirectory, this, should inherit parent's sgid bit if
this is set and irix_sgid_inherit sysctl is disabled.

V2: add missing source of "attr" file for _require_acls

V3: use _ls_l to filter out the selinux "."
    renumber to 314 to make the merge easier

V4: fix 314.out to the correct output

Thanks to Sandeen who have written this patch

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
2013-07-15 16:26:09 -05:00
Mark Tinguely 8db8559b89 xfstest: ensure small symlink is removed
Tests the XFS symlinks that are small enough to be in the
inode, but were move to a remote symlink due to an extended
attribute were correctly removed.

Signed-off-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
2013-07-09 11:15:14 -05:00
Eryu Guan 58bb2ecd56 xfstests generic/313: test ctime and mtime are updated on truncate and ftruncate
Regression test for commit:
3972f26 btrfs: update timestamps on truncate()

Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
2013-07-08 16:59:48 -05:00
Dave Chinner 0c91141c65 xfstests: xfs/253 doesn't use seqres correctly
It was missed when converting all the tests as it was using
${seq}.full and none of the regexes matched it. Fix it up to direct
the output to the correct place.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
2013-06-25 15:26:08 -05:00
Dave Chinner df58d55289 xfstests: generic/193 runs tests in wrong location
generic/193 runs the test in $here - the root of the xfstests source
tree/installation. IOWs, it doesn't test the filesystem on either
the TEST_DIR or SCRATCH_MNT, and so it not testing the filesystem
we think it is testing. Bad. Fixing this is the majority of the
change - introducing $test_root and $test_user for the files with
different owners, and then redirecting error output and filtering
the output appropriately.

And then add checks that truncate clears the suid/sgid bits
appropriately, something that has never been tested on XFS (and
likely other filesystems) so will cause kernels between 3.1 and 3.9
to assert fail as Dave Jones has recently reported.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
2013-06-25 14:53:59 -05:00
Jan Kara ce9d1cdd61 xfstests 285: Fix test for ext4 in some configurations
In some configurations (e.g. 1 KB block size), ext4 can decide it is
better to zero out several blocks rather than splitting unwritten
extent. This changes results SEEK_HOLE / SEEK_DATA returns and thus the
test fails. Fix the problem by disabling the feature for this test.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2013-06-03 13:40:36 -05:00
Theodore Ts'o f45c688157 xfstests: add generic/286 to the auto and quick groups
The generic/286 test tests SEEK_HOLE and SEEK_DATA, and is reasonably
fast.  We should just run the test by default.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2013-05-28 11:01:01 -05:00
Michael L. Semon f4ba26dcdc xfstests: Change mount method for generic/258
Use the built-in _test_mount function from xfstests so it will use
the correct mount options for xfstests.  The script used a simple
umount-and-mount sequence, which caused a test failure on an XFS
filesystem that used both realtime and external log devices.

Signed-off-by: Michael L. Semon <mlsemon35@gmail.com>
Reviewed-by: Eric Sandeen <sandeen@rehat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2013-05-22 13:50:59 -05:00
Josef Bacik a8c25f0702 xfstests: 311: fsck the dmflakey device instead of the real device
xfs was having issues with generic/311 because of caching issues. Make
_check_scratch_fs take an optional argument to use as the device to fsck.

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2013-05-16 08:48:03 -05:00
Dave Chinner 1bd086437f xfstests: generic/235 breaks /etc/mtab symlinks breaks xfs/189
Serenity lost.
Insanity looms darkly.
/etc/mtab

Random behaviour.
xfs/189 fails
After a week passing.

-SCRATCH_DEV on SCRATCH_MNT type xfs (ro,filestreams)
+SCRATCH_DEV on SCRATCH_MNT type xfs (ro,relatime,attr2,filestreams,inode64,noquota)

Confusion prevails.
/proc/mounts can never give success.
Anything but golden.

ls -l
/etc/mtab shows:
lrwxrwxrwx 1 root root 12 May  8 16:05 /etc/mtab -> /proc/mounts

symlink modified.
Stealth. Deception. WTF?
Ninjas go unseen.

"git grep mtab". Yay!
generic/235: sad
SElinux hack.

Remount context grot.
Mount uses all options from
/etc/mtab

Kernel rejects mount.
sed hacks /etc/mtab
Symlink becomes file.

Test frobulation.
xfs/189 passes
Randomness tamed.

Double face-palm. Tears.
Crack-inspired insanity.
mount(8) needs fixing.

Schizophrenia.
/etc/mtab. Same thing.
Test psychiatry.

Hack, slash, glue, polish.
xfs/189 fixed.
Made shiny again.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2013-05-16 06:53:05 -05:00
Zheng Liu fbf6e863cc xfstests: change test case file mode to 0755
Now in tests/ there are some test cases whose mode is 0644.  But they
should be 0755.  So fix it.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Reviewed-by: Dave Chinner <david@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2013-05-15 08:17:51 -05:00
Eryu Guan 355beacfaf ENOSPC in fallocate(2) could corrupt ext4 when file size > 4G
Regression test for commit
29ae07b ext4: Fix overflow caused by missing cast in ext4_fallocate()

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2013-05-15 07:48:41 -05:00
Eric Sandeen 91f87e3b89 xfstests btrfs/284: shorten duration, fix output
test 284 had... some issues.

First, it took so long nobody ran it; so shorten the extent
count by a factor of about 100.

Having fixed that, we see failures in 2 cases; when start or
len is -1, but the golden output file didn't have error
output, as if they should pass.

I'm going to argue that these *should* both fail; start = -1
has no real meaning.  length = -1 might mean "the rest
of the file" but if that's what you really want, just
don't specify -l.

So add failure output for those cases.

Send all command output to $seq.full, in case that changes
in the future; just capture the return value.

Then remove the return value echo on failure (50?) because
who knows when that might change to some other magic value.

Ok, then when defrag actually works, old defrag returned
"20" (because?) but a recent commit changed it to 0.
So accommodate that too.

And remove a stray "HAVE_DEFRAG=1" while we're at it.
That variable is never used.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2013-05-15 07:18:07 -05:00
Zheng Liu 92449b7f36 In xfstest 285/286 we don't check whether the target file system
supports seek data/hole operation or not.  Here _require_seek_data_hole
is defined to do this work.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2013-05-14 13:25:44 -05:00