diff --git a/lib/installedtest.pm b/lib/installedtest.pm index 956c37f9..4ad8c276 100644 --- a/lib/installedtest.pm +++ b/lib/installedtest.pm @@ -108,6 +108,11 @@ sub post_fail_hook { upload_logs "/tmp/var_log.tar.gz"; } + # Upload Modularity logs, if they exist. They never will unless modularity is tested. + unless (script_run 'test "$(ls /root/modularity/modular.log)"') { + upload_logs "/root/modularity/modular.log", failok=>1; + } + # Sometimes useful for diagnosing FreeIPA issues upload_logs "/etc/nsswitch.conf", failok=>1; diff --git a/tests/modularity_checkdefaults.pm b/tests/modularity_checkdefaults.pm index d970bf61..470ce523 100644 --- a/tests/modularity_checkdefaults.pm +++ b/tests/modularity_checkdefaults.pm @@ -8,10 +8,7 @@ sub run { $self->root_console(tty=>3); # Test if modules have default stream and profile defined. - assert_script_run('/root/modularity/modular_functions.py -a checkdefaults -w whitelist'); - - # Upload modular logs - upload_logs '/root/modularity/modular.log', failok=>1; + assert_script_run('/root/modularity/modular_functions.py -a checkdefaults -w whitelist'); } sub test_flags { diff --git a/tests/modularity_enable_disable_module.pm b/tests/modularity_enable_disable_module.pm index 62510274..e1c27b89 100644 --- a/tests/modularity_enable_disable_module.pm +++ b/tests/modularity_enable_disable_module.pm @@ -13,10 +13,8 @@ sub run { assert_script_run('/root/modularity/modular_functions.py -m dwm -s 6.1 -a list'); # Check that module can be enabled and disabled. - assert_script_run('/root/modularity/modular_functions.py -m dwm -s 6.1 -a enable,disable -f hard'); - - # Upload the modular log file. - upload_logs '/root/modularity/modular.log', failok=>1; + assert_script_run('/root/modularity/modular_functions.py -m dwm -s 6.1 -a enable,disable -f hard'); + } sub test_flags { diff --git a/tests/modularity_install_module.pm b/tests/modularity_install_module.pm index c25de0a5..b20a6cf9 100644 --- a/tests/modularity_install_module.pm +++ b/tests/modularity_install_module.pm @@ -12,9 +12,6 @@ sub run { # Check that module can be enabled and removed. assert_script_run('/root/modularity/modular_functions.py -m nodejs -s 11 -p default -a install,remove,reset -f hard'); - - # Upload modular logs - upload_logs '/root/modularity/modular.log', failok=>1; } sub test_flags {