mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-10-06 13:36:42 +00:00
fix(oci): preserve caller-owned install plans
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user