Merge remote-tracking branch 'gitea-ssh/main' into codex/p0-product-manifest-standard-20260629
# Conflicts: # scripts/security/gitea-authenticated-inventory-payload-validator.py
This commit is contained in:
@@ -79,6 +79,30 @@ def test_rejects_execution_request(tmp_path: Path) -> None:
|
||||
assert validation["operation_boundaries"]["gitea_write_performed"] is False
|
||||
|
||||
|
||||
def test_output_must_not_overwrite_input(tmp_path: Path) -> None:
|
||||
payload_path = tmp_path / "inventory.json"
|
||||
original = json.dumps(valid_payload())
|
||||
payload_path.write_text(original, encoding="utf-8")
|
||||
|
||||
result = subprocess.run(
|
||||
[
|
||||
sys.executable,
|
||||
str(SCRIPT),
|
||||
"--input",
|
||||
str(payload_path),
|
||||
"--output",
|
||||
str(payload_path),
|
||||
],
|
||||
text=True,
|
||||
capture_output=True,
|
||||
check=False,
|
||||
)
|
||||
|
||||
assert result.returncode != 0
|
||||
assert "output_must_not_equal_input" in result.stderr
|
||||
assert payload_path.read_text(encoding="utf-8") == original
|
||||
|
||||
|
||||
def valid_payload() -> dict:
|
||||
repos = [
|
||||
repo("wooo/awoooi"),
|
||||
|
||||
Reference in New Issue
Block a user