From 8dde738f1efb32623d8ef89134ce12e9f64d98d5 Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Wed, 18 Dec 2024 15:08:34 +0100 Subject: [PATCH] Remove all instances of Fedora 39 from tests and docs This is not at all necessary, tests are self contained and mentions in documentation are only illustrative, but it's nice to keep these up-to-date and in line with the current state. --- pkg/distro/fedora/distro_test.go | 50 +++++++++++------------------ pkg/distro/id_test.go | 8 ++--- pkg/distroidparser/idparser_test.go | 10 +++--- pkg/dnfjson/cache_test.go | 2 +- test/README.md | 8 ++--- test/scripts/test_imgtestlib.py | 10 +++--- 6 files changed, 37 insertions(+), 51 deletions(-) diff --git a/pkg/distro/fedora/distro_test.go b/pkg/distro/fedora/distro_test.go index 0dfa58f4af..886ce4944e 100644 --- a/pkg/distro/fedora/distro_test.go +++ b/pkg/distro/fedora/distro_test.go @@ -20,14 +20,14 @@ type fedoraFamilyDistro struct { } var fedoraFamilyDistros = []fedoraFamilyDistro{ - { - name: "fedora-39", - distro: fedora.DistroFactory("fedora-39"), - }, { name: "fedora-40", distro: fedora.DistroFactory("fedora-40"), }, + { + name: "fedora-41", + distro: fedora.DistroFactory("fedora-41"), + }, } func TestFilenameFromType(t *testing.T) { @@ -196,17 +196,7 @@ func TestFilenameFromType(t *testing.T) { }, } verTypes := map[string][]testCfg{ - "38": { - { - name: "iot-simplified-installer", - args: args{"iot-simplified-installer"}, - want: wantResult{ - filename: "simplified-installer.iso", - mimeType: "application/x-iso9660-image", - }, - }, - }, - "39": { + "40": { { name: "iot-bootable-container", args: args{"iot-bootable-container"}, @@ -224,7 +214,7 @@ func TestFilenameFromType(t *testing.T) { }, }, }, - "40": { + "41": { { name: "iot-bootable-container", args: args{"iot-bootable-container"}, @@ -351,12 +341,11 @@ func TestImageType_Name(t *testing.T) { "wsl", }, verTypes: map[string][]string{ - "38": {"iot-simplified-installer"}, - "39": { + "40": { "iot-bootable-container", "iot-simplified-installer", }, - "40": { + "41": { "iot-bootable-container", "iot-simplified-installer", }, @@ -378,12 +367,11 @@ func TestImageType_Name(t *testing.T) { "qcow2", }, verTypes: map[string][]string{ - "38": {"iot-simplified-installer"}, - "39": { + "40": { "iot-bootable-container", "iot-simplified-installer", }, - "40": { + "41": { "iot-bootable-container", "iot-simplified-installer", }, @@ -555,12 +543,11 @@ func TestArchitecture_ListImageTypes(t *testing.T) { "wsl", }, verTypes: map[string][]string{ - "38": {"iot-simplified-installer"}, - "39": { + "40": { "iot-bootable-container", "iot-simplified-installer", }, - "40": { + "41": { "iot-bootable-container", "iot-simplified-installer", }, @@ -584,12 +571,11 @@ func TestArchitecture_ListImageTypes(t *testing.T) { "qcow2", }, verTypes: map[string][]string{ - "38": {"iot-simplified-installer"}, - "39": { + "40": { "iot-bootable-container", "iot-simplified-installer", }, - "40": { + "41": { "iot-bootable-container", "iot-simplified-installer", }, @@ -602,10 +588,10 @@ func TestArchitecture_ListImageTypes(t *testing.T) { "qcow2", }, verTypes: map[string][]string{ - "39": { + "40": { "iot-bootable-container", }, - "40": { + "41": { "iot-bootable-container", }, }, @@ -617,10 +603,10 @@ func TestArchitecture_ListImageTypes(t *testing.T) { "qcow2", }, verTypes: map[string][]string{ - "39": { + "40": { "iot-bootable-container", }, - "40": { + "41": { "iot-bootable-container", }, }, diff --git a/pkg/distro/id_test.go b/pkg/distro/id_test.go index 5bf76a4927..6c95e6d361 100644 --- a/pkg/distro/id_test.go +++ b/pkg/distro/id_test.go @@ -15,18 +15,18 @@ func TestDistroIDParser(t *testing.T) { testCases := []testCase{ { - stringID: "fedora-39", + stringID: "fedora-41", expected: &ID{ Name: "fedora", - MajorVersion: 39, + MajorVersion: 41, MinorVersion: -1, }, }, { - stringID: "fedora-39.0", + stringID: "fedora-41.0", expected: &ID{ Name: "fedora", - MajorVersion: 39, + MajorVersion: 41, MinorVersion: 0, }, }, diff --git a/pkg/distroidparser/idparser_test.go b/pkg/distroidparser/idparser_test.go index eeb2e13b73..79f302c38d 100644 --- a/pkg/distroidparser/idparser_test.go +++ b/pkg/distroidparser/idparser_test.go @@ -18,15 +18,15 @@ func TestDefaltParser(t *testing.T) { testCases := []testCase{ // Fedora { - idStr: "fedora-39", - expected: &distro.ID{Name: "fedora", MajorVersion: 39, MinorVersion: -1}, + idStr: "fedora-41", + expected: &distro.ID{Name: "fedora", MajorVersion: 41, MinorVersion: -1}, }, { - idStr: "fedora-39.1", - expected: &distro.ID{Name: "fedora", MajorVersion: 39, MinorVersion: 1}, + idStr: "fedora-41.1", + expected: &distro.ID{Name: "fedora", MajorVersion: 41, MinorVersion: 1}, }, { - idStr: "fedora-39.1.1", + idStr: "fedora-41.1.1", err: true, }, // RHEL-7 diff --git a/pkg/dnfjson/cache_test.go b/pkg/dnfjson/cache_test.go index 2cc5acf2ed..8ba53669fc 100644 --- a/pkg/dnfjson/cache_test.go +++ b/pkg/dnfjson/cache_test.go @@ -356,7 +356,7 @@ func TestDNFCacheCleanup(t *testing.T) { func TestCleanupOldCacheDirs(t *testing.T) { // Run the cleanup without the cache present and with dummy distro names - CleanupOldCacheDirs("/var/tmp/test-no-cache-rpmmd/", []string{"fedora-38", "fedora-39"}) + CleanupOldCacheDirs("/var/tmp/test-no-cache-rpmmd/", []string{"fedora-40", "fedora-41"}) testCacheRoot := t.TempDir() // Make all the test caches under root, using their keys as a distro name. diff --git a/test/README.md b/test/README.md index eeb48bb29b..9b11ba0c44 100644 --- a/test/README.md +++ b/test/README.md @@ -5,7 +5,7 @@ - [./cmd/build](../cmd/build) takes a config file as argument to build an image. For example: ``` go build -o bin/build ./cmd/build -sudo ./bin/build --output ./buildtest --rpmmd /tmp/rpmmd --distro fedora-39 --type qcow2 --config test/configs/embed-containers.json +sudo ./bin/build --output ./buildtest --rpmmd /tmp/rpmmd --distro fedora-41 --type qcow2 --config test/configs/embed-containers.json ``` will build a Fedora 38 qcow2 image using the configuration specified in the file `embed-containers.json` @@ -17,7 +17,7 @@ The config map is also used in CI to dynamically generate test builds using the - `Schutzfile` defines content sources and test variables: - `common.rngseed` is the random number generator seed that is used by all the test scripts and commands. It ensures manifests are always generated with the same random values (e.g. for partition UUIDs) so tests can be skipped when an image hasn't changed (see [Workflow details](#workflow-details)) below. This value can be changed (incremented) when a rebuild of all test images is required. For example, if a test script changes in a way that will not affect the manifests, this value can be used to make sure all test images are built. - - The following are defined in an object keyed by a distro name (e.g. `fedora-39`). The distribution name and version must match the version of the CI runners. + - The following are defined in an object keyed by a distro name (e.g. `fedora-41`). The distribution name and version must match the version of the CI runners. - `dependencies.osbuild.commit`: the version of osbuild to use, as a commit ID. This must be a commit that was successfully built in osbuild's CI, so that RPMs will be available. It is used by [./test/scripts/setup-osbuild-repo](./scripts/setup-osbuild-repo). - `repos`: the repository configurations to use on the runners to install packages such as build dependencies and test tools. @@ -100,7 +100,7 @@ in the form for example: ```json { - "distro": "fedora-39", + "distro": "fedora-40", "arch": "x86_64", "image-type": "qcow2", "config": "all-customizations", @@ -143,7 +143,7 @@ Each build job runs in parallel. For each image that is successfully built, a fi ## Definitions -- ``: distribution name and version (e.g. `fedora-39`). +- ``: distribution name and version (e.g. `fedora-41`). - ``: architecture (one of `x86_64`, `aarch64`, `ppc64le`, `s390x`). - ``: name of the image type (e.g. `qcow2`). - ``: name of a build configuration like the ones found in `./test/configs/` (e.g. `all-customizations`). diff --git a/test/scripts/test_imgtestlib.py b/test/scripts/test_imgtestlib.py index 05ce95d748..2c4be9b522 100644 --- a/test/scripts/test_imgtestlib.py +++ b/test/scripts/test_imgtestlib.py @@ -38,14 +38,14 @@ def test_read_seed(): def test_path_generators(): - testlib.get_osbuild_nevra = lambda: "osbuild-104-1.fc39.noarch" + testlib.get_osbuild_nevra = lambda: "osbuild-104-1.fc41.noarch" assert testlib.gen_build_info_dir_path("inforoot", testlib.get_osbuild_nevra(), "abc123") == \ - "inforoot/osbuild-104-1.fc39.noarch/abc123/" + "inforoot/osbuild-104-1.fc41.noarch/abc123/" assert testlib.gen_build_info_path("inforoot", testlib.get_osbuild_nevra(), "abc123") == \ - "inforoot/osbuild-104-1.fc39.noarch/abc123/info.json" - assert testlib.gen_build_info_s3("fedora-39", "aarch64", "abc123") == \ - testlib.S3_BUCKET + "/images/builds/fedora-39/aarch64/osbuild-104-1.fc39.noarch/abc123/" + "inforoot/osbuild-104-1.fc41.noarch/abc123/info.json" + assert testlib.gen_build_info_s3("fedora-41", "aarch64", "abc123") == \ + testlib.S3_BUCKET + "/images/builds/fedora-41/aarch64/osbuild-104-1.fc41.noarch/abc123/" test_container = "registry.gitlab.com/redhat/services/products/image-builder/ci/osbuild-composer/manifest-list-test"