Jim Harris fa952fcd5a test/nbd: use dd to confirm I/O path is ready
We see a delay, especially in VMs, between when the
block layer reports the nbd device as ready (with
non-zero size) and when I/O will complete successfully
without an -ENOSPC error.

So to compensate, dd the first block of the nbd
device to a temporary file, then check the size of that
file to confirm the nbd device is ready for I/O.
Note that dd with a zero-sized input file will always
complete successfully just with 0 blocks transferred.
So we cannot rely on the return value of dd - we check
the size of the written file instead.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I84ea3b663668a27021619cbee502769af4922937

Reviewed-on: https://review.gerrithub.io/385936
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-10 17:00:58 -05:00
..
2017-09-11 18:25:17 -04:00
2017-10-24 17:19:44 -04:00
2016-08-04 13:15:33 -07:00