3 """Check that basic functionality works (tincd can be started and stopped)."""
5 from testlib.test import Test
6 from testlib.proc import Tinc
7 from testlib.log import log
8 from testlib.script import Script
9 from testlib import check
12 def init(ctx: Test) -> Tinc:
13 """Initialize new test nodes."""
15 node.add_script(Script.TINC_UP)
26 def test(ctx: Test, *flags: str) -> None:
27 """Run tests with flags."""
28 log.info("init new node")
31 log.info('starting tincd with flags "%s"', " ".join(flags))
32 tincd = node.tincd(*flags)
34 log.info("waiting for tinc-up script")
35 node[Script.TINC_UP].wait()
37 log.info("stopping tincd")
40 log.info("checking tincd exit code")
41 check.equals(0, tincd.wait())
44 with Test("foreground mode") as context:
47 with Test("background mode") as context: