teleo-infrastructure/tests/test_teleo_agent_systemd.py
2026-06-26 01:07:32 +02:00

20 lines
779 B
Python

from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[1]
def test_teleo_agent_template_supports_optional_per_agent_env_file():
unit = (REPO_ROOT / "systemd" / "teleo-agent@.service").read_text()
assert "Environment=PYTHONUNBUFFERED=1" in unit
assert "EnvironmentFile=-/opt/teleo-eval/secrets/teleo-agent-%i.env" in unit
def test_deploy_scripts_restart_wallet_test_agent_when_present():
auto_deploy = (REPO_ROOT / "deploy" / "auto-deploy.sh").read_text()
manual_deploy = (REPO_ROOT / "deploy" / "deploy.sh").read_text()
assert "add_restart_if_unit_exists teleo-agent@leo-wallet-test" in auto_deploy
assert 'systemctl list-units --all --full "$1.service"' in auto_deploy
assert "teleo-agent@leo-wallet-test" in manual_deploy