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

CIV: Refactor test_yum_group_install #333

Merged
merged 8 commits into from
Aug 8, 2024
Merged
Changes from 1 commit
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
15 changes: 6 additions & 9 deletions test_suite/cloud/test_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,10 @@ def test_yum_group_install(self, host):

with host.sudo():
dev_tools_install_command = 'yum -y groupinstall "Development tools"'
result = test_lib.print_host_command_output(host, dev_tools_install_command, capture_result=True)
result = host.run(dev_tools_install_command)

if result.failed:
if result.exit_status != 0:
sshmulev marked this conversation as resolved.
Show resolved Hide resolved
print(f'Command faild with error on first attempt: {result.stderr}')
err_message = "This system is not registered to Red Hat Subscription Management"
if err_message in result.stderr:
print('"Development tools" installation attempt failed. Trying to apply a workaround...')
Expand All @@ -570,13 +571,9 @@ def test_yum_group_install(self, host):
' && yum clean all'
)

result_second_attempt = test_lib.print_host_command_output(
host, dev_tools_install_command, capture_result=True
)

assert result_second_attempt.succeeded, (
'Error while installing Development tools group after two attempts. '
'Check test case output for more details.'
assert host.run(dev_tools_install_command).succeeded, (
f'Error while installing Development tools'
f' group after two attempts with error: {result.stderr}'
)
print('"Development tools" installed successfully.')
sshmulev marked this conversation as resolved.
Show resolved Hide resolved

Expand Down
Loading