2017-05-02 16:35:35 +03:00
|
|
|
source common.sh
|
|
|
|
|
|
|
|
clearStore
|
|
|
|
|
2018-01-13 15:18:35 +02:00
|
|
|
if ! canUseSandbox; then exit; fi
|
2020-06-25 19:26:34 +03:00
|
|
|
if ! [[ $busybox =~ busybox ]]; then exit; fi
|
2017-05-02 16:35:35 +03:00
|
|
|
|
2020-06-25 19:26:34 +03:00
|
|
|
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
|
2017-05-02 16:35:35 +03:00
|
|
|
|
2020-06-25 19:26:34 +03:00
|
|
|
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" \
|
2018-09-28 16:57:27 +03:00
|
|
|
--system-features foo
|
2017-05-02 16:35:35 +03:00
|
|
|
|
2020-06-25 19:26:34 +03:00
|
|
|
outPath=$(readlink -f $TEST_ROOT/result)
|
2017-05-02 16:35:35 +03:00
|
|
|
|
2020-06-25 19:26:34 +03:00
|
|
|
cat $TEST_ROOT/machine0/$outPath | grep FOOBAR
|
2017-05-02 16:35:35 +03:00
|
|
|
|
2020-06-25 19:26:34 +03:00
|
|
|
# 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
|