diff --git a/lib/utils.pm b/lib/utils.pm index 3facc102..58eaf0b5 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -654,7 +654,7 @@ sub download_modularity_tests { # Clone the main script repo, navigate there and set correct permissions. assert_script_run 'git clone https://pagure.io/fedora-qa/modularity_testing_scripts.git /root/modularity'; assert_script_run 'cd /root/modularity'; - assert_script_run 'chmod 755 /root/modular_functions.py' + assert_script_run 'chmod 755 /root/modularity/modular_functions.py'; # Clone the directory with the yaml files assert_script_run 'git clone https://pagure.io/releng/fedora-module-defaults.git /root/modularity/yaml'; } diff --git a/tests/modularity_checkdefaults.pm b/tests/modularity_checkdefaults.pm index 63247f41..d970bf61 100644 --- a/tests/modularity_checkdefaults.pm +++ b/tests/modularity_checkdefaults.pm @@ -7,14 +7,15 @@ sub run { # switch to tty and login as root $self->root_console(tty=>3); - # Download the testing script - download_modularity_tests(); - # Test if modules have default stream and profile defined. - assert_script_run('/root/modular_functions.py -a checkdefaults -w whitelist'); + assert_script_run('/root/modularity/modular_functions.py -a checkdefaults -w whitelist'); # Upload modular logs - upload_logs '/root/modular.log', failok=>1; + upload_logs '/root/modularity/modular.log', failok=>1; +} + +sub test_flags { + return {always_rollback => 1}; } 1; diff --git a/tests/modularity_enable_disable_module.pm b/tests/modularity_enable_disable_module.pm index 389ada97..62510274 100644 --- a/tests/modularity_enable_disable_module.pm +++ b/tests/modularity_enable_disable_module.pm @@ -8,18 +8,19 @@ sub run { # switch to tty and login as root $self->root_console(tty=>3); - # Download the testing script - download_modularity_tests(); - # Check that modularity works, that a particular module is available in the system, # and display information about that module. - assert_script_run('/root/modular_functions.py -m dwm -s 6.1 -a list'); + 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/modular_functions.py -m dwm -s 6.1 -a enable,disable -f hard'); + 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/modular.log', failok=>1; + upload_logs '/root/modularity/modular.log', failok=>1; +} + +sub test_flags { + return {always_rollback => 1}; } 1; diff --git a/tests/modularity_install_module.pm b/tests/modularity_install_module.pm index 422defa4..c25de0a5 100644 --- a/tests/modularity_install_module.pm +++ b/tests/modularity_install_module.pm @@ -7,17 +7,18 @@ sub run { # switch to tty and login as root $self->root_console(tty=>3); - # Download the testing script - download_modularity_tests(); - # Check that modularity works and that a particular module is available in the system. - assert_script_run('/root/modular_functions.py -s 11 -a list'); + assert_script_run('/root/modularity/modular_functions.py -s 11 -a list'); # Check that module can be enabled and removed. - assert_script_run('/root/modular_functions.py -m nodejs -s 11 -p default -a install,remove,reset -f hard'); + 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/modular.log', failok=>1; + upload_logs '/root/modularity/modular.log', failok=>1; +} + +sub test_flags { + return {always_rollback => 1}; } 1; diff --git a/tests/modularity_module_list.pm b/tests/modularity_module_list.pm index 6e7f605d..0a48f559 100644 --- a/tests/modularity_module_list.pm +++ b/tests/modularity_module_list.pm @@ -30,6 +30,10 @@ sub run { assert_script_run('dnf module list --installed'); } +sub test_flags { + return {always_rollback => 1}; +} + 1; diff --git a/tests/modularity_prepare_tests.pm b/tests/modularity_prepare_tests.pm new file mode 100644 index 00000000..2d1e57f6 --- /dev/null +++ b/tests/modularity_prepare_tests.pm @@ -0,0 +1,21 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; +sub run { + my $self=shift; + # switch to tty and login as root + $self->root_console(tty=>3); + + # Download the necessary testing data + download_modularity_tests(); +} + +sub test_flags { + return {fatal => 1, milestone => 1}; +} + + +1; + +# vim: set sw=4 et: diff --git a/tests/modularity_update_norepo.pm b/tests/modularity_update_norepo.pm index 18e2b1cc..99ccf238 100644 --- a/tests/modularity_update_norepo.pm +++ b/tests/modularity_update_norepo.pm @@ -7,20 +7,21 @@ sub run { # switch to tty and login as root $self->root_console(tty=>3); - # Download the testing script - download_modularity_tests(); - # Update the system assert_script_run('dnf update -y'); # Enable and install the nodejs module, stream 8. - assert_script_run('/root/modular_functions.py -m nodejs -s 11 -a enable,install -f hard'); + assert_script_run('/root/modularity/modular_functions.py -m nodejs -s 11 -a enable,install -f hard'); # Update the system without modular repos. assert_script_run('dnf update --disablerepo=\*modular -y'); # Check that the same version is listed in the installed modules. - assert_script_run('/root/modular_functions.py -m nodejs -s 11 -a checkinstall -f hard'); + assert_script_run('/root/modularity/modular_functions.py -m nodejs -s 11 -a checkinstall -f hard'); +} + +sub test_flags { + return {always_rollback => 1}; } 1;