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 5 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
20 changes: 18 additions & 2 deletions test_suite/cloud/test_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,24 @@ def test_yum_group_install(self, host):
pytest.skip('Not applicable to Atomic host AMIs')

with host.sudo():
assert host.run_test('yum -y groupinstall "Development tools"'), \
'Error while installing Development tools group'
dev_tools_install_command = 'yum -y groupinstall "Development tools"'
result = host.run(dev_tools_install_command)

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...')
host.run(
'echo -e "enabled=0" > /etc/yum/pluginconf.d/subscription-manager.conf'
' && yum clean all'
)

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

package_to_check = 'glibc-devel'
assert host.package(package_to_check).is_installed, \
Expand Down
Loading