X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=test%2Fintegration%2Ftestlib%2Ftest.py;fp=test%2Fintegration%2Ftestlib%2Ftest.py;h=690d6241957f0be8ac7942832a65e84eb8b5a911;hp=1306abd656e098cf2d58c52855f8e2367461b06d;hb=c8402791b82947c49ba1d04f855dab04191607ca;hpb=66eb66ec8f872db3dc12e1d01101772918d69a4a diff --git a/test/integration/testlib/test.py b/test/integration/testlib/test.py index 1306abd6..690d6241 100755 --- a/test/integration/testlib/test.py +++ b/test/integration/testlib/test.py @@ -21,10 +21,21 @@ class Test: self._nodes = [] self.name = name - def node(self, addr: str = "") -> Tinc: + def node(self, addr: str = "", init: T.Union[str, bool] = "") -> Tinc: """Create a Tinc instance and remember it for termination on exit.""" node = Tinc(addr=addr) self._nodes.append(node) + if init: + if isinstance(init, bool): + init = "" + stdin = f""" + init {node} + set Port 0 + set Address localhost + set DeviceType dummy + {init} + """ + node.cmd(stdin=stdin) return node def __str__(self) -> str: