mirror of
https://github.com/NixOS/nix
synced 2025-07-09 03:43:54 +02:00
Merge remote-tracking branch 'upstream/master' into functional-tests-on-nixos
This commit is contained in:
commit
602c444411
83 changed files with 1388 additions and 401 deletions
20
tests/functional/common/paths.sh
Normal file
20
tests/functional/common/paths.sh
Normal file
|
@ -0,0 +1,20 @@
|
|||
# shellcheck shell=bash
|
||||
|
||||
commonDir="$(readlink -f "$(dirname "${BASH_SOURCE[0]-$0}")")"
|
||||
|
||||
# Since this is a generated file
|
||||
# shellcheck disable=SC1091
|
||||
source "$commonDir/subst-vars.sh"
|
||||
# Make sure shellcheck knows this will be defined by the above generated snippet
|
||||
: "${bindir?}"
|
||||
|
||||
export PATH="$bindir:$PATH"
|
||||
|
||||
if [[ -n "${NIX_CLIENT_PACKAGE:-}" ]]; then
|
||||
export PATH="$NIX_CLIENT_PACKAGE/bin":$PATH
|
||||
fi
|
||||
|
||||
DAEMON_PATH="$PATH"
|
||||
if [[ -n "${NIX_DAEMON_PACKAGE:-}" ]]; then
|
||||
DAEMON_PATH="${NIX_DAEMON_PACKAGE}/bin:$DAEMON_PATH"
|
||||
fi
|
|
@ -1,10 +1,10 @@
|
|||
# NOTE: instances of @variable@ are substituted as defined in /mk/templates.mk
|
||||
|
||||
if ! isTestOnNixOS; then
|
||||
export SHELL="@bash@"
|
||||
export PATH=@bindir@:$PATH
|
||||
fi
|
||||
if [[ -z "${COMMON_SUBST_VARS_SH_SOURCED-}" ]]; then
|
||||
|
||||
COMMON_SUBST_VARS_SH_SOURCED=1
|
||||
|
||||
bindir=@bindir@
|
||||
export coreutils=@coreutils@
|
||||
#lsof=@lsof@
|
||||
|
||||
|
@ -16,3 +16,10 @@ export version=@PACKAGE_VERSION@
|
|||
export system=@system@
|
||||
|
||||
export BUILD_SHARED_LIBS=@BUILD_SHARED_LIBS@
|
||||
|
||||
if ! isTestOnNixOS; then
|
||||
export SHELL="@bash@"
|
||||
export PATH=@bindir@:$PATH
|
||||
fi
|
||||
|
||||
fi
|
||||
|
|
4
tests/functional/common/test-root.sh
Normal file
4
tests/functional/common/test-root.sh
Normal file
|
@ -0,0 +1,4 @@
|
|||
# shellcheck shell=bash
|
||||
|
||||
TEST_ROOT=$(realpath "${TMPDIR:-/tmp}/nix-test")/${TEST_NAME:-default/tests\/functional//}
|
||||
export TEST_ROOT
|
|
@ -21,9 +21,11 @@ commonDir="$(readlink -f "$(dirname "${BASH_SOURCE[0]-$0}")")"
|
|||
|
||||
source "$commonDir/subst-vars.sh"
|
||||
# Make sure shellcheck knows all these will be defined by the above generated snippet
|
||||
: "${PATH?} ${coreutils?} ${dot?} ${SHELL?} ${PAGER?} ${busybox?} ${version?} ${system?} ${BUILD_SHARED_LIBS?}"
|
||||
: "${bindir?} ${coreutils?} ${dot?} ${SHELL?} ${PAGER?} ${busybox?} ${version?} ${system?} ${BUILD_SHARED_LIBS?}"
|
||||
|
||||
source "$commonDir/paths.sh"
|
||||
source "$commonDir/test-root.sh"
|
||||
|
||||
export TEST_ROOT=$(realpath ${TMPDIR:-/tmp}/nix-test)/${TEST_NAME:-default/tests\/functional//}
|
||||
test_nix_conf_dir=$TEST_ROOT/etc
|
||||
test_nix_conf=$test_nix_conf_dir/nix.conf
|
||||
|
||||
|
@ -60,14 +62,6 @@ unset XDG_CONFIG_HOME
|
|||
unset XDG_CONFIG_DIRS
|
||||
unset XDG_CACHE_HOME
|
||||
|
||||
if [[ -n "${NIX_CLIENT_PACKAGE:-}" ]]; then
|
||||
export PATH="$NIX_CLIENT_PACKAGE/bin":$PATH
|
||||
fi
|
||||
DAEMON_PATH="$PATH"
|
||||
if [[ -n "${NIX_DAEMON_PACKAGE:-}" ]]; then
|
||||
DAEMON_PATH="${NIX_DAEMON_PACKAGE}/bin:$DAEMON_PATH"
|
||||
fi
|
||||
|
||||
export IMPURE_VAR1=foo
|
||||
export IMPURE_VAR2=bar
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue