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

[6.13.z] Add coverage for 1964037 installer cert regeneration #12800

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
12 changes: 11 additions & 1 deletion robottelo/cli/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ def add_operating_system(cls, options=None):

return cls.execute(cls._construct_command(options))

@classmethod
def ping(cls, options=None):
"""
Display status of Satellite.
"""

cls.command_sub = 'ping'

return cls.execute(cls._construct_command(options))

@classmethod
def create(cls, options=None, timeout=None):
"""
Expand Down Expand Up @@ -419,6 +429,6 @@ def _construct_command(cls, options=None):
if isinstance(val, list):
val = ','.join(str(el) for el in val)
tail += f' --{key}="{val}"'
cmd = f"{cls.command_base} {cls.command_sub or ''} {tail.strip()} {cls.command_end or ''}"
cmd = f"{cls.command_base or ''} {cls.command_sub or ''} {tail.strip()} {cls.command_end or ''}"

return cmd
31 changes: 31 additions & 0 deletions tests/foreman/destructive/test_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,34 @@ def test_positive_mismatched_satellite_fqdn(target_sat, set_random_fqdn):
)
installer_command_output = target_sat.execute('satellite-installer').stderr
assert warning_message in str(installer_command_output)


def test_positive_installer_certs_regenerate(target_sat):
"""Ensure "satellite-installer --certs-regenerate true" command correctly generates
/etc/tomcat/cert-users.properties after editing answers file

:id: db6152c3-4459-425b-998d-4a7992ca1f72

:steps:
1. Update /etc/foreman-installer/scenarios.d/satellite-answers.yaml
2. Fill some empty strings in certs category for 'state'
3. Run satellite-installer --certs-regenerate true
4. hammer ping

:expectedresults: Correct generation of /etc/tomcat/cert-users.properties

:BZ: 1964037

:customerscenario: true
"""
result = target_sat.install(
InstallerCommand(
'certs-update-all',
'certs-update-server',
'certs-update-server-ca',
certs_regenerate=['true'],
certs_state=['undef'],
)
)
assert result.status == 0
assert 'FAIL' not in target_sat.cli.Base.ping()