121683aa8eab4818ec5c5e2a2b85e3633544f02c
[tinc] / test / integration / executables.py
1 #!/usr/bin/env python3
2
3 """Basic sanity checks on compiled executables."""
4
5 from subprocess import run, PIPE
6
7 from testlib import path, check
8 from testlib.log import log
9
10 for exe in (
11     path.TINC_PATH,
12     path.TINCD_PATH,
13     path.SPTPS_TEST_PATH,
14     path.SPTPS_KEYPAIR_PATH,
15 ):
16     cmd = [exe, "--help"]
17     log.info('testing command "%s"', cmd)
18     res = run(cmd, stdout=PIPE, stderr=PIPE, encoding="utf-8", timeout=10, check=False)
19     check.equals(0, res.returncode)
20     check.is_in("Usage:", res.stdout, res.stderr)