summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2017-12-05 16:27:13 -0800
committerBen Pfaff <blp@ovn.org>2017-12-06 10:25:40 -0800
commitd3aed7210f9bc8ce3c398a341e82cd252a5e6ad8 (patch)
tree875fd9f8dcc60a11bf53bd1b2ff3481b2fe77896
parente7b9b17cd096c569b1c4d408b423ecedb9497c41 (diff)
downloadopenvswitch-d3aed7210f9bc8ce3c398a341e82cd252a5e6ad8.tar.gz
tests: Use $(MKDIR_P) to avoid races.
"test -d x || mkdir x" has a race when invoked in parallel: it is possible for two processes to both see that 'x' does not exist and both try to create it, and if that happens then one of them will fail. This avoids the problem. Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Greg Rose <gvrose8192@gmail.com>
-rw-r--r--tests/automake.mk2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/automake.mk b/tests/automake.mk
index c5c9939c6..ef74712e6 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -207,7 +207,7 @@ valgrind_wrappers = \
tests/valgrind/test-vconn
$(valgrind_wrappers): tests/valgrind-wrapper.in
- @test -d tests/valgrind || mkdir tests/valgrind
+ @$(MKDIR_P) tests/valgrind
$(AM_V_GEN) sed -e 's,[@]wrap_program[@],$@,' \
$(top_srcdir)/tests/valgrind-wrapper.in > $@.tmp && \
chmod +x $@.tmp && \