diff options
author | Shea Levy <shea@shealevy.com> | 2011-11-06T00·13+0000 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2011-11-06T00·13+0000 |
commit | 2721e9f56f92f5bd630dcbb0104fc56159cb28d4 (patch) | |
tree | f46ac1a8807b81cc54d176e8fb72915aa057f0ac /tests/common.sh.in | |
parent | bffe35acedafcd7c7237cb1415798362bff8a180 (diff) | |
parent | a6a3f3a8c26fdd6900880c13e924e6879d6c714c (diff) |
Merge from trunk
Diffstat (limited to 'tests/common.sh.in')
-rw-r--r-- | tests/common.sh.in | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/tests/common.sh.in b/tests/common.sh.in index b03cd49ec70d..62ac669df665 100644 --- a/tests/common.sh.in +++ b/tests/common.sh.in @@ -1,5 +1,7 @@ set -e +export TOP=$(pwd)/.. + export TEST_ROOT=$(pwd)/test-tmp export NIX_STORE_DIR if ! NIX_STORE_DIR=$(readlink -f $TEST_ROOT/store 2> /dev/null); then @@ -15,9 +17,12 @@ export NIX_DB_DIR=$TEST_ROOT/db export NIX_CONF_DIR=$TEST_ROOT/etc export NIX_BIN_DIR=$TEST_ROOT/bin export NIX_LIBEXEC_DIR=$TEST_ROOT/bin +export NIX_MANIFESTS_DIR=$TEST_ROOT/var/nix/manifests export NIX_ROOT_FINDER= export SHARED=$TEST_ROOT/shared +export PATH=$NIX_BIN_DIR:$TOP/scripts:$PATH + export NIX_REMOTE= export REAL_BIN_DIR=@bindir@ @@ -27,10 +32,10 @@ export REAL_DATA_DIR=@datadir@ export REAL_STORE_DIR=@storedir@ export NIX_BUILD_HOOK= export PERL=perl -export TOP=$(pwd)/.. -export bzip2_bin_test="@bzip2_bin_test@" -if test "${bzip2_bin_test:0:1}" != "/"; then - bzip2_bin_test=`pwd`/${bzip2_bin_test} +export PERL5LIB=$TOP/perl/lib:$PERL5LIB +export NIX_BZIP2="@bzip2_bin_test@/bzip2" +if test "${NIX_BZIP2:0:1}" != "/"; then + NIX_BZIP2=`pwd`/${NIX_BZIP2} fi export dot=@dot@ export xmllint="@xmllint@" @@ -42,13 +47,6 @@ export SHELL="@shell@" export version=@version@ export system=@system@ -export nixinstantiate=$TOP/src/nix-instantiate/nix-instantiate -export nixstore=$TOP/src/nix-store/nix-store -export nixenv=$TOP/src/nix-env/nix-env -export nixhash=$TOP/src/nix-hash/nix-hash -export nixworker=$TOP/src/nix-worker/nix-worker -export nixbuild=$NIX_BIN_DIR/nix-build - readLink() { ls -l "$1" | sed 's/.*->\ //' } @@ -65,7 +63,7 @@ clearStore() { mkdir "$NIX_STORE_DIR" rm -rf "$NIX_DB_DIR" mkdir "$NIX_DB_DIR" - $nixstore --init + nix-store --init clearProfiles rm -f "$NIX_STATE_DIR"/gcroots/auto/* rm -f "$NIX_STATE_DIR"/gcroots/ref @@ -76,7 +74,14 @@ clearManifests() { } startDaemon() { - $nixworker --daemon & + # Start the daemon, wait for the socket to appear. !!! + # ‘nix-worker’ should have an option to fork into the background. + rm -f $NIX_STATE_DIR/daemon-socket/socket + nix-worker --daemon & + for ((i = 0; i < 30; i++)); do + if [ -e $NIX_STATE_DIR/daemon-socket/socket ]; then break; fi + sleep 1 + done pidDaemon=$! trap "kill -9 $pidDaemon" EXIT export NIX_REMOTE=daemon |