26 行
1.1 KiB
Python
26 行
1.1 KiB
Python
"""The Windows deploy entrypoint must supply explicit SSH and Python settings."""
|
|
from __future__ import annotations
|
|
|
|
import pathlib
|
|
import unittest
|
|
|
|
|
|
ROOT = pathlib.Path(__file__).resolve().parents[1]
|
|
|
|
|
|
class WindowsDeployEntrypointTests(unittest.TestCase):
|
|
def test_bash_script_accepts_explicit_connection_and_test_settings(self):
|
|
script = (ROOT / "ops" / "deploy-plugin.sh").read_text(encoding="utf-8")
|
|
for token in ("SSH_KEY=", "SSH_PORT=", "PYTHON_BIN=", "SKIP_LOCAL_TESTS=", "DETAIL_ENHANCEMENT_ENABLED=", "SCP_OPTS="):
|
|
self.assertIn(token, script)
|
|
self.assertIn('"$PYTHON_BIN" -m unittest discover -s tests -q', script)
|
|
self.assertIn("shutdown persistence", script)
|
|
|
|
def test_powershell_wrapper_supplies_vm_key_and_python(self):
|
|
wrapper = (ROOT / "ops" / "deploy-plugin.ps1").read_text(encoding="utf-8")
|
|
for token in ("VmHost = \"192.168.31.215\"", "VmUser = \"agent\"", "SshKey", "PythonBin", "SSH_KEY", "PYTHON_BIN", "EnableDetailEnhancement", "DETAIL_ENHANCEMENT_ENABLED"):
|
|
self.assertIn(token, wrapper)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|