Skip to content

Commit

Permalink
Update test_positive_all_packages_update (#12342)
Browse files Browse the repository at this point in the history
* add test_positive_fm_packages_check_update

* add capsule marker

* add regex to find packages to update

* remove duplicate test

* update regex to match if there's multiple packages

(cherry picked from commit b2d4f98)
  • Loading branch information
mstrlc authored and web-flow committed Oct 27, 2023
1 parent 148e827 commit fa8b835
Showing 1 changed file with 8 additions and 0 deletions.
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

0 comments on commit fa8b835

Please sign in to comment.