1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00
Commit Graph

15 Commits

Author SHA1 Message Date
Frantisek Sumsal
8d9cdb31f7 test: make the output of TEST-69 less painful to read
The logs from TEST-69 still contain a lot of unnecessary shell
metacharacters, so to make the output more readable let's just set
TERM=dumb, instead of having to strip everything semi-manually. Also,
move the related --background= tweak to TEST-69, since it's relevant
only for that particular test.

Follow-up for 8d4bfd38ed.
2024-04-11 11:35:17 +02:00
Frantisek Sumsal
515eb678a0 test: wait until the test container is fully booted up
TEST-69 still occasionally times out in CI and appears to be stuck on
boot, so let's see if this helps the situation a bit.
2024-04-09 21:39:46 +02:00
Frantisek Sumsal
04f0c6752c test: set pexpect's logfile early
So we capture the container's boot as well.
2024-04-09 21:39:46 +02:00
Franck Bui
cf14d11447 test/test-shutdown.py: optionally display the test I/Os in a dedicated log file
Given that the test involves screen(1), sending various control sequences to
resize/clear the screen, most of the logs sent from the python script were
nearly impossible to read or mixed with other messages sent to the console
hence making the debug harder when the test is run manually.

This patch introduces an option to redirect the pexpect IOs into a file (to be
used in $STATEDIR/TEST-69-SHUTDOWN/run-nspawn).

The pexpect logs are also enabled later so the boot logs are skipped since
those are already included in the journal.
2024-02-12 16:57:51 +01:00
Franck Bui
14265c3360 test-69: send SIGTERM to ask systemd-nspawn to properly stop the container
The terminate() method sends SIGHUP but this signal is not handled by
systemd-nspawn hence the process just exits leaving the container scope around
breaking futher test executions.

This patch sends SIGTERM instead which is a defined API to request
sytemd-nspawn to stop and release the container's resources properly.

Follow-up for 8a7032cfb1.
2024-02-09 18:07:08 +01:00
Frantisek Sumsal
79f902eb09 Add .pylintrc to globally suppress warnings we don't really care about
Also, drop the respective disable directives from existing files.
2023-08-10 18:13:29 +02:00
Frantisek Sumsal
d932022ddf test: bump the container spawn timeout to 60s
As 30s might be not enough on busy systems (and we already bumped the
reboot timeout from 30s to 60s for this reason).
2023-01-23 19:13:49 +01:00
Frantisek Sumsal
55f7c96c8d test: a couple of pylint-related tweaks 2022-11-30 16:18:50 +01:00
Frantisek Sumsal
8a7032cfb1 test: give the container time to properly shut down on exception
Otherwise the `terminate()` method sends SIGKILL rather quickly (~0.3s),
which then leaves a dangling scope on the host system, breaking further
test executions.
2022-11-30 16:13:19 +01:00
Frantisek Sumsal
c0c03d9ce1 test: use SIGKILL to kill the container if necessary
TEST-69 uses a Python wrapper around the systemd-nspawn call, which on
error calls the `spawn.terminate()` method. However, with no arguments
it will only use SIGHUP and SIGINT signals - this might leave a stuck
container around, causing fails if the test is run again. With `force=True`
SIGKILL is used as well (if necessary).
2022-10-17 15:00:12 +02:00
Frantisek Sumsal
6ef1262d63 test: bump the reboot timeout to 60 seconds
As the reboot might take a bit on oversaturated hypervisors (spotted in
Ubuntu CI).
2022-08-26 19:16:45 +02:00
Zbigniew Jędrzejewski-Szmek
3dbb9bc5eb logind: rework wall message about pending shutdown/halt/reboot/…
Those messages simply *feel* dated: "The system is going for suspend NOW!".
Let's say "The system will suspend|power off|hibernate|… now!" instead.
The exclamation mark is enough to show the urgency.

Also, the "the" seemed out of place. We're not talking about a specific reboot.
2022-06-01 09:23:05 +02:00
Frantisek Sumsal
47a00df1f0 test: fix a couple of pylint warnings 2022-05-27 11:54:47 +02:00
Frantisek Sumsal
3e624bb13b test: bump the post-reboot expect() timeout
as it may take a bit longer on slower machines:

```
[  OK  ] Reached target System Reboot.
Found cgroup2 on /sys/fs/cgroup/, full unified hierarchy
Failed to open watchdog device /dev/watchdog0, ignoring: No such file or directory
binfmt_misc is not mounted, not detaching entries.
Sending SIGTERM to remaining processes...
ERROR:test-shutdown:Timeout exceeded.
<pexpect.pty_spawn.spawn object at 0x7f3d4bcd20b0>
command: /systemd-meson-build/systemd-nspawn
<...snip...>
buffer (last 100 chars): 'mbinfmt_misc is not mounted, not detaching entries.\x1b[0m\r\nSending SIGTERM to remaining processes...\r\n'
before (last 100 chars): 'mbinfmt_misc is not mounted, not detaching entries.\x1b[0m\r\nSending SIGTERM to remaining processes...\r\n'
after: <class 'pexpect.exceptions.TIMEOUT'>
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 572528
child_fd: 5
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
    0: re.compile('H login: ')
INFO:test-shutdown:killing child pid 572528
E: nspawn failed with exit code 1
```
2022-05-27 11:41:55 +02:00
Ludwig Nussel
48f3bc5cc4 test: add shutdown test
Wraps nspawn to be able to use pexpect. The test logs in on the console
and runs screen. In one screen window it types in shutdown commands and
checks whether a wall message was sent to the other.
2022-01-25 17:43:13 +01:00