From cfe2a330382d615633d462e7a59055c1a86a8d47 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 24 Aug 2018 14:39:18 -0700 Subject: [PATCH] Have domain controller upload logs *before* decommissioning It transpires that decommissioning wipes some stuff, like the dirsrv logs. Obviously we want these included in the logs we upload for reference purposes, so let's upload earlier. Signed-off-by: Adam Williamson --- tests/role_deploy_domain_controller_check.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/role_deploy_domain_controller_check.pm b/tests/role_deploy_domain_controller_check.pm index b5daba95..f4991c20 100644 --- a/tests/role_deploy_domain_controller_check.pm +++ b/tests/role_deploy_domain_controller_check.pm @@ -23,6 +23,10 @@ sub run { validate_script_output 'rolectl settings domaincontroller/domain.local', sub {$_ =~ m/dm_password = None/ }; # once child jobs are done, stop the role wait_for_children; + # run post-fail hook to upload logs - even when this test passes + # there are often cases where we need to see the logs (e.g. client + # test failed due to server issue) + $self->post_fail_hook(); assert_script_run 'rolectl stop domaincontroller/domain.local'; # check role is stopped validate_script_output 'rolectl status domaincontroller/domain.local', sub { $_ =~ m/^ready-to-start/ }; @@ -34,6 +38,10 @@ sub run { else { # once child jobs are done, stop the server wait_for_children; + # run post-fail hook to upload logs - even when this test passes + # there are often cases where we need to see the logs (e.g. client + # test failed due to server issue) + $self->post_fail_hook(); assert_script_run 'systemctl stop ipa.service'; # check server is stopped assert_script_run '! systemctl is-active ipa.service'; @@ -43,10 +51,6 @@ sub run { assert_script_run 'clear'; # FIXME check server is decommissioned...how? } - # run post-fail hook to upload logs - even when this test passes - # there are often cases where we need to see the logs (e.g. client - # test failed due to server issue) - $self->post_fail_hook(); }