mirror of
https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git
synced 2025-06-05 22:31:34 +00:00
Move testdata tarball into this repo
Again to reduce direct usage of pagure.io, move the testdata tarball (used by download_testdata) directly into this repo. For now it includes repository.tar.gz, which is silly, but I'll send a follow-up PR to openqa_testdata to drop that file if this works out. This includes a script to produce the tarball from the base repository, and adjusts download_testdata to get the tarball from autoinst_url and update its unpacking logic (as this version of the tarball has a top-level directory). Note the tarball in this commit is actually from the branch that backs https://pagure.io/fedora-qa/openqa_testdata/pull-request/1 to reduce size. Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
parent
9cb382095c
commit
eda3f9b4b6
BIN
data/testdata.tar.gz
Normal file
BIN
data/testdata.tar.gz
Normal file
Binary file not shown.
21
lib/utils.pm
21
lib/utils.pm
@ -1718,8 +1718,10 @@ sub check_and_install_git {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# This routine is used in Desktop test suites. It downloads the test data from
|
# This routine is used in Desktop test suites. It downloads the test data from
|
||||||
# the repository and populates the directory structure.
|
# tarball and populates the directory structure.
|
||||||
# The data repository is located at https://pagure.io/fedora-qa/openqa_testdata.
|
# The tarball is generated by update-data-tarball.sh from the
|
||||||
|
# https://pagure.io/fedora-qa/openqa_testdata repository; make changes
|
||||||
|
# there, then run the update-data-tarball.sh script and commit the result.
|
||||||
|
|
||||||
sub download_testdata {
|
sub download_testdata {
|
||||||
# We can select which Data to copy over.
|
# We can select which Data to copy over.
|
||||||
@ -1732,20 +1734,19 @@ sub download_testdata {
|
|||||||
assert_script_run("mkdir temp");
|
assert_script_run("mkdir temp");
|
||||||
assert_script_run("cd temp");
|
assert_script_run("cd temp");
|
||||||
# Download the compressed file with the repository content.
|
# Download the compressed file with the repository content.
|
||||||
assert_script_run("curl --retry-delay 10 --max-time 120 --retry 5 -o repository.tar.gz https://pagure.io/fedora-qa/openqa_testdata/blob/thetree/f/repository.tar.gz", timeout => 600);
|
assert_script_run("curl --retry-delay 10 --max-time 120 --retry 5 -O " . autoinst_url . "/data/testdata.tar.gz", timeout => 600);
|
||||||
# Untar it.
|
# Untar it.
|
||||||
assert_script_run("tar -zxvf repository.tar.gz");
|
assert_script_run("tar -zxvf testdata.tar.gz");
|
||||||
# Copy out the files into the VMs directory structure.
|
# Copy out the files into the VMs directory structure.
|
||||||
if ($data eq "structure") {
|
if ($data eq "structure") {
|
||||||
assert_script_run("cp music/* /home/$user/Music");
|
assert_script_run("cp openqa_testdata/music/* /home/$user/Music");
|
||||||
assert_script_run("cp documents/* /home/$user/Documents");
|
assert_script_run("cp openqa_testdata/documents/* /home/$user/Documents");
|
||||||
assert_script_run("cp pictures/* /home/$user/Pictures");
|
assert_script_run("cp openqa_testdata/pictures/* /home/$user/Pictures");
|
||||||
assert_script_run("cp video/* /home/$user/Videos");
|
assert_script_run("cp openqa_testdata/reference/* /home/$user/");
|
||||||
assert_script_run("cp reference/* /home/$user/");
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
assert_script_run("mkdir /home/$user/$data");
|
assert_script_run("mkdir /home/$user/$data");
|
||||||
assert_script_run("cp $data/* /home/$user/$data/");
|
assert_script_run("cp openqa_testdata/$data/* /home/$user/$data/");
|
||||||
}
|
}
|
||||||
# Delete the temporary directory and the downloaded file.
|
# Delete the temporary directory and the downloaded file.
|
||||||
assert_script_run("cd");
|
assert_script_run("cd");
|
||||||
|
32
update-data-tarball.sh
Executable file
32
update-data-tarball.sh
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
|
||||||
|
# Copyright Red Hat
|
||||||
|
#
|
||||||
|
# This file is part of os-autoinst-distri-fedora.
|
||||||
|
#
|
||||||
|
# os-autoinst-distri-fedora is free software; you can redistribute it
|
||||||
|
# and/or modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation, either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
# Author: Adam Williamson <awilliam@redhat.com>
|
||||||
|
|
||||||
|
# This is a helper script to update the tarball of the openqa_testdata
|
||||||
|
# repository that lives in data/ and is downloaded by the tests.
|
||||||
|
|
||||||
|
WORK_DIR=$(mktemp -d)
|
||||||
|
pushd ${WORK_DIR}
|
||||||
|
git clone https://pagure.io/fedora-qa/openqa_testdata.git
|
||||||
|
tar --exclude='.git' -czvf testdata.tar.gz openqa_testdata
|
||||||
|
popd
|
||||||
|
here=$(dirname ${0})
|
||||||
|
mv ${WORK_DIR}/testdata.tar.gz ${here}/data
|
||||||
|
rm -rf ${WORK_DIR}
|
Loading…
Reference in New Issue
Block a user