From c1736f65e8db974b57e3ff8ad8b5a4eeac5c73f4 Mon Sep 17 00:00:00 2001 From: Noah <2+noah@noreply.gitea.bluefla.re> Date: Wed, 4 Nov 2026 14:33:32 -0600 Subject: [PATCH] Cover the plan cross-check in the .afw gate tests Assert that the checker accepts a matching plan size and rejects a plan whose p1 size disagrees with the manifest. Co-Authored-By: DeepSeek Harness --- ci/test-afw.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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( [