diff --git a/src/borg/conftest.py b/src/borg/conftest.py index 074ace179..e9ea95f61 100644 --- a/src/borg/conftest.py +++ b/src/borg/conftest.py @@ -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 diff --git a/src/borg/testsuite/archiver/__init__.py b/src/borg/testsuite/archiver/__init__.py index ebb27f790..3169844e4 100644 --- a/src/borg/testsuite/archiver/__init__.py +++ b/src/borg/testsuite/archiver/__init__.py @@ -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) diff --git a/src/borg/testsuite/archiver/checks_test.py b/src/borg/testsuite/archiver/checks_test.py index eff167027..88efa31c5 100644 --- a/src/borg/testsuite/archiver/checks_test.py +++ b/src/borg/testsuite/archiver/checks_test.py @@ -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]):