mirror of
https://github.com/NixOS/nix.git
synced 2025-11-17 16:02:43 +01:00
Add some tests for the external gc daemon
This commit is contained in:
parent
dadc4a42c6
commit
2575dd4f19
2 changed files with 38 additions and 0 deletions
37
tests/gc-external-daemon.sh
Normal file
37
tests/gc-external-daemon.sh
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
source common.sh
|
||||
|
||||
export NIX_GC_SOCKET_PATH=$TEST_ROOT/gc.socket
|
||||
startGcDaemon() {
|
||||
# Start the daemon, wait for the socket to appear. !!!
|
||||
# ‘nix-daemon’ should have an option to fork into the background.
|
||||
rm -f $NIX_GC_SOCKET_PATH
|
||||
$(dirname $(which nix))/../libexec/nix/nix-find-roots \
|
||||
-l "$NIX_GC_SOCKET_PATH" \
|
||||
-d "$NIX_STATE_DIR" \
|
||||
-s "$NIX_STORE_DIR" \
|
||||
&
|
||||
for ((i = 0; i < 30; i++)); do
|
||||
if [[ -S $NIX_GC_SOCKET_PATH ]]; then break; fi
|
||||
sleep 1
|
||||
done
|
||||
pidGcDaemon=$!
|
||||
trap "killGcDaemon" EXIT
|
||||
}
|
||||
|
||||
killGcDaemon() {
|
||||
kill $pidGcDaemon
|
||||
for i in {0.10}; do
|
||||
kill -0 $pidGcDaemon || break
|
||||
sleep 1
|
||||
done
|
||||
kill -9 $pidGcDaemon || true
|
||||
wait $pidGcDaemon || true
|
||||
trap "" EXIT
|
||||
}
|
||||
|
||||
startGcDaemon
|
||||
|
||||
bash ./gc.sh
|
||||
bash ./gc-concurrent.sh
|
||||
bash ./gc-runtime.sh
|
||||
bash ./gc-auto.sh
|
||||
|
|
@ -2,6 +2,7 @@ nix_tests = \
|
|||
flakes.sh \
|
||||
ca/gc.sh \
|
||||
gc.sh \
|
||||
gc-external-daemon.sh \
|
||||
remote-store.sh \
|
||||
lang.sh \
|
||||
fetchMercurial.sh \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue