mirror of
https://github.com/NixOS/nix.git
synced 2025-11-12 21:46:01 +01:00
Add a test ensuring compatibility with an old daemon
This requires adding `nix` to its own closure which is a bit unfortunate,
but as it is optional (the test will be disabled if `OUTER_NIX` is unset) it
shouldn't be too much of an issue.
(Ideally this should go in another derivation so that we can build Nix and run
the test independently, but as the tests are running in the same derivation
as the build it's a bit complicated to do so).
(cherry picked from commit 5716345adf)
This commit is contained in:
parent
e0e9f91049
commit
02a186883b
2 changed files with 3 additions and 4 deletions
|
|
@ -55,7 +55,6 @@ clearStore() {
|
|||
mkdir "$NIX_STORE_DIR"
|
||||
rm -rf "$NIX_STATE_DIR"
|
||||
mkdir "$NIX_STATE_DIR"
|
||||
nix-store --init
|
||||
clearProfiles
|
||||
}
|
||||
|
||||
|
|
@ -71,7 +70,7 @@ startDaemon() {
|
|||
# Start the daemon, wait for the socket to appear. !!!
|
||||
# ‘nix-daemon’ should have an option to fork into the background.
|
||||
rm -f $NIX_STATE_DIR/daemon-socket/socket
|
||||
nix-daemon &
|
||||
${NIX_DAEMON_COMMAND:-nix-daemon} &
|
||||
for ((i = 0; i < 30; i++)); do
|
||||
if [ -e $NIX_DAEMON_SOCKET_PATH ]; then break; fi
|
||||
sleep 1
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ startDaemon
|
|||
|
||||
storeCleared=1 NIX_REMOTE_=$NIX_REMOTE $SHELL ./user-envs.sh
|
||||
|
||||
nix-store --gc --max-freed 1K
|
||||
|
||||
nix-store --dump-db > $TEST_ROOT/d1
|
||||
NIX_REMOTE= nix-store --dump-db > $TEST_ROOT/d2
|
||||
cmp $TEST_ROOT/d1 $TEST_ROOT/d2
|
||||
|
||||
nix-store --gc --max-freed 1K
|
||||
|
||||
killDaemon
|
||||
|
||||
user=$(whoami)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue