Add Synology CPUSet CI bootstrap for actual NAS capabilities
This commit is contained in:
@@ -159,8 +159,8 @@ class BootstrapTests(unittest.TestCase):
|
||||
|
||||
def apply_in_synthetic_host(self, fail_health=False, version="v1"):
|
||||
expected_entries = RUNNER.GITEA_CI_ENTRIES
|
||||
if version in ("v2", "v3"):
|
||||
expected_entries = RUNNER.GITEA_CI_V3_ENTRIES if version == "v3" else RUNNER.GITEA_CI_V2_ENTRIES
|
||||
if version in ("v2", "v3", "v4"):
|
||||
expected_entries = getattr(RUNNER, "GITEA_CI_" + version.upper() + "_ENTRIES")
|
||||
self.artifact.write_bytes(build_artifact.bundle("gitea-ci-bootstrap-" + version + "-test-001"))
|
||||
host = self.root / "host"
|
||||
host.mkdir()
|
||||
@@ -256,6 +256,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_v4_apply_and_receipt(self):
|
||||
paths, app, candidate, output = self.apply_in_synthetic_host(version="v4")
|
||||
self.assertTrue((app / "deployment/bootstrap-v4.json").is_file())
|
||||
self.assertEqual(json.loads(paths["STATE_FILE"].read_text())["status"], "ok")
|
||||
self.assertIn("deploy-ok patch=gitea-ci-bootstrap-v4-test-001", output)
|
||||
|
||||
def test_v4_rollback_preserves_identity(self):
|
||||
paths, app, candidate, output = self.apply_in_synthetic_host(fail_health=True, version="v4")
|
||||
self.assertFalse((app / "deployment/bootstrap-v4.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()
|
||||
|
||||
Reference in New Issue
Block a user