Skip to content

Commit

Permalink
Merge pull request #522 from SUSE/lifecycle_test
Browse files Browse the repository at this point in the history
Test for codestream lifecycle information being correct (bsc#1227100)
  • Loading branch information
dcermak authored Oct 15, 2024
2 parents 1a1901e + e9b2869 commit 76f5e01
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions tests/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def test_sle_bci_forbidden_packages(container_per_test):

@pytest.mark.skipif(
OS_VERSION not in ALLOWED_BCI_REPO_OS_VERSIONS,
reason="no included BCI repository - can't test",
reason="no included BCI repository",
)
@pytest.mark.parametrize("pkg", ("git", "curl", "wget", "unzip"))
@pytest.mark.parametrize("container_per_test", [BASE_CONTAINER], indirect=True)
Expand Down Expand Up @@ -177,9 +177,37 @@ def test_repo_content_licensing(container_per_test) -> None:
), "Found a package with a SUSE-Firmware license"


@pytest.mark.skipif(
(
not OS_VERSION.startswith("15")
or OS_VERSION not in ALLOWED_BCI_REPO_OS_VERSIONS
),
reason="no included BCI repository",
)
@pytest.mark.parametrize("container_per_test", [BASE_CONTAINER], indirect=True)
def test_codestream_lifecycle(container_per_test):
"""Check that the codestream lifecycle information is available
and has the expected value."""

zypper_lifecycle_xml = ET.fromstring(
container_per_test.connection.check_output(
"zypper --xmlout -i pd --xmlfwd codestream"
)
)
lifecycle = zypper_lifecycle_xml.find(
".//product[@name='SLES']/xmlfwd/codestream/endoflife"
)
assert (
lifecycle is not None
), "No endoflife information found in product description"
assert (
lifecycle.text == "2031-07-31"
), f"Expected end of life 2031-07-31, but got {lifecycle.text}"


@pytest.mark.skipif(
OS_VERSION not in ALLOWED_BCI_REPO_OS_VERSIONS,
reason="no included BCI repository - can't test",
reason="no included BCI repository",
)
@pytest.mark.skipif(
OS_VERSION == "tumbleweed", reason="No testing for openSUSE"
Expand Down

0 comments on commit 76f5e01

Please sign in to comment.