Flag hosts whose OS release no longer gets security updates
CI / tests (Python 3.10) (pull_request) Successful in 30s
CI / tests (Python 3.11) (pull_request) Successful in 30s
CI / tests (Python 3.12) (pull_request) Successful in 28s
CI / tests (Python 3.13) (pull_request) Successful in 28s
CI / lint (pull_request) Successful in 3s
CI / tests (Python 3.10) (pull_request) Successful in 30s
CI / tests (Python 3.11) (pull_request) Successful in 30s
CI / tests (Python 3.12) (pull_request) Successful in 28s
CI / tests (Python 3.13) (pull_request) Successful in 28s
CI / lint (pull_request) Successful in 3s
Past its end of support a release gets no more security updates, so apt offers nothing and the host showed ok indefinitely. The server now has a table of when free security support ends for each release the agent installs on (support.py): Debian's LTS end, and Ubuntu's end of standard support plus end of ESM. Dates from Debian LTS and Ubuntu's release cycle via endoflife.date; a test checks the table covers every release agent/install.sh accepts. The agent reports whether Ubuntu Pro is attached and esm-infra's status, read from the pro client's world-readable status.json. A host past its date goes to update; within os_eol_warn_days (default 90) of it, the row gets a note. An Ubuntu host with ESM enabled isn't warned when standard support ends, only before ESM does. The host page shows the dates. Agent 0.7.0; older agents don't report ESM and count as having none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5a11d31e66
commit
bc46c55298
15 files changed
+348
-7
No files matched your search
@@ -339,6 +339,19 @@ class EvaluateTest(unittest.TestCase):
|
||||
self.assertEqual(self.level(report(dpkg_unfinished_packages=[])).level, "ok")
|
||||
self.assertEqual(self.level(report(dpkg_unfinished_packages=None)).level, "ok")
|
||||
|
||||
def test_os_past_end_of_support(self):
|
||||
s = self.level(report(os_id="debian", os_version_id="11"))
|
||||
self.assertEqual(s.level, "update")
|
||||
self.assertIn("Debian 11 security support ended 2026-08-31", s.reasons[0])
|
||||
|
||||
def test_os_end_of_support_warning_is_a_note(self):
|
||||
# NOW is 2027-01-15; Ubuntu 22.04 standard support ends 2027-06-01.
|
||||
rep = report(os_id="ubuntu", os_version_id="22.04")
|
||||
self.assertEqual(evaluate(NOW, rep, NOW, Config(os_eol_warn_days=200)).level, "ok")
|
||||
self.assertIn("standard support ends 2027-06-01",
|
||||
evaluate(NOW, rep, NOW, Config(os_eol_warn_days=200)).reasons[0])
|
||||
self.assertEqual(self.level(rep).reasons, [], "outside the default 90 days")
|
||||
|
||||
def test_reboot_outranks_update(self):
|
||||
s = self.level(report(needrestart_ksta=3, security_count=2))
|
||||
self.assertEqual(s.level, "reboot")
|
||||
|
||||
Reference in new issue
Block a user