Put hosts with unloaded CPU microcode updates in reboot
CI / tests (Python 3.10) (pull_request) Successful in 40s
CI / tests (Python 3.11) (pull_request) Successful in 39s
CI / tests (Python 3.12) (pull_request) Successful in 38s
CI / tests (Python 3.13) (pull_request) Successful in 38s
CI / lint (pull_request) Failing after 3s

On bare metal, needrestart -b reports NEEDRESTART-UCSTA: 2 when the
installed intel-microcode/amd64-microcode is newer than what the CPU
loaded at boot, which only a reboot fixes. The agent dropped those
lines. It now reports needrestart_ucsta, _uccur and _ucexp, and the
server puts the host in reboot with both revisions. Livepatch doesn't
cover it. needrestart skips the check in VMs, so only physical hosts
(debian-homelab today) report it; the host page gets a "CPU microcode"
row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
patrickandClaude Opus 5.5 committed 2026-11-01 15:25:57 -05:00
1 parent 4676942108
commit 8174f1df81
8 files changed
+79 -1

No files matched your search

+10
View File
@@ -239,6 +239,16 @@ class DashboardTest(ServerCase):
self.assertIn("noble-security: not in apt&#x27;s sources", body)
self.assertIn("apt has no noble-security repository", body)
def test_host_page_shows_microcode(self):
self.add_user("admin", "a-long-password")
token = self.add_host("web01")
self.post_report(token, {"kernel_running": "6.12.57+deb13-amd64", "apt_lists_age_seconds": 60,
"needrestart_ucsta": 2, "needrestart_uccur": "0x001e",
"needrestart_ucexp": "0x0020"})
_, headers, _ = self.login("admin", "a-long-password")
body = self.request("GET", "/host/web01", headers={"Cookie": headers["Set-Cookie"].split(";")[0]})[2]
self.assertIn("update needs a reboot (loaded 0x001e, installed 0x0020)", body)
def test_host_page_shows_helper_units(self):
self.add_user("admin", "a-long-password")
token = self.add_host("web01")