From ce07c418d0789da2348e5c0dcb144bb33dbe7f22 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 7 Nov 2017 14:20:36 -0800 Subject: [PATCH] Fix (hackily) install of X, Firefox and haveged on Modular Modular composes don't include these packages, but we need them to run the web UI tests for FreeIPA and Cockpit. This is the most reasonable hack I can come up with for now: just use a non-modular fedora repo to source these packages when doing Modular compose testing. If we ever reach an all-Modular future, these packages should be available in Modular composes I guess, but for now they are not. --- lib/utils.pm | 4 ++++ tests/role_deploy_domain_controller.pm | 11 +++++++---- tests/server_cockpit_default.pm | 13 +++++++++---- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/lib/utils.pm b/lib/utils.pm index 24b2388e..47baf48a 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -325,6 +325,10 @@ sub _repo_setup_compose { if (get_var("MODULAR")) { # dnf config-manager not currently available on modular composes assert_script_run "sed -i -e 's,enabled=1,enabled=0,g' /etc/yum.repos.d/fedora-modular-server-updates-testing.repo /etc/yum.repos.d/fedora-modular-server-updates.repo"; + # add a disabled non-modular release repo; we have to use this + # to install some things we need for testing which aren't in + # Modular Server composes + assert_script_run 'printf "[fedora]\nname=Fedora $releasever - $basearch\nmetalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch\nenabled=0\nmetadata_expire=7d\nrepo_gpgcheck=0\ntype=rpm\ngpgcheck=1\ngpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch\nskip_if_unavailable=True" > /etc/yum.repos.d/fedora.repo'; # FIXME use the compose repo, as per below - easier if the repo # files had commented-out baseurl lines } diff --git a/tests/role_deploy_domain_controller.pm b/tests/role_deploy_domain_controller.pm index cee17e8f..f349dbd0 100644 --- a/tests/role_deploy_domain_controller.pm +++ b/tests/role_deploy_domain_controller.pm @@ -14,12 +14,15 @@ sub run { # test (in which case we're on the 'old' release at this point; # one of the upgrade test modules does repo_setup later) repo_setup() unless get_var("UPGRADE"); + # use --enablerepo=fedora for Modular compose testing (we need to + # create and use a non-Modular repo to get some packages which + # aren't in Modular Server composes) + my $extraparams = ''; + $extraparams = '--enablerepo=fedora' if (get_var("MODULAR")); # we need a lot of entropy for this, and we don't care how good # it is, so let's use haveged - unless (get_var("MODULAR")) { - assert_script_run 'dnf -y install haveged', 300; - assert_script_run 'systemctl start haveged.service'; - } + assert_script_run "dnf ${extraparams} -y install haveged", 300; + assert_script_run 'systemctl start haveged.service'; # read DNS server IPs from host's /etc/resolv.conf for passing to # rolectl my @forwards = get_host_dns(); diff --git a/tests/server_cockpit_default.pm b/tests/server_cockpit_default.pm index 0a68b734..8a939f68 100644 --- a/tests/server_cockpit_default.pm +++ b/tests/server_cockpit_default.pm @@ -11,13 +11,18 @@ sub run { assert_script_run 'firewall-cmd --query-service cockpit'; # use compose repo, disable u-t, etc. repo_setup(); + # use --enablerepo=fedora for Modular compose testing (we need to + # create and use a non-Modular repo to get some packages which + # aren't in Modular Server composes) + my $extraparams = ''; + $extraparams = '--enablerepo=fedora' if (get_var("MODULAR")); # install a desktop and firefox so we can actually try it - assert_script_run 'dnf -y groupinstall "base-x"', 300; + assert_script_run "dnf ${extraparams} -y groupinstall 'base-x'", 300; # FIXME: this should probably be in base-x...X seems to fail without - assert_script_run 'dnf -y install libglvnd-egl', 120; + assert_script_run "dnf ${extraparams} -y install libglvnd-egl", 120; # try to avoid random weird font selection happening - assert_script_run 'dnf -y install dejavu-sans-fonts dejavu-sans-mono-fonts dejavu-serif-fonts', 120; - assert_script_run 'dnf -y install firefox', 120; + assert_script_run "dnf ${extraparams} -y install dejavu-sans-fonts dejavu-sans-mono-fonts dejavu-serif-fonts", 120; + assert_script_run "dnf ${extraparams} -y install firefox", 120; start_cockpit(0); # quit firefox (return to console) send_key "ctrl-q";