diff options
author | David Thompson <dthompson2@worcester.edu> | 2016-03-26 08:45:08 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2016-03-27 15:09:21 -0400 |
commit | 13bc8d5e4f842fe595306c22c99a5868d8016318 (patch) | |
tree | aa68f2d597da1bcb8a34eabf83f8c06a4181d63f /tests | |
parent | c8786834ef53501e4ef0090b95520e4cefbe5b7b (diff) | |
download | patches-13bc8d5e4f842fe595306c22c99a5868d8016318.tar patches-13bc8d5e4f842fe595306c22c99a5868d8016318.tar.gz |
environment: Properly handle SIGINT.
Switching to execlp means that the process spawned in a container is PID
1, which obsoleted one of the 'guix environment --container' tests
because the init process can't be killed in the usual manner.
* guix/scripts/environment.scm (launch-environment/fork): New procedure.
(launch-environment): Switch from system* to execlp. Add handler for
SIGINT.
(guix-environment): Use launch-environment/fork.
* tests/guix-environment-container.sh: Replace abnormal exit test with
one that works now that the spawned process is PID 1.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/guix-environment-container.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh index aba34a3bd0..0a7ea481fc 100644 --- a/tests/guix-environment-container.sh +++ b/tests/guix-environment-container.sh @@ -82,8 +82,13 @@ grep -e "$NIX_STORE_DIR/.*-bash" $tmpdir/mounts # bootstrap bash rm $tmpdir/mounts +abnormal_exit_code=" +(use-modules (system foreign)) +;; Purposely make Guile crash with a segfault. :) +(pointer->string (make-pointer 123) 123)" + if guix environment --bootstrap --container \ - --ad-hoc bootstrap-binaries -- kill -SEGV 2 + --ad-hoc guile-bootstrap -- guile -c "$abnormal_exit_code" then false; else test $? -gt 127 |