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

Support testing a side tag instead of an update or task

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2023-07-04 13:13:15 -07:00
parent 2f709ed28e
commit 7c512fdc4a
5 changed files with 36 additions and 17 deletions

View File

@ -467,9 +467,9 @@ sub mount_update_image {
sub umount_update_image {
# inverse of mount_update_image
assert_script_run "sed -i '/updateiso/d' /etc/fstab";
assert_script_run "sed -i '/updateiso/d' /etc/fstab" if (get_var("ISO_2"));
assert_script_run "sed -i '/workaroundsiso/d' /etc/fstab" if (get_var("ISO_3"));
assert_script_run "umount /mnt/updateiso" unless (script_run "grep updateiso /proc/mounts");
assert_script_run "umount /mnt/updateiso" unless (!get_var("ISO_2") || script_run "grep updateiso /proc/mounts");
assert_script_run "umount /mnt/workaroundsiso" unless (!get_var("ISO_3") || script_run "grep workaroundsiso /proc/mounts");
}
@ -541,13 +541,14 @@ sub _repo_setup_compose {
sub _repo_setup_updates {
# Appropriate repo setup steps for testing a Bodhi update
# sanity check
die "_repo_setup_updates called, but ISO_2 is not attached!" unless (get_var("ISO_2"));
mount_update_image;
die "_repo_setup_updates called, but ISO_2 is not attached!" unless (get_var("ISO_2") || get_var("TAG"));
mount_update_image if (get_var("ISO_2"));
# Check if we already ran, bail if so
return unless script_run "test -f /root/.oqarsurun";
my $version = get_var("VERSION");
my $currrel = get_var("CURRREL", "0");
my $arch = get_var("ARCH");
my $tag = get_var("TAG");
# this can be used for debugging repo config if something is wrong
# unless (script_run 'pushd /etc/yum.repos.d && tar czvf yumreposd.tar.gz * && popd') {
# upload_logs "/etc/yum.repos.d/yumreposd.tar.gz";
@ -576,14 +577,19 @@ sub _repo_setup_updates {
}
# set up the workaround repo
setup_workaround_repo;
upload_logs "/mnt/updateiso/updatepkgnames.txt";
upload_logs "/mnt/updateiso/updatepkgs.txt";
upload_logs "/mnt/updateiso/updatepkgnames.txt" unless ($tag);
upload_logs "/mnt/updateiso/updatepkgs.txt" unless ($tag);
# write a repo config file, unless this is the support_server test
# and it is running on a different release than the update is for
# (in this case we need the repo to exist but do not want to use
# it on the actual support_server system)
unless (get_var("TEST") eq "support_server" && $version ne get_var("CURRREL")) {
assert_script_run 'printf "[advisory]\nname=Advisory repo\nbaseurl=file:///mnt/updateiso/update_repo\nenabled=1\nmetadata_expire=3600\ngpgcheck=0" > /etc/yum.repos.d/advisory.repo';
if ($tag) {
assert_script_run 'printf "[openqa-testtag]\nname=openqa-testtag\nbaseurl=https://kojipkgs.fedoraproject.org/repos/' . "$tag/latest/$arch" . '/\ncost=2000\nenabled=1\ngpgcheck=0\n" > /etc/yum.repos.d/openqa-testtag.repo';
}
else {
assert_script_run 'printf "[advisory]\nname=Advisory repo\nbaseurl=file:///mnt/updateiso/update_repo\nenabled=1\nmetadata_expire=3600\ngpgcheck=0" > /etc/yum.repos.d/advisory.repo';
}
# run an update now, except for upgrade or install tests,
# where the updated packages should have been installed
# already and we want to fail if they weren't, or CANNED
@ -1010,6 +1016,8 @@ sub quit_with_shortcut {
# are currently installed. This is here so we can do it both in
# _advisory_post and post_fail_hook.
sub advisory_get_installed_packages {
# can't do anything useful when testing a side tag
return if (get_var("TAG"));
# sanity check
die "advisory_get_installed_packages, but ISO_2 is not attached!" unless (get_var("ISO_2"));
mount_update_image;
@ -1041,6 +1049,8 @@ sub advisory_check_nonmatching_packages {
fatal => 1,
@_
);
# can't do anything useful when testing a side tag
return if (get_var("TAG"));
# sanity check
die "advisory_check_nonmatching_packages called, but ISO_2 is not attached!" unless (get_var("ISO_2"));
mount_update_image;

View File

@ -382,7 +382,7 @@
},
"settings": {
"+START_AFTER_TEST": "installer_build@%ARCH_BASE_MACHINE%",
"ADD_REPOSITORY_VARIATION": "nfs://172.16.2.110:/mnt/updateiso/update_repo",
"ADD_REPOSITORY_VARIATION": "%UPDATE_OR_TAG_REPO%",
"INSTALL": "1",
"INSTALL_UNLOCK": "support_ready",
"ISO": "%ADVISORY_OR_TASK%-netinst-%ARCH%.iso",

View File

@ -25,9 +25,10 @@ sub run {
unless ($version > $currrel) {
$cmd .= " --isfinal --repo=/etc/yum.repos.d/fedora-updates.repo";
}
$cmd .= " --repo=/etc/yum.repos.d/advisory.repo";
$cmd .= " --repo=/etc/yum.repos.d/advisory.repo" if (get_var("ISO_2"));
$cmd .= " --repo=/etc/yum.repos.d/workarounds.repo" if (get_var("ISO_3"));
$cmd .= " --repo=/etc/yum.repos.d/koji-rawhide.repo" if ($version eq $rawrel);
$cmd .= " --repo=/etc/yum.repos.d/openqa-testtag.repo" if (get_var("TAG"));
$cmd .= " ./results";
assert_script_run $cmd, 2400;
# good to have the log around for checks

View File

@ -43,11 +43,14 @@ sub run {
assert_script_run "echo \"include('/etc/mock/fedora-${version}-${arch}.cfg')\" > /etc/mock/openqa.cfg";
# make the side and workarounds repos and the serial device available inside the mock root
assert_script_run 'echo "config_opts[\'plugin_conf\'][\'bind_mount_enable\'] = True" >> /etc/mock/openqa.cfg';
assert_script_run 'echo "config_opts[\'plugin_conf\'][\'bind_mount_opts\'][\'dirs\'].append((\'/mnt/updateiso/update_repo\', \'/mnt/updateiso/update_repo\'))" >> /etc/mock/openqa.cfg';
assert_script_run 'echo "config_opts[\'plugin_conf\'][\'bind_mount_opts\'][\'dirs\'].append((\'/mnt/updateiso/update_repo\', \'/mnt/updateiso/update_repo\'))" >> /etc/mock/openqa.cfg' if (get_var("ISO_2"));
assert_script_run 'echo "config_opts[\'plugin_conf\'][\'bind_mount_opts\'][\'dirs\'].append((\'/mnt/workaroundsiso/workarounds_repo\', \'/mnt/workaroundsiso/workarounds_repo\'))" >> /etc/mock/openqa.cfg' if (get_var("ISO_3"));
assert_script_run 'echo "config_opts[\'plugin_conf\'][\'bind_mount_opts\'][\'dirs\'].append((\'/dev/' . $serialdev . '\', \'/dev/' . $serialdev . '\'))" >> /etc/mock/openqa.cfg';
# add the side repo to the config
my $repos = 'config_opts[\'dnf.conf\'] += \"\"\"\n[advisory]\nname=Advisory repo\nbaseurl=file:///mnt/updateiso/update_repo\nenabled=1\nmetadata_expire=3600\ngpgcheck=0\n';
my $tag = get_var("TAG");
my $repos = 'config_opts[\'dnf.conf\'] += \"\"\"\n';
# add the update repo or tag repo to the config
$repos .= '[advisory]\nname=Advisory repo\nbaseurl=file:///mnt/updateiso/update_repo\nenabled=1\nmetadata_expire=3600\ngpgcheck=0\n' if (get_var("ISO_2"));
$repos .= '[openqa-testtag]\nname=Tag test repo\nbaseurl=https://kojipkgs.fedoraproject.org/repos/' . "${tag}/latest/${arch}" . '\nenabled=1\nmetadata_expire=3600\ngpgcheck=0\n' if ($tag);
# and the workaround repo if present
$repos .= '\n[workarounds]\nname=Workarounds repo\nbaseurl=file:///mnt/workaroundsiso/workarounds_repo\nenabled=1\nmetadata_expire=3600\ngpgcheck=0\n' if (get_var("ISO_3"));
# also the buildroot repo, for Rawhide
@ -64,8 +67,9 @@ sub run {
assert_script_run 'git clone https://pagure.io/fedora-kickstarts.git';
assert_script_run 'cd fedora-kickstarts';
assert_script_run "git checkout ${branch}";
# now add the side repo to the appropriate repo ks
assert_script_run 'echo "repo --name=advisory --baseurl=file:///mnt/updateiso/update_repo" >> ' . $repoks;
# now add the side repo or tag repo to the appropriate repo ks
assert_script_run 'echo "repo --name=advisory --baseurl=file:///mnt/updateiso/update_repo" >> ' . $repoks if (get_var("ISO_2"));
assert_script_run 'echo "repo --name=openqa-testtag --baseurl=https://kojipkgs.fedoraproject.org/repos/' . "${tag}/latest/${arch}" . '" >> ' . $repoks if ($tag);
# and the workarounds repo
assert_script_run 'echo "repo --name=workarounds --baseurl=file:///mnt/workaroundsiso/workarounds_repo" >> ' . $repoks if (get_var("ISO_3"));
# and the buildroot repo, for Rawhide

View File

@ -41,13 +41,16 @@ sub run {
assert_script_run 'pushd workstation-ostree-config';
assert_script_run "git checkout ${branch}";
# now copy the advisory, workaround repo and koji-rawhide config files
assert_script_run 'cp /etc/yum.repos.d/advisory.repo .';
assert_script_run 'cp /etc/yum.repos.d/advisory.repo .' if (get_var("ISO_2"));
assert_script_run 'cp /etc/yum.repos.d/workarounds.repo .' if (get_var("ISO_3"));
assert_script_run 'cp /etc/yum.repos.d/koji-rawhide.repo .' if ($version eq $rawrel);
assert_script_run 'cp /etc/yum.repos.d/openqa-testtag.repo .' if (get_var("TAG"));
# and add them to the config file
my $repl = 'repos:\n - advisory';
my $repl = 'repos:';
$repl .= '\n - advisory' if (get_var("ISO_2"));
$repl .= '\n - workarounds' if (get_var("ISO_3"));
$repl .= '\n - koji-rawhide' if ($version eq $rawrel);
$repl .= '\n - openqa-testtag' if (get_var("TAG"));
assert_script_run 'sed -i -e "s,repos:,' . $repl . ',g" fedora-' . $lcsubv . '.yaml';
# change the ref name to a custom one (so we can test rebasing to
# the 'normal' ref later)
@ -94,9 +97,10 @@ sub run {
unless ($version > $currrel) {
$cmd .= " --isfinal --repo=/etc/yum.repos.d/fedora-updates.repo";
}
$cmd .= " --repo=/etc/yum.repos.d/advisory.repo";
$cmd .= " --repo=/etc/yum.repos.d/advisory.repo" if (get_var("ISO_2"));
$cmd .= " --repo=/etc/yum.repos.d/workarounds.repo" if (get_var("ISO_3"));
$cmd .= " --repo=/etc/yum.repos.d/koji-rawhide.repo" if ($version eq $rawrel);
$cmd .= " --repo=/etc/yum.repos.d/openqa-testtag.repo" if (get_var("TAG"));
$cmd .= " ./results";
assert_script_run $cmd, 7000;
# good to have the log around for checks