34 lines
1.5 KiB
Python
34 lines
1.5 KiB
Python
import pathlib
|
|
import unittest
|
|
|
|
|
|
ROOT = pathlib.Path(__file__).resolve().parents[2]
|
|
|
|
|
|
class NextPathPipelineTests(unittest.TestCase):
|
|
def test_deployment_is_debian_hosted_private_and_health_checked(self):
|
|
pipeline = (ROOT / "lib/jeannie/pipeline.sh").read_text(encoding="utf-8")
|
|
command = (ROOT / "jeannie").read_text(encoding="utf-8")
|
|
server = (ROOT / "cmd/jeannie-server/main.go").read_text(encoding="utf-8")
|
|
|
|
self.assertIn("deploy_nextpath()", pipeline)
|
|
self.assertIn('require_debian_server "deploy-nextpath"', pipeline)
|
|
self.assertIn("GOTOOLCHAIN=local go test ./cmd/nextpath/...", pipeline)
|
|
self.assertIn("NEXTPATH_ACCOUNT_STORE=${install_dir}/data/accounts.json", pipeline)
|
|
self.assertIn("ReadWritePaths=${install_dir}/data", pipeline)
|
|
self.assertIn("sudo chmod 0700", pipeline)
|
|
self.assertIn('curl -fsS --connect-timeout 3 "http://127.0.0.1:${http_port}/healthz"', pipeline)
|
|
self.assertIn("nextpath.service", pipeline)
|
|
self.assertIn("deploy-nextpath)", command)
|
|
self.assertIn('"deploy-nextpath": true', server)
|
|
|
|
def test_inventory_declares_public_wip(self):
|
|
inventory = (ROOT / "homelab.yml").read_text(encoding="utf-8")
|
|
self.assertIn("nextpath.lab2025.duckdns.org", inventory)
|
|
self.assertIn("install_dir: /data/homelab-nextpath", inventory)
|
|
self.assertIn("http_port: 8892", inventory)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|