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:02:44 +0000 (11:02 -0800)
commitd7f817b4bd1ba2a8b737ce7be9221f5586d633af
tree8f27b8d386b8b68df4f2c8e760460db069b92372
parent01f76032c6b2eb81df8cfbdb3a3cc0ae943d1d48
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