Avoid race condition in case tests directory does not exist
authorStefan Agner <stefan@agner.ch>
Tue, 14 Aug 2018 10:38:15 +0000 (12:38 +0200)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 14 Aug 2018 12:50:11 +0000 (12:50 +0000)
Make sure the tests directory exists before symlinking files
into it.

Closes: #1703
Closes: #1704
Approved by: cgwalters

Makefile-tests.am

index 85995aa6ee3f0b8a58dbc24932b7d6298408bcd4..3323c5f3a09b38dffac8cbae8280c751862f020e 100644 (file)
@@ -360,7 +360,8 @@ EXTRA_DIST += \
        $(NULL)
 
 tests/libreaddir-rand.so: Makefile
-       $(AM_V_GEN) ln -fns ../.libs/libreaddir-rand.so tests
+       mkdir -p tests/
+       $(AM_V_GEN) ln -fns ../.libs/libreaddir-rand.so tests/
 ALL_LOCAL_RULES += tests/libreaddir-rand.so
 CLEANFILES += tests/libreaddir-rand.so tests/ostree-symlink-stamp \
                tests/ostree-prepare-root-symlink-stamp tests/ostree-remount-symlink-stamp \