Second review pass: strip account fields, clear stale cidata inputs, await OEM finalization
Codex xhigh round 2: - Strip account authentication fields (!users, !root-password, root_enc_password, auth_config account entries) from the archinstall config in OEM mode, not just user_credentials — a combined/legacy config could otherwise have archinstall create a provisioning account before OOBE. - Clear stale OEM inputs (oem marker, credentials, optional files) from /root before copying a cidata drive, so a retried install in the same live session can't force a fresh drive back into OEM mode or reuse an old LUKS passphrase. - The test harness waits for the OEM pending flag to clear before saving the base image, so it never snapshots a half-finalized first boot; it also handles the deliberately skipped mode picker on blank disks built against a pre-OEM runtime. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e49ea2bc96
commit
8aee09cb29
5 files changed
+90
-2
No files matched your search
@@ -137,6 +137,20 @@ class ContextOemTest(unittest.TestCase):
|
||||
self.assertEqual(synthesized["users"], [])
|
||||
self.assertNotIn("root_enc_password", synthesized)
|
||||
|
||||
def test_oem_strips_account_fields_from_arch_config(self):
|
||||
config = self.base_config(oem=True)
|
||||
config["!users"] = [{"username": "rig"}]
|
||||
config["!root-password"] = "hunter2"
|
||||
config["root_enc_password"] = "x"
|
||||
config["auth_config"] = {"users": [{"username": "rig"}], "root_enc_password": "x"}
|
||||
self.write_config(config)
|
||||
ctx = self.from_env()
|
||||
|
||||
arch_config = json.loads(ctx.arch_config_path.read_text())
|
||||
for key in ("!users", "!root-password", "root_enc_password", "users"):
|
||||
self.assertNotIn(key, arch_config)
|
||||
self.assertEqual(arch_config["auth_config"], {})
|
||||
|
||||
def test_oem_unencrypted_touches_nothing(self):
|
||||
self.write_config(self.base_config(oem=True))
|
||||
ctx = self.from_env()
|
||||
|
||||
Reference in new issue
Block a user