diff --git a/ci/test-afw.py b/ci/test-afw.py index 63a6e72..3a88332 100755 --- a/ci/test-afw.py +++ b/ci/test-afw.py @@ -314,6 +314,27 @@ class AfwTests(unittest.TestCase): self.assertNotEqual(result.returncode, 0) self.assertIn("required image is missing", result.stderr) + def test_plan_size_cross_check(self): + bundle = build_afw(self.temp, self.input) + plan = self.temp / "plan.json" + plan.write_text(json.dumps({ + "board": "cv1835", + "arch": "arm64", + "bootloader_policy": "preserve", + "partitions": [{"name": "p1", "size": P1}], + })) + result = self.check(bundle, "--allow-unsigned", "--plan", plan) + self.assertEqual(result.returncode, 0, result.stderr) + plan.write_text(json.dumps({ + "board": "cv1835", + "arch": "arm64", + "bootloader_policy": "preserve", + "partitions": [{"name": "p1", "size": P1 - 1}], + })) + result = self.check(bundle, "--allow-unsigned", "--plan", plan) + self.assertNotEqual(result.returncode, 0) + self.assertIn("differs from the manifest", result.stderr) + def test_unknown_board_fails(self): result = run( [