diff --git a/test_suite/cloud/test_aws.py b/test_suite/cloud/test_aws.py index 7487eab5..38476457 100644 --- a/test_suite/cloud/test_aws.py +++ b/test_suite/cloud/test_aws.py @@ -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.failed: + 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.') package_to_check = 'glibc-devel' assert host.package(package_to_check).is_installed, \