summary refs log tree commit diff
path: root/tests/guix-daemon.sh
diff options
context:
space:
mode:
authorRoel Janssen <roel@gnu.org>2018-04-19 17:11:30 +0200
committerRoel Janssen <roel@gnu.org>2018-04-19 19:06:26 +0200
commit5cefb13ddd4d51a63a387e74c138035b7b8b8537 (patch)
treed98bd60a2a5465f58853da7c224810497ebb5ec9 /tests/guix-daemon.sh
parent7c16af4646fac789000495064a13284691dbeb75 (diff)
downloadguix-5cefb13ddd4d51a63a387e74c138035b7b8b8537.tar.gz
guix-daemon: Disable garbage collection for remote connections.
* nix/nix-daemon/nix-daemon.cc (isRemoteConnection): New variable.
  (performOp): For wopCollectGarbage, throw an error when isRemoteConnection
  is set.
  (acceptConnection): Set isRemoteConnection when connection is not AF_UNIX.
* tests/guix-daemon.sh: Add a test for the new behavior.
Diffstat (limited to 'tests/guix-daemon.sh')
-rw-r--r--tests/guix-daemon.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/guix-daemon.sh b/tests/guix-daemon.sh
index 6f91eb58bf..9ae6e0b77a 100644
--- a/tests/guix-daemon.sh
+++ b/tests/guix-daemon.sh
@@ -194,6 +194,20 @@ do
     kill "$daemon_pid"
 done
 
+# Make sure garbage collection from a TCP connection does not work.
+
+tcp_socket="127.0.0.1:9999"
+guix-daemon --listen="$tcp_socket" &
+daemon_pid=$!
+
+GUIX_DAEMON_SOCKET="guix://$tcp_socket"
+export GUIX_DAEMON_SOCKET
+
+if guix gc; then false; else true; fi
+
+unset GUIX_DAEMON_SOCKET
+kill "$daemon_pid"
+
 # Log compression.
 
 guix-daemon --listen="$socket" --disable-chroot --debug --log-compression=gzip &