IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
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 8d4bfd38ed941aa8003d7007145eccc01f52a5f6.
v255-only change: --background= is not supported in v255's sd-nspawn, so
that hunk is dropped
(cherry picked from commit 8d9cdb31f7cc41bb2252be70a2410030551aabde)
(cherry picked from commit 93c5ff05dcad782acdf87f4491b053c708a4eb45)
(cherry picked from commit 75d7263080c1c373666a334b873443118f047af2)
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.
(cherry picked from commit 515eb678a057099ee7e462ec83f71b199a368f8a)
(cherry picked from commit 67f620875294782cc4d8a029f97bb144979636bc)
(cherry picked from commit c77a839e9f9ad987c5f13b692d0c5de69bacfc8b)
So we capture the container's boot as well.
(cherry picked from commit 04f0c6752c10d152bc1884b2cc92b1f0b2df5de5)
(cherry picked from commit 8303b81fcdeb40cb39a810ce1c19d219b960f664)
(cherry picked from commit 0fd2f6cc93593322cd37195b140191368ea468b7)
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.
(cherry picked from commit cf14d1144717967ebdd150cb21ed5dc00e832a80)
(cherry picked from commit dcea9bc57852b6d86651fed02445cc1c9a772164)
(cherry picked from commit 9fbbd59f9d077b05e336cb511c61b4ff8e3d214f)
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 8a7032cfb108c6daa395686320d9361c2195860a.
(cherry picked from commit 14265c3360b02191975654981715584227c0650e)
(cherry picked from commit 4b0f60de3b5b0d1ce5ab37dba56a9661e600b1f6)
(cherry picked from commit e6f68d43f2c2ee71d99de0eb3a510668d1dcac1c)
Otherwise the `terminate()` method sends SIGKILL rather quickly (~0.3s),
which then leaves a dangling scope on the host system, breaking further
test executions.
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).
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.
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
```
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.