From d8b69f3ac19c7562f966059cac43e79ffd465a7d Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Wed, 7 Aug 2024 17:58:16 +0200 Subject: [PATCH] test: setup the subscription repositories Ensure that subscription-manager is configured so that the package manager can properly receive content from the repositories of the self-deployed Candlepin. This should have been done in the past, and it will be critical for switching to SCA for testing: in SCA mode, all the content of the organization is available by default, and some repositories are also automatically enabled. This means: - installing the GPG key for RPM packages - setting the baseurl in rhsm.conf --- test/check-subscriptions | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/check-subscriptions b/test/check-subscriptions index 2fcb500..a819449 100755 --- a/test/check-subscriptions +++ b/test/check-subscriptions @@ -181,6 +181,25 @@ class SubscriptionsCase(MachineCase): # Wait for the web service to be accessible machine_python(self.machine, WAIT_SCRIPT, CANDLEPIN_URL) + # Setup the repositories properly using the Candlepin RPM GPG key + m.execute( + [ + "curl", + "-o", + "/etc/pki/rpm-gpg/RPM-GPG-KEY-candlepin", + f"http://{CANDLEPIN_HOSTNAME}:8080/RPM-GPG-KEY-candlepin", + ] + ) + machine_restorecon(self.machine, "/etc/pki/rpm-gpg/") + m.execute( + [ + "subscription-manager", + "config", + "--rhsm.baseurl", + f"http://{CANDLEPIN_HOSTNAME}:8080", + ] + ) + hostname = m.execute(["hostname"]).rstrip() if m.image.startswith("rhel-"):