55 lines
2.5 KiB
Python
55 lines
2.5 KiB
Python
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from pathlib import Path
|
||
|
|
import unittest
|
||
|
|
|
||
|
|
|
||
|
|
class TestDITAv2Ops(unittest.TestCase):
|
||
|
|
def test_operator_playbook_mentions_supervisor_program(self) -> None:
|
||
|
|
text = Path("/mnt/dolphinng5_predict/prod/docs/DITA_V2_OPERATOR_PLAYBOOK.md").read_text()
|
||
|
|
self.assertIn("dolphin:dita_v2", text)
|
||
|
|
self.assertIn("launch_dita_v2.py", text)
|
||
|
|
self.assertIn("dita_v2_ctl.py", text)
|
||
|
|
|
||
|
|
def test_supervisor_config_contains_dita_v2_program(self) -> None:
|
||
|
|
conf = Path("/mnt/dolphinng5_predict/prod/supervisor/dolphin-supervisord.conf").read_text()
|
||
|
|
self.assertIn("[program:dita_v2]", conf)
|
||
|
|
self.assertIn("launch_dita_v2.py", conf)
|
||
|
|
|
||
|
|
def test_supervisor_migration_doc_mentions_dita_v2_recovery(self) -> None:
|
||
|
|
text = Path("/mnt/dolphinng5_predict/prod/AGENT_READ_Supervisor_migration.md").read_text()
|
||
|
|
self.assertIn("dolphin:dita_v2", text)
|
||
|
|
self.assertIn("dita_v2_ctl.py", text)
|
||
|
|
self.assertIn("Do not use `systemctl` for `dolphin:dita_v2`", text)
|
||
|
|
|
||
|
|
def test_supervisor_wrapper_mentions_dita_v2(self) -> None:
|
||
|
|
text = Path("/mnt/dolphinng5_predict/prod/supervisor/supervisorctl.sh").read_text()
|
||
|
|
self.assertIn("dita_v2", text)
|
||
|
|
self.assertIn("dita_v2_ctl.py", text)
|
||
|
|
|
||
|
|
def test_supervisor_config_has_dita_v2_comment(self) -> None:
|
||
|
|
conf = Path("/mnt/dolphinng5_predict/prod/supervisor/dolphin-supervisord.conf").read_text()
|
||
|
|
self.assertIn("DITAv2 — supervised kernel", conf)
|
||
|
|
|
||
|
|
def test_operational_status_mentions_dita_v2(self) -> None:
|
||
|
|
text = Path("/mnt/dolphinng5_predict/prod/docs/OPERATIONAL_STATUS.md").read_text()
|
||
|
|
self.assertIn("DITAv2 Kernel", text)
|
||
|
|
self.assertIn("dolphin:dita_v2", text)
|
||
|
|
|
||
|
|
def test_live_smoke_wrapper_is_documented_and_wired(self) -> None:
|
||
|
|
script = Path("/mnt/dolphinng5_predict/prod/ops/dita_v2_live_bingx_smoke.py").read_text()
|
||
|
|
self.assertIn("BINGX_SMOKE_LIVE", script)
|
||
|
|
self.assertIn("BINGX_SMOKE_ALLOW_TRADE", script)
|
||
|
|
self.assertIn("DITA_V2_LIVE_BINGX", script)
|
||
|
|
self.assertIn("test_dita_v2_live_bingx_testnet_e2e.py", script)
|
||
|
|
self.assertIn("--dry-run", script)
|
||
|
|
|
||
|
|
playbook = Path("/mnt/dolphinng5_predict/prod/docs/DITA_V2_OPERATOR_PLAYBOOK.md").read_text()
|
||
|
|
self.assertIn("dita_v2_live_bingx_smoke.py", playbook)
|
||
|
|
self.assertIn("--dry-run", playbook)
|
||
|
|
self.assertIn("TRXUSDT", playbook)
|
||
|
|
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
unittest.main()
|