diff --git a/main.pm b/main.pm index 96294559..15e0e0d5 100644 --- a/main.pm +++ b/main.pm @@ -169,7 +169,7 @@ sub load_install_tests() { autotest::loadtest "tests/install_source_graphical.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"; } diff --git a/templates-updates b/templates-updates index 3e7b6d9d..84164715 100755 --- a/templates-updates +++ b/templates-updates @@ -378,6 +378,18 @@ }, 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", machine => { name => "64bit" }, @@ -984,9 +996,14 @@ name => "install_default_update", settings => [ { key => "INSTALL", value => "1" }, + { key => "INSTALL_UNLOCK", value => "support_ready" }, { key => "ISO", value => "%ADVISORY%-netinst-%ARCH%.iso" }, + { key => "NICTYPE", value => "tap" }, { 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 => "WORKER_CLASS", value => "tap" }, ], }, ], diff --git a/tests/_boot_to_anaconda.pm b/tests/_boot_to_anaconda.pm index 92cdc7ba..4e3827c3 100644 --- a/tests/_boot_to_anaconda.pm +++ b/tests/_boot_to_anaconda.pm @@ -18,6 +18,11 @@ sub run { if ($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")) { $params .= "inst.text "; } diff --git a/tests/_check_install_source.pm b/tests/_check_install_source.pm index 7b811a7c..0cb22f8a 100644 --- a/tests/_check_install_source.pm +++ b/tests/_check_install_source.pm @@ -6,30 +6,37 @@ use anaconda; sub run { my $self = shift; my $repourl; + my $addrepourl; if (get_var("MIRRORLIST_GRAPHICAL")) { $repourl = get_mirrorlist_url(); } else { $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 $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://) { $repourl =~ s/^nfsvers=.://; # the above both checks if we're dealing with an NFS URL, and # strips the 'nfs:' and 'nfsvers=.:' from it if so - if (get_var("OFW")) { - # for PowerPC mounting info may be not in anaconda.log - assert_script_run "mount |grep nfs |grep '${repourl}'"; - } - else { - # message is in packaging.log up to F26, anaconda.log F27+ - assert_script_run "grep 'mounting ${repourl}' /tmp/packaging.log /tmp/anaconda.log"; - } + # check the repo was actually mounted + assert_script_run "mount |grep nfs |grep '${repourl}'"; } - else { + elsif ($repourl) { # there are only three hard problems in software development: # naming things, cache expiry, off-by-one errors...and quoting # we need single quotes (at the perl level) around the start @@ -48,6 +55,13 @@ sub run { # is done. 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"; # Anaconda hub diff --git a/tests/_support_server.pm b/tests/_support_server.pm index e62f3e26..36bd6594 100644 --- a/tests/_support_server.pm +++ b/tests/_support_server.pm @@ -4,6 +4,7 @@ use testapi; use lockapi; use mmapi; use tapnet; +use utils; sub run { my $self=shift; @@ -32,19 +33,27 @@ sub run { assert_script_run "mkdir -p /export"; # get the kickstart assert_script_run "curl -o /export/root-user-crypted-net.ks https://jskladan.fedorapeople.org/kickstarts/root-user-crypted-net.ks"; - # create the repo share - assert_script_run "mkdir -p /repo"; - # create a mount point for the ISO - assert_script_run "mkdir -p /mnt/iso"; - # mount the ISO there - assert_script_run "mount /dev/cdrom /mnt/iso"; - # copy the contents of the ISO to the repo share - assert_script_run "cp -R /mnt/iso/* /repo", 180; - # put the updates image in the NFS repo (for testing this update - # image delivery method) - assert_script_run "curl -o /repo/images/updates.img https://fedorapeople.org/groups/qa/updates/updates-openqa.img"; - # 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"; + # 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 + assert_script_run "mkdir -p /repo"; + # create a mount point for the ISO + assert_script_run "mkdir -p /mnt/iso"; + # mount the ISO there + assert_script_run "mount /dev/cdrom /mnt/iso"; + # copy the contents of the ISO to the repo share + assert_script_run "cp -R /mnt/iso/* /repo", 180; + # put the updates image in the NFS repo (for testing this update + # image delivery method) + assert_script_run "curl -o /repo/images/updates.img https://fedorapeople.org/groups/qa/updates/updates-openqa.img"; + # 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"; + } + # open firewall port assert_script_run "firewall-cmd --add-service=nfs"; # start the server