about summary refs log tree commit diff
path: root/tests/common.sh.in
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2011-07-20T11·50+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2011-07-20T11·50+0000
commit4bdb51e621e2690e561b7581d5670af08e7b3170 (patch)
treedc7e24f8890d2ae8bf59fbf5a6c31feae73e20f7 /tests/common.sh.in
parent0243eea4b92ca1598353e31b7e3c0d195c903221 (diff)
* Refactoring.
Diffstat (limited to 'tests/common.sh.in')
-rw-r--r--tests/common.sh.in17
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/common.sh.in b/tests/common.sh.in
index 2c47d75eea23..b03cd49ec70d 100644
--- a/tests/common.sh.in
+++ b/tests/common.sh.in
@@ -18,9 +18,7 @@ export NIX_LIBEXEC_DIR=$TEST_ROOT/bin
 export NIX_ROOT_FINDER=
 export SHARED=$TEST_ROOT/shared
 
-if test -z "$FORCE_NIX_REMOTE"; then
-    export NIX_REMOTE=
-fi
+export NIX_REMOTE=
 
 export REAL_BIN_DIR=@bindir@
 export REAL_LIBEXEC_DIR=@libexecdir@
@@ -77,6 +75,19 @@ clearManifests() {
     rm -f $NIX_STATE_DIR/manifests/*
 }
 
+startDaemon() {
+    $nixworker --daemon &
+    pidDaemon=$!
+    trap "kill -9 $pidDaemon" EXIT
+    export NIX_REMOTE=daemon
+}
+
+killDaemon() {
+    kill -9 $pidDaemon
+    wait $pidDaemon || true
+    trap "" EXIT
+}
+
 fail() {
     echo "$1"
     exit 1