File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -2103,7 +2103,7 @@ install_testuser() {
2103
2103
# create unprivileged user for user manager tests
2104
2104
mkdir -p " ${initdir:? } /etc/sysusers.d"
2105
2105
cat > " $initdir /etc/sysusers.d/testuser.conf" << EOF
2106
- u testuser 4711 "Test User" /home/testuser
2106
+ u testuser 4711 "Test User" /home/testuser /bin/bash
2107
2107
EOF
2108
2108
2109
2109
mkdir -p " $initdir /home/testuser"
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ # SPDX-License-Identifier: LGPL-2.1-or-later
3
+ set -eux
4
+ set -o pipefail
5
+
6
+ journalctl --rotate --vacuum-files=1
7
+ # Nuke all archived journals, so we start with a clean slate
8
+ rm -f " /var/log/journal/$( < /etc/machine-id) " /system@* .journal
9
+ rm -f " /var/log/journal/$( < /etc/machine-id) " /user-* @* .journal
10
+ journalctl --header | grep path
11
+
12
+ # Make sure the user instance is active when we rotate journals
13
+ systemd-run --unit user-sleep.service --user -M testuser@ sleep infinity
14
+
15
+ for _ in {0..9}; do
16
+ journalctl --rotate
17
+ journalctl --sync
18
+ SYSTEMD_LOG_LEVEL=debug journalctl -n1 -q
19
+ (! journalctl -n0 -q | & grep corrupted)
20
+ done
21
+
22
+ systemctl stop --user -M testuser@ user-sleep.service
23
+
24
+ journalctl --sync
25
+ journalctl --rotate --vacuum-files=1
26
+ # Nuke all archived journals, so we start with a clean slate
27
+ rm -f " /var/log/journal/$( < /etc/machine-id) " /system@* .journal
28
+ rm -f " /var/log/journal/$( < /etc/machine-id) /" user-* @* .journal
29
+ journalctl --header | grep path
30
+
31
+ for _ in {0..9}; do
32
+ journalctl --rotate --vacuum-files=1
33
+ journalctl --sync
34
+ SYSTEMD_LOG_LEVEL=debug journalctl -n1 -q
35
+ (! journalctl -n0 -q | & grep corrupted)
36
+ done
You can’t perform that action at this time.
0 commit comments