From 1bda006b748ffec371096af56a8fbf7125658f71 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 13 Sep 2012 17:58:14 -0400 Subject: [PATCH] Add a test for nix-profile.sh --- tests/Makefile.am | 2 +- tests/common.sh.in | 1 + tests/nix-profile.sh | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 tests/nix-profile.sh diff --git a/tests/Makefile.am b/tests/Makefile.am index 641e29d7e..df3c9c600 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -10,7 +10,7 @@ TESTS = init.sh hash.sh lang.sh add.sh simple.sh dependencies.sh \ remote-store.sh export.sh export-graph.sh negative-caching.sh \ binary-patching.sh timeout.sh secure-drv-outputs.sh nix-channel.sh \ multiple-outputs.sh import-derivation.sh fetchurl.sh optimise-store.sh \ - binary-cache.sh + binary-cache.sh nix-profile.sh XFAIL_TESTS = diff --git a/tests/common.sh.in b/tests/common.sh.in index 1d473ca05..ee0ddfbb6 100644 --- a/tests/common.sh.in +++ b/tests/common.sh.in @@ -1,6 +1,7 @@ set -e datadir="@datadir@" +sysconfdir="@sysconfdir@" export TEST_ROOT=$(pwd)/test-tmp export NIX_STORE_DIR diff --git a/tests/nix-profile.sh b/tests/nix-profile.sh new file mode 100644 index 000000000..5530d7737 --- /dev/null +++ b/tests/nix-profile.sh @@ -0,0 +1,10 @@ +source common.sh + +home=$TEST_ROOT/home +rm -rf $home +mkdir -p $home +HOME=$home $SHELL -e -c ". $sysconfdir/profile.d/nix.sh" +HOME=$home $SHELL -e -c ". $sysconfdir/profile.d/nix.sh" # test idempotency + +[ -e $home/.nix-profile ] +[ -e $home/.nix-channels ]