[Libguestfs] [PATCH v2 nbdkit 5/5] tests: Add a helper function which waits for nbdkit to start up.

Richard W.M. Jones rjones at redhat.com
Thu Sep 13 18:54:11 UTC 2018


On Thu, Sep 13, 2018 at 01:35:11PM -0500, Eric Blake wrote:
> 
> ...and thus this should be "$(cat "$pidfile")"

Woah wait, this actually works?!

(Tests ...)

It does!  Never knew that.

I'll fix this ...

> >+++ b/tests/test-ip.sh
> 
> >-if ! test -f ip.pid; then
> >-    echo "$0: PID file was not created"
> >-    exit 1
> >-fi
> >-
> >+start_nbdkit -P ip.pid -p $port example1
> >  pid="$(cat ip.pid)"
> >  # Check the process exists.
>     kill -s 0 $pid
> 
> Hmm. Should the 'kill -s 0 $pid' be moved into the common code for
> all tests to benefit from (detecting early crashes where nbdkit
> started and created the pidfile, but then died)?  If so, you don't
> need $pid in this file any longer.
> 
> >+++ b/tests/test-start.sh
> 
> >-if ! test -f start.pid; then
> >-    echo "$0: PID file was not created"
> >-    exit 1
> >-fi
> >-
> >+start_nbdkit -P start.pid -U start.sock example1
> >  pid="$(cat start.pid)"
> >  # Check the process exists.
> 
> and another one.

These are problems in the existing tests, so a job for another day.

> The stuff I found is minor enough that I don't see a problem with
> you fixing and committing the series, rather than going through a
> v3.  And I love the overall diffstat :)

Thanks for the review,

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v




More information about the Libguestfs mailing list