Skip to content

Commit

Permalink
Typo + change of satellite url
Browse files Browse the repository at this point in the history
  • Loading branch information
hosekadam committed Nov 23, 2022
1 parent 8bda952 commit 42a80d7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
logging.basicConfig(level="DEBUG" if env.str("DEBUG") else "INFO", stream=sys.stderr)
logger = logging.getLogger(__name__)

SATELLITE_URL = "dogfood-sat.hosts.prod.upshift.rdu2.redhat.com"
SATELLITE_URL = "satellite.sat.engineering.redhat.com"
SATELLITE_PKG_URL = "https://satellite.sat.engineering.redhat.com/pub/katello-ca-consumer-latest.noarch.rpm"
SATELLITE_PKG_DST = "/usr/share/convert2rhel/subscription-manager/katello-ca-consumer-latest.noarch.rpm"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
from envparse import env


# Replace urls in rhsm.conf file to the satellite server
# Without doing this we get obsolete dogfood server as source of repositories
def replace_urls_rhsm():
with open("/etc/rhsm/rhsm.conf", "r+") as f:
file = f.read()
# Replacing the urls
file = re.sub("hostname = .*", "hostname = {}".format(SATELLITE_URL), file)
file = re.sub("baseurl = .*", "baseurl = https://{}/pulp/repos".format(SATELLITE_URL), file)

# Setting the position to the top of the page to insert data
f.seek(0)
f.write(file)
f.truncate()


# Configure and limit connection to the satellite server only
def configure_connection():
satellite_ip = socket.gethostbyname(SATELLITE_URL)
Expand Down Expand Up @@ -32,12 +47,15 @@ def test_prepare_system(shell):
)
assert shell("rpm -i {}".format(SATELLITE_PKG_DST)).returncode == 0

replace_urls_rhsm()
shell("rm -rf /etc/yum.repos.d/*")

# Subscribe system
assert (
shell(
("subscription-manager register --org={} --activationkey={}").format(env.str("SATELLITE_ORG"), "centos7")
("subscription-manager register --org={} --activationkey={}").format(
env.str("SATELLITE_ORG"), env.str("SATELLITE_KEY_CENTOS7")
)
).returncode
== 0
)
Expand Down

0 comments on commit 42a80d7

Please sign in to comment.