Skip to content

Commit

Permalink
Fixed test_required_packages_are_installed test case.
Browse files Browse the repository at this point in the history
We now check for the correct packages for RHEL-SAP in its dedicated module.
  • Loading branch information
narmaku committed Jul 1, 2024
1 parent 5b536d0 commit 1bd4f6c
Showing 1 changed file with 45 additions and 28 deletions.
73 changes: 45 additions & 28 deletions test_suite/cloud/test_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,34 +272,6 @@ def test_required_packages_are_installed(self, host):
if version.parse('8.3') > system_release >= version.parse('8.0'):
required_pkgs.append('rng-tools')

if test_lib.is_rhel_sap(host):
required_pkgs.extend(['rhel-system-roles-sap', 'ansible'])

# BugZilla 1959813
required_pkgs.extend(['bind-utils', 'compat-sap-c++-9', 'nfs-utils', 'tcsh'])

# BugZilla 1959813
required_pkgs.append('uuidd')

# BugZilla 1959923, 1961168
required_pkgs.extend(['cairo', 'expect', 'graphviz', 'gtk2',
'iptraf-ng', 'krb5-workstation', 'libaio'])

# BugZilla 1959923, 1961168
required_pkgs.extend(['libatomic', 'libcanberra-gtk2', 'libicu',
'libpng12', 'libtool-ltdl', 'lm_sensors', 'net-tools'])

required_pkgs.extend(['numactl', 'PackageKit-gtk3-module', 'xorg-x11-xauth', 'libnsl'])

# BugZilla 1959962
required_pkgs.append('tuned-profiles-sap-hana')

# CLOUDX-367
if system_release >= version.parse('8.6'):
required_pkgs.append('ansible-core')
else:
required_pkgs.append('ansible')

# CLOUDX-451
if system_release.major == 9 and system_release.minor >= 3 or \
system_release.major == 8 and system_release.minor >= 9:
Expand Down Expand Up @@ -827,6 +799,51 @@ def test_ha_specific_script(self, host, rhel_high_availability_only):

assert result.rc == 0

@pytest.mark.run_on(['rhel'])
def test_sap_required_packages_are_installed(self, host):
system_release = version.parse(host.system_info.release)

required_pkgs = []

required_pkgs.extend(['rhel-system-roles-sap'])

# BugZilla 1959813
required_pkgs.extend(['bind-utils', 'nfs-utils', 'tcsh'])

# BugZilla 1959813
required_pkgs.append('uuidd')

# BugZilla 1959923, 1961168
required_pkgs.extend(['cairo', 'expect', 'graphviz', 'gtk2',
'iptraf-ng', 'krb5-workstation', 'libaio'])

# BugZilla 1959923, 1961168
required_pkgs.extend(['libatomic', 'libcanberra-gtk2', 'libicu',
'libtool-ltdl', 'lm_sensors', 'net-tools'])

required_pkgs.extend(['numactl', 'PackageKit-gtk3-module', 'xorg-x11-xauth', 'libnsl'])

# BugZilla 1959962
required_pkgs.append('tuned-profiles-sap-hana')

# CLOUDX-557
if system_release < version.parse('8.0'):
required_pkgs.append('libpng12')

# CLOUDX-367, CLOUDX-557
if system_release >= version.parse('8.6'):
required_pkgs.append('ansible-core')
else:
required_pkgs.append('ansible')

# CLOUDX-557
if system_release < version.parse('9.0'):
required_pkgs.append('compat-sap-c++-9')

missing_pkgs = [pkg for pkg in required_pkgs if not host.package(pkg).is_installed]

assert len(missing_pkgs) == 0, f'Missing packages required by RHEL-SAP: {", ".join(missing_pkgs)}'


@pytest.mark.order(2)
class TestsAWSNetworking:
Expand Down

0 comments on commit 1bd4f6c

Please sign in to comment.