Fix candidate build metadata and runtime safeguards
Offline project checks / check (push) Canceled after 0s
Offline project checks / check (push) Canceled after 0s
Repair kernel patch formatting and refresh kernel/camera package revisions and checksums. Integrate battery guard into generated images, correct charging controls and emergency shutdown handling, and reject invalid camera authentication configuration. Extend recipe validation and regression coverage, and update build and installation documentation. Kernel, camera and image compilation remain pending on the build server.
This commit is contained in:
@@ -75,6 +75,41 @@ class ArtifactTests(unittest.TestCase):
|
||||
self.verify()
|
||||
|
||||
|
||||
class RecipeChecksTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.temp = tempfile.TemporaryDirectory()
|
||||
self.addCleanup(self.temp.cleanup)
|
||||
self.root = Path(self.temp.name)
|
||||
self.package = self.root / 'camera'
|
||||
self.package.mkdir()
|
||||
|
||||
def recipe(self, name, content):
|
||||
source = self.package / name
|
||||
source.write_text(content)
|
||||
(self.package / 'APKBUILD').write_text(
|
||||
'sha512sums="\n' + workflow.digest(source, 'sha512') + ' ' + name + '\n"\n')
|
||||
return source
|
||||
|
||||
def check(self):
|
||||
workflow.recipe_checks(self.root, set(), packages=('camera',))
|
||||
|
||||
def test_camera_source_checksum_is_checked(self):
|
||||
source = self.recipe('serve.py', 'print("original")\n')
|
||||
self.check()
|
||||
source.write_text('print("changed")\n')
|
||||
with self.assertRaisesRegex(ValueError, 'Recipe input'):
|
||||
self.check()
|
||||
|
||||
def test_patch_syntax_is_checked_even_with_matching_checksum(self):
|
||||
self.recipe('bad.patch', '--- a/file\n+++ b/file\n@@ -1 +1,2 @@\n-old\n+new\n')
|
||||
with self.assertRaisesRegex(ValueError, 'Invalid patch format'):
|
||||
self.check()
|
||||
|
||||
def test_valid_patch_is_accepted_without_upstream_checkout(self):
|
||||
self.recipe('valid.patch', '--- a/file\n+++ b/file\n@@ -1 +1 @@\n-old\n+new\n')
|
||||
self.check()
|
||||
|
||||
|
||||
class PrepareTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.temp = tempfile.TemporaryDirectory()
|
||||
|
||||
Reference in New Issue
Block a user