From 6e262be28b9df5b017ae51ce8cb5ee827364b112 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 5 Oct 2018 23:53:17 -0700 Subject: [PATCH] Add a check that FreeIPA is actually up after upgrade The FreeIPA upgrade test didn't actually check that FreeIPA is actually running after the upgrade and reboot, it just kinda assumed it is. Let's add a check to the start of the 'check' test module that makes sure ipa.service actually comes up to 'active' state. This'll make it clearer when tests are failing because FreeIPA didn't come up right after the upgrade. The check will run on non-upgrade tests too, but that's fine. Signed-off-by: Adam Williamson --- tests/role_deploy_domain_controller_check.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/role_deploy_domain_controller_check.pm b/tests/role_deploy_domain_controller_check.pm index 16a14476..deeff101 100644 --- a/tests/role_deploy_domain_controller_check.pm +++ b/tests/role_deploy_domain_controller_check.pm @@ -6,6 +6,18 @@ use mmapi; sub run { my $self = shift; + # make sure ipa.service actually came up successfully + my $count = 40; + while (1) { + $count -= 1; + die "Waited too long for ipa.service to show up!" if ($count == 0); + sleep 3; + # if it's active, we're done here + last unless script_run 'systemctl is-active ipa.service'; + # if it's not...fail if it's failed + assert_script_run '! systemctl is-failed ipa.service'; + # if we get here, it's activating, so loop around + } # if this is an update, notify clients that we're now up again mutex_create('server_upgraded') if get_var("UPGRADE"); # from here we branch: for F28 and earlier we use rolekit as