Check that the release's security repository is configured and fresh
CI / tests (Python 3.10) (pull_request) Successful in 36s
CI / tests (Python 3.11) (pull_request) Successful in 36s
CI / tests (Python 3.12) (pull_request) Successful in 37s
CI / tests (Python 3.13) (pull_request) Successful in 37s
CI / lint (pull_request) Successful in 4s
CI / tests (Python 3.10) (pull_request) Successful in 36s
CI / tests (Python 3.11) (pull_request) Successful in 36s
CI / tests (Python 3.12) (pull_request) Successful in 37s
CI / tests (Python 3.13) (pull_request) Successful in 37s
CI / lint (pull_request) Successful in 4s
security_count is only meaningful if apt has the release's security suite. A host missing it from its sources shows 0 security updates forever, and one whose apt can't fetch it (expired key, wrong URL after a release upgrade, a mirror that fell behind) keeps the last copy while the update stamps and other lists move on, so neither the simulation nor the package list age notices. The agent (0.9.0) now finds apt's list for <codename>-security by its Suite: (Ubuntu) or Codename: (Debian) field, since file names depend on the mirror (mirror+file: sources, several mirrors), and reports security_repo_suite and security_repo_age_seconds from its Date:, the newest copy winning. The server puts the host in update when there's no such list, or when it's older than security_repo_stale_after_days (default 7) while the package lists are otherwise fresh; if all of them are old, the existing "package lists N days old" reason covers it. Releases past the end of support are skipped: their suite has stopped publishing, and support.check already says so. ESM suites publish too rarely to judge by date and aren't checked. The host page gets a "Security repository" row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fa6cca4f64
commit
c9912d5fbc
12 files changed
+261
-4
No files matched your search
@@ -117,6 +117,15 @@ class ConfigTest(unittest.TestCase):
|
||||
with self.subTest(bad=bad), self.assertRaises(SystemExit):
|
||||
config.load(self.write(tmp, f"unattended_upgrades_stale_after_days = {bad}\n"))
|
||||
|
||||
def test_security_repo_stale_days_validated(self):
|
||||
with tempdir() as tmp:
|
||||
self.assertEqual(config.Config().security_repo_stale_after_days, 7.0)
|
||||
self.assertEqual(config.load(self.write(tmp, "security_repo_stale_after_days = 0\n"))
|
||||
.security_repo_stale_after_days, 0)
|
||||
for bad in ("-1", "inf", "nan", '"7"'):
|
||||
with self.subTest(bad=bad), self.assertRaises(SystemExit):
|
||||
config.load(self.write(tmp, f"security_repo_stale_after_days = {bad}\n"))
|
||||
|
||||
def test_fallback_parser_matches_tomllib(self):
|
||||
"""Python 3.10 has no tomllib; the fallback must read the same configs."""
|
||||
if config.tomllib is None:
|
||||
|
||||
Reference in new issue
Block a user