projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add tests for some device & address variables
[tinc]
/
test
/
integration
/
testlib
/
test.py
diff --git
a/test/integration/testlib/test.py
b/test/integration/testlib/test.py
index
1306abd
..
690d624
100755
(executable)
--- a/
test/integration/testlib/test.py
+++ b/
test/integration/testlib/test.py
@@
-21,10
+21,21
@@
class Test:
self._nodes = []
self.name = name
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)
"""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:
return node
def __str__(self) -> str: