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>
Wed, 29 Feb 2012 01:14:22 +0000 (17:14 -0800)
commitf802352d41e377f3e68614202c8e9cef5ce862f2
tree091c28e8f54ebd6dcf8810865ff265f3bb876a71
parent5e0c05bc058c78a11be6747f62e6ad88e5d06b70
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 unit 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