about summary refs log tree commit diff
path: root/tests/parallel.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/parallel.sh')
-rw-r--r--tests/parallel.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/parallel.sh b/tests/parallel.sh
new file mode 100644
index 000000000000..7040f7ad91d3
--- /dev/null
+++ b/tests/parallel.sh
@@ -0,0 +1,20 @@
+storeExpr=$($TOP/src/nix-instantiate/nix-instantiate parallel.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
+
+if test "$(cat $SHARED.cur)" != 0; then exit 1; fi
+if test "$(cat $SHARED.max)" != 3; then exit 1; fi