diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2020-11-30 21:57:52 +0100 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2020-12-04 23:24:12 +0100 |
commit | 448d3462b0f85c0f70ce67f7684497247b34c3d8 (patch) | |
tree | 2a4d052a5d3886c93b36c7958c7bc9d03cb9cf6e /.github/workflows/test_mkosi_boot.py | |
parent | mkosi: Add findutils to Fedora config (diff) | |
download | systemd-448d3462b0f85c0f70ce67f7684497247b34c3d8.tar.xz systemd-448d3462b0f85c0f70ce67f7684497247b34c3d8.zip |
CI: Add mkosi boot tests
Using the new mkosi Github Action, we can add some simple boot tests
for the systemd mkosi configs. This makes sure these keep working
as expected.
Diffstat (limited to '')
-rwxr-xr-x | .github/workflows/test_mkosi_boot.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/.github/workflows/test_mkosi_boot.py b/.github/workflows/test_mkosi_boot.py new file mode 100755 index 0000000000..37904eb059 --- /dev/null +++ b/.github/workflows/test_mkosi_boot.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: LGPL-2.1-or-later + +import pexpect +import sys + + +def run() -> None: + p = pexpect.spawnu(" ".join(sys.argv[1:]), logfile=sys.stdout, timeout=300) + + p.expect("login:") + p.sendline("root") + + p.expect("#") + p.sendline("systemctl poweroff") + + p.expect(pexpect.EOF) + + +try: + run() +except pexpect.EOF: + print("UNEXPECTED EOF") + sys.exit(1) +except pexpect.TIMEOUT: + print("TIMED OUT") + sys.exit(1) |