From ccfef0d168deef53f6287f024f672875716ecea6 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 7 Sep 2023 08:34:16 -0700 Subject: [PATCH] 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 --- tests/_do_install_and_reboot.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/_do_install_and_reboot.pm b/tests/_do_install_and_reboot.pm index 39e0cf96..f5acd225 100644 --- a/tests/_do_install_and_reboot.pm +++ b/tests/_do_install_and_reboot.pm @@ -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";