]> www.infradead.org Git - users/sagi/blktests.git/log
users/sagi/blktests.git
7 years agonbd: kill the nbd.pid file on cleanup
Josef Bacik [Wed, 16 May 2018 16:03:57 +0000 (12:03 -0400)]
nbd: kill the nbd.pid file on cleanup

Just in case, we don't want this to be left laying around.

Signed-off-by: Josef Bacik <jbacik@fb.com>
7 years agonbd/001: use -L for nbd-client
Omar Sandoval [Mon, 11 Jun 2018 20:15:11 +0000 (13:15 -0700)]
nbd/001: use -L for nbd-client

Newer versions of nbd-client always use netlink, which makes the
nbdsetsize test program fail. Use the -L (-nonetlink) option to force
the ioctl interface. This means that this test can't be run with older
versions of nbd-client anymore, but, eh.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agonbd: clean up common and nbd/001
Omar Sandoval [Mon, 11 Jun 2018 18:51:37 +0000 (11:51 -0700)]
nbd: clean up common and nbd/001

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock/008: don't try to offline all CPUs if all CPUs are hotpluggable
Omar Sandoval [Mon, 11 Jun 2018 18:31:57 +0000 (11:31 -0700)]
block/008: don't try to offline all CPUs if all CPUs are hotpluggable

Chen Rong reported that if CPU0 is hotpluggable (because we booted with
cpu0_hotplug or CONFIG_BOOTPARAM_HOTPLUG_CPU0 was enabled), block/008
can try to offline all CPUs at once, which isn't allowed. Fix it by
repeatedly offlining as many CPUs as is allowed and onlining all CPUs,
instead of the previous approach of randomly onlining/offlining. This is
better than the previous approach because we won't try to online already
online CPUs and offline already offline CPUs. Closes #23.

Reported-by: Chen Rong <chenr.fnst@cn.fujitsu.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agonvme/00[234]: clean up modules after running
Chaitanya Kulkarni [Sun, 3 Jun 2018 19:01:26 +0000 (15:01 -0400)]
nvme/00[234]: clean up modules after running

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agoblock/011: don't use sysfs for device disabling
Keith Busch [Mon, 4 Jun 2018 22:51:41 +0000 (16:51 -0600)]
block/011: don't use sysfs for device disabling

The PCI sysfs interface may not be a dependable method for toggling the
PCI device state to trigger the timeouts. This patch goes directly to
the config space to make device failure occur.

Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <keith.busch@intel.com>
7 years agonvme/001: fix filter and golden output
Johannes Thumshirn [Wed, 30 May 2018 08:22:26 +0000 (10:22 +0200)]
nvme/001: fix filter and golden output

Adjust filter and golden output to consider the following:
* Normalize white space between PID and CPU#
* Nomalize flags
* Normalize slba

Fixes #21.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
[Omar: normalize spaces after PID and timestamp differently]
Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock/020: don't pass shared_tags to null_blk
Ming Lei [Wed, 30 May 2018 05:10:38 +0000 (13:10 +0800)]
block/020: don't pass shared_tags to null_blk

The issue isn't related to shared tags, and it can be triggered if
'shared_tags' is set to 0.

Remove this so that this test can run on older kernels, and to avoid
misunderstandings.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
7 years agoblock/020: test IO req allocation
Ming Lei [Tue, 22 May 2018 11:12:49 +0000 (19:12 +0800)]
block/020: test IO req allocation

IO request allocation may hang for ever if the allocation process
migrages. This test covers the request allocation code path.

The following patch can fix this issue on linus kernel:

https://marc.info/?l=linux-block&m=152671586923185&w=2

Signed-off-by: Ming Lei <ming.lei@redhat.com>
[Omar: clarify comment and description]
Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoscsi_debug: settle udev before removing scsi_debug
Omar Sandoval [Thu, 24 May 2018 00:18:57 +0000 (17:18 -0700)]
scsi_debug: settle udev before removing scsi_debug

I'm still seeing "modprobe: FATAL: Module scsi_debug is in use." errors.
At least on v4.17-rc6, this gets rid of them. Fixes GitHub issue #17.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoDocumentation: document custom config setup
Omar Sandoval [Wed, 23 May 2018 00:11:11 +0000 (17:11 -0700)]
Documentation: document custom config setup

To quote Johannes Thumshirn's patch which inspired this one: "The config
file is bash and it gets sourced, so all bash magic is doable in there
as well. Document it so others don't have to re-discover this gem as
well."

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblktests: use consistent helper returns
Chaitanya Kulkarni [Tue, 22 May 2018 07:36:11 +0000 (03:36 -0400)]
blktests: use consistent helper returns

This is a cleanup patch which uses consistent return values for helper
functions.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agoMerge pull request #20 from dublio/master
Omar Sandoval [Mon, 21 May 2018 17:20:30 +0000 (10:20 -0700)]
Merge pull request #20 from dublio/master

remove null_blk module after test finished

7 years agoblock/010: remove null_blk module after test finished
weiping zhang [Mon, 21 May 2018 14:56:38 +0000 (22:56 +0800)]
block/010: remove null_blk module after test finished

Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
7 years agoblktests: use global configfs variable
Chaitanya Kulkarni [Tue, 8 May 2018 05:45:32 +0000 (01:45 -0400)]
blktests: use global configfs variable

This patch introduces a global variable to hold the
configfs nvmet path. Now we don't need repetitive
local variables to hold the path and testcases
can use the newly introduced variable if needed.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agonvme: add test for resetting the loopback controller
Johannes Thumshirn [Thu, 3 May 2018 15:00:54 +0000 (17:00 +0200)]
nvme: add test for resetting the loopback controller

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
7 years agonvme: fix counting the target port
Johannes Thumshirn [Thu, 3 May 2018 15:00:53 +0000 (17:00 +0200)]
nvme: fix counting the target port

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
7 years agonvme: move _find_nvme_loop_dev to common code
Johannes Thumshirn [Thu, 3 May 2018 15:00:52 +0000 (17:00 +0200)]
nvme: move _find_nvme_loop_dev to common code

_find_nvme_loop_dev is quite useful for all nvme test, so move it over
to common code.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
[Omar: make variables local while we're here]
Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agonvme/004: fix _find_nvme_loop_dev and cat
Omar Sandoval [Mon, 14 May 2018 19:52:38 +0000 (12:52 -0700)]
nvme/004: fix _find_nvme_loop_dev and cat

We were looking at the wrong paths. Based on a patch from Johannes
Thumshirn.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock/017: update comment now that patch is upstream
Omar Sandoval [Mon, 7 May 2018 22:01:43 +0000 (15:01 -0700)]
block/017: update comment now that patch is upstream

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agocommon/rc: fix _have_tracefs
Omar Sandoval [Fri, 27 Apr 2018 00:22:59 +0000 (17:22 -0700)]
common/rc: fix _have_tracefs

Apparently tracefs is lazily mounted, so try to stat
/sys/kernel/debug/tracing/trace before we check if it's mounted in order
to avoid false negatives.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoClarify difference between QUICK and TIMED
Omar Sandoval [Fri, 27 Apr 2018 00:12:55 +0000 (17:12 -0700)]
Clarify difference between QUICK and TIMED

Add more documentation for TIMED, make sure QUICK and TIMED can't be
combined, and fix a bug where QUICK and TIMED would leak between tests.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock/019: use explicit --runtime instead of overriding TIMEOUT
Omar Sandoval [Thu, 26 Apr 2018 23:47:47 +0000 (16:47 -0700)]
block/019: use explicit --runtime instead of overriding TIMEOUT

This is really a QUICK test, not a TIMED test. Use --runtime and
document that _run_fio can handle that.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoAdd surprise removal block test
Keith Busch [Thu, 26 Apr 2018 22:52:24 +0000 (16:52 -0600)]
Add surprise removal block test

This test is for PCI devices in a surprise remove capable slot and tests
how well the drivers and kernel handle losing the link to that device.

The test finds the PCI Express Capability register of the pci slot a block
device is in, then at offset 0x10 (the Link Control Register) writes a 1
to bit 4 (Link Disable). This occurs unbeknownst to any of the drivers,
just like a surprise removal. Drivers will find out about this through
the pcie hotplug handler, at which point it's too late to communicate
with the device, therfore testing how well we cope with the condition.

The link is reenabled at the end of the test.

Note, this is currently incompatible with NVMe Subsystems when
CONFIG_NVME_MULTIPATH since the /dev/nvme*n* names don't have a pci
parent in sysfs.

Signed-off-by: Keith Busch <keith.busch@intel.com>
7 years agoblock: add a test for iostats time spent doing I/O
Omar Sandoval [Thu, 26 Apr 2018 22:36:57 +0000 (15:36 -0700)]
block: add a test for iostats time spent doing I/O

This is to test my request timestamp rework patch series.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock/017: also check /sys/block/$dev/stat
Omar Sandoval [Thu, 26 Apr 2018 22:06:08 +0000 (15:06 -0700)]
block/017: also check /sys/block/$dev/stat

This should have the same value as /proc/diskstats.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock: add regression test for inflight counter
Omar Sandoval [Thu, 26 Apr 2018 07:18:22 +0000 (00:18 -0700)]
block: add regression test for inflight counter

This is a basic sanity check for the inflight counter, which already
turned up a bug.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoDocument that contributors should run `make check`
Omar Sandoval [Wed, 25 Apr 2018 23:09:55 +0000 (16:09 -0700)]
Document that contributors should run `make check`

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoMakefile: check for leftover TODO comments in new tests
Omar Sandoval [Wed, 25 Apr 2018 22:59:16 +0000 (15:59 -0700)]
Makefile: check for leftover TODO comments in new tests

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoMakefile: rename shellcheck target to check
Omar Sandoval [Wed, 25 Apr 2018 22:57:10 +0000 (15:57 -0700)]
Makefile: rename shellcheck target to check

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoIgnore some shellcheck warnings
Omar Sandoval [Wed, 25 Apr 2018 22:35:45 +0000 (15:35 -0700)]
Ignore some shellcheck warnings

This is the simplest way to get schedulers, and it'll always work, so
ignore the recommendation to do something fancier.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agonvme: fix _create_nvmet_port
Omar Sandoval [Wed, 25 Apr 2018 22:15:43 +0000 (15:15 -0700)]
nvme: fix _create_nvmet_port

First of all, we get a shellcheck warning:

common/nvme:32:18: note: Use find instead of ls to better handle
non-alphanumeric filenames. [SC2012]

Secondly, it's not _technically_ correct to just count the number of
ports, since there could be just one port numbered 1. Instead, find the
first free port.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agocheck: fix shellcheck warning on missing config
Omar Sandoval [Wed, 25 Apr 2018 22:08:43 +0000 (15:08 -0700)]
check: fix shellcheck warning on missing config

The config is optional, and shellcheck isn't smart enough to notice that
it's guarded by a readable test.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoUpdate comments referring to upstreamed patches
Omar Sandoval [Wed, 25 Apr 2018 16:10:23 +0000 (09:10 -0700)]
Update comments referring to upstreamed patches

We can refer to the commit ids now that they're in mainline.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agonvme: add a regression test for UUID ns descriptops
Johannes Thumshirn [Tue, 24 Apr 2018 16:12:51 +0000 (10:12 -0600)]
nvme: add a regression test for UUID ns descriptops

Add a regression test for NVMe 1.3's UUID Namespace Descriptors.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
7 years agonvme: add uuid parameter to _create_nvmet_subsystem
Johannes Thumshirn [Tue, 24 Apr 2018 16:12:50 +0000 (10:12 -0600)]
nvme: add uuid parameter to _create_nvmet_subsystem

Add an optional UUID parameter to _create_nvmet_subsystem().

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
7 years agonvme: fix counting available ports
Johannes Thumshirn [Tue, 24 Apr 2018 16:12:49 +0000 (10:12 -0600)]
nvme: fix counting available ports

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
7 years agoscsi/004: set delay in nanoseconds instead of jiffies
Omar Sandoval [Tue, 24 Apr 2018 23:09:13 +0000 (16:09 -0700)]
scsi/004: set delay in nanoseconds instead of jiffies

Steffen pointed out that "the timeout should be sufficiently larger than
scsi_debug/delay, in order not to run into the command timeout". The
delay parameter is in jiffies, so on s390 with the default HZ=100, 1000
jiffies are 10 seconds, more than the blk-mq timeout. Just use ndelay
instead.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock: add regression test for interruptible wait
Omar Sandoval [Tue, 24 Apr 2018 22:38:33 +0000 (15:38 -0700)]
block: add regression test for interruptible wait

Add a regression test for 1dc3039bc87a ("block: do not use interruptible
wait anywhere") using null-blk.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoscsi/004: set a shorter device timeout
Omar Sandoval [Thu, 19 Apr 2018 20:16:30 +0000 (13:16 -0700)]
scsi/004: set a shorter device timeout

With the default timeout, the test takes a long time to run for no good
reason.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoscsi/004: add regression test for false BLK_STS_OK with non good SAM status
Steffen Maier [Tue, 17 Apr 2018 09:03:37 +0000 (11:03 +0200)]
scsi/004: add regression test for false BLK_STS_OK with non good SAM status

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Steffen Maier <maier@linux.ibm.com>
7 years agoMerge pull request #16 from josefbacik/master
Omar Sandoval [Fri, 13 Apr 2018 20:48:44 +0000 (13:48 -0700)]
Merge pull request #16 from josefbacik/master

Add our first NBD test.

7 years agoblktests: add nbd test for online resize
Josef Bacik [Fri, 13 Apr 2018 16:07:48 +0000 (12:07 -0400)]
blktests: add nbd test for online resize

This tests resizing a connected nbd device.  We connect to the existing
10gig device, and resize it online to 1gig, and make sure lsblk and
parted (which use different size determination methods) both report the
correctly updated size.

Signed-off-by: Josef Bacik <jbacik@fb.com>
[Omar: squash commits, add note on required patches]
Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblktests: add nbd infrastructure
Josef Bacik [Fri, 13 Apr 2018 16:05:12 +0000 (12:05 -0400)]
blktests: add nbd infrastructure

NBD needs to setup a server and such, so add all the supporting helpers
so we can start building tests for nbd.

Signed-off-by: Josef Bacik <jbacik@fb.com>
[Omar: fix variable quoting]
Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoDocumentation: clarify that TEST_DEVS is optional
Omar Sandoval [Tue, 10 Apr 2018 18:13:38 +0000 (11:13 -0700)]
Documentation: clarify that TEST_DEVS is optional

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agotest/nvme/003: add test case for patch "nvme: don't send keep-alives to the discovery...
Johannes Thumshirn [Tue, 27 Mar 2018 09:21:09 +0000 (11:21 +0200)]
test/nvme/003: add test case for patch "nvme: don't send keep-alives to the discovery controller"

Add a regression test for the patch titled "nvme: don't send
keep-alives to the discovery controller".

This patch creates a local loopback nvme target and then connects to
it. If the patch is not applied we see two error messages in dmesg:
"failed nvme_keep_alive_end_io error=" from the nvme host and "nvmet:
unsupported cmd 24" from the nvme target. If the patch is applied
dmesg is quiet.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
7 years agoMerge pull request #14 from morbidrsa/nvme/002
Omar Sandoval [Sat, 7 Apr 2018 03:52:54 +0000 (20:52 -0700)]
Merge pull request #14 from morbidrsa/nvme/002

This pull adds a new test-case to the nvme test group for testing big
discovery log pages.

It is inspired by a bug triggered in the user-space 'nvme discover' with
a non Linux target which set's an non 0 MDTS (Maximum Data Transfer
Size) value causing nvme cli to fail the discovery.

There isn't a userspace fix yet, but it's still a nice scalability test.

7 years agotest/nvme/002: Test big discovery log pages
Johannes Thumshirn [Wed, 21 Mar 2018 12:55:48 +0000 (13:55 +0100)]
test/nvme/002: Test big discovery log pages

Test nvme discovery with many (1000) subsystems so the discovery log
page exceeds 4k.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
7 years agocommon/nvme: add helper functions to define a nvme target
Johannes Thumshirn [Wed, 21 Mar 2018 12:48:21 +0000 (13:48 +0100)]
common/nvme: add helper functions to define a nvme target

Add:
- _create_nvmet_port()
- _remove_nvmet_port()
- _create_nvmet_subsystem()
- _remove_nvmet_subsytem()
- _add_nvmet_subsys_to_port()
- _remove_nvmet_subsystem_from_port()

which serve as helper functions to create new nvmet ports and
subsystems for NVMe over Fabrics focused test cases.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
7 years agocommon/rc: add _have_configfs
Johannes Thumshirn [Wed, 21 Mar 2018 12:13:05 +0000 (13:13 +0100)]
common/rc: add _have_configfs

Add a _have_configfs() helper function checking if we have configfs
mounted similar to the already present _have_tracefs().

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
7 years agoFix some shellcheck warnings
Omar Sandoval [Fri, 6 Apr 2018 23:40:35 +0000 (16:40 -0700)]
Fix some shellcheck warnings

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoloop: add ioctl lock imbalance regression test
Omar Sandoval [Fri, 6 Apr 2018 16:58:43 +0000 (09:58 -0700)]
loop: add ioctl lock imbalance regression test

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock/013: fix shellcheck warning
Omar Sandoval [Wed, 28 Mar 2018 19:55:17 +0000 (12:55 -0700)]
block/013: fix shellcheck warning

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoRename sg group to scsi
Omar Sandoval [Wed, 28 Mar 2018 19:47:28 +0000 (12:47 -0700)]
Rename sg group to scsi

sg/003 is really an sd test, and there's no point in having separate
test group for sd.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoMerge pull request #13 from jeremycline/sg-ro-reread-part
Omar Sandoval [Wed, 28 Mar 2018 19:26:53 +0000 (12:26 -0700)]
Merge pull request #13 from jeremycline/sg-ro-reread-part

sg: test for patch "Keep disk read-only when re-reading partition"

7 years agosg: test for patch "Keep disk read-only when re-reading partition"
Jeremy Cline [Tue, 6 Mar 2018 19:22:33 +0000 (14:22 -0500)]
sg: test for patch "Keep disk read-only when re-reading partition"

Add a regression test for the patch "scsi: sd: Keep disk read-only when
re-reading partition" which ensures re-reading a disk's partition table
doesn't change its read-only flag.

Signed-off-by: Jeremy Cline <jeremy@jcline.org>
7 years agoMerge pull request #12 from morbidrsa/dir-locals
Omar Sandoval [Thu, 1 Mar 2018 21:18:16 +0000 (13:18 -0800)]
Merge pull request #12 from morbidrsa/dir-locals

dir-locals.el: add emacs local variable config

7 years agodir-locals.el: add emacs local variable config
Johannes Thumshirn [Thu, 1 Mar 2018 12:09:09 +0000 (13:09 +0100)]
dir-locals.el: add emacs local variable config

Add a dir-locals.el so Emacs will do the right thing when editing
blktests code and test cases.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
7 years agoblock/014: test all I/O schedulers
Omar Sandoval [Wed, 28 Feb 2018 18:17:34 +0000 (10:17 -0800)]
block/014: test all I/O schedulers

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock: add blk-mq requeue test
Omar Sandoval [Wed, 28 Feb 2018 18:11:12 +0000 (10:11 -0800)]
block: add blk-mq requeue test

This test is pretty trivial but it reproduces the hang fixed by
ba989a01469d ("block: kyber: fix domain token leak during requeue").

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock/014: fix comment about timeout frequency
Omar Sandoval [Wed, 28 Feb 2018 17:48:50 +0000 (09:48 -0800)]
block/014: fix comment about timeout frequency

An earlier version had interval 2 and probability 100%, but then I
changed it to interval 1 and probability 50%.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock: add smoke test for timeouts
Omar Sandoval [Wed, 28 Feb 2018 08:30:32 +0000 (00:30 -0800)]
block: add smoke test for timeouts

This doesn't do much, it just makes sure that the timeouts are executed
without hanging or crashing.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoMerge pull request #11 from morbidrsa/nvme-tracepoints
Omar Sandoval [Wed, 28 Feb 2018 07:41:39 +0000 (23:41 -0800)]
Merge pull request #11 from morbidrsa/nvme-tracepoints

Add the first NVMe-specific test.

7 years agotests/nvme: add NVMe test group and tracepoint test
Johannes Thumshirn [Fri, 16 Feb 2018 14:19:16 +0000 (15:19 +0100)]
tests/nvme: add NVMe test group and tracepoint test

Add a NVMe test group and a tracepoint test as the first test case.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoMerge pull request #10 from felixsch/cpuhotplug-fix
Omar Sandoval [Tue, 13 Feb 2018 19:51:59 +0000 (11:51 -0800)]
Merge pull request #10 from felixsch/cpuhotplug-fix

Append not replace cpus to cpus hotplug list

7 years agoAppend cpus to hotplug list instead of selecting the last one
Felix Schnizlein [Tue, 2 Jan 2018 09:18:54 +0000 (10:18 +0100)]
Append cpus to hotplug list instead of selecting the last one

Due to a missing plus, available cpus where not collected but only
the last possible one was used.

Signed-off-by: Felix Schnizlein <fschnizlein@suse.com>
7 years agoblock/013: Add test for BLKRRPART ioctl
xiao yang [Tue, 19 Dec 2017 10:30:23 +0000 (18:30 +0800)]
block/013: Add test for BLKRRPART ioctl

If the entire block device is formatted with a filesystem and
mounted, running "blockdev --rereadpt" should fail and return
EBUSY instead of pass.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: xiao yang <yangx.jy@cn.fujitsu.com>
[Omar: simplified a bit]
Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agocommon/rc: allow 5-digit domains in _get_pci_dev_from_blkdev
Jon Derrick [Mon, 27 Nov 2017 21:49:05 +0000 (14:49 -0700)]
common/rc: allow 5-digit domains in _get_pci_dev_from_blkdev

At least one driver (VMD) uses 32-bit pci domains, but is effectively
limited to 5-digit domains. Allow tests to access devices with 4-5 digit
domains.

Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
7 years agoMerge pull request #9 from yide1728/yizhang-branch
Omar Sandoval [Mon, 27 Nov 2017 19:45:02 +0000 (11:45 -0800)]
Merge pull request #9 from yide1728/yizhang-branch

Add missing _have_fio to a few tests.

7 years agoblock/006, block/008, block/010: add _have_fio to require function
Yi Zhang [Wed, 22 Nov 2017 07:34:56 +0000 (15:34 +0800)]
block/006, block/008, block/010: add _have_fio to require function

Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
7 years agoloop/003: use a C program instead of bash
Omar Sandoval [Fri, 10 Nov 2017 21:30:49 +0000 (13:30 -0800)]
loop/003: use a C program instead of bash

shellcheck can't parse the {FD} syntax, and doing it in bash adds a
bunch of extra overhead to the loop, anyways.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agosrc: fix loblksize usage message
Omar Sandoval [Fri, 10 Nov 2017 21:23:41 +0000 (13:23 -0800)]
src: fix loblksize usage message

BLKSIZE is not optional.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agosrc: add missing copyright header to loblksize
Omar Sandoval [Fri, 10 Nov 2017 21:20:51 +0000 (13:20 -0800)]
src: add missing copyright header to loblksize

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoshellcheck: ignore SC2119
Omar Sandoval [Fri, 10 Nov 2017 21:18:33 +0000 (13:18 -0800)]
shellcheck: ignore SC2119

It was causing this useless note:

tests/block/002:33:7: note: Use _init_scsi_debug "$@" if function's $1 should mean script's $1. [SC2119]

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock/012: fix xfs_io error mismatch
Omar Sandoval [Fri, 10 Nov 2017 19:07:13 +0000 (11:07 -0800)]
block/012: fix xfs_io error mismatch

Old versions of xfs_io (like David must be using) use pwrite64() instead
of pwrite(), which was causing an output mismatch on my newer version.
Pull in _filter_xfs_io_error from xfstests to fix it. While we're here,
add a slightly more descriptive description.

Fixes: 3aeec46f048b ("block/012: add test for BLKROSET/BLKROGET ioctls")
Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoMerge pull request #7 from ddiss/ro_get_set
Omar Sandoval [Fri, 10 Nov 2017 18:54:11 +0000 (10:54 -0800)]
Merge pull request #7 from ddiss/ro_get_set

Compiler warning fix and new test for BLKRO{SET,GET}.

7 years agoblock/012: add test for BLKROSET/BLKROGET ioctls
David Disseldorp [Wed, 8 Nov 2017 18:07:46 +0000 (19:07 +0100)]
block/012: add test for BLKROSET/BLKROGET ioctls

Use blockdev --setro/--getro to manipulate the read-only state of a test
device, and confirm that writes fail while set.

Signed-off-by: David Disseldorp <ddiss@suse.de>
7 years agosg: fix compiler warning
David Disseldorp [Wed, 8 Nov 2017 16:42:17 +0000 (17:42 +0100)]
sg: fix compiler warning

sg/dxfer-from-dev.c: In function ‘main’:
sg/dxfer-from-dev.c:57:1: warning: control reaches end of non-void
  function [-Wreturn-type]

Signed-off-by: David Disseldorp <ddiss@suse.de>
7 years agoMerge pull request #6 from nishita28/master
Omar Sandoval [Mon, 6 Nov 2017 22:15:10 +0000 (14:15 -0800)]
Merge pull request #6 from nishita28/master

add: Check page-cache coherency after BLKDISCARD

7 years agoadd: Check page-cache coherency after BLKDISCARD
Nishita Borkar [Thu, 2 Nov 2017 20:35:17 +0000 (16:35 -0400)]
add: Check page-cache coherency after BLKDISCARD

Regression test for fix https://lkml.org/lkml/2017/3/22/789
Page cache should be dropped after successful discard

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Nishita Borkar <nishita.borkar@oracle.com>
7 years agocommon/rc: fix _get_pci_dev_from_blkdev
Omar Sandoval [Tue, 24 Oct 2017 21:01:29 +0000 (14:01 -0700)]
common/rc: fix _get_pci_dev_from_blkdev

The device path might include multiple PCI devices, like the port.
Always get the last one.

Fixes #5.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoloop: update block size tests for new ioctl
Omar Sandoval [Thu, 7 Sep 2017 17:58:21 +0000 (10:58 -0700)]
loop: update block size tests for new ioctl

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoloop: test direct I/O mode + custom block size
Omar Sandoval [Fri, 18 Aug 2017 19:22:58 +0000 (12:22 -0700)]
loop: test direct I/O mode + custom block size

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoloop/002: check that we can read and write
Omar Sandoval [Fri, 18 Aug 2017 19:18:07 +0000 (12:18 -0700)]
loop/002: check that we can read and write

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoloop/002: check physical block size and minimum io size as well
Omar Sandoval [Fri, 18 Aug 2017 18:38:28 +0000 (11:38 -0700)]
loop/002: check physical block size and minimum io size as well

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoMerge pull request #3 from liangxiao1/master
Omar Sandoval [Tue, 22 Aug 2017 03:51:54 +0000 (20:51 -0700)]
Merge pull request #3 from liangxiao1/master

Check if null_block supports blocking in block/006

8 years agoblock/006: added checking if null_blk has blocking flag
Xiao Liang [Tue, 22 Aug 2017 02:51:21 +0000 (10:51 +0800)]
block/006: added checking if null_blk has blocking flag

There is no 'blocking' parameter on some branches, eg. RHEL7.

Signed-off-by: Xiao Liang <xiliang@redhat.com>
8 years agoloop: test if closing an unbound device is too slow
Omar Sandoval [Fri, 18 Aug 2017 08:01:11 +0000 (01:01 -0700)]
loop: test if closing an unbound device is too slow

Based on a patch from James Wang.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoloop: test LO_FLAGS_BLOCKSIZE
Omar Sandoval [Fri, 18 Aug 2017 06:22:22 +0000 (23:22 -0700)]
loop: test LO_FLAGS_BLOCKSIZE

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agosrc: compile with -Wall
Omar Sandoval [Fri, 18 Aug 2017 05:37:33 +0000 (22:37 -0700)]
src: compile with -Wall

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agonew: clarify what CHECK_DMESG does
Omar Sandoval [Wed, 16 Aug 2017 06:00:55 +0000 (23:00 -0700)]
new: clarify what CHECK_DMESG does

It only checks for scary messages in dmesg, not random messages.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocommon/scsi_debug: make helpers more useful
Omar Sandoval [Wed, 16 Aug 2017 05:36:43 +0000 (22:36 -0700)]
common/scsi_debug: make helpers more useful

Generalize the helpers to make them more useful: instead of always
setting up one device, it now takes arbitrary module parameters and sets
up as many devices as requested.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agosg/001: remove unused scsi_debug dependency
Omar Sandoval [Wed, 16 Aug 2017 05:36:03 +0000 (22:36 -0700)]
sg/001: remove unused scsi_debug dependency

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoblock/001: require sd_mod and sr_mod
Omar Sandoval [Wed, 16 Aug 2017 05:34:30 +0000 (22:34 -0700)]
block/001: require sd_mod and sr_mod

This test doesn't do anything interesting without those.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agosg: add regression test for patch scsi: sg: fix SG_DXFER_FROM_DEV transfers
Johannes Thumshirn [Thu, 6 Jul 2017 12:09:21 +0000 (14:09 +0200)]
sg: add regression test for patch scsi: sg: fix SG_DXFER_FROM_DEV transfers

Add a regression test for the patch titled "scsi: sg: fix
SG_DXFER_FROM_DEV transfers" which reassembles the syscalls done by Nero
Burning ROM to discover CD and DVD burners.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
[Omar: rename _get_sg_from_blockdev to _get_test_dev_sg and fix sg/001]
Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agotests: use nproc to get number of CPUs for fio jobs
Johannes Thumshirn [Fri, 30 Jun 2017 09:07:35 +0000 (11:07 +0200)]
tests: use nproc to get number of CPUs for fio jobs

Use nproc to get number of CPUs for fio jobs and introduce
_run_fio_rand_io helper for parallel IO which we don't really care about
the details and just want some IO.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
8 years agoblock/011: Perform PCI reset while doing IO
Johannes Thumshirn [Tue, 27 Jun 2017 13:42:57 +0000 (15:42 +0200)]
block/011: Perform PCI reset while doing IO

This test-case performs I/O with fio while doing PCI disable/enable
cycles.

In the results we don't care for I/O errors but for hiccups in dmesg only.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
8 years agorc: add helpers to handle PCI test devices
Johannes Thumshirn [Tue, 27 Jun 2017 13:42:56 +0000 (15:42 +0200)]
rc: add helpers to handle PCI test devices

Add two helpers to check whether a device is attached via PCI and to get the
PCI device from a TEST_DEV

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
8 years agorc: use grep -q instead of redirecting to /dev/null
Omar Sandoval [Mon, 26 Jun 2017 21:25:44 +0000 (14:25 -0700)]
rc: use grep -q instead of redirecting to /dev/null

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoblock/010: only run if null_blk supports shared_tags
Omar Sandoval [Mon, 26 Jun 2017 21:13:21 +0000 (14:13 -0700)]
block/010: only run if null_blk supports shared_tags

Signed-off-by: Omar Sandoval <osandov@fb.com>