Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions tmt/tests/booted/bootc_testlib.nu
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,31 @@
# that seems to have appeared in C10S
# TODO diagnose and fill in here
export def reboot [] {
# Sometimes systemd daemons are still running old binaries and response "Access denied" when send reboot request
# Force a full sync before reboot
sync
# Allow more delay for bootc to settle
sleep 30sec
# Confirm root cause
# loginctl show-session $(loginctl | awk '/tty/ {print $1}')
loginctl
busctl call org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager CanReboot
journalctl -u systemd-logind -n200 --no-pager
journalctl -b -n200 | sed -n '1,200p'
journalctl -k -n200 --no-pager
ausearch -m USER_CMD -ts recent 2>/dev/null or true
ausearch -m avc,USER_AVC -ts recent 2>/dev/null or true
journalctl -b | grep -i "denied\|capability\|reboot\|sys_reboot"
capsh --print 2>/dev/null or true
# Enable polkit permissions for test user (root or non-root)
# to allow logind reboot non-interactively
sudo sh -c 'cat >/etc/polkit-1/rules.d/49-allow-reboot.rules <<EOF
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.login1.reboot" ||
action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
action.id == "org.freedesktop.login1.power-off") {

if (subject.user == "root" || subject.isInGroup("wheel")) {
return polkit.Result.YES;
}
}
});
EOF'

tmt-reboot
}
Expand Down
Loading