From 0f2e75f150e37046df15ffb27bf01d54fcdc8da1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20R=C5=AF=C5=BEi=C4=8Dka?= Date: Mon, 22 Jul 2019 15:38:24 +0200 Subject: [PATCH] Change way of data preparation. --- lib/utils.pm | 18 ++++++++++-------- tests/modularity_checkdefaults.pm | 4 ++-- tests/modularity_enable_disable_module.pm | 4 ++-- tests/modularity_install_module.pm | 4 ++-- tests/modularity_update_norepo.pm | 4 ++-- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/lib/utils.pm b/lib/utils.pm index 1045c25e..3facc102 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -648,16 +648,18 @@ sub check_desktop_clean { } sub download_modularity_tests { -# Download the modularity test script, place in the system and then -# modify the access rights to make it executable. - my ($whitelist) = @_; - assert_script_run 'curl -o /root/test.py https://pagure.io/fedora-qa/modularity_testing_scripts/raw/master/f/modular_functions.py'; - if ($whitelist eq 'whitelist') { - assert_script_run 'curl -o /root/whitelist https://pagure.io/fedora-qa/modularity_testing_scripts/raw/master/f/whitelist'; - } - assert_script_run 'chmod 755 /root/test.py'; +# Prepare the VM for modularity tests. +# First, install git, if is has not been installed before. + assert_script_run 'dnf install git -y'; +# 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' +# Clone the directory with the yaml files + assert_script_run 'git clone https://pagure.io/releng/fedora-module-defaults.git /root/modularity/yaml'; } + sub quit_firefox { # Quit Firefox, handling the 'close multiple tabs' warning screen if # it shows up diff --git a/tests/modularity_checkdefaults.pm b/tests/modularity_checkdefaults.pm index 6ebfa013..63247f41 100644 --- a/tests/modularity_checkdefaults.pm +++ b/tests/modularity_checkdefaults.pm @@ -8,10 +8,10 @@ sub run { $self->root_console(tty=>3); # Download the testing script - download_modularity_tests('whitelist'); + download_modularity_tests(); # Test if modules have default stream and profile defined. - assert_script_run('/root/test.py -a checkdefaults -w whitelist'); + assert_script_run('/root/modular_functions.py -a checkdefaults -w whitelist'); # Upload modular logs upload_logs '/root/modular.log', failok=>1; diff --git a/tests/modularity_enable_disable_module.pm b/tests/modularity_enable_disable_module.pm index e4732292..389ada97 100644 --- a/tests/modularity_enable_disable_module.pm +++ b/tests/modularity_enable_disable_module.pm @@ -13,10 +13,10 @@ sub run { # Check that modularity works, that a particular module is available in the system, # and display information about that module. - assert_script_run('/root/test.py -m dwm -s 6.1 -a list'); + assert_script_run('/root/modular_functions.py -m dwm -s 6.1 -a list'); # Check that module can be enabled and disabled. - assert_script_run('/root/test.py -m dwm -s 6.1 -a enable,disable -f hard'); + assert_script_run('/root/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; diff --git a/tests/modularity_install_module.pm b/tests/modularity_install_module.pm index fb1856d1..422defa4 100644 --- a/tests/modularity_install_module.pm +++ b/tests/modularity_install_module.pm @@ -11,10 +11,10 @@ sub run { download_modularity_tests(); # Check that modularity works and that a particular module is available in the system. - assert_script_run('/root/test.py -m nodejs -s 11 -a list'); + assert_script_run('/root/modular_functions.py -s 11 -a list'); # Check that module can be enabled and removed. - assert_script_run('/root/test.py -m nodejs -s 11 -p default -a install,remove,reset -f hard'); + assert_script_run('/root/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; diff --git a/tests/modularity_update_norepo.pm b/tests/modularity_update_norepo.pm index 0e28c5d2..18e2b1cc 100644 --- a/tests/modularity_update_norepo.pm +++ b/tests/modularity_update_norepo.pm @@ -14,13 +14,13 @@ sub run { assert_script_run('dnf update -y'); # Enable and install the nodejs module, stream 8. - assert_script_run('/root/test.py -m nodejs -s 11 -a enable,install -f hard'); + assert_script_run('/root/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/test.py -m nodejs -s 11 -a checkinstall -f hard'); + assert_script_run('/root/modular_functions.py -m nodejs -s 11 -a checkinstall -f hard'); } 1;