File tree Expand file tree Collapse file tree 3 files changed +4
-20
lines changed Expand file tree Collapse file tree 3 files changed +4
-20
lines changed Original file line number Diff line number Diff line change 11import binascii
22import glob
33import io
4- import platform
54import shlex
65import subprocess
76from pathlib import Path
1716from unblob .models import ProcessResult
1817from unblob .processing import ExtractionConfig
1918from unblob .report import ExtractCommandFailedReport
20- from unblob .sandbox import AccessFS , SandboxError , restrict_access
2119
2220
2321@pytest .fixture (scope = "session" , autouse = True )
@@ -219,17 +217,3 @@ def start(self, s):
219217 rv .write (line .data )
220218
221219 return rv .getvalue ()
222-
223-
224- def is_sandbox_available ():
225- is_sandbox_available = True
226-
227- try :
228- restrict_access (AccessFS .read_write ("/" ))
229- except SandboxError :
230- is_sandbox_available = False
231-
232- if platform .architecture == "x86_64" and platform .system == "linux" :
233- assert is_sandbox_available , "Sandboxing should work at least on Linux-x86_64"
234-
235- return is_sandbox_available
Original file line number Diff line number Diff line change 77from click .testing import CliRunner
88
99import unblob .cli
10+ from rust .test_sandbox import landlock_supported
1011from unblob .extractors import Command
1112from unblob .extractors .command import MultiFileCommand
1213from unblob .handlers import BUILTIN_HANDLERS
1819 DEFAULT_SKIP_MAGIC ,
1920 ExtractionConfig ,
2021)
21- from unblob .testing import is_sandbox_available
2222from unblob .ui import (
2323 NullProgressReporter ,
2424 ProgressReporter ,
@@ -431,7 +431,7 @@ def test_clear_skip_magics(
431431
432432
433433@pytest .mark .skipif (
434- not is_sandbox_available (), reason = "Sandboxing is only available on Linux"
434+ not landlock_supported (), reason = "Sandboxing is only available on Linux"
435435)
436436def test_sandbox_escape (tmp_path : Path ):
437437 runner = CliRunner ()
Original file line number Diff line number Diff line change 22
33import pytest
44
5+ from rust .test_sandbox import landlock_supported
56from unblob .processing import ExtractionConfig
67from unblob .sandbox import Sandbox
7- from unblob .testing import is_sandbox_available
88
99pytestmark = pytest .mark .skipif (
10- not is_sandbox_available (), reason = "Sandboxing only works on Linux"
10+ not landlock_supported (), reason = "Sandboxing only works on Linux"
1111)
1212
1313
You can’t perform that action at this time.
0 commit comments