This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env python3
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
"""Phase-1.0CL native cleanup guardrails."""
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
import unittest
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--root", type=Path, required=True)
|
||||
root = parser.parse_args().root
|
||||
|
||||
|
||||
class Phase10CLGuardrails(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls) -> None:
|
||||
cls.data = json.loads((root / "manifests/retroarch/phase-1.0cl-native-sdk-configure-progress-and-cleanup-gate.json").read_text(encoding="utf-8"))
|
||||
|
||||
def test_parent_and_progress(self) -> None:
|
||||
parent = root / "manifests/retroarch/phase-1.0ck-native-sdk-sdl-materializer-one-shot-gate.json"
|
||||
self.assertEqual(hashlib.sha256(parent.read_bytes()).hexdigest(), self.data["source_bindings"]["phase10ck_manifest_sha256"])
|
||||
result = self.data["consumed_attempt"]
|
||||
self.assertEqual(result["completed_cmake_checks"], 96)
|
||||
self.assertTrue(result["native_compiler_used"])
|
||||
self.assertTrue(result["native_sysroot_used"])
|
||||
self.assertFalse(result["sdl_build_invoked"])
|
||||
|
||||
def test_cleanup_only(self) -> None:
|
||||
auth = self.data["authorizations"]
|
||||
self.assertTrue(auth["exact_native_root_cleanup_authorized"])
|
||||
for key, value in auth.items():
|
||||
if key != "exact_native_root_cleanup_authorized":
|
||||
self.assertFalse(value, key)
|
||||
self.assertFalse(self.data["cleanup"]["automatic_retry"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(argv=[__file__])
|
||||
Reference in New Issue
Block a user