In preparation for changing tests over to use SPDX tags, add the
initial licenses needed for the common/ and tests/ changeover to
the LICENSES/ directory. For this initial patch set, only the GPLv2
license text is required.
The tests and other common scripts will be converted to tags via a
script and, if necessary touched up to fix any warts the script
can't handle. The script is run on a target via:
for f in `git grep -l "GNU General" <target>` ; do
echo $f
cat $f | awk -f hdr.awk > $f.new
mv -f $f.new $f
done
This, unfortunately, changes the permissions of the files, so each
patch was post processed to remove the mode change fields from
the patches before they were committed. This preserves the file
modes, even though the files were replaced.
The awk script that dos all the substitution work is as follows:
$ cat hdr.awk
BEGIN {
hdr = 1
tag = "GPL-2.0"
ignore = 0
str = ""
cstr = ""
}
/^#[\!#][ ]*\/bin\/bash/ {
print $0
next
}
/^#[\!#][ ]*.*\/perl/ {
print $0
next
}
/any later version./ {
tag = "GPL-2.0+"
next
}
/^#[\-]{65}/ {
if (hdr == 1 && ignore == 0) {
ignore = 1
hdr = 0
} else if (ignore == 1) {
# use this to ignore empty comment line after license
ignore = 2
}
next
}
/This program is free software/ {
if (hdr == 1 && ignore == 0) {
ignore = 1
hdr = 0
}
next
}
/02110-1301[, ] *USA/ {
# use this to ignore empty comment line after license
if (ignore = 1) {
ignore = 2
}
next
}
/^#[ ]*Copyright/ {
if (cstr != "")
cstr = cstr "\n"
cstr = cstr $0
next
}
// {
if (ignore == 2) {
print "# SPDX-License-Identifier: " tag
print cstr "\n#"
print str
str=""
ignore = 3
}
if (ignore == 1) {
next
} else if (ignore == 3) {
# ignore trailing empty comment lines
if ($0 == "#")
next
ignore = 0
}
if (str != "")
str = str "\n"
str = str $0
}
END {
print str
}
$
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Make sure that all of our commands that can print geometry
information all print the /same/ information.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Abstract calls to xfs_info into $XFS_INFO_PROG like we do for all
other xfs utilities.
[Eryu: require xfs_info to be present if FSTYP is xfs]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
In xfs/310 we have to _require_scratch_nocheck last because anything
else that calls _require_scratch (e.g. _require_xfs_scratch_rmapbt)
will create the "check scratch after test exit" file.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
We recently redefined sb_fname's array length to use a symbolic
constant instead of a magic number, so update this test accordingly.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Xu Huan reported that this test fails on nfs in some setup.
Apparently, the assumptions made about xfs/ext* do not hold
for nfs.
Relax the verification of filetype not supported case to
allow either DT_UNKNOWN or actual file type on all files and
not only on special dir entires "." and "..".
Convert the unknown d_type replacement code from awk to bash
so it is a bit more readable and flexible.
Reported-by: Xu Huan <xuhuan.fnst@cn.fujitsu.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Tested-by: Xu Huan <xuhuan.fnst@cn.fujitsu.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Commit ea7ad43 ("fstests: implement require of multiple overlayfs
features") changed the message when tests are not run due to missing
overlayfs feature.
Restore the check for existing module param before trying to mount
which restores the old message format, e.g.:
[not run] feature 'metacopy' not supported by overlay
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
From the feedback of cifs developer, the behaviour of atime/noatime
for cifs is basically noatime always. So the atime related mount
options have no effect on cifs mounts. And Skip these tests on CIFS.
Signed-off-by: xiaoli feng <xifeng@redhat.com>
Acked-by: Steve French <smfrench@gmail.com>
Acked-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
If a malicious XFS contains a block+ format directory wherein the
directory inode's core.mode is corrupted, and there are
subdirectories of the corrupted directory, an attempt to traverse up
the directory tree by running xfs_scrub will crash the kernel in
__xfs_dir3_data_check.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Currently, xfs_io scrub command doesn't allow the probe function
to have any parameter, so we remove the invalid 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 <guaneryu@gmail.com>
Currently a test appears to pass even if it leaves a corrupt
filesystem behind, or a splat in the system logs that should not be
there. While the test is internally tracked as failed (and the
summary reports it as failed) the per-test output exits with a
success and so emits a completion time before the post-test checks
are run by the test harness. Rework the check code to report
post-test check failures as specific test failures rather than as
separate failure line items in the overall harness output.
Reworking where we emit the errors this also allows us to include
the post-test filesystem checking in the test runtime. This is
currently not accounted to the test and can be substantial. Hence
the real elapsed time of each test is not accurately reflected in
the time stats being reported and so regressions in filesystem
checking performance go unnoticed.
Changing the output reporting requires a complete reworking of the
main test check loop. It's a bunch of spaghetti at the moment
because it has post test reporting code at the end of the loop which
must run regardless of the test result. By moving the post test
reporting to the start of the next loop iteration, we can clean up
the code substantially by using continue directives where
appropriate.
Also, for cases where we haven't run the test or it's already been
marked as failed, don't bother running the filesystem/dmesg checks
for failure as we're already going to report the test as failed.
This touches almost all of the loop, so get rid of the remaining
4 space indents inside the loop while moving all this code around.
[Eryu: fixed wrong test seq name issue in xUnit report when test hit
"continue" in the check loop, e.g. notrun, with Dave ACKing the fix]
Signed-Off-By: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
The btrfs/volume group represent a set of btrfs test-cases, which
shall intend to verify the relevant btrfs volume operations.
Under this new group all the existing btrfs/replace group would come
under, and also the device operations test cases which does not have
any group as of now. This group is helpful to verify the btrfs
volume related changes.
Run as
./check -g btrfs/volume
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Btrfs has the same issue as XFS here in that the extent layout on a
> 4096 page size system will not match what is reflected in the test
output.
Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Use $RESIZE2FS_PROG instead of direct name to call program with full
path. Also add an appropriate feature test.
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Use $RESIZE2FS_PROG and $DUMPE2FS_PROG instead of names directly to
make progs be executed with full path. Also add proper feature test
macros.
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
The test uses resize2fs(8) without proper feature test macro and
also without specifying full path to it. Fix that.
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Cleanup couple of things that were objected to when creating test
ext4/033 out of this one.
Use _require_scratch_nocheck instead of recreating scratch fs before
exiting. Avoid needless cleanup of dmhugedev on exit - _cleanup
takes care of that. Use _scratch_unmount where possible.
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Test for overflow of s_inodes_count during filesystem resizing.
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>