From 468e92655ad1cddf8cb0d5620b3eb2bab47857c8 Mon Sep 17 00:00:00 2001 From: ScottW514 Date: Wed, 9 Sep 2026 18:28:47 -0400 Subject: [PATCH] Teach the manifest guard test about the version file The guard keeps scripts/manifest-from-tree.py and forgefirm-image-manifest.bbclass computing the same identity, so it pins the skip list by value and the new suffix failed it. It now expects the version file in both places, and a second case proves the point the change exists for: setting the release number leaves the layer hash where it was. My miss: I proved the identity by hand and pushed without running the unit suite first. --- forgetest/tests/test_tree_manifest.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/forgetest/tests/test_tree_manifest.py b/forgetest/tests/test_tree_manifest.py index f205b8e..87c5b05 100644 --- a/forgetest/tests/test_tree_manifest.py +++ b/forgetest/tests/test_tree_manifest.py @@ -94,13 +94,28 @@ class TreeManifestTests(unittest.TestCase): self.assertNotEqual(self.mod.layer_content(self.layer), base) def test_layer_hash_matches_the_bbclass_rule(self): - # The same skip list as FORGEFIRM_MANIFEST_PIN_SUFFIX + *.md in - # forgefirm-image-manifest.bbclass. + # The same skip list as *.md plus FORGEFIRM_MANIFEST_PIN_SUFFIX and + # FORGEFIRM_MANIFEST_VERSION_SUFFIX in + # forgefirm-image-manifest.bbclass. The two implementations compute + # the same identity - one on the build host, one on a workstation - + # so a suffix added to either without the other is the failure this + # guards. bbclass = os.path.join(REPO, "meta-forgefirm", "classes", "forgefirm-image-manifest.bbclass") with open(bbclass, encoding="utf-8") as f: text = f.read() self.assertIn('FORGEFIRM_MANIFEST_PIN_SUFFIX ?= "-pin.inc"', text) - self.assertEqual(self.mod.LAYER_SKIP_SUFFIXES, (".md", "-pin.inc")) + self.assertIn('FORGEFIRM_MANIFEST_VERSION_SUFFIX ?= "forgefirm-release.inc"', text) + self.assertEqual(self.mod.LAYER_SKIP_SUFFIXES, + (".md", "-pin.inc", "forgefirm-release.inc")) + + def test_layer_hash_ignores_the_release_version(self): + # The version is metadata: setting the release number must not move + # the layer hash, or the bump would invalidate the campaign that + # authorizes the release. + self.write("forgefirm-release.inc",'FORGEFIRM_RELEASE ?= "0.0.1"\n') + base = self.mod.layer_content(self.layer) + self.write("forgefirm-release.inc",'FORGEFIRM_RELEASE ?= "0.0.2"\n') + self.assertEqual(self.mod.layer_content(self.layer), base) if __name__ == "__main__":