Skip to content

Commit

Permalink
Add test for satellite package removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Griffin-Sullivan committed Nov 8, 2023
1 parent 034dcac commit 01b2cbc
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/foreman/destructive/test_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

import pytest

from robottelo.hosts import Satellite

pytestmark = pytest.mark.destructive


Expand Down Expand Up @@ -58,3 +60,33 @@ def test_positive_all_packages_update(target_sat):
assert matches is None # No packages available to update
assert 'FAIL' not in result.stdout
assert result.status == 0


@pytest.mark.include_capsule
def test_negative_remove_satellite_packages(target_sat):
"""Ensure user can't remove satellite or its dependent packages
:id: af150302-418a-4d42-8d01-bb0e6b90f81f
:steps:
1. yum remove <satellite or other dependency>
:expectedresults: removal should fail due to protecting the satellite package
:BZ: 1884395
:customerscenario: true
"""
# Packages include satellite direct dependencies like foreman,
# but also dependency of dependencies like wget for foreman
if isinstance(target_sat, Satellite):
package_list = ['foreman', 'foreman-proxy', 'katello', 'wget', 'satellite']
else:
package_list = ['foreman-proxy', 'satellite-capsule']
for package in package_list:
result = target_sat.execute(f'yum remove {package}')
assert result.status != 0
assert (
'Problem: The operation would result in removing the following protected packages: satellite'
in result.stdout
)

0 comments on commit 01b2cbc

Please sign in to comment.