mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-09 17:00:11 -04:00
remote archiver tests: use rest:/// rather than ssh://
This commit is contained in:
parent
39ac734b9c
commit
f53dd6c3c4
3 changed files with 10 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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]):
|
||||
|
|
|
|||
Loading…
Reference in a new issue