Commit Graph

379 Commits

Author SHA1 Message Date
Eryu Guan 00d42708c2 xfs/021: filter out detailed array element info from xfs_db
Starting from xfsprogs commit 384283555871 ("xfs_db: print one array
element per line"), xfs_db prints one array element per line. This
breaks the filter in xfs/021, which now fails as:

  hdr.freemap[0-2] = [base,size] [FREEMAP..]
 +0:[104,1892]
 +1:[0,0]
 +2:[0,0]
  entries[0-2] = [hashval,nameidx,incomplete,root,local] [ENTRIES..]

So we have extra lines that need to be filtered out,

Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-11-13 14:01:07 +08:00
Zorro Lang 08adb2554e fstests: test xfs_copy V5 XFS without -d option
Before xfsprogs commit a872b62 (xfs_copy: band-aids for CRC
filesystems), xfs_copy requires the "-d" option to copy a V5 XFS,
because it can't rewrite the UUID of V5 XFS properly.

Now xfs_copy already full support to copy a V5 XFS. But for above
old problem, xfstests use below patch to make sure xfs_copy always
use "-d" option to copy a V5 XFS:

  8346e53 common: append -d option to XFS_COPY_PROG when testing v5 xfs

That cause xfstests miss the coverage of copying a V5 XFS without
"-d". For test this feature I did below things:

  1. Changed init_rc(), add "-d" to $XFS_COPY_PROG if xfs_copy can't
     copy a V5 XFS properly.
  2. xfs/073 test V4 xfs forcibly by specify "-m crc=0" in case. I
     think it's useless now, so remove it.
  3. Changed xfs/032. If xfs_copy full support to copy a V5 XFS, test
     with and without "-d" option, or only test with "-d" option.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-11-13 14:01:06 +08:00
Eryu Guan ae254a9f9f fstests: make xfs_io mandatory
_test_inode_flag() and _test_inode_extsz() use "which $XFS_IO_PROG"
to check if xfs_io command is available. And "-i" option was added
to XFS_IO_PROG varibable by commit 54659ecdb5 ("fstests: run
xfs_io with -i option if supported"). So the command becomes "which
/usr/sbin/xfs_io -i", and it stops and waits for input from stdin,
because "-i" option of "which" means "Read aliases from stdin".

I've seen xfs/008 hang when testing with latest xfsprogs, where
xfs_io has "-i" support.

Fix it by removing the xfs_io command detections, and making xfs_io
mandatory in common/config.

Also fix the indentions in these functions, use tab instead of
spaces, while we're at it.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-11-07 16:06:31 +08:00
Dave Chinner c52086226b filter: xfs_io output has dropped "64" from error messages
Upstream xfs_io has been converted to always use LFS compliant
(i.e. 64 bit) pwrite() rather than pwrite64(). Similar changes have
been made for multiple syscalls that have "*64" variants. hence the
error output of all these commands has changed, such as "pwrite64:
..." to "pwrite: ....".

Make a filter to catch the *64 variants and strip it, and
convert all the golden output to use the non-*64 variant. This will
make all golden output matching work correctly regardless of what
version of xfs_io is in use.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-11-03 10:41:41 +08:00
Eryu Guan 4c99b91d0a xfs/054: only filter ROOT_INO at the beginning
In the test ROOT_INO is filtered out and/or replaced, but if
ROOT_INO is also 32, more "32"s are filtered and replaced than
expected. This happens to me when testing 512B block size XFS and 1k
block size CRC enabled XFS.

Fix it by filtering out only ROOT_INO at the beginning of a line,
and removing all "g" modifiers in sed expressions.

Also the ROOT_INO should be the root inode number of TEST_DIR not
SCRATCH_MNT.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-10-26 10:38:11 +08:00
Xiao Yang dc46bab289 xfs: remove the device parameter from __populate_check_xfs_dir
In commit c08ebd092 ("xfs: fix $XFS_DB_PROG usage"), the need for
callers to pass the device to populate into
__populate_check_xfs_dir() was removed. So we can now clean up all
the callers by removing the device parameter.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-10-21 23:20:14 +08:00
Darrick J. Wong da41142607 xfs: fix more xfs_db open-coding instances
Convert some more cases of 'xfs_db $SCRATCH_DEV' to _scratch_xfs_db
that were left out of the initial cleanup patch.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-10-21 23:20:14 +08:00
Darrick J. Wong ed6e4664ee fstests: fix fallocate commands that need the unshare switch
We re-added the UNSHARE flag to fallocate, so go make sure that all
the unshare tests actually check that the installed copy of xfs_io
supports the 'funshare' command and that the underlying filesystem
understands the flag, and change the tests themselves to use
funshare.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-10-21 23:20:14 +08:00
Darrick J. Wong bf5a5da572 xfs: set the refcount btree cowflag when setting up cow
When we're setting up a fake cow extent in the refcountbt to test
cleanup of fake cow extents, set the cowflag in the record field
to reflect our new disk format of storing the staging extents in
the right side of the tree.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-10-21 23:20:14 +08:00
Amir Goldstein f182653c6b fstests: strip quotes from "$XFS_IO_PROG" call sites
The value of "$XFS_IO_PROG" may contain extra flags after the
binary path (e.g. -F), so it is wrong to use the variable inside
quotes in xfs_io execution call sites.

This bug surfaced while testing the new xfs_io -i flag.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-10-20 22:20:28 +08:00
Amir Goldstein 3fcfdba403 fstests: fix call sites that used xfs_io directly
Convert those few remaining call sites to use the XFS_IO_PROG env var.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-10-20 22:20:08 +08:00
Eryu Guan 16ef0843f2 xfs/122: remove dead code
Seems this hunk of dead code is used for debug purpose to inspect
what the output looks like after _attribute_filter. Just remove it.

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-10-14 10:05:34 +08:00
Eryu Guan c61fa13e94 xfs: renumber tests after merge
Tests were merged with high seq numbers to avoid conflicts with
other tests. Now renumber them to contiguous numbers, as all other
tests have been merged correctly. This is easier to do than
assigning the final seq numbers at commit time.

Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-10-08 14:02:04 +08:00
Darrick J. Wong c6aa8a7666 xfs: check copy-on-write fragmentation
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-10-08 13:50:06 +08:00
Darrick J. Wong 8144ddc459 xfs: test realtime rmapbt code
Test the realtime rmap btree code by exercising various IO patterns
on realtime files.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-10-07 17:49:38 +08:00
Darrick J. Wong f9da3861fc xfs: more rmapbt tests
More tests for the reverse mapping functionality.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-10-07 17:26:37 +08:00
Eric Sandeen f57e3c3b49 xfs: exercise and validate the xfs_io inode command
Run various modes of the xfs_io "inode" command.

This fails today, I have some patches to fix it up.
The "grep -q" for failures strings are fairly loose
because I'm changing them, and don't want to depend
on the exact error or usage message ...

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-10-07 17:18:53 +08:00
Darrick J. Wong c08ebd092d xfs: fix $XFS_DB_PROG usage
xfs_db requires us to pass in the log device, if any; this can be
accomplished via _scratch_xfs_db_options (if we're operating on the
scratch device, anyway).  However, many of the tests/xfs/ scripts
pass only $SCRATCH_DEV directly, so they'll fail if we test with an
external log.  Fix that by adding a new _scratch_xfs_db helper.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-10-07 17:18:53 +08:00
Darrick J. Wong fff869cb9c fstests: use get_block_size helper
Don't open code grabbing the block size; just use the helper.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-10-07 17:18:53 +08:00
Zorro Lang a5296288d6 xfs/032: test the next block size if mkfs fails
If test on a 512b sector size device, xfs/032 will try to do:

  mkfs.xfs -s size=512 -b size=512 ...

The 512b block size is not acceptable for V5 XFS. So if mkfs.xfs
fails, try next block size (blksize *= 2) directly.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-10-07 17:18:53 +08:00
Eryu Guan 2ad510c15e xfs/287: fix wrong seq number in test
It's 287 not 285.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-09-29 16:04:08 +08:00
Darrick J. Wong c13342b75b xfs/207,327: fsxattr no longer has the reflink flag
The FS_XFLAG_REFLINK flag was removed from struct fsxattr prior to
the inclusion of reflink in XFS, so remove it from the test outputs.
Note that the inode flag still exists; it's simply not presented
to userspace any more.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-09-29 14:46:43 +08:00
Darrick J. Wong 961956168b xfs/130: don't modify files after failed mount
In xfs/130, we try to mount a filesystem with the expectation that it
will fail.  Therefore, it is inappropriate to try to write to the
mountpoint, since it could otherwise be writable.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-09-29 14:46:40 +08:00
Darrick J. Wong 41dfeb425e xfs/122: decrease the log update done item sizes
Redundant fields were removed from the rmap/refcount/bmap update done
log items, so fix the size tests.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-09-29 14:46:21 +08:00
Eryu Guan c27a67f0e7 fstests: move now-generic xfs project quota tests generic
Now that these tests have been made generic, move them into the
generic/ dir and update group files.

xfs/133 -> generic/383
xfs/134 -> generic/384
xfs/196 -> generic/385
xfs/262 -> generic/386

Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-09-23 12:30:04 +08:00