mirror of
https://github.com/systemd/systemd.git
synced 2024-10-29 21:55:36 +03:00
448d3462b0
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.
28 lines
470 B
Python
Executable File
28 lines
470 B
Python
Executable File
#!/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)
|