Skip to content

Commit

Permalink
No capture logs if tests passed.
Browse files Browse the repository at this point in the history
  • Loading branch information
sshmulev committed Aug 8, 2024
1 parent bd4d7ef commit 2d09e3a
Showing 1 changed file with 6 additions and 9 deletions.
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:
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.')

Expand Down

0 comments on commit 2d09e3a

Please sign in to comment.