Flag hosts where unattended-upgrades has stopped succeeding
On a host with unattended-upgrades enabled, no successful run in
unattended_upgrades_stale_after_days (default 3, 0 disables) puts it in
update. The reason says which way it broke: still running but failing
("last succeeded 5d ago and is failing (last ran 6h ago); check
/var/log/unattended-upgrades/"), not running at all ("is
apt-daily-upgrade.timer enabled?"), or never succeeded. A host where it
hasn't completed its first run yet gets a note, and packages it keeps back
are noted. Hosts with it disabled or not installed, and agents before
0.8.0, are judged as before. The host page shows the state, both stamp
ages and the kept-back packages.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
df097c9da3
commit
bfac723850
7 files changed
+143
No files matched your search
@@ -197,6 +197,20 @@ class DashboardTest(ServerCase):
|
||||
self.assertIn("<code>linux-image-6.8.0-138-generic</code>", body)
|
||||
self.assertIn("/boot has 95 MB free, 81% used; the next kernel may not fit", body)
|
||||
|
||||
def test_host_page_shows_unattended_upgrades(self):
|
||||
self.add_user("admin", "a-long-password")
|
||||
token = self.add_host("web01")
|
||||
self.post_report(token, {"kernel_running": "6.8.0-136-generic", "apt_lists_age_seconds": 60,
|
||||
"unattended_upgrades": "enabled",
|
||||
"unattended_upgrades_success_age_seconds": 5 * 86400 + 7200,
|
||||
"unattended_upgrades_run_age_seconds": 6 * 3600,
|
||||
"unattended_upgrades_kept_back": ["openssl"]})
|
||||
_, headers, _ = self.login("admin", "a-long-password")
|
||||
body = self.request("GET", "/host/web01", headers={"Cookie": headers["Set-Cookie"].split(";")[0]})[2]
|
||||
self.assertIn("enabled, last success 5d 2h before the report, last run 6h 0m before the report", body)
|
||||
self.assertIn("<code>openssl</code>", body)
|
||||
self.assertIn("unattended-upgrades last succeeded 5d ago and is failing", body)
|
||||
|
||||
def test_host_page_shows_os_support(self):
|
||||
self.add_user("admin", "a-long-password")
|
||||
token = self.add_host("web01")
|
||||
|
||||
Reference in new issue
Block a user