about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/build-hook.hook.sh23
-rw-r--r--tests/build-hook.sh10
-rw-r--r--tests/build-remote.sh13
-rw-r--r--tests/local.mk2
4 files changed, 5 insertions, 43 deletions
diff --git a/tests/build-hook.hook.sh b/tests/build-hook.hook.sh
deleted file mode 100755
index c7472eab7600..000000000000
--- a/tests/build-hook.hook.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#! /bin/sh
-
-#set -x
-
-while read x y drv rest; do
-
-    echo "HOOK for $drv" >&2
-
-    outPath=`sed 's/Derive(\[("out",\"\([^\"]*\)\".*/\1/' $drv`
-
-    echo "output path is $outPath" >&2
-
-    if `echo $outPath | grep -q input-1`; then
-        echo "# accept" >&2
-        read inputs
-        read outputs
-        mkdir $outPath
-        echo "BAR" > $outPath/foo
-    else
-        echo "# decline" >&2
-    fi
-
-done
diff --git a/tests/build-hook.sh b/tests/build-hook.sh
deleted file mode 100644
index 2005c7cebdc4..000000000000
--- a/tests/build-hook.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-source common.sh
-
-clearStore
-
-outPath=$(nix-build build-hook.nix --no-out-link --option build-hook $(pwd)/build-hook.hook.sh)
-
-echo "output path is $outPath"
-
-text=$(cat "$outPath"/foobar)
-if test "$text" != "BARBAR"; then exit 1; fi
diff --git a/tests/build-remote.sh b/tests/build-remote.sh
index e27ce7e25a8e..603b57c59ed0 100644
--- a/tests/build-remote.sh
+++ b/tests/build-remote.sh
@@ -9,16 +9,11 @@ chmod -R u+w $TEST_ROOT/store0 || true
 chmod -R u+w $TEST_ROOT/store1 || true
 rm -rf $TEST_ROOT/store0 $TEST_ROOT/store1
 
-# FIXME: --option is not passed to build-remote, so have to create a config file.
-export NIX_CONF_DIR=$TEST_ROOT/etc2
-mkdir -p $NIX_CONF_DIR
-echo "
-sandbox-paths = /nix/store
-sandbox-build-dir = /build-tmp
-" > $NIX_CONF_DIR/nix.conf
+nix build -f build-hook.nix -o $TEST_ROOT/result --max-jobs 0 \
+  --sandbox-paths /nix/store --sandbox-build-dir /build-tmp \
+  --builders "local?root=$TEST_ROOT/store0; local?root=$TEST_ROOT/store1 - - 1 1 foo"
 
-outPath=$(nix-build build-hook.nix --no-out-link -j0 \
-  --option builders "local?root=$TEST_ROOT/store0; local?root=$TEST_ROOT/store1 - - 1 1 foo")
+outPath=$TEST_ROOT/result
 
 cat $outPath/foobar | grep FOOBAR
 
diff --git a/tests/local.mk b/tests/local.mk
index 7d99a0fc7675..19d6f1893d29 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -3,7 +3,7 @@ check:
 
 nix_tests = \
   init.sh hash.sh lang.sh add.sh simple.sh dependencies.sh \
-  build-hook.sh gc.sh gc-concurrent.sh \
+  gc.sh gc-concurrent.sh \
   referrers.sh user-envs.sh logging.sh nix-build.sh misc.sh fixed.sh \
   gc-runtime.sh check-refs.sh filter-source.sh \
   remote-store.sh export.sh export-graph.sh \