about summary refs log tree commit diff
path: root/tests/locking.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/locking.sh')
-rw-r--r--tests/locking.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/locking.sh b/tests/locking.sh
new file mode 100644
index 000000000000..5728aee93727
--- /dev/null
+++ b/tests/locking.sh
@@ -0,0 +1,17 @@
+storeExpr=$($TOP/src/nix-instantiate/nix-instantiate locking.nix)
+
+echo "store expr is $storeExpr"
+
+for i in $(seq 1 5); do
+    echo "WORKER $i"
+    $TOP/src/nix-store/nix-store -rvvB "$storeExpr" &
+done
+
+sleep 5
+
+outPath=$($TOP/src/nix-store/nix-store -qnfvvvvv "$storeExpr")
+
+echo "output path is $outPath"
+
+text=$(cat "$outPath")
+if test "$text" != "aabcade"; then exit 1; fi