tests/functional: Skip tests that don't work in NixOS environment yet

This commit is contained in:
Robert Hensing 2024-06-16 12:51:46 +02:00
parent 211aec473e
commit 8557d79650
96 changed files with 190 additions and 0 deletions

View file

@ -31,6 +31,8 @@ test "$hash1" = "sha256:$hash2"
#### New style commands
TODO_NixOS
clearStore
(

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
clearCacheCache

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
needLocalStore "'--no-require-sigs' cant be used with the daemon"
# We can produce drvs directly into the binary cache

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
clearCache

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
# https://github.com/NixOS/nix/issues/6572

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
###################################################
# Check that --dry-run isn't confused with read-only mode
# https://github.com/NixOS/nix/issues/1795

View file

@ -4,6 +4,7 @@ source common.sh
enableFeatures "daemon-trust-override"
TODO_NixOS
restartDaemon
requireSandboxSupport

View file

@ -4,6 +4,8 @@ source common.sh
enableFeatures "daemon-trust-override"
TODO_NixOS
restartDaemon
# Remote doesn't trust us

View file

@ -4,6 +4,7 @@ source common.sh
enableFeatures "daemon-trust-override"
TODO_NixOS
restartDaemon
# Remote doesn't trusts us, but this is fine because we are only

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
# Make sure that 'nix build' returns all outputs by default.

View file

@ -2,4 +2,6 @@ source ../common.sh
enableFeatures "ca-derivations"
TODO_NixOS
restartDaemon

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
rm -rf "$TEST_ROOT/case"

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
RESULT=$TEST_ROOT/result

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
RESULT=$TEST_ROOT/result

View file

@ -15,6 +15,8 @@ checkBuildTempDirRemoved ()
# written to build temp directories to verify created by this instance
checkBuildId=$(date +%s%N)
TODO_NixOS
clearStore
nix-build dependencies.nix --no-out-link
@ -76,6 +78,8 @@ grep 'may not be deterministic' $TEST_ROOT/log
[ "$status" = "104" ]
if checkBuildTempDirRemoved $TEST_ROOT/log; then false; fi
TODO_NixOS
clearStore
path=$(nix-build check.nix -A fetchurl --no-out-link)

View file

@ -39,6 +39,8 @@ EOF
cp simple.nix shell.nix simple.builder.sh config.nix "$flakeDir/"
TODO_NixOS
outPath=$(nix build --print-out-paths --no-link --sandbox-paths '/nix? /bin? /lib? /lib64? /usr?' --store "$TEST_ROOT/x" path:"$flakeDir")
[[ $outPath =~ ^/nix2/store/.*-simple$ ]]

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
clearCache

View file

@ -28,6 +28,8 @@ nix registry remove userhome-with-xdg
# Assert the .config folder hasn't been created.
[ ! -e "$HOME/.config" ]
TODO_NixOS # Very specific test setup not compatible with the NixOS test environment?
# Test that files are loaded from XDG by default
export XDG_CONFIG_HOME=$TEST_ROOT/confighome
export XDG_CONFIG_DIRS=$TEST_ROOT/dir1:$TEST_ROOT/dir2

View file

@ -10,6 +10,8 @@ if [[ -z "${NIX_DAEMON_PACKAGE-}" ]]; then
skipTest "not using the Nix daemon"
fi
TODO_NixOS
killDaemon
# Fill the db using the older Nix

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
# regression #9932

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
drvPath=$(nix-instantiate dependencies.nix)

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
needLocalStore "--dump-db requires a local store"
clearStore

View file

@ -5,4 +5,6 @@ requireDaemonNewerThan "2.16.0pre20230419"
enableFeatures "ca-derivations dynamic-derivations"
TODO_NixOS
restartDaemon

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
# Using `--eval-store` with the daemon will eventually copy everything
# to the build store, invalidating most of the tests here
needLocalStore "“--eval-store” doesn't achieve much with the daemon"

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
testStdinHeredoc=$(nix eval -f - <<EOF

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
clearProfiles

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
outPath=$(nix-build dependencies.nix --no-out-link)

View file

@ -4,6 +4,8 @@ source common.sh
enableFeatures "fetch-closure"
TODO_NixOS
clearStore
clearCacheCache

View file

@ -4,6 +4,8 @@ source common.sh
requireGit
TODO_NixOS
clearStore
# Intentionally not in a canonical form

View file

@ -4,6 +4,8 @@ source common.sh
requireGit
TODO_NixOS
clearStore
repo="$TEST_ROOT/git"

View file

@ -6,6 +6,8 @@ set -u
requireGit
TODO_NixOS
clearStore
rootRepo=$TEST_ROOT/gitSubmodulesRoot

View file

@ -7,6 +7,8 @@ requireGit
enableFeatures "verified-fetches"
TODO_NixOS
clearStore
repo="$TEST_ROOT/git"

View file

@ -4,6 +4,8 @@ source common.sh
[[ $(type -p hg) ]] || skipTest "Mercurial not installed"
TODO_NixOS
clearStore
# Intentionally not in a canonical form

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
cd "$TEST_ROOT"

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
# Test fetching a flat file.

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
path=$(nix-store -q $(nix-instantiate fixed.nix -A good.0))

View file

@ -28,6 +28,7 @@ EOF
# Without --accept-flake-config, the post hook should not run.
nix build < /dev/null
(! [[ -f post-hook-ran ]])
TODO_NixOS
clearStore
nix build --accept-flake-config

View file

@ -2,6 +2,8 @@
source ../common.sh
TODO_NixOS
clearStore
rm -rf $TEST_HOME/.cache $TEST_HOME/.config $TEST_HOME/.local

View file

@ -15,6 +15,8 @@ source common.sh
requireGit
TODO_NixOS
clearStore
# Submodules can't be fetched locally by default.

View file

@ -2,6 +2,8 @@
source ./common.sh
TODO_NixOS
requireGit
clearStore

View file

@ -2,6 +2,8 @@
source ../common.sh
TODO_NixOS
clearStore
rm -rf $TEST_HOME/.cache $TEST_HOME/.config $TEST_HOME/.local
cp ../shell-hello.nix ../config.nix $TEST_HOME

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
writeSimpleFlake "$TEST_HOME"

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
rm -rf $TEST_HOME/.cache $TEST_HOME/.config $TEST_HOME/.local

View file

@ -4,6 +4,8 @@ source common.sh
needLocalStore "“min-free” and “max-free” are daemon options"
TODO_NixOS
clearStore
garbage1=$(nix store add-path --name garbage1 ./nar-access.sh)

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
lockFifo1=$TEST_ROOT/test1.fifo

View file

@ -4,6 +4,8 @@
# parallel with it.
source common.sh
TODO_NixOS
needLocalStore "the GC test needs a synchronisation point"
clearStore

View file

@ -11,6 +11,8 @@ esac
set -m # enable job control, needed for kill
TODO_NixOS
profiles="$NIX_STATE_DIR"/profiles
rm -rf "$profiles"

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
drvPath=$(nix-instantiate dependencies.nix)

View file

@ -1,5 +1,7 @@
source ../common.sh
TODO_NixOS
clearStore
clearCache

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
# test help output

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
if nix-instantiate --readonly-mode ./import-derivation.nix; then

View file

@ -4,6 +4,8 @@ source common.sh
requireDaemonNewerThan "2.8pre20220311"
TODO_NixOS
enableFeatures "ca-derivations impure-derivations"
restartDaemon

View file

@ -5,6 +5,8 @@ source common.sh
# Needs the config option 'impure-env' to work
requireDaemonNewerThan "2.19.0"
TODO_NixOS
enableFeatures "configurable-impure-env"
restartDaemon

View file

@ -4,6 +4,8 @@ source common.sh
needLocalStore "the sandbox only runs on the builder side, so it makes no sense to test it with the daemon"
TODO_NixOS
clearStore
requireSandboxSupport

View file

@ -15,6 +15,8 @@ declare -a storesBad=(
"$storeBadRoot" "$storeBadLower" "$storeBadUpper"
)
TODO_NixOS
for i in "${storesBad[@]}"; do
echo $i
unshare --mount --map-root-user bash <<EOF

View file

@ -1,5 +1,7 @@
source ../common/vars-and-functions.sh
TODO_NixOS
# The new Linux mount interface does not seem to support remounting
# OverlayFS mount points.
#

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
path=$(nix-build dependencies.nix --no-out-link)

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
rm -f $TEST_ROOT/result*

View file

@ -27,6 +27,8 @@ diff -u baz.cat-nar $storePath/foo/baz
nix store cat $storePath/foo/baz > baz.cat-nar
diff -u baz.cat-nar $storePath/foo/baz
TODO_NixOS
# Check that 'nix store cat' fails on invalid store paths.
invalidPath="$(dirname $storePath)/99999999999999999999999999999999-foo"
cp -r $storePath $invalidPath

View file

@ -4,6 +4,8 @@ source common.sh
# This test is run by `tests/functional/nested-sandboxing/runner.nix` in an extra layer of sandboxing.
[[ -d /nix/store ]] || skipTest "running this test without Nix's deps being drawn from /nix/store is not yet supported"
TODO_NixOS
requireSandboxSupport
source ./nested-sandboxing/command.sh

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
outPath=$(nix-build dependencies.nix -o $TEST_ROOT/result)

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
## Test `nix-collect-garbage -d`

View file

@ -2,6 +2,8 @@ proto=$1
shift
(( $# == 0 ))
TODO_NixOS
clearStore
clearCache

View file

@ -4,6 +4,8 @@ source common.sh
source nix-copy-ssh-common.sh "ssh-ng"
TODO_NixOS
clearStore
clearRemoteStore

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
clearProfiles

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
if [[ -n ${CONTENT_ADDRESSED:-} ]]; then

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
outPath1=$(echo 'with import ./config.nix; mkDerivation { name = "foo1"; builder = builtins.toFile "builder" "mkdir $out; echo hello > $out/foo"; }' | nix-build - --no-out-link --auto-optimise-store)

View file

@ -3,6 +3,7 @@
source common.sh
testNormalization () {
TODO_NixOS
clearStore
outPath=$(nix-build ./simple.nix --no-out-link)
test "$(stat -c %Y $outPath)" -eq 1

View file

@ -4,6 +4,8 @@ source common.sh
# First, test that -jN performs builds in parallel.
echo "testing nix-build -j..."
TODO_NixOS
clearStore
rm -f $_NIX_TEST_SHARED.cur $_NIX_TEST_SHARED.max

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
outPath=$(nix-build --no-out-link -E "

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
nix-build --no-out-link -E '

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
rm -f $TEST_ROOT/result

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
nix eval --expr 'assert 1 + 2 == 3; true'

View file

@ -6,6 +6,8 @@ enableFeatures "read-only-local-store"
needLocalStore "cannot open store read-only when daemon has already opened it writeable"
TODO_NixOS
clearStore
happy () {

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
outPath=$(nix-build --no-out-link readfile-context.nix)

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
enableFeatures 'recursive-nix'
restartDaemon

View file

@ -4,6 +4,8 @@ source common.sh
needLocalStore "uses some low-level store manipulations that arent available through the daemon"
TODO_NixOS
clearStore
max=500

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
# Ensure "fake ssh" remote store works just as legacy fake ssh would.

View file

@ -4,6 +4,8 @@ source common.sh
needLocalStore "--repair needs a local store"
TODO_NixOS
clearStore
path=$(nix-build dependencies.nix -o $TEST_ROOT/result)

View file

@ -22,6 +22,8 @@ replUndefinedVariable="
import $testDir/undefined-variable.nix
"
TODO_NixOS
testRepl () {
local nixArgs
nixArgs=("$@")

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
nix-instantiate --restrict-eval --eval -E '1 + 2'

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
clearCache

View file

@ -6,6 +6,8 @@
source common.sh
TODO_NixOS
clearStore
startDaemon

View file

@ -4,6 +4,8 @@ source common.sh
requireDaemonNewerThan "2.6.0pre20211215"
TODO_NixOS
clearStore
nix-build --no-out-link -E '

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
clearCache

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
clearCache

View file

@ -17,6 +17,8 @@ echo "output path is $outPath"
text=$(cat "$outPath/hello")
if test "$text" != "Hello World!"; then exit 1; fi
TODO_NixOS
# Directed delete: $outPath is not reachable from a root, so it should
# be deleteable.
nix-store --delete $outPath

View file

@ -16,4 +16,6 @@ fi
expect 127 NIX_REMOTE=unix:$PWD/store nix store info || \
fail "nix store info on a non-existent store should fail"
TODO_NixOS
[[ "$(echo "$STORE_INFO_JSON" | jq -r ".url")" == "${NIX_REMOTE:-local}" ]]

View file

@ -6,6 +6,8 @@ source common.sh
# tests for the older versions
requireDaemonNewerThan "2.4pre20210712"
TODO_NixOS
clearStore
rm -f $TEST_ROOT/result

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
cd "$TEST_HOME"

View file

@ -7,6 +7,8 @@ requireSandboxSupport
if ! command -p -v unshare; then skipTest "Need unshare"; fi
needLocalStore "The test uses --store always so we would just be bypassing the daemon"
TODO_NixOS
unshare --mount --map-root-user bash <<EOF
source common.sh

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
rm -rf $TEST_HOME

View file

@ -13,6 +13,8 @@ fi
killDaemon
unset NIX_REMOTE
TODO_NixOS
clearStore
clearProfiles
rm -rf ~/.nix-profile

View file

@ -11,6 +11,8 @@ outPath10=$(nix-env -f ./user-envs.nix -qa --out-path --no-name '*' | grep foo-1
drvPath10=$(nix-env -f ./user-envs.nix -qa --drv-path --no-name '*' | grep foo-1.0)
[ -n "$outPath10" -a -n "$drvPath10" ]
TODO_NixOS
# Query with json
nix-env -f ./user-envs.nix -qa --json | jq -e '.[] | select(.name == "bar-0.1") | [
.outputName == "out",

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
cp ./dependencies.nix ./dependencies.builder0.sh ./config.nix $TEST_HOME

View file

@ -2,6 +2,8 @@
source common.sh
TODO_NixOS
clearStore
clearCache