testing: remove obsolete daemon tests

remove all daemon version checks targeting daemons we no longer support.

Change-Id: If722024c3d66c73fa1b3cdd63134a09389ac6ea5
This commit is contained in:
eldritch horrors
2025-07-22 10:39:32 +00:00
parent d8dfffbe37
commit 6ddd3045f0
13 changed files with 14 additions and 102 deletions
+1 -3
View File
@@ -49,6 +49,4 @@ second
EOF
nix-store --delete "$p" # Clean up for next test
}
if isDaemonNewer "2.12pre0"; then
issue_6572_dependent_outputs
fi
issue_6572_dependent_outputs
+3 -10
View File
@@ -41,16 +41,9 @@ nix-build -o $RESULT check-refs.nix -A test7
# test10 should succeed (no disallowed references).
nix-build -o $RESULT check-refs.nix -A test10
if isDaemonNewer 2.12pre20230103; then
if ! isDaemonNewer 2.16.0; then
enableFeatures discard-references
restartDaemon
fi
# test11 should succeed.
test11=$(nix-build -o $RESULT check-refs.nix -A test11)
[[ -z $(nix-store -q --references "$test11") ]]
fi
# test11 should succeed.
test11=$(nix-build -o $RESULT check-refs.nix -A test11)
[[ -z $(nix-store -q --references "$test11") ]]
# test12 should fail (syntactically invalid).
expectStderr 1 nix-build -vvv -o "$RESULT" check-refs.nix -A test12 >"$TEST_ROOT/test12.stderr"
-6
View File
@@ -5,12 +5,6 @@ enableFeatures "fetch-closure"
clearStore
clearCacheCache
# Old daemons don't properly zero out the self-references when
# calculating the CA hashes, so this breaks `nix store
# make-content-addressed` which expects the client and the daemon to
# compute the same hash
requireDaemonNewerThan "2.16.0pre20230524"
# Initialize binary cache.
nonCaPath=$(nix build --json --file ./dependencies.nix --no-link | jq -r .[].outputs.out)
caPath=$(nix store make-content-addressed --json $nonCaPath | jq -r '.rewrites | map(.) | .[]')
+4 -8
View File
@@ -15,10 +15,8 @@ nix path-info --json $path | grep fixed:md5:2qk15sxzzjlnpjk9brn7j8ppcd
echo 'testing good...'
nix-build fixed.nix -A good --no-out-link
if isDaemonNewer "2.4pre20210927"; then
echo 'testing --check...'
nix-build fixed.nix -A check --check && fail "should fail"
fi
echo 'testing --check...'
nix-build fixed.nix -A check --check && fail "should fail"
echo 'testing good2...'
nix-build fixed.nix -A good2 --no-out-link
@@ -26,10 +24,8 @@ nix-build fixed.nix -A good2 --no-out-link
echo 'testing reallyBad...'
nix-instantiate fixed.nix -A reallyBad && fail "should fail"
if isDaemonNewer "2.20pre20240108"; then
echo 'testing fixed with references...'
expectStderr 1 nix-build fixed.nix -A badReferences | grepQuiet "not allowed to refer to other store paths"
fi
echo 'testing fixed with references...'
expectStderr 1 nix-build fixed.nix -A badReferences | grepQuiet "not allowed to refer to other store paths"
echo 'testing illegal references...'
# Fixed FOD hashes cannot be asserted because:
-1
View File
@@ -61,7 +61,6 @@ functional_tests_scripts = [
'fetchMercurial.sh',
'gc-auto.sh',
'user-envs.sh',
'user-envs-migration.sh',
'binary-cache.sh',
'binary-cache-regression-fj647.sh',
'multiple-outputs.sh',
@@ -1,9 +1,5 @@
source ../common.sh
# 27ce722638 required some incompatible changes to the nix file, so skip this
# tests for the older versions
requireDaemonNewerThan "2.4pre20210712"
clearStore
export NIX_BUILD_SHELL=$SHELL
+1 -5
View File
@@ -9,11 +9,7 @@ echo 'require-sigs = false' >> $NIX_CONF_DIR/nix.conf
restartDaemon
if isDaemonNewer "2.13"; then
pushToStore="$PWD/push-to-store.sh"
else
pushToStore="$PWD/push-to-store-old.sh"
fi
pushToStore="$PWD/push-to-store.sh"
# Build the dependencies and push them to the remote store.
nix-build -o $TEST_ROOT/result dependencies.nix --post-build-hook "$pushToStore"
-14
View File
@@ -1,14 +0,0 @@
#!/usr/bin/env bash
set -x
set -e
[ -n "$OUT_PATHS" ]
[ -n "$DRV_PATH" ]
echo Pushing "$OUT_PATHS" to "$REMOTE_STORE"
if [ -n "$BUILD_HOOK_ONLY_OUT_PATHS" ]; then
printf "%s" "$OUT_PATHS" | xargs nix copy --to "$REMOTE_STORE" --no-require-sigs
else
printf "%s" "$DRV_PATH" | xargs nix copy --to "$REMOTE_STORE" --no-require-sigs
fi
+4 -9
View File
@@ -10,15 +10,10 @@ nix --store ssh-ng://localhost?remote-store=$TEST_ROOT/other-store store ping --
startDaemon
if isDaemonNewer "2.15pre0"; then
# Ensure that ping works trusted with new daemon
nix store ping --json | jq -e '.trusted'
# Suppress grumpiness about multiple nixes on PATH
(nix doctor || true) 2>&1 | grep 'You are trusted by'
else
# And the the field is absent with the old daemon
nix store ping --json | jq -e 'has("trusted") | not'
fi
# Ensure that ping works trusted with new daemon
nix store ping --json | jq -e '.trusted'
# Suppress grumpiness about multiple nixes on PATH
(nix doctor || true) 2>&1 | grep 'You are trusted by'
# Test import-from-derivation through the daemon.
[[ $(nix eval --impure --raw --file ./ifd.nix) = hi ]]
-2
View File
@@ -1,7 +1,5 @@
source common.sh
requireDaemonNewerThan "2.6.0pre20211215"
clearStore
nix-build --no-out-link -E '
+1 -1
View File
@@ -5,7 +5,7 @@ STORE_INFO_JSON=$(nix store ping --json)
echo "$STORE_INFO" | grep "Store URL: ${NIX_REMOTE}"
if [[ -v NIX_DAEMON_PACKAGE ]] && isDaemonNewer "2.7.0pre20220126"; then
if [[ -v NIX_DAEMON_PACKAGE ]] then
DAEMON_VERSION=$($NIX_DAEMON_PACKAGE/bin/nix daemon --version | cut -d' ' -f3)
echo "$STORE_INFO" | grep "Version: $DAEMON_VERSION"
[[ "$(echo "$STORE_INFO_JSON" | jq -r ".version")" == "$DAEMON_VERSION" ]]
-4
View File
@@ -1,9 +1,5 @@
source common.sh
# 27ce722638 required some incompatible changes to the nix file, so skip this
# tests for the older versions
requireDaemonNewerThan "2.4pre20210712"
clearStore
rm -f $TEST_ROOT/result
-35
View File
@@ -1,35 +0,0 @@
# Test that the migration of user environments
# (https://github.com/NixOS/nix/pull/5226) does preserve everything
source common.sh
if isDaemonNewer "2.4pre20211005"; then
skipTest "Daemon is too new"
fi
killDaemon
unset NIX_REMOTE
clearStore
clearProfiles
rm -rf ~/.nix-profile
# Fill the environment using the older Nix
PATH_WITH_NEW_NIX="$PATH"
export PATH="$NIX_DAEMON_PACKAGE/bin:$PATH"
nix-env -f user-envs.nix -i foo-1.0
nix-env -f user-envs.nix -i bar-0.1
# Migrate to the new profile dir, and ensure that everythings there
export PATH="$PATH_WITH_NEW_NIX"
nix-env -q # Trigger the migration
( [[ -L ~/.nix-profile ]] && \
[[ $(readlink ~/.nix-profile) == ~/.local/share/nix/profiles/profile ]] ) || \
fail "The nix profile should point to the new location"
(nix-env -q | grep foo && nix-env -q | grep bar && \
[[ -e ~/.nix-profile/bin/foo ]] && \
[[ $(nix-env --list-generations | wc -l) == 2 ]]) ||
fail "The nix profile should have the same content as before the migration"