tests: Flock the implicit layer test

Fix #121

Change-Id: I2e060a3ddda3bf919d6be8a3e0af7169ac0fee63
This commit is contained in:
Jeremy Hayes
2018-12-18 13:35:31 -07:00
committed by Jeremy Hayes
parent c2237b330f
commit d454224a4d
+6 -1
View File
@@ -101,6 +101,11 @@ RunImplicitLayerTest()
echo "ImplicitLayer test PASSED"
}
! RunImplicitLayerTest && echo "ImplicitLayer test FAILED" >&2 && exit 1
# Prevent the implicit layer test from running concurrently with itself in another process.
# i.e. flock the following command subshell with an automatic file descriptor.
filename=${0##*/}
(
flock "$filedesc" && ! RunImplicitLayerTest && echo "ImplicitLayer test FAILED" >&2 && exit 1
){filedesc}>"/tmp/$filename.lockfile"
popd > /dev/null