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

- Use the "baseproduct" link as indicator of the product, SLES vs. SL… #208

Merged
merged 3 commits into from
Jul 2, 2019
Merged
Changes from 1 commit
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
13 changes: 11 additions & 2 deletions usr/share/lib/img_proof/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import os
import pytest

from susepubliccloudinfoclient import infoserverrequests
Expand Down Expand Up @@ -163,6 +164,14 @@ def f(provider):
return f


@pytest.fixture()
def get_baseproduct():
smarlowucf marked this conversation as resolved.
Show resolved Hide resolved
"""Return the nmae of the file the 'baseproduct' link points to"""
baseproduct = '/etc/products.d/baseproduct'
if os.path.islink(baseproduct):
smarlowucf marked this conversation as resolved.
Show resolved Hide resolved
return os.readlink(baseproduct).split('.')[0]


@pytest.fixture()
def get_release_value(host):
def f(key):
Expand Down Expand Up @@ -194,8 +203,8 @@ def f(provider):
@pytest.fixture()
def get_smt_servers(get_release_value, host):
def f(provider, region):
cpe_name = get_release_value('CPE_NAME')
if 'sap' in cpe_name:
product_name = get_baseproduct()
smarlowucf marked this conversation as resolved.
Show resolved Hide resolved
if 'sap' in product_name.lower():
smt_type = 'smt-sap'
else:
smt_type = 'smt-sles'
Expand Down