Bart Van Assche [Sat, 28 Mar 2020 18:22:51 +0000 (11:22 -0700)]
Add a test that triggers the blk_mq_realloc_hw_ctxs() error path
Add a test that triggers the code touched by commit d0930bb8f46b ("blk-mq:
Fix a recently introduced regression in blk_mq_realloc_hw_ctxs()"). This
test only runs if a recently added fault injection feature is available,
namely commit 596444e75705 ("null_blk: Add support for init_hctx() fault
injection").
Cc: Ming Lei <ming.lei@redhat.com> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bart Van Assche [Sat, 28 Mar 2020 18:22:48 +0000 (11:22 -0700)]
Make _exit_null_blk remove all null_blk device instances
Instead of making every test remove null_blk device instances before calling
_exit_null_blk(), move the null_blk device instance removal code into
_exit_null_blk().
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Reviewed-by: Daniel Wagner <dwagner@suse.de> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Omar Sandoval [Thu, 5 Mar 2020 01:21:51 +0000 (17:21 -0800)]
Support skipping tests from test{,_device}()
Most of the time, test requirements can be checked without much setup.
However, in some cases, it's not possible to know if the test can be run
until we're halfway through the test. Allow setting SKIP_REASON from the
test function. This should only be used as a last resort.
Omar Sandoval [Thu, 5 Mar 2020 01:08:51 +0000 (17:08 -0800)]
Show last run for skipped tests
When we support skipping from test{,_device}, we will show the last run
information and then skip the test. This is inconsistent with how we
currently show skipped tests, which doesn't display any information. For
consistency, consolidate on always showing the last run (and for device
tests, showing the skipped message for each device).
Omar Sandoval [Thu, 5 Mar 2020 00:27:38 +0000 (16:27 -0800)]
Skip tests based on SKIP_REASON, not return value
Currently, {,group_,device_}requires are required to both set
SKIP_REASON and return non-zero. This is somewhat redundant, and will be
inconsistent with skipping from test{,_device} that is about to be
implemented. Let's ignore the return value and always skip the test if
SKIP_REASON is set. The _have_foo and _test_dev_foo helpers should still
return so that they can be chained together.
Yi Zhang [Thu, 20 Feb 2020 14:46:49 +0000 (22:46 +0800)]
nbd/003: fix compiling error with gcc version 4.8.5
cc -O2 -Wall -Wshadow -o mount_clear_sock mount_clear_sock.c
mount_clear_sock.c: In function ‘main’:
mount_clear_sock.c:39:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i < loops; i++) {
^
mount_clear_sock.c:39:2: note: use option -std=c99 or -std=gnu99 to compile your code
Sun Ke [Mon, 23 Dec 2019 03:18:29 +0000 (11:18 +0800)]
nbd/003:add mount and clear_sock test for nbd
Add the test case to check nbd device. This test case catches regressions
fixed by commit 92b5c8f0063e4 "nbd: replace kill_bdev() with
__invalidate_device() again".
Establish the nbd connection. Run two processes. The first one do mount
and umount, and the other one do clear_sock ioctl.
Signed-off-by: Sun Ke <sunke32@huawei.com>
[Omar: simplify] Signed-off-by: Omar Sandoval <osandov@fb.com>
Daniel Wagner [Mon, 3 Feb 2020 16:40:49 +0000 (17:40 +0100)]
nvme/018: Reword misleading error message
'nvme read' is expected to fail, though the error message "ERROR:
Successfully..." is misleading. Reword the error text to clarify the
real intent of the test and what failed.
Reported-by: Logan Gunthorpe <logang@deltatee.com> Reviewed-by: Logan Gunthorpe <logang@deltatee.com> Reviewed-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Daniel Wagner <dwagner@suse.de>
Bart Van Assche [Fri, 13 Dec 2019 14:32:31 +0000 (09:32 -0500)]
common/multipath-over-rdma, tests/srp: Make it easy to use siw instead of rdma_rxe
Make all_primary_gids() return GIDs with zero suffix since SoftiWARP
GIDs have such a suffix. Add SoftiWARP support in start_soft_rdma() and
stop_soft_rdma(). Make do_rdma_cm_login() submit the source IP address
and scope ID to the SRP initiator driver since that information is
essential to establish an IPv6 connection between link-local addresses.
Iterate over RDMA ports instead of UMAD device nodes in log_in() since
no UMAD device node is associated with SoftiWARP ports. In start_lio_srpt(),
use the GID format to identify SoftiWARP ports since the GID suffix for
these ports is zero.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Commit e9ffecc "Convert license headers to SPDX tags" remove extensive
license description and replace with a SPDX tag. However, one line was
left behind. Remove this line.
Signed-off-by: André Almeida <andrealmeid@collabora.com>
André Almeida [Wed, 30 Oct 2019 22:27:06 +0000 (19:27 -0300)]
check: Add configuration file option
Add an option to be possible to use a different configuration file
rather than the default "config" file.
Signed-off-by: André Almeida <andrealmeid@collabora.com>
[Omar: rework so command line options still take precedence over config,
document precedence] Signed-off-by: Omar Sandoval <osandov@fb.com>
André Almeida [Wed, 30 Oct 2019 22:27:05 +0000 (19:27 -0300)]
check: Make "device-only" option a valid option
"--device-only" option is described at the "Usage" help message and it's
even parsed as an option by the main code. However, since it's not a
parameter of getopt, when trying to use it will trigger a "unrecognized
option". Fix that to allow usage of this option.
Signed-off-by: André Almeida <andrealmeid@collabora.com>
Bart Van Assche [Thu, 24 Oct 2019 21:03:52 +0000 (14:03 -0700)]
Add a test that triggers blk_mq_update_nr_hw_queues()
Note: the newly added test script only triggers blk_mq_update_nr_hw_queues()
for kernel versions that include commit 45919fbfe1c4 ("null_blk: Enable
modifying 'submit_queues' after an instance has been configured").
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Yi Zhang [Wed, 11 Sep 2019 08:53:43 +0000 (16:53 +0800)]
nvme: Add new test case about nvme rescan/reset/remove during IO
Add one test to cover NVMe SSD rescan/reset/remove operation during
IO, the steps found several issues during my previous testing, check
them here:
http://lists.infradead.org/pipermail/linux-nvme/2017-February/008358.html
http://lists.infradead.org/pipermail/linux-nvme/2017-May/010259.html
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Reviewed-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
[Omar: allow all attributes to be missing and check for directory
existence] Signed-off-by: Omar Sandoval <osandov@fb.com>
nvme/031: Add test to check controller deletion after setup
A number of bug fixes have been submitted to the kernel to
fix bugs when a controller is removed immediately after it is
set up. This new test ensures this doesn't regress.
André Almeida [Tue, 8 Oct 2019 00:36:06 +0000 (21:36 -0300)]
README: Stress warning about destructive actions
The information that an action can cause potentially data loss should be
displayed before the command, not after. Change the order and stress the
warning.
Signed-off-by: André Almeida <andrealmeid@collabora.com>
Bart Van Assche [Thu, 8 Aug 2019 20:05:04 +0000 (13:05 -0700)]
tests/nvmeof-mp/rc: Make simulate_network_failure_loop() more robust
Avoid that the following is logged in the nvmeof-mp .full log files:
ls: cannot access '/sys/class/nvme/*/device/*/nvme0n1/reset_controller': No such
file or directory
tests/nvmeof-mp/rc: line 124: : No such file or directory
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bart Van Assche [Thu, 8 Aug 2019 20:05:03 +0000 (13:05 -0700)]
tests/nvme/rc: Modify the approach for disabling and re-enabling Ctrl-C
Avoid that the following error messages are reported when redirecting stdin:
stty: 'standard input': Inappropriate ioctl for device
stty: 'standard input': Inappropriate ioctl for device
Cc: Logan Gunthorpe <logang@deltatee.com> Cc: Johannes Thumshirn <jthumshirn@suse.de> Fixes: a987b10bc179 ("nvme: Ensure all ports and subsystems are removed on cleanup") Reviewed-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bart Van Assche [Mon, 5 Aug 2019 23:25:12 +0000 (16:25 -0700)]
Make the NVMe tests more reliable
When running blktests with kernel debugging enabled it can happen that
_find_nvme_loop_dev() returns before the NVMe block device has appeared
in sysfs. This patch avoids that the NVMe tests fail as follows:
+cat: /sys/block/nvme1n1/uuid: No such file or directory
+cat: /sys/block/nvme1n1/wwid: No such file or directory
Cc: Logan Gunthorpe <logang@deltatee.com> Cc: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Cc: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Logan Gunthorpe <logang@deltatee.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
It is no longer important for correct test functionality to
remove the modules between tests. Therefore, we ignore errors
if the modules are not removed (ie. if they are builtin).
With this patch, it is now safe to run the tests with the nvmet
modules built-in. This will be more convienent for developers
that want to run the tests in a simple VM.
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
nvme: Ensure all ports and subsystems are removed on cleanup
This ensures any test that fails or is interrupted will cleanup
their subsystems. This will prevent the system from being left
in an inconsistent state that will fail subsequent tests.
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
nvme: Cleanup modprobe lines into helper functions
Move all the lines to modprobe nvmet and nvme-loop
into _setup_nvmet() and _cleanup_nvmet() helper functions
and call _cleanup_nvmet() using _register_test_cleanup()
to ensure it's always called after the test terminates.
This will allow us to improve the cleanup of these tests and
not leave the system in an inconsistent state when tests
are aborted.
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
check: Add the ability to call a cleanup function after a test ends
In order to ensure tests properly clean themselves up, even if
they are subject to interruption, add the ability to call a test
specified function at cleanup time.
Any test can call _register_test_cleanup with the first argument
as a function to call after the test ends or is interrupted
(similar to using 'trap <func> EXIT').
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
nvme/018: Ignore error message generated by nvme read
nvme-cli at some point started printing the error message:
NVMe status: CAP_EXCEEDED: The execution of the command has caused the
capacity of the namespace to be exceeded(0x6081)
This was not accounted for by test 018 and caused it to fail.
This test does not need to test the error message content, it's
only important that a read past the end of the file fails. Therefore,
pipe stderr of nvme-cli to $FULL.
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
nvme/005: Don't rely on modprobing to set the multipath paramater
On test systems with existing nvme drives or built-in modules it may not
be possible to remove nvme-core in order to re-probe it with
multipath=1.
Instead, skip the test if the multipath parameter is not already set
ahead of time.
Note: the multipath parameter of nvme-core is set by default if
CONFIG_NVME_MULTIPATH is set so this will only affect systems
that explicitly disable it via the module parameter.
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
nvme: Add new test to verify the generation counter
Now that the other discovery tests ignore the generation counter value,
create a new test to specifically check that it increments when
subsystems are added or removed from ports and when allow_any_host
is set/unset.
nvme: More agressively filter the discovery output
Comparing the entire output of nvme-cli for discovery is fragile
and error prone as things change. There's already been the
long standing issue of the generation counter mismatching
and also some versions of nvme-cli print an extra "sq flow control
disable supported" text[1].
Instead, filter out all but a few key values from the discovery
text which should still be sufficient for this test and much
less likely to be subject to churn.
Michael Moese [Wed, 17 Jul 2019 17:12:48 +0000 (11:12 -0600)]
Add filter function for nvme discover
Several NVMe tests (002, 016, 017) used a pipe to a sed call filtering
the output. This call is moved to a new filter function nvme/rc and
the calls to sed are replaced by this function.
Additionally, the test nvme/016 failed for me due to the Generation
counter being greater than 1, so the new filter function was expanded to
replace the Generation counter with 'X'.
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Michael Moese <mmoese@suse.de>
[logang@deltatee.com: added missing changes to 002.out and 017.out] Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Shin'ichiro Kawasaki [Fri, 7 Jun 2019 12:19:55 +0000 (21:19 +0900)]
zbd/007: Add zone mapping test for logical devices
Add the test case to check zones sector mapping of logical devices
This test case requires that such a logical device be specified in
TEST_DEVS in config. The test is skipped for devices that are identified
as not logically created. This test case catches regressions of complex
zone remapping problem fixed by commit 9864cd5dc54c "dm: fix report zone
remapping to account for partition offset".
To test that the zone mapping is correct, select a few sequential write
required zones of the logical device and move the write pointers of
these zones through the container device of the logical device, using
the physical sector mapping of the zones. The write pointers position of
the selected zones is then checked through a zone report of the logical
device using the logical sector mapping of the zones. The test reports a
success if the position of the zone write pointers relative to the zone
start sector must be identical for both the logical and physical
locations of the zones.
Shin'ichiro Kawasaki [Fri, 7 Jun 2019 12:19:54 +0000 (21:19 +0900)]
zbd/rc: Introduce helper functions for zone mapping test
As a preparation for the zone mapping test case, add several helper
functions. _find_last_sequential_zone() and
_find_sequential_zone_in_middle() help to select test target zones.
_test_dev_is_logical() checks TEST_DEV is the valid test target.
_test_dev_has_dm_map() helps to check that the dm target is linear or
flakey. _get_dev_container_and_sector() helps to get the container device
and sector mappings.
Xiao Liang [Sat, 11 May 2019 15:36:51 +0000 (23:36 +0800)]
block/005,008: do exit if fio did not finish within timeout
In some bad situation, fio needs taking over several hours to complete
random read operations with specified size. The test may skip out in such
cases and does not block other cases run.
With this patch, the case will be ended within $TIMEOUT(if set) or 900s.
block/005 => nvme1n1 (switch schedulers while doing IO) [failed]
runtime ... 1800.477s
read iops ...
--- tests/block/005.out 2019-03-31 14:29:39.905449312 +0000
+++ /home/ec2-user/blktests/results/nvme1n1/block/005.out.bad 2019-05-07 04:10:16.026681842 +0000
@@ -1,2 +1,4 @@
Running block/005
+fio did not finish after 900 seconds which probably caused by
+lower disk performance
Test complete
Reviewed-by: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com> Signed-off-by: Xiao Liang <xiliang@redhat.com>
[Omar: add some headroom for explicit timeouts] Signed-off-by: Omar Sandoval <osandov@osandov.com>
Omar Sandoval [Mon, 6 May 2019 21:24:53 +0000 (14:24 -0700)]
block/027: fix shellcheck errors
tests/block/027:59:35: note: Double quote to prevent globbing and word splitting. [SC2086]
tests/block/027:59:48: note: Double quote to prevent globbing and word splitting. [SC2086]
Dennis Zhou [Wed, 1 May 2019 19:48:38 +0000 (15:48 -0400)]
block: fix fio jobs for 027 and add cgroup support
Previously, the test was broken as "$fio_jobs" was considered as a
string instead of additional parameters. This is fixed here.
Second, there was an issue with earlier kernels when request lists
existed such that request_queues were never being cleaned up because
non-root blkgs took a reference on the queue. However, blkgs were being
cleaned up after the last reference to the request_queue was put back.
This creates a blktest cgroup for the fio jobs to utilize and should be
useful for catching this scenario in the future.
Jon Derrick [Fri, 3 May 2019 18:28:28 +0000 (12:28 -0600)]
blktests: Use old variable check for Bash <4.2
Bash 4.2 and above supports -v variable checks, which returns true for
set or null. Instead use an older bashism that is compatible with bash
4.1 and earlier but only returns true if the variable is set non-null.
This inherently adds a sanity check in case of null variables.
Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
Ming Lei [Fri, 26 Apr 2019 02:39:37 +0000 (10:39 +0800)]
block/028: check if T10 verification fails
When T10 verification fails, the error code of BLK_STS_PROTECTION
may not be propagated to user space, see mpage_end_io().
So seems the only reliable way for detecting the failure is to
check dmesg.
Cc: Martin K . Petersen <martin.petersen@oracle.com> Signed-off-by: Ming Lei <ming.lei@redhat.com>
[Omar: use DMESG_FILTER] Signed-off-by: Omar Sandoval <osandov@fb.com>
Ming Lei [Mon, 15 Apr 2019 01:22:29 +0000 (09:22 +0800)]
nvme/012 & 013: avoid extremely slow xfs IO
It is observed that nvme/012 may take ~17 minutes to complete on aarch64,
even worse it may trigger IO timeout on nvme-loop.
Eric and Dave replied that it is because of too small log size on small
disk.
So pass '-l size=32m' to avoid the issue.
With this patch, nvme/012 can be completed in one minute.
Cc: Eric Sandeen <esandeen@redhat.com> Cc: Dave Chinner <dchinner@redhat.com> Cc: "Darrick J. Wong" <darrick.wong@oracle.com> Cc: linux-xfs@vger.kernel.org Signed-off-by: Ming Lei <ming.lei@redhat.com>
Ming Lei [Tue, 5 Mar 2019 01:50:26 +0000 (09:50 +0800)]
blktests: add userspace IO test
Add one test to cover changes on block passthrough IO interface,
such as blk_rq_map_user(), blk_rq_map_user_iov(), blk_rq_unmap_user()
and blk_rq_map_kern().
Dongli Zhang [Thu, 14 Mar 2019 11:45:17 +0000 (19:45 +0800)]
loop/001: verify all partitions are removed
loop/001 does not test whether all partitions are removed successfully
during loop device partition scanning. As a result, the regression
introduced by 0da03cab87e6 ("loop: Fix deadlock when calling
blkdev_reread_part()") can not be detected.
The regression will generate below message in dmesg:
[ 464.414043] __loop_clr_fd: partition scan of loop0 failed (rc=-22)
and leave orphan partitions like below:
- /dev/loop0p1
- /sys/block/loop0/loop0p1
This patch verifies all partitions are removed by checking if there is
/sys/block/loopX/loopXpY left. The expected number of partitions left is 0.
Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
[Omar: check devices and sysfs for both before and after] Signed-off-by: Omar Sandoval <osandov@fb.com>
Shin'ichiro Kawasaki [Thu, 14 Mar 2019 03:46:33 +0000 (12:46 +0900)]
zbd/006: Test revalidate during other I/O requests
Since SCSI scanning occurs asynchronously, the kernel function
blk_revalidate_disk_zones() called from sd_revalidate_disk() may be
executed while write I/Os are ongoing. As a result,
blk_revalidate_disk_zones() must not cause write I/O errors by changing
zone related parameters of the device queue unless the disk has changed.
This patch allows checking this behavior and catch regressions such as
fixed by commit ccce20fc7968 ("scsi: sd_zbc: Avoid that resetting a zone
fails sporadically").
To trigger disk revalidate, fio is executed with the --loops option
causing the target device file to be closed and reopen at each loop. The
file close triggers disk revalidate and fio starts issuing I/Os before
revalidate completes, resulting in the desired simultaneous parallel
execution of write I/Os and blk_revalidate_disk_zones().
Also move the _find_first_sequential_zone() helper function from zbd/005
to zbd/rc and reuse it in the new test case for target zone selection.
Shin'ichiro Kawasaki [Tue, 5 Mar 2019 05:24:47 +0000 (14:24 +0900)]
zbd: Change sysfs path for partition devices
zbd/001 and zbd/002 test cases fail for partition devices because of
sysfs path difference between partition devices and their holder
devices. The size parameter in sysfs path is different between the
partition devices and their holder devices. The holder devices have
nr_zones parameter in sysfs but the partition devices do not.
Utilize _test_dev_is_partition() helper function and TEST_DEV_PART_SYSFS
variable to refer correct sysfs size parameter for the partition devices.
Do not refer sysfs nr_zones parameter for the partition devices. Instead,
calculate the expected nr_zones from device capacity and zone size.
Shin'ichiro Kawasaki [Tue, 5 Mar 2019 05:24:46 +0000 (14:24 +0900)]
common: Add _test_dev_is_partition() helper function
To control test conditions unique for partition devices, introduce the
_test_dev_is_partition() helper function. Refer TEST_DEV_PART_SYSFS
variable to tell if the TEST_DEV is a partition device or not.
Shin'ichiro Kawasaki [Tue, 5 Mar 2019 05:24:45 +0000 (14:24 +0900)]
check: Add TEST_DEV_PART_SYSFS variable
When partition devices are specified in TEST_DEV, TEST_DEV_SYSFS
variable points to the sysfs paths of holder devices of the partition
devices (e.g., /sys/block/sda). This sysfs path is different from the
sysfs path of the partition devices (e.g., /sys/block/sda/sda1). For
example, size parameters exist in both the holder device sysfs and
the partition device sysfs with different values.
To allow test cases to access sysfs path of the partition devices,
add TEST_DEV_PART_SYSFS variable. TEST_DEV_SYSFS is set as is to refer
the sysfs path of the holder devices. If the TEST_DEV is not a partition
device, an empty string is set to the TEST_DEV_PART_SYSFS variable.
Rename _find_sysfs_dir() function to _find_sysfs_dirs() and make it find
holder device sysfs as well as the partition device sysfs. The function
obtains the canonical sysfs path, and if the device is a partition
device, the function cuts the last device name in the canonical sysfs
path to obtain the holder device sysfs path.
Instead of trying to log in to each target port from each initiator
port, only log in to the target ports associated with the RDMA HCA
from which the log in request is sent. This avoids that the SRP
initiator driver logs the following error message when e.g.
attempting to log in to interface lo from an Ethernet interface:
"QP creation failed".
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bart Van Assche [Fri, 22 Feb 2019 22:21:10 +0000 (14:21 -0800)]
tests/srp/rc: Consider all network interfaces
Instead of giving up if a login attempt fails, try all network interfaces.
This patch ensures that login succeeds if the first network interface that
is encountered is down and another network interface is up.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bart Van Assche [Fri, 22 Feb 2019 22:05:47 +0000 (14:05 -0800)]
tests/srp/rc: Simplify log_in()
Since the 'sysfsdir' variable is identical to the 'd' variable, leave
out 'sysfsdir' and use 'd' instead. This patch does not change any
functionality.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bart Van Assche [Thu, 21 Feb 2019 23:18:58 +0000 (15:18 -0800)]
nvmeof-mp, srp: Check multipathd version
The srp tests reliably report data corruption with multipathd versions
before 0.7.0 due to a multipathd bug. Hence verify that the multipathd
version is at least 0.7.0.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
zhengbin [Wed, 20 Feb 2019 09:38:06 +0000 (17:38 +0800)]
loop/004: Need to wait for drop caches if block_size is changed
When i test blktests, loop/004 will be fail. The Key test steps
are as follows:
1. losetup -f --show /dev/sda
2. src/loblksize /dev/loop0 4096
step 1 will create /dev/loop0. after that, daemon systemd-udevd
will visit and close /dev/loop0 who will add and delete
i_mapping->nrpages.
PS: the operation of systemd-udevd is in the background.
step 2 will set /dev/loop0 block size, linux kernel function
loop_set_block_size has been changed since commit 5db470e229e2
("loop: drop caches if offset or block_size are changed")
+ if (lo->lo_queue->limits.logical_block_size != arg &&
+ lo->lo_device->bd_inode->i_mapping->nrpages) {
+ err = -EAGAIN;
+ pr_warn("%s: loop%d (%s) has still dirty pages\n",
+ __func__, lo->lo_number, lo->lo_file_name,
+ lo->lo_device->bd_inode->i_mapping->nrpages);
+ goto out_unfreeze;
+ }
--->maybe systemd-udevd just visited /dev/loop0, this leads to failure
Shin'ichiro Kawasaki [Wed, 20 Feb 2019 08:12:28 +0000 (17:12 +0900)]
zbd/004: Add zone condition "Closed" for sequential write required zones
The test case zbd/004 executes write operations for two sequential write
required zones across the zone boundary between them. After the write
operation, the second zone has non-zero write pointer. At that status,
the zone can have not only "Implicit Open" condition but also "Closed"
condition based on zone status management logic of the block zoned device.
Add "Closed" condition to the zone condition check logic in zbd/004. Add
ZONE_COND_CLOSED constant definition in zbd/rc.
Masato Suzuki [Wed, 20 Feb 2019 08:12:27 +0000 (17:12 +0900)]
block/024: Increase I/O time
The total time spent on write I/Os for the 3 dd executions will be at most
1500 * 3 * 0.5ms = 2250ms, that is, 2.25s. Due to system overhead and
timer triggers, a total write I/O time larger than this value is generally
reported through I/O stat. However, for a system with very low overhead
and/or very precise timers, the reported value can be under 2.5s, leading
to a rounded value equal to 2s, and not the 3s expected.
To avoid the test to fail due to this problem, increase the number of write
I/Os executed so that the total exact I/O time exceeds 2.5s, leading to a
rounded value equal to 3s. The change increases the number of I/Os of the
second and third dd calls to 1800, leading to an exact write I/O time of
(1500 + 1800 * 2) * 0.5 ms = 2.55s.
Omar Sandoval [Wed, 13 Feb 2019 20:56:48 +0000 (12:56 -0800)]
travis: streamline config
- Reorder the testing matrix to more or less the order of importance.
- Don't install libc and libstdc++ explicitly; it's not necessary and
for some reason it installs a bunch of other packages.
- We only test on Linux, so get rid of the conditional.
- Don't error out if apt update fails, since that seems to happen every
now and then because some repository changed keys.
Omar Sandoval [Wed, 13 Feb 2019 20:05:51 +0000 (12:05 -0800)]
travis: run make check
We want to run shellcheck and the other sanity checks on all pushes.
Install the latest stable version of shellcheck, as old versions are
known to have false positives.
Bart Van Assche [Wed, 2 Jan 2019 03:14:37 +0000 (19:14 -0800)]
tests/srp/rc: Increase maximum request size
A new feature for the SRP initiator and target drivers in kernel v5.0-rc1
is that both the initiator and target drivers support immediate data.
Since the default maximum immediate data size is 8 KB, increase the target
maximum request size such that the SRP initiator can send write requests
with up to 8 KB of immediate data.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bart Van Assche [Thu, 13 Dec 2018 21:49:20 +0000 (13:49 -0800)]
common/multipath-over-rdma: Skip teardown if $debug has been set
A convenient way to debug the srp and nvmeof-mp tests scripts is to set
the debug variable in common/multipath-over-rdma. Examining what went
wrong during a test is only possible if teardown() is skipped after a
test failure. Make sure that this is the case.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>