Files
lix/tests/functional2/store/test_ssh_relay.py
T
eldritch horrors fae0242f69 testing: migrate ssh-relay.sh
Change-Id: I520c8be1c30b4ee7660c8ceeba62a6d0757c337b
2026-02-28 22:09:44 +00:00

21 lines
711 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"
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"