Skip to content

Commit

Permalink
mounted-ssh-ng store: integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
urbas committed Aug 29, 2023
1 parent cfa41c9 commit ab97b95
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libstore/ssh-store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ class MountedSSHStore : public virtual MountedSSHStoreConfig, public virtual SSH
* remote side see the direct root the client made?) seems bigger.
*
* In addition, the remote-side will have a process associated with
* the authenticating user handlering the connection (even if there
* the authenticating user handling the connection (even if there
* is a system-wide daemon or similar). This process can safely make
* the direct and indrect roots without there being such a risk of
* privilage escalation / symlinks in directories owned by the
* the direct and indirect roots without there being such a risk of
* privilege escalation / symlinks in directories owned by the
* originating requester that they cannot delete.
*/
Path addPermRoot(const StorePath & path, const Path & gcRoot) override
Expand Down
23 changes: 23 additions & 0 deletions tests/build-remote-with-mounted-ssh-ng.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
source common.sh

requireSandboxSupport
[[ $busybox =~ busybox ]] || skipTest "no busybox"

echo NIX_STORE_DIR=$NIX_STORE_DIR
echo NIX_STATE_DIR=$NIX_STATE_DIR

# Avoid store dir being inside sandbox build-dir
# export NIX_STORE_DIR=$TEST_ROOT/store
# export NIX_STATE_DIR=$TEST_ROOT/var/nix

enableFeatures mounted-ssh-store

nix build -Lvf simple.nix \
--arg busybox $busybox \
--out-link $TEST_ROOT/result-from-remote \
--store mounted-ssh-ng://localhost

# This verifies that the out link was actually created and valid. The ability
# to create out links (permanent gc roots) is the distinguishing feature of
# the mounted-ssh-ng store.
cat $TEST_ROOT/result-from-remote/hello | grepQuiet 'Hello World!'
1 change: 1 addition & 0 deletions tests/local.mk
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ nix_tests = \
build-remote-trustless-should-pass-2.sh \
build-remote-trustless-should-pass-3.sh \
build-remote-trustless-should-fail-0.sh \
build-remote-with-mounted-ssh-ng.sh \
nar-access.sh \
pure-eval.sh \
eval.sh \
Expand Down

0 comments on commit ab97b95

Please sign in to comment.