1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-24 23:03:08 +00:00

Change the way to download test data.

This PR changes the way to download the test data into the VM.
Although it does not use a disk image as suggested in one
of the review, it does not clone the entire repository, but
a simple tar.gz file that holds the data which will be
distributed into the directory structure.

This way, the amount of data needed to be downloaded dropped
from approximately 50MB to below 2MB.

Also, the existing test suites were adapted to this situation.
This commit is contained in:
Lukáš Růžička 2022-07-01 14:40:10 +02:00
parent f81dab6739
commit 1f8b56e068
21 changed files with 75 additions and 46 deletions

View File

@ -1509,17 +1509,31 @@ sub check_and_install_git {
}
# This routine is used in Desktop test suites. It downloads the test data from
# the repository and puts the file into correct locations.
# the repository and populates the directory structure.
# The data repository is located at https://pagure.io/fedora-qa/openqa_testdata.
sub download_testdata {
my ($repodir, $location) = @_;
# Navigate to the test's home directory
assert_script_run("cd /home/test/");
# Clone the test repository;
assert_script_run("git clone https://pagure.io/fedora-qa/openqa_testdata.git");
# Copy the test data into $repodir to $location.
assert_script_run("cp openqa_testdata/$repodir/* $location");
# Navigate to the user's home directory
my $user = get_var("USER_LOGIN") // "test";
assert_script_run("cd /home/$user/");
# Create a temporary directory to unpack the zipped file.
assert_script_run("mkdir temp");
assert_script_run("cd temp");
# Download the compressed file with the repository content.
assert_script_run("wget https://pagure.io/fedora-qa/openqa_testdata/blob/thetree/f/repository.tar.gz", timeout => 120);
# Untar it.
assert_script_run("tar -zxvf repository.tar.gz");
# Copy out the files into the VMs directory structure.
assert_script_run("cp music/* /home/$user/Music");
assert_script_run("cp documents/* /home/$user/Documents");
assert_script_run("cp pictures/* /home/$user/Pictures");
assert_script_run("cp video/* /home/$user/Videos");
assert_script_run("cp reference/* /home/$user/");
# Delete the temporary directory and the downloaded file.
assert_script_run("cd");
assert_script_run("rm -rf /home/$user/temp");
# Change ownership
assert_script_run("chown -R test:test $location");
assert_script_run("chown -R test:test /home/$user/");
}
# On Fedora, the serial console is not writable for regular users which lames

View File

@ -1,11 +1,11 @@
{
"area": [
{
"height": 15,
"type": "match",
"height": 15,
"width": 71,
"xpos": 330,
"ypos": 157
"xpos": 188,
"ypos": 182
}
],
"properties": [],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -1,11 +1,11 @@
{
"area": [
{
"width": 71,
"xpos": 14,
"ypos": 6,
"type": "match",
"ypos": 7,
"height": 91,
"xpos": 14
"width": 71,
"height": 91
}
],
"properties": [],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 417 KiB

View File

@ -1,8 +1,8 @@
{
"area": [
{
"xpos": 515,
"ypos": 469,
"ypos": 470,
"xpos": 521,
"width": 183,
"height": 117,
"type": "match"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 KiB

After

Width:  |  Height:  |  Size: 320 KiB

View File

@ -1,11 +1,11 @@
{
"area": [
{
"xpos": 403,
"ypos": 355,
"width": 155,
"type": "match",
"height": 95,
"type": "match"
"width": 155,
"xpos": 408,
"ypos": 355
}
],
"properties": [],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 KiB

After

Width:  |  Height:  |  Size: 586 KiB

View File

@ -1,11 +1,11 @@
{
"area": [
{
"xpos": 816,
"ypos": 91,
"type": "match",
"width": 205,
"height": 285,
"type": "match"
"xpos": 819,
"ypos": 91
}
],
"properties": [],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 KiB

After

Width:  |  Height:  |  Size: 321 KiB

View File

@ -1,11 +1,11 @@
{
"area": [
{
"xpos": 475,
"ypos": 47,
"width": 75,
"height": 21,
"type": "match"
"type": "match",
"ypos": 47,
"xpos": 475
}
],
"properties": [],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 KiB

After

Width:  |  Height:  |  Size: 320 KiB

View File

@ -1,11 +1,11 @@
{
"area": [
{
"xpos": 793,
"ypos": 93,
"width": 162,
"height": 22,
"type": "match"
"type": "match",
"ypos": 93,
"xpos": 797
}
],
"properties": [],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 653 KiB

After

Width:  |  Height:  |  Size: 320 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 200,
"ypos": 180,
"type": "match",
"width": 66,
"height": 20
}
],
"properties": [],
"tags": [
"gte_txt_file"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 KiB

View File

@ -13,7 +13,7 @@ sub run {
# Perform git test
check_and_install_git();
# Download the test data
download_testdata("eog", "Pictures");
download_testdata();
# Exit the terminal
desktop_vt;

View File

@ -27,7 +27,7 @@ sub run {
assert_script_run("ls /home/test/Pictures/");
# Compare the files
assert_script_run("diff /home/test/Pictures/image.jpg /home/test/Pictures/new_image.jpg");
assert_script_run("diff /home/test/Pictures/leaves.jpg /home/test/Pictures/new_image.jpg");
}
sub test_flags {

View File

@ -14,7 +14,7 @@ sub run {
# Perform git test
check_and_install_git();
# Download the test data
download_testdata("evince", "Documents");
download_testdata();
# Exit the terminal
desktop_vt;

View File

@ -13,7 +13,7 @@ sub run {
# Get the test data from the test data repository.
check_and_install_git();
download_testdata("gnome-text-editor", "Documents");
download_testdata();
# Remove gedit on upgraded systems so we don't launch it by accident
script_run("dnf -y remove gedit") if (get_var("IMAGETYPE") eq "upgrade");
# Return to Desktop