summaryrefslogtreecommitdiff
path: root/check
AgeCommit message (Collapse)Author
2023-01-22xfstests: add fuse supportv2023.01.22Miklos Szeredi
This allows using any fuse filesystem that can be mounted with mount -t fuse$FUSE_SUBTYP ... Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Jakob Unterwurzacher <jakobunt@gmail.com> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
2023-01-14overlay: avoid to use NULL OVL_BASE_FSTYP for mountingBaokun Li
Generally, FSTYP is used to specify OVL_BASE_FSTYP. When we specify FSTYP through an environment variable, it is not converted to OVL_BASE_FSTYP. In addition, sometimes we do not even specify the file type. For example, we only use `./check -n -overlay -g auto` to list overlay-related cases. If OVL_BASE_FSTYP is NULL, mounting fails and the test fails. To solve this problem, try to assign a value to OVL_BASE_FSTYP when specifying -overlay. In addition, in the _overlay_base_mount function, the basic file system type of the overlay is specified only when OVL_BASE_FSTYP is not NULL. Reported-by: Murphy Zhou <jencce.kernel@gmail.com> Signed-off-by: Baokun Li <libaokun1@huawei.com> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
2022-12-16check: wipe tmp.arglistLeah Rumancik
Make sure tmp.arglist is wiped before each run to avoid accidentally rerunning tests. Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: David Disseldorp <ddiss@suse.de> Signed-off-by: Zorro Lang <zlang@kernel.org>
2022-12-15check: ensure sect_stop is initialized if interruptedDavid Disseldorp
sect_stop is normally set immediately prior to calling _wrapup() via run_section(). However, when called via a trap signal handler, sect_stop may be uninitialized, leading to a negative section time (sect_stop - sect_start) in the xunit report. E.g. Interrupted! Passed all 1 tests Xunit report: /home/david/xfstests/results//result.xml rapido1:/# head /home/david/xfstests/results//result.xml <?xml version="1.0" encoding="UTF-8"?> <testsuite name="xfstests" failures="0" skipped="0" tests="1" time="-1670885797" ... > This commit uses the existing $interrupt flag to determine when sect_stop needs to be initialised. Signed-off-by: David Disseldorp <ddiss@suse.de> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
2022-12-14check: call _check_dmesg even if the test case failedQu Wenruo
[BUG] When KEEP_DMESG=yes is specified, passed test cases will also keep their $seqres.dmesg files. However for failed test cases (caused by _fail calls), their dmesg files are not saved at all: # rm -rf results/btrfs/219* # ./check btrfs/219 # ls result/btrfs/219* results/btrfs/219.full results/btrfs/219.out.bad [CAUSE] $seqres.dmesg is created (and later deleted depending on config) by _check_dmesg() function. But if a test case failed by calling _fail, then we no longer call _check_dmesg(), thus no dmesg will be saved no matter whatever the config is. [FIX] If the test case itself failed, then still call _check_dmesg() to either save the dmesg unconditionally (KEEP_DMESG=yes case), or save the dmesg if there is something wrong (default). The dmesg can be pretty handy debug clue for both cases. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Disseldorp <ddiss@suse.de> Signed-off-by: Zorro Lang <zlang@kernel.org>
2022-10-16fstests: get section config after RUN_SECTION checksv2022.10.16Josef Bacik
While trying to do ./check -s <some section> I was failing because I had a section defined higher than <some section> that had TEST_DEV=/some/nonexistent/device, since I was using the other section to test an experimental drive. This appears to be because we run through all of the sections, and when getting the section config we check to see if it's valid, and in this case the section wasn't valid. The section I was actually trying to use was valid however. Fix check to see if the section we're trying to run is in our list of sections to run first, and then if it is get the config at that point. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
2022-10-15check: detect and preserve all coredumps made by a testDarrick J. Wong
If someone sets kernel.core_uses_pid (or kernel.core_pattern), any coredumps generated by fstests might have names that are longer than just "core". Since the pid isn't all that useful by itself, let's record the coredumps by hash when we save them, so that we don't waste space storing identical crash dumps. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
2022-09-20egrep, fgrep: deprecatedMurphy Zhou
Since this grep commit: commit a9515624709865d480e3142fd959bccd1c9372d1 Author: Paul Eggert <eggert@cs.ucla.edu> Date: Sun Aug 15 10:52:13 2021 -0700 egrep, fgrep: now obsolete egrep will trigger a warning like: +egrep: warning: egrep is obsolescent; using grep -E This will break many gold output. Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
2022-09-04common: filter internal errors during io error testingDarrick J. Wong
The goal of an EIO shutdown test is to examine the shutdown and recovery behavior if we make the underlying storage device return EIO. On XFS, it's possible that the shutdown will come from a thread that cancels a dirty transaction due to the EIO. This is expected behavior, but _check_dmesg will flag it as a test failure. Make it so that we can add simple regexps to the default check_dmesg filter function, then add the "Internal error" string to filter function when we invoke an EIO test. This fixes periodic regressions in generic/019 and generic/475. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
2022-07-24report: add support for the xunit-quiet formatv2022.07.24Theodore Ts'o
The xunit-quiet format excludes the NNN.{full,dmesg,bad} files in <system-out> and <system-err> nodes which are included in the xunit report format. For test runners that save the entire results directory to preserve all of the test artifacts, capturing the NNN.{full,dmesg,bad} in the results.xml file is redundant. In addition, if the NNN.bad is too large, it can cause the junitparser python library to refuse to parse the XML file to prevent potential denial of service attacks[1]. A simple way to avoid this problem is to simply to omit the <system-out> and <system-err> nodes in the results.xml file. [1] https://gitlab.com/gitlab-org/gitlab/-/issues/268035 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: David Disseldorp <ddiss@suse.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>
2022-07-09check: add -L <n> parameter to rerun failed testsDavid Disseldorp
If check is run with -L <n>, then a failed test will be rerun <n> times before proceeding to the next test. Following completion of the rerun loop, aggregate pass/fail statistics are printed. Rerun tests will be tracked as a single failure in overall pass/fail metrics (via @try and @bad), with .out.bad, .dmesg, .core, .hints, .notrun and .full saved using a .rerun# suffix. Suggested-by: Theodore Ts'o <tytso@mit.edu> Link: https://lwn.net/Articles/897061/ Signed-off-by: David Disseldorp <ddiss@suse.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>
2022-07-09check: append bad / notrun arrays in helper functionDavid Disseldorp
Currently the @try, @bad and @notrun arrays are appended with seqnum at different points in the main run_section() loop: - @try: shortly prior to test script execution - @notrun: on list (check -n), or after .notrun flagged test completion - @bad: at the start of subsequent test loop and loop exit For future loop-test-following-failure functionality it makes sense to combine some of these steps. This change moves both @notrun and @bad appends into a helper function which is called at the end of each loop iteration. Signed-off-by: David Disseldorp <ddiss@suse.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>
2022-07-09check: make a few variables localDavid Disseldorp
The variables aren't used outside of function scope. Also convert one timestamp output to use the helper. Signed-off-by: David Disseldorp <ddiss@suse.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>
2022-07-09report: pass through most details as function parametersDavid Disseldorp
Report generation currently involves reaching into a whole bunch of globals for things like section name and start/end times. Pass these through as explicit function parameters to avoid unintentional breakage. One minor fix included is the default xunit error message, which used $sequm instead of $seqnum. Signed-off-by: David Disseldorp <ddiss@suse.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>
2022-07-02check: document mkfs.xfs reliance on fstests exportsDarrick J. Wong
There are a number of fstests that employ special (and now unsupported) XFS filesystem configurations to perform testing in a controlled environment. The presence of the QA_CHECK_FS and MSGVERB variables are used by mkfs.xfs to detect that it's running inside fstests, which enables the unsupported configurations. Nobody else should be using filesystems with tiny logs, non-redundant superblocks, or smaller than the (new) minimum supported size. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
2022-06-24check: remove err and first_test variablesDavid Disseldorp
tc_status can be used for both of these. Signed-off-by: David Disseldorp <ddiss@suse.de> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
2022-06-24check: use arrays instead of separate n_ countersDavid Disseldorp
The separate n_try, n_bad and n_notrun counters are unnecessary when the corresponding lists are switched to bash arrays. Signed-off-by: David Disseldorp <ddiss@suse.de> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
2022-06-24report: fix xunit tests countDavid Disseldorp
The xunit "section report" provides a tests attribute, which according to https://llg.cubic.org/docs/junit/ represents: tests="" <!-- The total number of tests in the suite, required. --> The current value is generated as a sum of the $n_try and $n_notrun counters. This is incorrect as the $n_try counter already includes tests which are run but complete with _notrun. One special case exists for $showme (check -n), where $n_try remains zero, so $n_notrun can be used as-is. Signed-off-by: David Disseldorp <ddiss@suse.de> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
2022-06-24check: simplify check.time parsingDavid Disseldorp
There's no need to use grep and awk when the latter can do all that's needed, including the pretty printing. Signed-off-by: David Disseldorp <ddiss@suse.de> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
2022-06-24check: avoid FSTYP=<fstyp parameter> repetitionDavid Disseldorp
Signed-off-by: David Disseldorp <ddiss@suse.de> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
2022-05-02common: print hints for reasons of test failuresAmir Goldstein
Introduce helpers _fixed_by_{kernel,git}_commit() and _fixed_in_{kernel_,}version() that can be used to hint testers why a test might be failing and aid in auto-generating of expunge lists for downstream kernel testing. A test may be annotated with multiple hints, for example: _fixed_by_kernel_commit 09889695864 xfs: foo _fixed_by_kernel_commit 46464565465 ext4: bar _fixed_in_version xfsprogs v5.15 Annotate fix kernel commits for some overlayfs tests. Annotate fix kernel version for some overlayfs tests testing for legacy behavior whose fixes are not likely to be backported to stable kernels. This is modeled after LTP's 'make filter-known-fails' and print_failure_hints() using struct tst_tag annotations. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
2021-08-01check: back off the OOM score adjustment to -500Darrick J. Wong
Dave Chinner complained that fstests really shouldn't be running at -1000 oom score adjustment because that makes it more "important" than certain system daemons (e.g. journald, udev). That's true, so increase it to -500. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-08-01check: don't leave the scratch filesystem mounted after _notrunDarrick J. Wong
Unmount the scratch filesystem if a test decides to _notrun itself because _try_wipe_scratch_devs will not be able to wipe the scratch device prior to the next test run. We don't want to let scratch state from one test leak into subsequent tests if we can help it. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-18check: run _check_filesystems in an OOM-happy subshellDarrick J. Wong
While running fstests one night, I observed that fstests stopped abruptly because ./check ran _check_filesystems to run xfs_repair. In turn, repair (which inherited oom_score_adj=-1000 from ./check) consumed so much memory that the OOM killer ran around killing other daemons, rendering the system nonfunctional. This is silly -- we set an OOM score adjustment of -1000 on the ./check process so that the test framework itself wouldn't get OOM-killed, because that aborts the entire run. Everything else is fair game for that, including subprocesses started by _check_filesystems. Therefore, adapt _check_filesystems (and its children) to run in a subshell with a much higher oom score adjustment. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-04check: exit with exit code 1 after printing the usage messageTheodore Ts'o
If check is passed an invalid command line option, exit with a non-zero exit code so that a script calling check can detect the failure. The check script already performs an "exit 1" if a valid option has an invalid argument, so this is consistent with existing practice. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-06-27check: use generated group filesDarrick J. Wong
Convert the ./check script to use the automatically generated group list membership files, as the transition is now complete. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com> Reviewed-by: Allison Henderson <allison.henderson@oracle.com> Reviewed-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-03-07check: add CLI option to repeat and stop tests in case of failureRitesh Harjani
Currently with -i <n> option the test can run for many iterations, but in case if we want to stop the iteration in case of a failure, it is much easier to have such an option which could check the failed status and stop the test from further proceeding. This patch adds such an option (-I <n>) thereby extending the -i <n> option functionality. Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-03-07check: run tests in exactly the order specifiedDarrick J. Wong
Introduce a new --exact-order switch to disable all sorting, filtering of repeated lines, and shuffling of test order. The goal of this is to be able to run tests in a specific order, namely to try to reproduce test failures that could be the result of a -r(andomize) run getting lucky. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-03-07check: don't abort on non-existent excluded groupsDarrick J. Wong
Don't abort the whole test run if we asked to exclude groups that aren't included in the candidate group list, since we actually /are/ satisfying the user's request. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-03-07check: allow '-e testid' to exclude a single testDarrick J. Wong
This enables us to mask off specific tests. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2020-12-06check: source common/rc again if TEST_DEV was recreatedEryu Guan
If TEST_DEV is recreated by check, FSTYP derived from TEST_DEV previously could be changed too and might not reflect the reality. So source common/rc again with correct FSTYP to get fs-specific configs, e.g. common/xfs. For example, using this config-section config file, and run section ext4 first then xfs, you can see: our local _scratch_mkfs routine ... ./common/rc: line 825: _scratch_mkfs_xfs: command not found check: failed to mkfs $SCRATCH_DEV using specified options local.config: [default] RECREATE_TEST_DEV=true TEST_DEV=/dev/sda5 SCRATCH_DEV=/dev/sda6 TEST_DIR=/mnt/test SCRATCH_MNT=/mnt/scratch [ext4] MKFS_OPTIONS="-b 4096" FSTYP=ext4 [xfs] FSTYP=xfs MKFS_OPTIONS="-f -b size=4k" Tested-by: Ritesh Harjani <riteshh@linux.ibm.com> Signed-off-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
2020-11-22check: run tests in a systemd scope for mandatory test cleanupDarrick J. Wong
TLDR: If systemd is available, run each test in its own temporary systemd scope. This enables the test harness to forcibly clean up all of the test's child processes (if it does not do so itself) so that we can move into the post-test unmount and check cleanly. I frequently run fstests in "low" memory situations (2GB!) to force the kernel to do interesting things. There are a few tests like generic/224 and generic/561 that put processes in the background and occasionally trigger the OOM killer. Most of the time the OOM killer correctly shoots down fsstress or duperemove, but once in a while it's stupid enough to shoot down the test control process (i.e. tests/generic/224) instead. fsstress is still running in the background, and the one process that knew about that is dead. When the control process dies, ./check moves on to the post-test fsck, which fails because fsstress is still running and we can't unmount. After fsck fails, ./check moves on to the next test, which fails because fsstress is /still/ writing to the filesystem and we can't unmount or format. The end result is that that one OOM kill causes cascading test failures, and I have to re-start fstests to see if I get a clean(er) run. So, the solution I present in this patch is to teach ./check to try to run the test script in a systemd scope. If that succeeds, ./check will tell systemd to kill the scope when the test script exits and returns control to ./check. Concretely, this means that systemd creates a new cgroup, stuffs the processes in that cgroup, and when we kill the scope, systemd kills all the processes in that cgroup and deletes the cgroup. The end result is that fstests now has an easy way to ensure that /all/ child processes of a test are dead before we try to unmount the test and scratch devices. I've designed this to be optional, because not everyone does or wants or likes to run systemd, but it makes QA easier. 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>
2020-10-21check: fix misspelled variable name for sectionsFilipe Manana
We have some places that refer to the variable OPTIONS_HAVE_SECTIONS has OPTIONS_HAVE_SECIONS, obviously a typo. So fix them. Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2020-10-18fstests: drop check.log and check.time into section specific results dirJosef Bacik
Right now we only track check.log and check.time globally, it would be nice to do it per-section as well. This makes it easier to parse results from systems that run a bunch of different configurations at once. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2020-09-21check: try reloading modulesDarrick J. Wong
Optionally reload the module between each test to try to pinpoint slab cache errors and whatnot. 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>
2020-07-20check: clear WARN_ONCE state before each testLukas Czerner
clear WARN_ONCE state before each test to allow a potential problem to be reported for each test [Eryu: replace "/sys/kernel/debug" with $DEBUGFS_MNT ] Signed-off-by: Lukas Czerner <lczerner@redhat.com> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2020-07-20check: add CLI option to repeat testsDave Chinner
Frequently when trying to reproduce a problem I want to run a set of specific tests in a loop, over and over again. I run fstests from a set of run scripts that have non-trivial overhead (e.g. patterning block devices before the runs start), so if all I want to do is run the same test 100x, using a shell loop over the entire run scripts reduces the iteration rate substantially. Hence add an option to check to allow fstests to loop a number of times over the configured test set without stopping. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2019-10-18fstests: Add virtio-fs shared file system supportQI Fuli
This patch adds support for virtio-fs shared file system that lets virtual machines access a directory tree on the host. To run xfstests on it, first, start virtiofsd daemon in host: ./virtiofsd -o vhost_user_socket=/tmp/vhostqemu0 -o source=$DIR0 -o cache=always ./virtiofsd -o vhost_user_socket=/tmp/vhostqemu1 -o source=$DIR1 -o cache=always second, launch QEMU with: -chardev socket,id=char0,path=/tmp/vhostqemu0 -device vhost-user-fs-pci,queue-size=1024,chardev=char0,tag=myfs0 -chardev socket,id=char1,path=/tmp/vhostqemu1 -device vhost-user-fs-pci,queue-size=1024,chardev=char1,tag=myfs1 -m 8G -object memory-backend-file,id=mem,size=8G,mem-path=/dev/shm,share=on -numa node,memdev=mem then, inside the VM run xfstests with: export TEST_DEV=myfs0 export TEST_DIR=$TESTDIR export SCRATCH_DEV=myfs1 export SCRATCH_MNT=$SCRATCHMNT export MOUNT_OPTIONS="" export TEST_FS_MOUNT_OPTS="" Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Misono Tomohiro <misono.tomohiro@fujitsu.com> Signed-off-by: QI Fuli <qi.fuli@fujitsu.com> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2019-10-06check: convert spaces to tabs in help msgPo-Hsu Lin
There are some mix use of spaces and tabs in the help message: $ ./check --help Usage: ./check [options] [testlist] check options -nfs test NFS -glusterfs test GlusterFS -cifs test CIFS -9p test 9p -overlay test overlay -pvfs2 test PVFS2 -tmpfs test TMPFS -ubifs test ubifs unify them with tabs. Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2019-07-05check: add ext4 group list when testing ext2 and ext3Theodore Ts'o
Modern kernels use the ext4 implementation to support ext2 and ext3 mounts, and a number of the ext4 tests are actually suitable for ext2 and ext3. We're trying to move tests out of shared anyway, so instead of moving tests from ext4/NNN to shared, let's just include the ext4 group list when FSTYP is ext2 or ext3. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2019-06-07check: try to insulate the test framework from oom killerDarrick J. Wong
Some of the tests in xfstests (e.g. generic/224 with 512M of memory) consume a lot of memory, and when this happens the OOM killer will run around stomping on processes. Sometimes it kills the ./check process before it kills the actual test, which means that the test run doesn't complete. Therefore, make the ./check process OOM-proof while bumping up the attractiveness of the test itself, in the hopes that even if the test OOMs we'll still be able to continue on our way. 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>
2019-04-21check: wipe scratch devices between testsDarrick J. Wong
Wipe the scratch devices in between each test to ensure that tests are formatting them and not making assumptions about previous contents. 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>
2019-04-21check: remove require_{test,scratch}* after a test failsDarrick J. Wong
Remove the require_{test,scratch]* sentinel files after a test fails. This eliminates false fsck corruption reports such as the following: 1. Test A calls _require_scratch, which creates the sentinel file $RESULT_DIR/require_scratch to facilitate fsck after the test completes. 2. Test A runs some test, which corrupts the scratch filesystem due to kernel bug or something. 3. Test A calls _fail because of the errors in (2). Note that the test case returned 1, so ./check unmounts the test and scratch filesystems without checking them or removing $RESULT_DIR/require_scratch 4. Test B starts up, but does not call _require_scratch. The $RESULT_DIR/require_scratch file is still there. 5. Test B completes successfully. 6. ./check calls _check_filesystems, which sees the $RESULT_DIR/require_scratch file and runs fsck. 7. fsck reports the corrupt scratch device (which is associated with test B) even though B did not ever touch the scratch device and it was actually test A that corrupted the filesystem. Note that with the "check: wipe scratch devices between tests" patch applied, we can also reproduce this problem by running xfs/172 and xfs/195 with a scratch device small enough that the files created in 172 span multiple AGs and therefore cause 172 to fail. 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>
2019-03-23check: really improve test list randomizationDarrick J. Wong
coreutils provides the shuf(1) utility that randomizes the order of a list and seeds its random number generator with /dev/urandom. It's a bit speedier than awk, so use it if available. 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>
2019-03-23check: improve test list randomizationDarrick J. Wong
awk doesn't have a particularly good random number generator -- it seeds from the Unix epoch time in seconds, which means that the run order across a bunch of VMs started at exactly the same time are unsettlingly predictable. Therefore, at least try to seed it with bash's $RANDOM, which is slightly less predictable. 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>
2019-02-16common: fix kmemleak to work with sectionsDarrick J. Wong
Refactor the kmemleak code to work correctly with sections. This requires changing the location of the "is kmemleak enabled?" flag to use /tmp instead of RESULT_BASE, scanning for leaks after every test, and clarifying which functions get used when. 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>
2019-01-06Revert "common/config: create $RESULT_BASE before dumping kmemleak leaks"Nikolay Borisov
This commit tried to fix the brokennes of the kmemleak support but it inadvertently broke the creation of the RESULT_BASE directory which lead to problems creating check.time file. Turns out kmemleak support in xfstests has more problems and it needs to be majorly refactor and this commit doesn't really solve the problem. For the time being just revert to at least allow older configuration files, which have explicitly set RESULT_BASE to work. This reverts commit 7fc034868d5dce9aaf3517c9c2197221b9a772e4. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-12-29check: use _try_scratch_mount instead of _scratch_mount to mount SCRATCH_DEVHou Tao
Else there won't be any error messages when mounting SCRATCH_DEV failed, because _scratch_mount exits early by invoking _fail. Signed-off-by: Hou Tao <houtao1@huawei.com> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-12-22check: fix -X exclude_file behaviourDavid Disseldorp
It is currently processed before FSTYP has been properly set, leading to xfs, btrfs, etc. specific exclude_files being ignored. Signed-off-by: David Disseldorp <ddiss@suse.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-12-22common/config: create $RESULT_BASE before dumping kmemleak leaksJohannes Thumshirn
In _init_kmemleak() we're touching a check_kmemleak file in ${RESULT_BASE} if ${DEBUGFS_MNT/kmemleak} exists as a marker that we have to check for kmemleak output after running a test. In 'check' we're calling _init_kmemleak() at around 60% of the file, but ${RESULT_BASE} is created later at around 62% of the file, causing the 'touch' in _init_kmemleak() to fail. Create the ${RESULT_BASE} just after assigning the default value in get_next_config() [Eryu: check for mkdir failure and remove the $RESULT_BASE creation in check.] Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>