Share accounts: an older live Blancco release warns instead of failing

A fresh server gets boot-tools/blancco from the USB, which can be an older
Blancco (7.15.1) than our preferences (7.20). The version guard refused to
patch its config.img and the exception failed the whole share apply, so the
first-boot playbook failed. refresh_live_prefs() now returns a warning for
config.img and still writes the served preferences.xml (UEFI path).
This commit is contained in:
cproudlock
2026-10-17 12:40:00 -04:00
parent 7572692b84
commit c2b0c3d35e
4 changed files with 37 additions and 7 deletions

View File

@@ -179,6 +179,23 @@ class ShareAccounts(Fixture):
with open(BP.repo_prefs_path(), "rb") as f:
self.assertEqual(self.prefs_share_pw(BP.apply(f.read())), PW)
def test_older_live_release_warns_instead_of_failing(self):
# A config.img from an older Blancco than our preferences (the repo
# payload can lag): the version guard refuses it. The served
# preferences (UEFI path) still change; the change is not refused.
old = cpio_file(self.cfg, "preferences.xml").replace(
b"<major>20</major>", b"<major>15</major>", 1)
self.assertIn(b"<major>15</major>", old)
cfg = newc({"report.key": b"KEY", "preferences.xml": old, "config.xml": b"<c/>"})
with open(os.path.join(BU.blancco_root(), "config.img"), "wb") as f:
f.write(cfg)
done = SA.set_password("blancco", PW)
self.assertTrue(any("WARNING" in d and "config.img" in d for d in done), done)
with open(BP.served_prefs_path(), "rb") as f:
self.assertEqual(self.prefs_share_pw(f.read()), PW)
with open(os.path.join(BU.blancco_root(), "config.img"), "rb") as f:
self.assertEqual(f.read(), cfg) # left as it was
def test_apply_is_idempotent(self):
SA.set_password("pxe-upload", PW)
SA.set_password("clonezilla", PW + "x")