mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-06 13:05:47 +00:00
Add an end-to-end probe for guest memory above the host address limit
This commit is contained in:
1 parent
15b5d46f70
commit
46e36d95a3
3 files changed
+117
-1
No files matched your search
@@ -8,6 +8,7 @@ from pathlib import Path
|
||||
|
||||
REPO = Path(__file__).resolve().parents[2]
|
||||
PATCH = REPO / "tools/fex/patches/0027-fixed-guest-memory-above-host-address-limit.patch"
|
||||
PROBE = REPO / "tools/fex/probes/guest-high-memory.c"
|
||||
|
||||
SOURCE = "Source/Tools/LinuxEmulation/LinuxSyscalls/GuestHighMemory.cpp"
|
||||
HEADER = "Source/Tools/LinuxEmulation/LinuxSyscalls/GuestHighMemory.h"
|
||||
@@ -402,5 +403,27 @@ class GuestHighMemoryTest(unittest.TestCase):
|
||||
self.assertNotIn("OverlapsLocked", text)
|
||||
|
||||
|
||||
@unittest.skipUnless(platform.machine() == "x86_64", "the probe is x86-64 code")
|
||||
class GuestHighMemoryProbeTest(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
compiler = shutil.which("cc") or shutil.which("gcc") or shutil.which("clang")
|
||||
if not compiler:
|
||||
raise unittest.SkipTest("no C compiler")
|
||||
cls.tmp = Path(tempfile.mkdtemp(prefix="fex-guest-high-memory-"))
|
||||
cls.binary = cls.tmp / "probe"
|
||||
subprocess.run([compiler, "-O2", "-pthread", "-o", str(cls.binary), str(PROBE)], check=True, capture_output=True, text=True)
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
shutil.rmtree(cls.tmp, ignore_errors=True)
|
||||
|
||||
def test_native_kernel_passes_every_check(self):
|
||||
result = subprocess.run([str(self.binary)], capture_output=True, text=True, timeout=120)
|
||||
self.assertEqual(result.returncode, 0, result.stdout)
|
||||
self.assertNotIn("FAIL", result.stdout)
|
||||
self.assertEqual(result.stdout.splitlines()[-1], "RESULT PASS")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user