timeval: Add "time/stop" unixctl command, for use in unit tests.
authorBen Pfaff <blp@nicira.com>
Tue, 28 Feb 2012 22:57:13 +0000 (14:57 -0800)
committerBen Pfaff <blp@nicira.com>
Fri, 2 Mar 2012 19:06:58 +0000 (11:06 -0800)
commitc521d98befd333f25913b06eebc4947575cc5915
treec58fdb97c5fbc2b997ba6cbefa9b2a6a9422afe5
parente519d31e1e5b4aa1417d71b15836de9a012feb02
timeval: Add "time/stop" unixctl command, for use in unit tests.

Although we try to avoid it, some unit tests are necessarily
timing-sensitive.  The new "time/stop" command that this commit adds should
help with that, by preventing time from advancing from the viewpoint of
the OVS "timeval" functions except when "time/warp" explicitly advances
the current time.  This should allow the unit tests that need it to become
reproducible regardless of the speed at which the tests run.

This commit adds one use of "time/stop" to the unit test suite, in the one
timing-sensitive test of which I am currently aware.

Bug #9782.
Reported-by: Tim Chen <tchen@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/timeval.c
tests/ofproto-dpif.at