about summary refs log tree commit diff
path: root/tests/common.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'tests/common.sh.in')
-rw-r--r--tests/common.sh.in31
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