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

Add SLE 15 repos to on-demand test #116

Merged
merged 2 commits into from
Aug 14, 2018
Merged
Show file tree
Hide file tree
Changes from all 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: 17 additions & 3 deletions usr/share/lib/ipa/tests/SLES/SAP/test_sles_sap_license.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,24 @@ def test_sles_sap_license(host):
license_content = 'SUSE End User License Agreement'

lic_dir = host.file(license_dir)
assert lic_dir.exists
assert lic_dir.is_directory

try:
assert lic_dir.exists
assert lic_dir.is_directory
except AssertionError:
# SLE15 dir changed
license_dir = '/etc/YaST2/licenses/SLES_SAP'
lic_dir = host.file(license_dir)
assert lic_dir.exists
assert lic_dir.is_directory

license = host.file(license_dir + '/license.txt')
assert license.exists
assert license.is_file
assert license.contains(license_content)

try:
assert license.contains(license_content)
except AssertionError:
# SLE15 license text changed
license_content = 'SUSE(R) Linux Enterprise End User License Agreement'
assert license.contains(license_content)
2 changes: 0 additions & 2 deletions usr/share/lib/ipa/tests/SLES/SAP/test_sles_sap_on_demand.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions usr/share/lib/ipa/tests/SLES/SAP/test_sles_sap_repos.py

This file was deleted.

89 changes: 85 additions & 4 deletions usr/share/lib/ipa/tests/SLES/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,80 @@
'SLE-HA12-SP3-Updates'
]

SLE_15_BASE = [
'SLE-Module-Basesystem15-Debuginfo-Pool',
'SLE-Module-Basesystem15-Debuginfo-Updates',
'SLE-Module-Basesystem15-Pool',
'SLE-Module-Basesystem15-Updates'
]

SLE_15_PRODUCTS = [
'SLE-Product-SLES15-Pool',
'SLE-Product-SLES15-Updates'
]

SLE_15_MODULES = [
'SLE-Module-CAP-Tools15-Debuginfo-Pool',
'SLE-Module-CAP-Tools15-Debuginfo-Updates',
'SLE-Module-CAP-Tools15-Pool',
'SLE-Module-CAP-Tools15-Updates',
'SLE-Module-Containers15-Debuginfo-Pool',
'SLE-Module-Containers15-Debuginfo-Updates',
'SLE-Module-Containers15-Pool',
'SLE-Module-Containers15-Updates',
'SLE-Module-Desktop-Applications15-Debuginfo-Pool',
'SLE-Module-Desktop-Applications15-Debuginfo-Updates',
'SLE-Module-Desktop-Applications15-Pool',
'SLE-Module-Desktop-Applications15-Updates',
'SLE-Module-DevTools15-Debuginfo-Pool',
'SLE-Module-DevTools15-Debuginfo-Updates',
'SLE-Module-DevTools15-Pool',
'SLE-Module-DevTools15-Updates',
'SLE-Module-Legacy15-Debuginfo-Pool',
'SLE-Module-Legacy15-Debuginfo-Updates',
'SLE-Module-Legacy15-Pool',
'SLE-Module-Legacy15-Updates',
'SLE-Module-Public-Cloud15-Debuginfo-Pool',
'SLE-Module-Public-Cloud15-Debuginfo-Updates',
'SLE-Module-Public-Cloud15-Pool',
'SLE-Module-Public-Cloud15-Updates',
'SLE-Module-Server-Applications15-Debuginfo-Pool',
'SLE-Module-Server-Applications15-Debuginfo-Updates',
'SLE-Module-Server-Applications15-Pool',
'SLE-Module-Server-Applications15-Updates',
'SLE-Module-Web-Scripting15-Debuginfo-Pool',
'SLE-Module-Web-Scripting15-Debuginfo-Updates',
'SLE-Module-Web-Scripting15-Pool',
'SLE-Module-Web-Scripting15-Updates'
]

SLE_15_SAP = [
'SLE-Module-SAP-Applications15-Debuginfo-Pool',
'SLE-Module-SAP-Applications15-Debuginfo-Updates',
'SLE-Module-SAP-Applications15-Pool',
'SLE-Module-SAP-Applications15-Updates',
'SLE-Product-HA15-Debuginfo-Pool',
'SLE-Product-HA15-Debuginfo-Updates',
'SLE-Product-HA15-Pool',
'SLE-Product-HA15-Updates',
'SLE-Product-SLES_SAP15-Debuginfo-Pool',
'SLE-Product-SLES_SAP15-Debuginfo-Updates',
'SLE-Product-SLES_SAP15-Pool',
'SLE-Product-SLES_SAP15-Updates'
]

SLES_REPOS = {
'11.4': SLE_11_SP4_BASE + SLE_11_SP4_MODULES,
'12': SLE_12_BASE + SLE_12_MODULES,
'12-SAP': SLE_12_SAP,
'12-SAP': SLE_12_SAP + SLE_12_BASE + SLE_12_MODULES,
'12-SP1': SLE_12_SP1_BASE + SLE_12_SP1_MODULES,
'12-SP1-SAP': SLE_12_SP1_SAP,
'12-SP1-SAP': SLE_12_SP1_SAP + SLE_12_SP1_BASE + SLE_12_SP1_MODULES,
'12-SP2': SLE_12_SP2_BASE + SLE_12_SP2_MODULES,
'12-SP2-SAP': SLE_12_SP2_SAP,
'12-SP2-SAP': SLE_12_SP2_SAP + SLE_12_SP2_BASE + SLE_12_SP2_MODULES,
'12-SP3': SLE_12_SP3_BASE + SLE_12_SP3_MODULES,
'12-SP3-SAP': SLE_12_SP3_SAP
'12-SP3-SAP': SLE_12_SP3_SAP + SLE_12_SP3_BASE + SLE_12_SP3_MODULES,
'15': SLE_15_BASE + SLE_15_MODULES + SLE_15_PRODUCTS,
'15-SAP': SLE_15_SAP + SLE_15_BASE + SLE_15_MODULES
}


Expand All @@ -168,3 +232,20 @@ def get_sles_repos():
def f(version):
return SLES_REPOS[version]
return f


@pytest.fixture()
def is_sles_sap(host):
def f():
license_dir = '/etc/YaST2/licenses/ha'
lic_dir = host.file(license_dir)
try:
assert lic_dir.exists
assert lic_dir.is_directory
except AssertionError:
# SLE15 dir changed
license_dir = '/etc/YaST2/licenses/SLES_SAP'
lic_dir = host.file(license_dir)
return lic_dir.exists and lic_dir.is_directory
return True
return f
8 changes: 7 additions & 1 deletion usr/share/lib/ipa/tests/SLES/test_sles_license.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ def test_sles_license(host):
license = host.file(license_dir + '/license.txt')
assert license.exists
assert license.is_file
assert license.contains(license_content)

try:
assert license.contains(license_content)
except Exception:
# SLE15 license text changed
license_content = 'SUSE(R) Linux Enterprise End User License Agreement'
assert license.contains(license_content)
24 changes: 22 additions & 2 deletions usr/share/lib/ipa/tests/SLES/test_sles_repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,36 @@
def test_sles_repos(check_zypper_repo,
determine_provider,
get_release_value,
get_sles_repos):
get_sles_repos,
is_sles_sap):
provider = determine_provider()
version = get_release_value('VERSION')
sap = is_sles_sap()

if sap:
version += '-SAP'

missing_repos = []
for repo in get_sles_repos(version):
assert check_zypper_repo(
result = check_zypper_repo(
''.join([
'SMT-http_smt-{provider}_susecloud_net:'.format(
provider=provider
),
repo
])
)
if not result:
missing_repos.append(
''.join([
'SMT-http_smt-{provider}_susecloud_net:'.format(
provider=provider
),
repo
])
)

if missing_repos:
raise Exception(
'Missing Repos: \n{0}'.format('\n'.join(missing_repos))
)