fix(oci): preserve caller-owned install plans

This commit is contained in:
VAIO73
2026-09-27 13:28:39 +02:00
parent 6e7be4c029
commit 1367bcb7d4
2 changed files with 37 additions and 2 deletions
@@ -0,0 +1,20 @@
"""The installer must not need to rewrite files supplied by its caller."""
from pathlib import Path
import unittest
ROOT = Path(__file__).resolve().parents[1]
INSTALLER = ROOT / "remote" / "install_oci.sh"
class CanonicalInstallerInputTests(unittest.TestCase):
def test_persisted_contract_uses_private_copies_not_caller_files(self):
installer = INSTALLER.read_text(encoding="utf-8")
self.assertIn('mktemp -d "/var/tmp/proxmenux-oci-inputs-${VMID}.XXXXXX"', installer)
self.assertIn('TEMPLATE_FILE="${CANONICAL_INPUT_DIR}/template.json"', installer)
self.assertIn('DEPLOYMENT_FILE="${CANONICAL_INPUT_DIR}/deployment.json"', installer)
self.assertIn('cleanup_canonical_inputs || true', installer)
self.assertNotIn('jq \'.template\' "$INSTANCE_CONTRACT" >"$TEMPLATE_FILE"', installer)
self.assertNotIn('jq \'.deployment\' "$INSTANCE_CONTRACT" >"$DEPLOYMENT_FILE"', installer)