Fix nix-profile test in a chroot

http://hydra.nixos.org/build/36462078
This commit is contained in:
Eelco Dolstra 2016-05-31 13:07:24 +02:00
parent c9ff3747db
commit 759ac27f28
2 changed files with 8 additions and 3 deletions

View File

@ -22,6 +22,7 @@ export HOME=$TEST_HOME
mkdir -p $TEST_HOME
export PATH=@bindir@:$PATH
coreutils=@coreutils@
export NIX_BUILD_HOOK=
export dot=@dot@

View File

@ -1,10 +1,14 @@
source common.sh
sed -e "s|@localstatedir@|$TEST_ROOT/profile-var|g" -e "s|@coreutils@|$coreutils|g" < ../scripts/nix-profile.sh.in > $TEST_ROOT/nix-profile.sh
user=$(whoami)
rm -rf $TEST_HOME
rm -rf $TEST_HOME $TEST_ROOT/profile-var
mkdir -p $TEST_HOME
USER=$user $SHELL -e -c ". ../scripts/nix-profile.sh"
USER=$user $SHELL -e -c ". ../scripts/nix-profile.sh" # test idempotency
USER=$user $SHELL -e -c ". $TEST_ROOT/nix-profile.sh; set"
USER=$user $SHELL -e -c ". $TEST_ROOT/nix-profile.sh" # test idempotency
[ -L $TEST_HOME/.nix-profile ]
[ -e $TEST_HOME/.nix-channels ]
[ -e $TEST_ROOT/profile-var/nix/gcroots/per-user/$user ]
[ -e $TEST_ROOT/profile-var/nix/profiles/per-user/$user ]