diff options
author | Julien Lepiller <julien@lepiller.eu> | 2019-10-25 21:39:21 +0200 |
---|---|---|
committer | Julien Lepiller <julien@lepiller.eu> | 2019-11-08 21:52:53 +0100 |
commit | b1fb663404894268b5ee92c040f12c52c0bee425 (patch) | |
tree | 6173456b994ac199283af45544740154ca2b34c7 /tests | |
parent | f49e9131889775a74a85c1f9b29f108030337b8b (diff) | |
download | guix-b1fb663404894268b5ee92c040f12c52c0bee425.tar.gz |
guix: package: lock profiles when processing them.
* guix/scripts/package.scm (process-actions): Get a per-profile lock to prevent concurrent actions on profiles. * tests/guix-package.sh: Add test.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/guix-package.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/guix-package.sh b/tests/guix-package.sh index 0de30bf6c1..7ad0699380 100644 --- a/tests/guix-package.sh +++ b/tests/guix-package.sh @@ -33,7 +33,7 @@ profile="t-profile-$$" tmpfile="t-guix-package-file-$$" rm -f "$profile" "$tmpfile" -trap 'rm -f "$profile" "$profile-"[0-9]* "$tmpfile"; rm -rf "$module_dir" t-home-'"$$" EXIT +trap 'rm -f "$profile" "$profile.lock" "$profile-"[0-9]* "$tmpfile"; rm -rf "$module_dir" t-home-'"$$" EXIT # Use `-e' with a non-package expression. if guix package --bootstrap -e +; @@ -452,3 +452,11 @@ rm -rf "$module_dir" # Make sure we can see user profiles. guix package --list-profiles | grep "$profile" guix package --list-profiles | grep '\.guix-profile' + +# Make sure we can properly lock a profile. +mkdir "$module_dir" +echo '(sleep 60)' > "$module_dir/manifest.scm" +guix package -m "$module_dir/manifest.scm" -p "$module_dir/profile" & +pid=$! +if guix install emacs -p "$module_dir/profile"; then kill $pid; false; else true; fi +kill $pid |