1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-21 13:33:08 +00:00

Retry setting root password on live

This seems to have started failing periodically at the start of
this month, I've no idea why. For now, let's retry it a few
times and see if that helps.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2023-09-07 08:34:16 -07:00
parent d8efb7df1d
commit ccfef0d168

View File

@ -171,7 +171,15 @@ sub run {
}
if (grep { $_ eq 'rootpw' } @actions) {
my $root_password = get_var("ROOT_PASSWORD") || "weakpassword";
assert_script_run "echo 'root:$root_password' | chpasswd -R $mount";
# this seems to have started to fail periodically with "failure while
# writing changes to /etc/shadow" on 2023-09-01, attempt to work
# around that
my $count = 5;
while ($count) {
last unless (script_run "echo 'root:$root_password' | chpasswd -R $mount");
die "setting root password failed five time!" unless ($count);
$count -= 1;
}
}
if (grep { $_ eq 'noplymouth' } @actions) {
assert_script_run "chroot $mount dnf -y remove plymouth";