diff --git a/tests/test_sync_orchestrator.py b/tests/test_sync_orchestrator.py index 7dcbfee..144cc66 100644 --- a/tests/test_sync_orchestrator.py +++ b/tests/test_sync_orchestrator.py @@ -17,7 +17,7 @@ class OrchestratorTest(unittest.TestCase): db,state,config,run,request=values return subprocess.run(["python3",str(executable),"--database",str(db),"--state",str(state),"--config",str(config),"--run-id",run,"--request-id",request],capture_output=True,text=True) def test_browser_configuration_cannot_select_command_or_boolean_timeout(self): - for override in ({"peer_command":["evil"]},{"timeout_seconds":True}): + for override in ({"peer_command":["evil"]},{"timeout_seconds":True},{"mode":"mtp"}): with self.subTest(override=override),tempfile.TemporaryDirectory() as directory: root=Path(directory);values=self.fixture(root,**override);result=self.invoke(ORCHESTRATOR,values) self.assertEqual(result.returncode,2);self.assertEqual(json.loads(values[1].read_text())["phase"],"failed") diff --git a/tools/sync_orchestrator.py b/tools/sync_orchestrator.py index 1477941..140664b 100644 --- a/tools/sync_orchestrator.py +++ b/tools/sync_orchestrator.py @@ -171,8 +171,8 @@ def run(args: argparse.Namespace) -> int: raise RuntimeError("invalid trusted sync configuration") if config["format"] != "trainlog-sync-orchestrator-config" or config["version"] != 1 or config["enabled"] is not True: raise RuntimeError("full-generation synchronization is disabled") - if config["mode"] not in ("directory","mtp"): - raise RuntimeError("invalid transport mode") + if config["mode"] != "directory": + raise RuntimeError("physical MTP generation transport is not implemented") for key in ("transport_root","owned_root"): if not isinstance(config[key],str) or not Path(config[key]).is_absolute(): raise RuntimeError("trusted paths must be absolute") if not isinstance(config["expected_peer_id"],str) or not re.fullmatch(r"peer_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",config["expected_peer_id"]): raise RuntimeError("invalid expected peer identity")