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-"):