Skip to content

Commit

Permalink
Remove tests/upgrades/test_satellite_maintain.py and list-versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Griffin-Sullivan committed May 28, 2024
1 parent 77d0790 commit 8855ec8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 121 deletions.
8 changes: 0 additions & 8 deletions robottelo/cli/sm_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
[ARG] ... subcommand arguments
Subcommands:
list-versions List versions this system is upgradable to
check Run pre-upgrade checks before upgrading to specified version
run Run full upgrade to a specified version
Expand All @@ -23,13 +22,6 @@ class Upgrade(Base):

command_base = 'upgrade'

@classmethod
def list_versions(cls, options=None, env_var=None):
"""Build satellite-maintain upgrade list-versions"""
cls.command_sub = 'list-versions'
options = options or {}
return cls.sm_execute(cls._construct_command(options), env_var=env_var)

@classmethod
def check(cls, options=None, env_var=None):
"""Build satellite-maintain upgrade check"""
Expand Down
55 changes: 13 additions & 42 deletions tests/foreman/maintain/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,42 +28,6 @@ def last_y_stream_version(release):
return f"{release.split('.')[0]}.{y_minus}"


@pytest.mark.e2e
@pytest.mark.include_capsule
def test_positive_satellite_maintain_upgrade_list(sat_maintain):
"""List versions this system is upgradable to
:id: 12efec41-4f09-4199-a20c-a4525e773b78
:parametrized: yes
:steps:
1. Run satellite-maintain upgrade list-versions
:expectedresults: Versions system is upgradable to are listed.
"""
xy_version = '.'.join(sat_maintain.version.split('.')[:2])
previous_xy_version = '.'.join(
[xy_version.split('.')[0], str(int(xy_version.split('.')[1]) - 1)]
)
if sat_maintain.version.startswith(xy_version):
versions = [f'{xy_version}.z']
elif sat_maintain.version.startswith(previous_xy_version):
versions = [f'{previous_xy_version}.z', xy_version]
else:
versions = ['Unsupported Satellite/Capsule version']

# Reboot if needed
if sat_maintain.execute('needs-restarting -r').status == 1:
sat_maintain.power_control(state='reboot')

result = sat_maintain.cli.Upgrade.list_versions()
assert result.status == 0
assert 'FAIL' not in result.stdout
for ver in versions:
assert ver in result.stdout


@pytest.mark.include_capsule
def test_positive_repositories_validate(sat_maintain):
"""Test repositories-validate pre-upgrade check is
Expand Down Expand Up @@ -162,8 +126,8 @@ def test_positive_self_update_maintain_package(sat_maintain):
:parametrized: yes
:steps:
1. Run satellite-maintain upgrade list-versions/check/run command.
2. Run satellite-maintain upgrade list-versions/check/run command
1. Run satellite-maintain update check command.
2. Run satellite-maintain update check command
with disable-self-upgrade option.
:expectedresults:
Expand All @@ -172,10 +136,17 @@ def test_positive_self_update_maintain_package(sat_maintain):
:BZ: 1649329
"""
result = sat_maintain.cli.Upgrade.list_versions()
result = sat_maintain.cli.Update.check(
options={'whitelist': 'repositories-validate, non-rh-packages'}
)
assert result.status == 0
assert 'Checking for new version of satellite-maintain...' in result.stdout
result = sat_maintain.cli.Upgrade.list_versions(options={'disable-self-upgrade': True})
result = sat_maintain.cli.Update.check(
options={
'whitelist': 'repositories-validate, non-rh-packages',
'disable-self-update': True,
}
)
assert result.status == 0
assert 'Checking for new version of satellite-maintain...' not in result.stdout

Expand Down Expand Up @@ -216,8 +187,8 @@ def test_positive_check_presence_satellite_or_satellite_capsule(sat_maintain):
:parametrized: yes
:steps:
1. Run satellite-maintain upgrade list-versions/check/run command.
2. Run satellite-maintain upgrade list-versions/check/run command,
1. Run satellite-maintain upgrade check/run command.
2. Run satellite-maintain upgrade check/run command,
after removing satellite and satellite-capsule packages.
:expectedresults:
Expand Down
71 changes: 0 additions & 71 deletions tests/upgrades/test_satellite_maintain.py

This file was deleted.

0 comments on commit 8855ec8

Please sign in to comment.