Author: eelco
Date: Wed Jul 20 11:50:13 2011
New Revision: 27838
URL: https://svn.nixos.org/websvn/nix/?rev=27838&sc=1

Log:
* Refactoring.

Modified:
   nix/trunk/tests/common.sh.in
   nix/trunk/tests/remote-store.sh

Modified: nix/trunk/tests/common.sh.in
==============================================================================
--- nix/trunk/tests/common.sh.in        Wed Jul 20 11:47:00 2011        (r27837)
+++ nix/trunk/tests/common.sh.in        Wed Jul 20 11:50:13 2011        (r27838)
@@ -18,9 +18,7 @@
 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 @@
     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

Modified: nix/trunk/tests/remote-store.sh
==============================================================================
--- nix/trunk/tests/remote-store.sh     Wed Jul 20 11:47:00 2011        (r27837)
+++ nix/trunk/tests/remote-store.sh     Wed Jul 20 11:50:13 2011        (r27838)
@@ -1,7 +1,5 @@
 source common.sh
 
-export FORCE_NIX_REMOTE=1
-
 echo '*** testing slave mode ***'
 clearStore
 clearManifests
@@ -10,10 +8,6 @@
 echo '*** testing daemon mode ***'
 clearStore
 clearManifests
-$nixworker --daemon &
-pidDaemon=$!
-trap "kill -9 $pidDaemon" EXIT
-NIX_REMOTE=daemon $SHELL ./user-envs.sh
-kill -9 $pidDaemon
-wait $pidDaemon || true
-trap "" EXIT
+startDaemon
+$SHELL ./user-envs.sh
+killDaemon
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to