Laszlo Ersek
2022-Feb-04 08:18 UTC
[Libguestfs] [libnbd PATCH] copy: Fail nbdcopy if NBD read or write fails
On 02/03/22 14:49, Eric Blake wrote:> On Thu, Feb 03, 2022 at 11:52:43AM +0100, Laszlo Ersek wrote:>> What's the reason to test writing if the read test fails first? > > When running the testsuite, it's nice to uncover as many cases as > possible in a single run, rather than patching one early failure just > to encounter another failure on the next test run that was previously > skipped because of the first failure.This is a great idea, and I wish it worked consistently *between* separate test cases too. I distinctly remember connect-tcp6 failing for me (earlier), and myself dismissing it, and assuming everything else was OK. Then, in the RHEL9 Brew environment, where connect-tcp6 was specifically disabled, I was hit by the actual test failures :/ (And there was no easy way to skip connect-tcp6.)> One way to do this is to write > two separate tests (one that tests failed reads from NBD as source, a > second that tests failed writes to NBD as destination), but writing > two nearly-identical .sh files is more boilerplate overhead than just > jamming related tests into the same .sh script.Right, but this is exactly what I wish worked -- but IME doesn't always work.> >> >> Looks OK to me, but should be definitely reviewed by another reviewer. > > Looks like Rich has given ACK as well. >Thanks! Laszlo
Richard W.M. Jones
2022-Feb-08 13:43 UTC
[Libguestfs] [libnbd PATCH] copy: Fail nbdcopy if NBD read or write fails
On Fri, Feb 04, 2022 at 09:18:07AM +0100, Laszlo Ersek wrote:> (And there was no easy way to skip connect-tcp6.)Wwe use this in libnbd.spec: https://src.fedoraproject.org/rpms/libnbd/blob/rawhide/f/libnbd.spec#_214 In libguestfs we have a whole infrastructure for skipping tests by setting $SKIP_* variables in localenv. https://libguestfs.org/guestfs-building.1.html#local-files https://github.com/libguestfs/libguestfs/blob/0553f90462f456b1fe7100346aa1a4f12fccb288/tests/test-functions.sh#L39 For libnbd/nbdkit it might be possible to automate it in the same way with tests/functions.sh.in + $0, but it's not implemented at the moment. Of course it'd be better if the tests didn't fail :-) Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW