remote archiver tests: use rest:/// rather than ssh://

This commit is contained in:
Thomas Waldmann 2026-06-01 23:58:28 +02:00
parent 39ac734b9c
commit f53dd6c3c4
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01
3 changed files with 10 additions and 3 deletions

View file

@ -96,7 +96,7 @@ class ArchiverSetup:
self.patterns_file_path: str | None = None
def get_kind(self) -> str:
if self.repository_location.startswith("ssh://__testsuite__"):
if self.repository_location.startswith("ssh://__testsuite__") or self.repository_location.startswith("rest://"):
return "remote"
elif self.EXE == "borg.exe":
return "binary"
@ -152,7 +152,7 @@ def archiver(tmp_path, set_env_variables):
@pytest.fixture()
def remote_archiver(archiver):
archiver.repository_location = "ssh://__testsuite__/" + str(archiver.repository_path)
archiver.repository_location = "rest://" + "/" + str(archiver.repository_path)
yield archiver

View file

@ -178,7 +178,10 @@ def open_archive(repo_path, name):
def open_repository(archiver):
if archiver.get_kind() == "remote":
return RemoteRepository(Location(archiver.repository_location))
location = Location(archiver.repository_location)
if location.proto == "rest":
return Repository(location, exclusive=True)
return RemoteRepository(location)
else:
return Repository(archiver.repository_path, exclusive=True)

View file

@ -278,6 +278,8 @@ def test_unknown_mandatory_feature_in_cache(archivers, request):
# Begin Remote Tests
def test_remote_repo_restrict_to_path(remote_archiver):
if remote_archiver.repository_location.startswith("rest://"):
pytest.skip("Not applicable for rest:// protocol")
original_location, repo_path = remote_archiver.repository_location, remote_archiver.repository_path
# restricted to repo directory itself:
with patch.object(RemoteRepository, "extra_test_args", ["--restrict-to-path", repo_path]):
@ -306,6 +308,8 @@ def test_remote_repo_restrict_to_path(remote_archiver):
def test_remote_repo_restrict_to_repository(remote_archiver):
if remote_archiver.repository_location.startswith("rest://"):
pytest.skip("Not applicable for rest:// protocol")
repo_path = remote_archiver.repository_path
# restricted to repo directory itself:
with patch.object(RemoteRepository, "extra_test_args", ["--restrict-to-repository", repo_path]):