Skip to content

Commit 3883d9a

Browse files
committed
test: Debug reboot issue in C10S
Signed-off-by: Xiaofeng Wang <[email protected]>
1 parent f687add commit 3883d9a

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

tmt/tests/booted/bootc_testlib.nu

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,23 @@
44
# that seems to have appeared in C10S
55
# TODO diagnose and fill in here
66
export def reboot [] {
7-
# Sometimes systemd daemons are still running old binaries and response "Access denied" when send reboot request
8-
# Force a full sync before reboot
9-
sync
10-
# Allow more delay for bootc to settle
11-
sleep 30sec
7+
# Confirm root cause
8+
loginctl show-session $(loginctl | awk '/tty/ {print $1}')
9+
busctl call org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager CanReboot
10+
# Enable polkit permissions for test user (root or non-root)
11+
# to allow logind reboot non-interactively
12+
sudo sh -c 'cat >/etc/polkit-1/rules.d/49-allow-reboot.rules <<EOF
13+
polkit.addRule(function(action, subject) {
14+
if (action.id == "org.freedesktop.login1.reboot" ||
15+
action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
16+
action.id == "org.freedesktop.login1.power-off") {
17+
18+
if (subject.user == "root" || subject.isInGroup("wheel")) {
19+
return polkit.Result.YES;
20+
}
21+
}
22+
});
23+
EOF'
1224

1325
tmt-reboot
1426
}

0 commit comments

Comments
 (0)