Skip to content

Commit

Permalink
Update outdated packages on centos and oracle hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
shweta83 committed Jan 12, 2024
1 parent 40c6b46 commit 87b41d2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/foreman/api/test_convert2rhel.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def centos(
"""Deploy and register Centos host"""
# updating centos packages on CentOS 8 is necessary for conversion
major = version.split('.')[0]
centos_host.execute('yum -y update')
if major == '8':
centos_host.execute('yum -y update centos-*')
repo_url = settings.repos.convert2rhel.convert_to_rhel_repo.format(major)
Expand Down Expand Up @@ -199,12 +200,17 @@ def oracle(
# disable rhn-client-tools because it obsoletes the subscription manager package
oracle_host.execute('echo "exclude=rhn-client-tools" >> /etc/yum.conf')
# install and set correct kernel, based on convert2rhel docs
oracle_host.execute('yum -y update kernel*')
result = oracle_host.execute(
'yum install -y kernel && '
'grubby --set-default /boot/vmlinuz-'
'`rpm -q --qf "%{BUILDTIME}\t%{EVR}.%{ARCH}\n" kernel | sort -nr | head -1 | cut -f2`'
)
assert result.status == 0
oracle_host.execute(
'sed -i -- \'s/CleanupModulesOnExit=yes/CleanupModulesOnExit=no/g\'",'
' "/etc/firewalld/firewalld.conf"'
)
oracle_host.power_control(state='reboot')
major = version.split('.')[0]
repo_url = settings.repos.convert2rhel.convert_to_rhel_repo.format(major)
Expand Down Expand Up @@ -263,6 +269,7 @@ def test_convert2rhel_oracle(module_target_sat, oracle, activation_key_rhel, ver
:CaseImportance: Medium
"""
oracle.execute('yum -y update')
host_content = module_target_sat.api.Host(id=oracle.hostname).read_json()
assert host_content['operatingsystem_name'] == f"OracleLinux {version}"

Expand Down

0 comments on commit 87b41d2

Please sign in to comment.