Skip to content

Commit

Permalink
Remove all instances of Fedora 39 from tests and docs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
achilleas-k authored and thozza committed Dec 19, 2024
1 parent 27129b5 commit 8dde738
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 51 deletions.
50 changes: 18 additions & 32 deletions pkg/distro/fedora/distro_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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"},
Expand All @@ -224,7 +214,7 @@ func TestFilenameFromType(t *testing.T) {
},
},
},
"40": {
"41": {
{
name: "iot-bootable-container",
args: args{"iot-bootable-container"},
Expand Down Expand Up @@ -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",
},
Expand All @@ -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",
},
Expand Down Expand Up @@ -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",
},
Expand All @@ -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",
},
Expand All @@ -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",
},
},
Expand All @@ -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",
},
},
Expand Down
8 changes: 4 additions & 4 deletions pkg/distro/id_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
Expand Down
10 changes: 5 additions & 5 deletions pkg/distroidparser/idparser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/dnfjson/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand All @@ -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.

Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -143,7 +143,7 @@ Each build job runs in parallel. For each image that is successfully built, a fi

## Definitions

- `<distro>`: distribution name and version (e.g. `fedora-39`).
- `<distro>`: distribution name and version (e.g. `fedora-41`).
- `<arch>`: architecture (one of `x86_64`, `aarch64`, `ppc64le`, `s390x`).
- `<image type>`: name of the image type (e.g. `qcow2`).
- `<config name>`: name of a build configuration like the ones found in `./test/configs/` (e.g. `all-customizations`).
Expand Down
10 changes: 5 additions & 5 deletions test/scripts/test_imgtestlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 8dde738

Please sign in to comment.