From f84b98ae5e4f3b32022bc8f6152da1cf831345b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Prchl=C3=ADk?= Date: Thu, 2 Jan 2025 14:23:04 +0100 Subject: [PATCH 1/3] Add CentOS Stream 10 among test images --- Makefile | 8 ++++++++ containers/centos/stream10/Containerfile | 10 ++++++++++ containers/centos/stream10/Containerfile.upstream | 10 ++++++++++ tests/images.sh | 9 +++++++++ tests/prepare/install/test.sh | 4 ++++ tests/unit/test_package_managers.py | 4 ++++ 6 files changed, 45 insertions(+) create mode 100644 containers/centos/stream10/Containerfile create mode 100644 containers/centos/stream10/Containerfile.upstream diff --git a/Makefile b/Makefile index 24b1cae558..9824b281f3 100644 --- a/Makefile +++ b/Makefile @@ -96,6 +96,8 @@ TMT_TEST_CONTAINER_IMAGES := $(TMT_TEST_CONTAINER_IMAGE_NAME_PREFIX)/alpine:late $(TMT_TEST_CONTAINER_IMAGE_NAME_PREFIX)/centos/7/upstream:latest \ $(TMT_TEST_CONTAINER_IMAGE_NAME_PREFIX)/centos/stream9:latest \ $(TMT_TEST_CONTAINER_IMAGE_NAME_PREFIX)/centos/stream9/upstream:latest \ + $(TMT_TEST_CONTAINER_IMAGE_NAME_PREFIX)/centos/stream10:latest \ + $(TMT_TEST_CONTAINER_IMAGE_NAME_PREFIX)/centos/stream10/upstream:latest \ $(TMT_TEST_CONTAINER_IMAGE_NAME_PREFIX)/fedora/coreos:stable \ $(TMT_TEST_CONTAINER_IMAGE_NAME_PREFIX)/fedora/coreos/ostree:stable \ $(TMT_TEST_CONTAINER_IMAGE_NAME_PREFIX)/fedora/rawhide:latest \ @@ -144,6 +146,12 @@ $(TMT_TEST_IMAGE_TARGET_PREFIX)/$(TMT_TEST_CONTAINER_IMAGE_NAME_PREFIX)/centos/7 $(TMT_TEST_IMAGE_TARGET_PREFIX)/$(TMT_TEST_CONTAINER_IMAGE_NAME_PREFIX)/centos/7/upstream\:latest: $(call build-test-container-image,$@,centos/7/Containerfile.upstream) +$(TMT_TEST_IMAGE_TARGET_PREFIX)/$(TMT_TEST_CONTAINER_IMAGE_NAME_PREFIX)/centos/stream10\:latest: + $(call build-test-container-image,$@,centos/stream10/Containerfile) + +$(TMT_TEST_IMAGE_TARGET_PREFIX)/$(TMT_TEST_CONTAINER_IMAGE_NAME_PREFIX)/centos/stream10/upstream\:latest: + $(call build-test-container-image,$@,centos/stream10/Containerfile.upstream) + $(TMT_TEST_IMAGE_TARGET_PREFIX)/$(TMT_TEST_CONTAINER_IMAGE_NAME_PREFIX)/centos/stream9\:latest: $(call build-test-container-image,$@,centos/stream9/Containerfile) diff --git a/containers/centos/stream10/Containerfile b/containers/centos/stream10/Containerfile new file mode 100644 index 0000000000..93be4255ee --- /dev/null +++ b/containers/centos/stream10/Containerfile @@ -0,0 +1,10 @@ +# +# A CentOS Stream 10 image tailored for tmt test suite +# +# tmt/tests/centos/stream10/upstream:latest +# + +FROM quay.io/centos/centos:stream10 + + # Populate dnf cache +RUN dnf makecache diff --git a/containers/centos/stream10/Containerfile.upstream b/containers/centos/stream10/Containerfile.upstream new file mode 100644 index 0000000000..93be4255ee --- /dev/null +++ b/containers/centos/stream10/Containerfile.upstream @@ -0,0 +1,10 @@ +# +# A CentOS Stream 10 image tailored for tmt test suite +# +# tmt/tests/centos/stream10/upstream:latest +# + +FROM quay.io/centos/centos:stream10 + + # Populate dnf cache +RUN dnf makecache diff --git a/tests/images.sh b/tests/images.sh index 8b01fde3ba..b20569bfb0 100644 --- a/tests/images.sh +++ b/tests/images.sh @@ -21,6 +21,7 @@ _MAKEFILE_DIR="$(dirname $(readlink -f ${BASH_SOURCE[0]}))/.." TEST_CONTAINER_IMAGES="${TEST_CONTAINER_IMAGES:-$TEST_IMAGE_PREFIX/alpine:latest $TEST_IMAGE_PREFIX/centos/7/upstream:latest $TEST_IMAGE_PREFIX/centos/stream9/upstream:latest +$TEST_IMAGE_PREFIX/centos/stream10/upstream:latest $TEST_IMAGE_PREFIX/fedora/39/upstream:latest $TEST_IMAGE_PREFIX/fedora/40/upstream:latest $TEST_IMAGE_PREFIX/fedora/41/upstream:latest @@ -37,6 +38,7 @@ $TEST_IMAGE_PREFIX/debian/12.7/upstream:latest}" # TODO: enable Ubuntu # TODO: enable centos-7 again with modified repo files TEST_VIRTUAL_IMAGES="${TEST_VIRTUAL_IMAGES:-centos-stream-9 +centos-stream-10 fedora-39 fedora-40 fedora-41 @@ -79,6 +81,13 @@ function is_centos_stream_9 () { return 1 } +function is_centos_stream_10 () { + [[ "$1" =~ ^.*centos/stream10[:/].* ]] && return 0 + [[ "$1" = "centos-stream-10" ]] && return 0 + + return 1 +} + function is_centos_7 () { [[ "$1" =~ ^.*centos/7[:/].* ]] && return 0 [[ "$1" = "centos-7" ]] && return 0 diff --git a/tests/prepare/install/test.sh b/tests/prepare/install/test.sh index 89b049bc5f..95193b5448 100755 --- a/tests/prepare/install/test.sh +++ b/tests/prepare/install/test.sh @@ -80,6 +80,10 @@ rlJournalStart rlRun "distro=centos-stream-9" rlRun "package_manager=dnf" + elif is_centos_stream_10 "$image"; then + rlRun "distro=centos-stream-10" + rlRun "package_manager=dnf" + elif is_centos_7 "$image"; then rlRun "distro=centos-7" rlRun "package_manager=yum" diff --git a/tests/unit/test_package_managers.py b/tests/unit/test_package_managers.py index 331e74a215..2f33d5f081 100644 --- a/tests/unit/test_package_managers.py +++ b/tests/unit/test_package_managers.py @@ -46,6 +46,8 @@ url='containers-storage:localhost/tmt/tests/container/fedora/40/upstream:latest') CONTAINER_FEDORA_39 = Container( url='containers-storage:localhost/tmt/tests/container/fedora/39/upstream:latest') +CONTAINER_CENTOS_STREAM_10 = Container( + url='containers-storage:localhost/tmt/tests/container/centos/stream10/upstream:latest') CONTAINER_CENTOS_STREAM_9 = Container( url='containers-storage:localhost/tmt/tests/container/centos/stream9/upstream:latest') CONTAINER_CENTOS_7 = Container( @@ -148,6 +150,8 @@ def assert_output( (CONTAINER_FEDORA_39, PACKAGE_MANAGER_YUM), # CentOS Stream + (CONTAINER_CENTOS_STREAM_10, PACKAGE_MANAGER_DNF), + (CONTAINER_CENTOS_STREAM_10, PACKAGE_MANAGER_YUM), (CONTAINER_CENTOS_STREAM_9, PACKAGE_MANAGER_DNF), (CONTAINER_CENTOS_STREAM_9, PACKAGE_MANAGER_YUM), From 08661435fb5d4ceea17f2ba2241466383aba2301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Prchl=C3=ADk?= Date: Tue, 21 Jan 2025 14:46:56 +0100 Subject: [PATCH 2/3] squash: Update containers/centos/stream10/Containerfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Petr Šplíchal --- containers/centos/stream10/Containerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/containers/centos/stream10/Containerfile b/containers/centos/stream10/Containerfile index 93be4255ee..3aabd421ad 100644 --- a/containers/centos/stream10/Containerfile +++ b/containers/centos/stream10/Containerfile @@ -1,7 +1,7 @@ # # A CentOS Stream 10 image tailored for tmt test suite # -# tmt/tests/centos/stream10/upstream:latest +# tmt/tests/centos/stream10:latest # FROM quay.io/centos/centos:stream10 From 187ef946b9f1e800d688f5c4db3348c4b8c7c531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Prchl=C3=ADk?= Date: Tue, 21 Jan 2025 21:50:48 +0100 Subject: [PATCH 3/3] squash: drop centos stream 10 vs yum --- tests/unit/test_package_managers.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/unit/test_package_managers.py b/tests/unit/test_package_managers.py index 2f33d5f081..e5abacecf4 100644 --- a/tests/unit/test_package_managers.py +++ b/tests/unit/test_package_managers.py @@ -151,7 +151,6 @@ def assert_output( # CentOS Stream (CONTAINER_CENTOS_STREAM_10, PACKAGE_MANAGER_DNF), - (CONTAINER_CENTOS_STREAM_10, PACKAGE_MANAGER_YUM), (CONTAINER_CENTOS_STREAM_9, PACKAGE_MANAGER_DNF), (CONTAINER_CENTOS_STREAM_9, PACKAGE_MANAGER_YUM),