From 120553c9759e16660f8e595a2341f21c065fcedb Mon Sep 17 00:00:00 2001 From: cproudlock Date: Fri, 16 Oct 2026 21:00:52 -0400 Subject: [PATCH] Test: image re-import merges Deploy/Applications (MCL certs) and keeps the Engineering Layer --- webapp/tests/test_engineering_layer.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/webapp/tests/test_engineering_layer.py b/webapp/tests/test_engineering_layer.py index e00881e..cb2838b 100644 --- a/webapp/tests/test_engineering_layer.py +++ b/webapp/tests/test_engineering_layer.py @@ -122,6 +122,24 @@ class EngineeringLayer(unittest.TestCase): EL.restore("../../etc") + def test_image_reimport_keeps_payload_and_adds_certs(self): + # MCL's Deploy\Applications carries the GE CA certs the unattends + # install; re-importing it must merge, not wipe extra_engineering. + from services import deploy + self.up("payload.zip", payload_zip("3.1")) + src = tempfile.mkdtemp(dir=_T) + apps = os.path.join(src, "Applications") + os.makedirs(apps) + with open(os.path.join(apps, "GE_External_Root_CA_2_1.cer"), "wb") as f: + f.write(b"cert") + dst = os.path.join(config.SAMBA_SHARE, "gea-engineer", "Deploy") + deploy.import_deploy(src, dst, "gea-engineer") + self.assertTrue(os.path.isfile(os.path.join(dst, "Applications", "GE_External_Root_CA_2_1.cer"))) + st = EL.status() + self.assertEqual(st["active"]["version"], "3.1") + self.assertTrue(st["prereqs"]["present"] and st["script"]) + + class EngineeringLayerPages(unittest.TestCase): def setUp(self): shutil.rmtree(config.SAMBA_SHARE, ignore_errors=True)