Skip to content

Commit

Permalink
Provide better error output for test_satellite_installation (#17105)
Browse files Browse the repository at this point in the history
(cherry picked from commit c170b84)
  • Loading branch information
ekohl committed Dec 13, 2024
1 parent e6f8c4e commit 84193f4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
28 changes: 15 additions & 13 deletions pytest_fixtures/core/sat_cap_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,23 +350,22 @@ def installer_satellite(request):
# enable satellite repos
for repo in sat.SATELLITE_CDN_REPOS.values():
sat.enable_repo(repo, force=True)
elif settings.server.version.source == 'nightly':
sat.create_custom_repos(
satellite_repo=settings.repos.satellite_repo,
satmaintenance_repo=settings.repos.satmaintenance_repo,
)
else:
if settings.server.version.source == 'nightly':
sat.create_custom_repos(
satellite_repo=settings.repos.satellite_repo,
satmaintenance_repo=settings.repos.satmaintenance_repo,
)
else:
# get ohsnap repofile
sat.download_repofile(
product='satellite',
release=settings.server.version.release,
snap=settings.server.version.snap,
)
# get ohsnap repofile
sat.download_repofile(
product='satellite',
release=settings.server.version.release,
snap=settings.server.version.snap,
)

sat.install_satellite_or_capsule_package()
# Install Satellite
sat.execute(
installer_result = sat.execute(
InstallerCommand(
installer_args=[
'scenario satellite',
Expand All @@ -375,6 +374,9 @@ def installer_satellite(request):
).get_command(),
timeout='30m',
)
# exit code 0 means no changes, 2 means changes were applied succesfully
assert installer_result.status in (0, 2), installer_result.stdout

if 'sanity' in request.config.option.markexpr:
configure_nailgun()
configure_airgun()
Expand Down
10 changes: 5 additions & 5 deletions tests/foreman/installer/test_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1327,22 +1327,22 @@ def common_sat_install_assertions(satellite):
result = satellite.execute(
r'journalctl --quiet --no-pager --boot --priority err -u "dynflow-sidekiq*" -u "foreman-proxy" -u "foreman" -u "httpd" -u "postgresql" -u "pulpcore-api" -u "pulpcore-content" -u "pulpcore-worker*" -u "redis" -u "tomcat"'
)
assert len(result.stdout) == 0
assert not result.stdout
# no errors in /var/log/foreman/production.log
result = satellite.execute(r'grep --context=100 -E "\[E\|" /var/log/foreman/production.log')
if not is_open('SAT-21086'):
assert len(result.stdout) == 0
assert not result.stdout
# no errors/failures in /var/log/foreman-installer/satellite.log
result = satellite.execute(
r'grep "\[ERROR" --context=100 /var/log/foreman-installer/satellite.log'
)
assert len(result.stdout) == 0
assert not result.stdout
# no errors/failures in /var/log/httpd/*
result = satellite.execute(r'grep -iR "error" /var/log/httpd/*')
assert len(result.stdout) == 0
assert not result.stdout
# no errors/failures in /var/log/candlepin/*
result = satellite.execute(r'grep -iR "error" /var/log/candlepin/*')
assert len(result.stdout) == 0
assert not result.stdout

result = satellite.cli.Health.check()
assert 'FAIL' not in result.stdout
Expand Down

0 comments on commit 84193f4

Please sign in to comment.