Skip to content

Commit

Permalink
test: setup the subscription repositories
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ptoscano authored and m-horky committed Aug 8, 2024
1 parent 7c49fe2 commit 9bcfc71
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/check-subscriptions
Original file line number Diff line number Diff line change
Expand Up @@ -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-"):
Expand Down

0 comments on commit 9bcfc71

Please sign in to comment.