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.feature import SANDBOX_LEVEL
8 from testlib.log import log
9 from testlib.script import Script
10 from testlib import check
13 def init(ctx: Test) -> Tinc:
14 """Initialize new test nodes."""
16 node.add_script(Script.TINC_UP)
22 set Sandbox {SANDBOX_LEVEL}
28 def test(ctx: Test, *flags: str) -> None:
29 """Run tests with flags."""
30 log.info("init new node")
33 log.info('starting tincd with flags "%s"', " ".join(flags))
34 tincd = node.tincd(*flags)
36 log.info("waiting for tinc-up script")
37 node[Script.TINC_UP].wait()
39 log.info("stopping tincd")
42 log.info("checking tincd exit code")
43 check.equals(0, tincd.wait())
46 with Test("foreground mode") as context:
49 with Test("background mode") as context: