Support Python 3.11 isolated restore
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a02994-7685-7940-bf34-3555b8256018
This commit is contained in:
parent
295bf43d54
commit
2c92b97f37
3 changed files with 21 additions and 3 deletions
|
|
@ -163,6 +163,18 @@ class S1BackupRecoveryTests(unittest.TestCase):
|
|||
with self.assertRaisesRegex(RestoreError, "digest mismatch"):
|
||||
validate_bundle(bundle, self.spec)
|
||||
|
||||
def test_isolated_restore_supports_python_311_tar_api(self) -> None:
|
||||
bundle = self._create()
|
||||
with mock.patch("s1_restore.sys.version_info", (3, 11, 0)):
|
||||
restored = extract_bundle(
|
||||
bundle=bundle,
|
||||
spec_path=self.spec,
|
||||
destination=self.root / "restore-python311",
|
||||
identity=self.identity,
|
||||
age_binary=shutil.which("age"),
|
||||
)
|
||||
self.assertEqual("fixture-host\n", (restored / "etc/hostname").read_text())
|
||||
|
||||
def test_archive_traversal_and_escaping_link_fail(self) -> None:
|
||||
member = tarfile.TarInfo("../../etc/shadow")
|
||||
with self.assertRaisesRegex(RestoreError, "unsafe archive member"):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue