Have update installer test install the update packages (#89)

In https://bugzilla.redhat.com/show_bug.cgi?id=1669256 it became
obvious that there's a missing feature in the new installer test
for updates: the update is both used in the image build process
and built into the installer environment itself, but it is not
actually included in the installed package set. This can be a
problem if the update has a bug that manifests *only* at install
time if it is in the install transaction (which is exactly the
case there), because the test will not catch this, and nor will
any other test.

So this commit makes `support_server` set up the update repo and
serve it out via NFS when it's run in an update context, and
makes the actual update install test run parallel with it and
use that repository. This way the install should include the
package(s) from the update. (It also of course means the test
fails if an update breaks NFS or something like that, but hey,
we want to know that!)

A parallel commit for fedora_openqa is necessary to add the
required CURRREL setting for the updates-installer flavor.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2019-01-25 14:41:32 +01:00
parent 12affb145f
commit d1006a38e5
5 changed files with 69 additions and 24 deletions

View File

@ -169,7 +169,7 @@ sub load_install_tests() {
autotest::loadtest "tests/install_source_graphical.pm"; autotest::loadtest "tests/install_source_graphical.pm";
autotest::loadtest "tests/_check_install_source.pm"; autotest::loadtest "tests/_check_install_source.pm";
} }
if (get_var("REPOSITORY_VARIATION")){ if (get_var("REPOSITORY_VARIATION") || get_var("ADD_REPOSITORY_VARIATION")) {
autotest::loadtest "tests/_check_install_source.pm"; autotest::loadtest "tests/_check_install_source.pm";
} }

View File

@ -378,6 +378,18 @@
}, },
test_suite => { name => "installer_build" }, test_suite => { name => "installer_build" },
}, },
{
group_name => "Fedora Updates",
machine => { name => "64bit" },
prio => 40,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "updates-installer",
version => "*",
},
test_suite => { name => "support_server" },
},
{ {
group_name => "Fedora Updates", group_name => "Fedora Updates",
machine => { name => "64bit" }, machine => { name => "64bit" },
@ -984,9 +996,14 @@
name => "install_default_update", name => "install_default_update",
settings => [ settings => [
{ key => "INSTALL", value => "1" }, { key => "INSTALL", value => "1" },
{ key => "INSTALL_UNLOCK", value => "support_ready" },
{ key => "ISO", value => "%ADVISORY%-netinst-%ARCH%.iso" }, { key => "ISO", value => "%ADVISORY%-netinst-%ARCH%.iso" },
{ key => "NICTYPE", value => "tap" },
{ key => "PACKAGE_SET", value => "default" }, { key => "PACKAGE_SET", value => "default" },
{ key => "PARALLEL_WITH", value => "support_server" },
{ key => "ADD_REPOSITORY_VARIATION", value => "nfs://10.0.2.110:/opt/update_repo" },
{ key => "+START_AFTER_TEST", value => "installer_build" }, { key => "+START_AFTER_TEST", value => "installer_build" },
{ key => "WORKER_CLASS", value => "tap" },
], ],
}, },
], ],

View File

@ -18,6 +18,11 @@ sub run {
if ($repourl) { if ($repourl) {
$params .= "inst.repo=" . get_full_repo($repourl) . " "; $params .= "inst.repo=" . get_full_repo($repourl) . " ";
} }
# Construct inst.addrepo arg for ADD_REPOSITORY_VARIATION
my $repourl = get_var("ADD_REPOSITORY_VARIATION");
if ($repourl) {
$params .= "inst.addrepo=addrepo," . get_full_repo($repourl) . " ";
}
if (get_var("ANACONDA_TEXT")) { if (get_var("ANACONDA_TEXT")) {
$params .= "inst.text "; $params .= "inst.text ";
} }

View File

@ -6,30 +6,37 @@ use anaconda;
sub run { sub run {
my $self = shift; my $self = shift;
my $repourl; my $repourl;
my $addrepourl;
if (get_var("MIRRORLIST_GRAPHICAL")) { if (get_var("MIRRORLIST_GRAPHICAL")) {
$repourl = get_mirrorlist_url(); $repourl = get_mirrorlist_url();
} }
else { else {
$repourl = get_var("REPOSITORY_VARIATION", get_var("REPOSITORY_GRAPHICAL")); $repourl = get_var("REPOSITORY_VARIATION", get_var("REPOSITORY_GRAPHICAL"));
$repourl = get_full_repo($repourl); $repourl = get_full_repo($repourl) if ($repourl);
$addrepourl = get_var("ADD_REPOSITORY_VARIATION");
$addrepourl = get_full_repo($addrepourl) if ($addrepourl);
} }
# check that the repo was used # check that the repo was used
$self->root_console; $self->root_console;
if ($addrepourl) {
if ($addrepourl =~ m,^nfs://,,) {
# this line tells us it set up a repo for our URL...
assert_script_run 'grep "repo addrepo.*' . ${addrepourl} . '" /tmp/packaging.log';
# ...this line tells us it added the repo called 'addrepo'...
assert_script_run 'grep "\(added\|enabled\) repo: .addrepo." /tmp/packaging.log';
# ...and this line tells us it worked (I hope)
assert_script_run 'grep "enabled repo.*nfs" /tmp/packaging.log';
}
}
if ($repourl =~ s/^nfs://) { if ($repourl =~ s/^nfs://) {
$repourl =~ s/^nfsvers=.://; $repourl =~ s/^nfsvers=.://;
# the above both checks if we're dealing with an NFS URL, and # the above both checks if we're dealing with an NFS URL, and
# strips the 'nfs:' and 'nfsvers=.:' from it if so # strips the 'nfs:' and 'nfsvers=.:' from it if so
if (get_var("OFW")) { # check the repo was actually mounted
# for PowerPC mounting info may be not in anaconda.log
assert_script_run "mount |grep nfs |grep '${repourl}'"; assert_script_run "mount |grep nfs |grep '${repourl}'";
} }
else { elsif ($repourl) {
# message is in packaging.log up to F26, anaconda.log F27+
assert_script_run "grep 'mounting ${repourl}' /tmp/packaging.log /tmp/anaconda.log";
}
}
else {
# there are only three hard problems in software development: # there are only three hard problems in software development:
# naming things, cache expiry, off-by-one errors...and quoting # naming things, cache expiry, off-by-one errors...and quoting
# we need single quotes (at the perl level) around the start # we need single quotes (at the perl level) around the start
@ -48,6 +55,13 @@ sub run {
# is done. # is done.
assert_script_run 'grep "\(added\|enabled\) repo: ' . "\\('anaconda'\\|''\\).*${repourl}" . '" /tmp/packaging.log'; assert_script_run 'grep "\(added\|enabled\) repo: ' . "\\('anaconda'\\|''\\).*${repourl}" . '" /tmp/packaging.log';
} }
if ($repourl) {
# check we don't have an error indicating our repo wasn't used
assert_script_run '! grep "base repo.*not valid" /tmp/packaging.log';
}
# just for convenience - sometimes it's useful to see this log
# for a success case
upload_logs "/tmp/packaging.log", failok=>1;
send_key "ctrl-alt-f6"; send_key "ctrl-alt-f6";
# Anaconda hub # Anaconda hub

View File

@ -4,6 +4,7 @@ use testapi;
use lockapi; use lockapi;
use mmapi; use mmapi;
use tapnet; use tapnet;
use utils;
sub run { sub run {
my $self=shift; my $self=shift;
@ -32,6 +33,12 @@ sub run {
assert_script_run "mkdir -p /export"; assert_script_run "mkdir -p /export";
# get the kickstart # get the kickstart
assert_script_run "curl -o /export/root-user-crypted-net.ks https://jskladan.fedorapeople.org/kickstarts/root-user-crypted-net.ks"; assert_script_run "curl -o /export/root-user-crypted-net.ks https://jskladan.fedorapeople.org/kickstarts/root-user-crypted-net.ks";
# for update tests, set up the update repository and export it
if (get_var("ADVISORY")) {
assert_script_run "echo '/opt/update_repo 10.0.2.0/24(ro)' >> /etc/exports";
}
# for compose tests, we do all this stuff
else {
# create the repo share # create the repo share
assert_script_run "mkdir -p /repo"; assert_script_run "mkdir -p /repo";
# create a mount point for the ISO # create a mount point for the ISO
@ -45,6 +52,8 @@ sub run {
assert_script_run "curl -o /repo/images/updates.img https://fedorapeople.org/groups/qa/updates/updates-openqa.img"; assert_script_run "curl -o /repo/images/updates.img https://fedorapeople.org/groups/qa/updates/updates-openqa.img";
# set up the exports # set up the exports
assert_script_run "printf '/export 10.0.2.0/24(ro)\n/repo 10.0.2.0/24(ro)' > /etc/exports"; assert_script_run "printf '/export 10.0.2.0/24(ro)\n/repo 10.0.2.0/24(ro)' > /etc/exports";
}
# open firewall port # open firewall port
assert_script_run "firewall-cmd --add-service=nfs"; assert_script_run "firewall-cmd --add-service=nfs";
# start the server # start the server