Add Synology CPU shares CI profile and host capability preflight

This commit is contained in:
Codex
2026-09-29 14:52:31 +03:00
parent aa84e73bd8
commit 3321046c2a
8 changed files with 306 additions and 32 deletions
+15 -3
View File
@@ -159,9 +159,9 @@ class BootstrapTests(unittest.TestCase):
def apply_in_synthetic_host(self, fail_health=False, version="v1"):
expected_entries = RUNNER.GITEA_CI_ENTRIES
if version == "v2":
expected_entries = RUNNER.GITEA_CI_V2_ENTRIES
self.artifact.write_bytes(build_artifact.bundle("gitea-ci-bootstrap-v2-test-001"))
if version in ("v2", "v3"):
expected_entries = RUNNER.GITEA_CI_V3_ENTRIES if version == "v3" else RUNNER.GITEA_CI_V2_ENTRIES
self.artifact.write_bytes(build_artifact.bundle("gitea-ci-bootstrap-" + version + "-test-001"))
host = self.root / "host"
host.mkdir()
names = {name: host / name.lower() for name in (
@@ -244,6 +244,18 @@ class BootstrapTests(unittest.TestCase):
self.assertEqual((app / "data/registration-marker").read_text(), "preserve-on-rollback")
self.assertEqual(json.loads(paths["FAILED_STATE_FILE"].read_text())["rollback_status"], "ok:gitea-ci-bootstrap")
def test_v3_apply_and_receipt(self):
paths, app, candidate, output = self.apply_in_synthetic_host(version="v3")
self.assertTrue((app / "deployment/bootstrap-v3.json").is_file())
self.assertEqual(json.loads(paths["STATE_FILE"].read_text())["status"], "ok")
self.assertIn("deploy-ok patch=gitea-ci-bootstrap-v3-test-001", output)
def test_v3_rollback_preserves_identity(self):
paths, app, candidate, output = self.apply_in_synthetic_host(fail_health=True, version="v3")
self.assertFalse((app / "deployment/bootstrap-v3.json").exists())
self.assertEqual((app / "data/registration-marker").read_text(), "preserve-on-rollback")
self.assertEqual(json.loads(paths["FAILED_STATE_FILE"].read_text())["rollback_status"], "ok:gitea-ci-bootstrap")
if __name__ == "__main__":
unittest.main()