Skip to content

Commit 0897bfb

Browse files
Merge pull request #9893 from ThomasWaldmann/fix-test-master
fix test_rest_serve_command_ssh
2 parents 6d9f351 + aeeb427 commit 0897bfb

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/borg/testsuite/repository_test.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ def test_rest_serve_command_local():
2020

2121
def test_rest_serve_command_ssh(monkeypatch):
2222
# rest:// with a host is reached via ssh, running "borg serve --rest" remotely.
23-
monkeypatch.delenv("BORGSTORE_RSH", raising=False)
23+
# we override BORGSTORE_RSH to a simple "ssh" here to simplify testing.
24+
# without that, borgstore 0.5.5+ would also set some ssh options via cmdline.
25+
monkeypatch.setenv("BORGSTORE_RSH", "ssh")
2426
monkeypatch.delenv("BORG_REMOTE_PATH", raising=False)
25-
cmd = rest_serve_command(Location("rest://user@host:2222/repo/path"))
26-
assert cmd[:4] == ["ssh", "-p", "2222", "user@host"]
27-
assert cmd[4:] == ["borg", "serve", "--rest", "--backend", "FILE:repo/path"]
27+
cmd = rest_serve_command(Location("rest://user@host/repo/path"))
28+
assert cmd[:2] == ["ssh", "user@host"]
29+
assert cmd[-5:] == ["borg", "serve", "--rest", "--backend", "FILE:repo/path"]
2830

2931

3032
@pytest.fixture()

0 commit comments

Comments
 (0)