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

Remove tests/upgrades/test_satellite_maintain.py and list-versions #14970

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
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: 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.