aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-05-31 13:07:24 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-05-31 13:07:24 +0200
commit759ac27f282182075047887dd7574749eea2488a (patch)
treee7fcf89f1def8eb2186f487d947139e1ac58334f /tests
parentc9ff3747db50ad31465e0b67ab9d0ffff36d2e86 (diff)
Fix nix-profile test in a chroot
http://hydra.nixos.org/build/36462078
Diffstat (limited to 'tests')
-rw-r--r--tests/common.sh.in1
-rw-r--r--tests/nix-profile.sh10
2 files changed, 8 insertions, 3 deletions
diff --git a/tests/common.sh.in b/tests/common.sh.in
index 756c20c9d..e721c3696 100644
--- a/tests/common.sh.in
+++ b/tests/common.sh.in
@@ -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@
diff --git a/tests/nix-profile.sh b/tests/nix-profile.sh
index 2cc3910ba..b244815e2 100644
--- a/tests/nix-profile.sh
+++ b/tests/nix-profile.sh
@@ -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 ]