Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test_positive_all_packages_update #12342

Merged
merged 5 commits into from
Oct 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/foreman/destructive/test_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@

:Upstream: No
"""
import re

import pytest

pytestmark = pytest.mark.destructive


@pytest.mark.include_capsule
def test_positive_all_packages_update(target_sat):
"""Verify update and check-update work as expected.

Expand Down Expand Up @@ -48,5 +51,10 @@ def test_positive_all_packages_update(target_sat):
target_sat.power_control(state='reboot')
# Run check-update again to verify there are no more packages available to update
result = target_sat.cli.Packages.check_update()
# Regex to match if there are packages available to update
# Matches lines like '\n\nwalrus.noarch 5.21-1 custom_repo\n'
pattern = '(\\n){1,2}(\\S+)(\\s+)(\\S+)(\\s+)(\\S+)(\\n)'
matches = re.search(pattern, result.stdout)
assert matches is None # No packages available to update
assert 'FAIL' not in result.stdout
assert result.status == 0
Loading