mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 05:16:01 +00:00
Bundle verified PowerVR graphics components through existing build preparation
This commit is contained in:
1 parent
cf4b210ef8
commit
690f737a4c
24 files changed
+1795
-1
No files matched your search
@@ -6,6 +6,7 @@ import subprocess
|
||||
import tarfile
|
||||
import tempfile
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
from zipfile import ZipFile
|
||||
|
||||
|
||||
@@ -19,6 +20,10 @@ class RuntimeInputsTest(unittest.TestCase):
|
||||
self.temp = tempfile.TemporaryDirectory()
|
||||
self.addCleanup(self.temp.cleanup)
|
||||
self.root = Path(self.temp.name)
|
||||
# Component archive validation has its own binary/archive fixtures.
|
||||
component_check = patch.object(runtime, 'verify_powervr')
|
||||
component_check.start()
|
||||
self.addCleanup(component_check.stop)
|
||||
paths = runtime.outputs(self.root)
|
||||
for name in runtime.required():
|
||||
path = self.root / paths.get(name, 'app/src/main/' + name)
|
||||
@@ -55,6 +60,20 @@ class RuntimeInputsTest(unittest.TestCase):
|
||||
with self.assertRaisesRegex(ValueError, 'sources changed'):
|
||||
runtime.verify(self.root)
|
||||
|
||||
def test_changed_powervr_wrapper_rejects_old_outputs(self):
|
||||
wrapper = self.root / 'tools/hybris/run-proton.py'
|
||||
wrapper.parent.mkdir(parents=True)
|
||||
wrapper.write_text('current wrapper')
|
||||
runtime.record(self.root)
|
||||
wrapper.write_text('changed wrapper')
|
||||
with self.assertRaisesRegex(ValueError, 'sources changed'):
|
||||
runtime.verify(self.root)
|
||||
|
||||
def test_missing_powervr_bundle_cannot_be_attested(self):
|
||||
(self.root / 'app/src/main/assets/hybris/runtime.tzst').unlink()
|
||||
with self.assertRaisesRegex(ValueError, 'assets/hybris/runtime.tzst'):
|
||||
runtime.record(self.root)
|
||||
|
||||
def test_modified_prebuilt_binary_is_rejected(self):
|
||||
runtime.record(self.root)
|
||||
(self.root / 'app/src/main/jniLibs/arm64-v8a/libproot.so').write_bytes(b'old APK binary')
|
||||
|
||||
Reference in new issue
Block a user