aboutsummaryrefslogtreecommitdiff
path: root/tests/build-remote.sh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-06-26 08:46:46 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-06-26 08:46:46 +0200
commitadf2fbbdc2c94644b0d1023d844c7dc0e485a20f (patch)
tree5999d2c223cb24402995747d79a3de6d6aaebb73 /tests/build-remote.sh
parent09fc06daab280735dd2ec94276f00a9c5bffd9b2 (diff)
parentb7ccf7ae2af3d7eaf3696358ecbbce5a2bcfe652 (diff)
Merge remote-tracking branch 'origin/master' into flakes
Diffstat (limited to 'tests/build-remote.sh')
-rw-r--r--tests/build-remote.sh33
1 files changed, 20 insertions, 13 deletions
diff --git a/tests/build-remote.sh b/tests/build-remote.sh
index a550f4460..4dfb753e1 100644
--- a/tests/build-remote.sh
+++ b/tests/build-remote.sh
@@ -3,22 +3,29 @@ source common.sh
clearStore
if ! canUseSandbox; then exit; fi
-if [[ ! $SHELL =~ /nix/store ]]; then exit; fi
+if ! [[ $busybox =~ busybox ]]; then exit; fi
-chmod -R u+w $TEST_ROOT/store0 || true
-chmod -R u+w $TEST_ROOT/store1 || true
-rm -rf $TEST_ROOT/store0 $TEST_ROOT/store1
+chmod -R u+w $TEST_ROOT/machine0 || true
+chmod -R u+w $TEST_ROOT/machine1 || true
+chmod -R u+w $TEST_ROOT/machine2 || true
+rm -rf $TEST_ROOT/machine0 $TEST_ROOT/machine1 $TEST_ROOT/machine2
+rm -f $TEST_ROOT/result
-nix build -f build-hook.nix -o $TEST_ROOT/result --max-jobs 0 \
- --sandbox-paths /nix/store --sandbox-build-dir /build-tmp \
- --builders "$TEST_ROOT/store0; $TEST_ROOT/store1 - - 1 1 foo" \
+unset NIX_STORE_DIR
+unset NIX_STATE_DIR
+
+# Note: ssh://localhost bypasses ssh, directly invoking nix-store as a
+# child process. This allows us to test LegacySSHStore::buildDerivation().
+nix build -L -v -f build-hook.nix -o $TEST_ROOT/result --max-jobs 0 \
+ --arg busybox $busybox \
+ --store $TEST_ROOT/machine0 \
+ --builders "ssh://localhost?remote-store=$TEST_ROOT/machine1; $TEST_ROOT/machine2 - - 1 1 foo" \
--system-features foo
-outPath=$TEST_ROOT/result
+outPath=$(readlink -f $TEST_ROOT/result)
-cat $outPath/foobar | grep FOOBAR
+cat $TEST_ROOT/machine0/$outPath | grep FOOBAR
-# Ensure that input1 was built on store1 due to the required feature.
-p=$(readlink -f $outPath/input-2)
-(! nix path-info --store $TEST_ROOT/store0 --all | grep builder-build-hook-input-1.sh)
-nix path-info --store $TEST_ROOT/store1 --all | grep builder-build-hook-input-1.sh
+# Ensure that input1 was built on store2 due to the required feature.
+(! nix path-info --store $TEST_ROOT/machine1 --all | grep builder-build-remote-input-1.sh)
+nix path-info --store $TEST_ROOT/machine2 --all | grep builder-build-remote-input-1.sh