On Mon, Sep 30, 2019 at 11:53:32AM -0500, Eric Blake wrote:
On 9/28/19 3:02 PM, Richard W.M. Jones wrote:
--- tests/Makefile.am | 6 ++++ tests/test-info-conntime.sh | 65 +++++++++++++++++++++++++++++++++++ tests/test-info-time.sh | 68 +++++++++++++++++++++++++++++++++++++ tests/test-info-uptime.sh | 65 +++++++++++++++++++++++++++++++++++ 4 files changed, 204 insertions(+)
+# Test the info plugin with mode=conntime. + +source ./functions.sh +set -e +set -x + +requires nbdsh --version + +sock=`mktemp -u` +files="info-conntime.out info-conntime.pid $sock" +rm -f $files +cleanup_fn rm -f $files + +# Run nbdkit. +start_nbdkit -P info-conntime.pid -U $sock info mode=conntime +
For conntime, is it worth testing 2 separate connections:
Connection 1: connect, sleep 1, read Connection 2: connect, read
where the delta read by connection 2 should be less than the delta read by 1? (longer sleep if needed)
Conversely, for uptime, 2 separate connections with the same access pattern should show connection 2 greater than the delta of 1.
Otherwise looks good.
We do need to improve these tests - another thing which could be done would be to measure and at least print the round trip time. I tried to implement the new modes using clock_gettime but it wasn't entirely simple, so I pushed it as is with a warning in the man page. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org