forked from lix-project/lix
addacfce4a
When `NIX_DAEMON_PACKAGE` is set, make all the tests use the Nix daemon. That way we can test every piece of Nix functionality both with and without the daemon. Tests for which using the daemon isn’t possible or doesn’t make sens can selectively be disabled with `needLocalStore`
22 lines
703 B
Bash
Executable file
22 lines
703 B
Bash
Executable file
#!/usr/bin/env bash
|
||
|
||
# Regression test for https://github.com/NixOS/nix/issues/4858
|
||
|
||
source common.sh
|
||
|
||
requireDaemonNewerThan "2.4pre20210621"
|
||
|
||
# Get the output path of `rootCA`, and put some garbage instead
|
||
outPath="$(nix-build ./content-addressed.nix -A rootCA --no-out-link)"
|
||
nix-store --delete "$outPath"
|
||
touch "$outPath"
|
||
|
||
# The build should correctly remove the garbage and put the expected path instead
|
||
nix-build ./content-addressed.nix -A rootCA --no-out-link
|
||
|
||
# Rebuild it. This shouldn’t overwrite the existing path
|
||
oldInode=$(stat -c '%i' "$outPath")
|
||
nix-build ./content-addressed.nix -A rootCA --no-out-link --arg seed 2
|
||
newInode=$(stat -c '%i' "$outPath")
|
||
[[ "$oldInode" == "$newInode" ]]
|