7760e6f963
POSIX allows for the atime (or technically, any of the times) to be updated as a side effect of searching a directory (allows, not requires). The NetBSD UDF implementation apparently works that way, treating a directory search as a read of the directory, and hence updating the access time. Compensate for that in the test (rather than just expecting failure) by verifying that the atime after the directory search is within a small margin of the atime before the search (currently, "small" is 1 second). We could fetch the time before the mkdir and both stat() calls, do all of that, fetch the time after, subtract, and require the after stat() atime to be bounded by the atime set by the original mkdir and returned in the first stat() and that time + the difference in elapsed time - that would be more accurate, but is a lot more work for little real benefit. Should anyone be interested in doing that extra work, remember to use monotonic time (clock_gettime(CLOCK_MOMNOTONIC, ...)) not the time of day clock for measuring the elapsed time. Along with this, remove the "if (udf) failure expected" and the if (udf && we haven't failed yet) fail("random failure failed to happen") stuff... (the "random" would have been that sometimes the mkdir and two lookups (stat() calls) would all occur within the same clock tick, meaning that the atimes would all be the same. Other times the clock would tick somewhere between the mkdir() and the 2nd stat().) |
||
---|---|---|
.. | ||
bin | ||
crypto | ||
dev | ||
fs | ||
games | ||
include | ||
ipf | ||
kernel | ||
lib | ||
libexec | ||
modules | ||
net | ||
rump | ||
sbin | ||
share | ||
sys | ||
usr.bin | ||
usr.sbin | ||
h_macros.h | ||
Makefile | ||
Makefile.inc | ||
README |
$NetBSD: README,v 1.4 2012/05/18 15:36:21 jruoho Exp $ When adding new tests, please try to follow the following conventions. 1. For library routines, including system calls, the directory structure of the tests should follow the directory structure of the real source tree. For instance, interfaces available via the C library should follow: src/lib/libc/gen -> src/tests/lib/libc/gen src/lib/libc/sys -> src/tests/lib/libc/sys ... 2. Equivalently, all tests for userland utilities should try to follow their location in the source tree. If this can not be satisfied, the tests for a utility should be located under the directory to which the utility is installed. Thus, a test for env(1) should go to src/tests/usr.bin/env. Likewise, a test for tcpdump(8) should be in src/tests/usr.sbin/tcpdump, even though the source code for the program is located under src/external. 3. Otherwise use your own discretion.