Files
lix/tests/functional2/store/test_ssh_relay.py
T
piegamesandeldritch horrors d5044f0016 testlib: default nix fixture to also test all daemon protocols (2.5/3)
All tests should have been clear here, but alas

Co-authored-by: eldritch horrors <pennae@lix.systems>
Change-Id: Id642be1f6e0fb714b844ee5348dc096866cf3906
2026-06-28 16:52:12 +00:00

21 lines
730 B
Python

from pathlib import Path
from testlib.fixtures.nix import Nix
from testlib.fixtures.file_helper import File, with_files
@with_files({"hello": File("hello")})
def test_ssh_relay(nix: Nix):
"""
test that nesting ssh stores via remote-store url parameters works.
we don't currently check that each store spawns a new ssh instance,
but if it didn't we'd almost certainly get remote execution errors.
"""
nix.settings.add_xp_feature("nix-command")
ssh_localhost = "ssh://localhost?remote-store=local"
store = ssh_localhost + 3 * f"?remote-store={ssh_localhost}"
out = nix.nix(["store", "add-path", "--store", store, "hello"]).run().ok().stdout_plain
assert Path(out).read_text() == "hello"