Port osbuild/images v0.33.0 with dot-notation to composer

Update the osbuild/images to the version which introduces "dot notation"
for distro release versions.

 - Replace all uses of distroregistry by distrofactory.
 - Delete local version of reporegistry and use the one from the
   osbuild/images.
 - Weldr: unify `createWeldrAPI()` and `createWeldrAPI2()` into a single
   `createTestWeldrAPI()` function`.
 - store/fixture: rework fixtures to allow overriding the host distro
   name and host architecture name. A cleanup function to restore the
   host distro and arch names is always part of the fixture struct.
 - Delete `distro_mock` package, since it is no longer used.
 - Bump the required version of osbuild to 98, because the OSCAP
   customization is using the 'compress_results' stage option, which is
   not available in older versions of osbuild.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2024-01-08 17:58:49 +01:00 committed by Achilleas Koutsou
parent f6ff8c40dd
commit 625b1578fa
1166 changed files with 154457 additions and 5508 deletions

View file

@ -127,8 +127,14 @@ func TestErrorsAlteredBasePath(t *testing.T) {
}
}
func newTestDistro(t *testing.T) distro.Distro {
distroStruct := test_distro.DistroFactory(test_distro.TestDistro1Name)
require.NotNil(t, distroStruct)
return distroStruct
}
func TestCreate(t *testing.T) {
distroStruct := test_distro.New()
distroStruct := newTestDistro(t)
arch, err := distroStruct.GetArch(test_distro.TestArchName)
if err != nil {
t.Fatalf("error getting arch from distro: %v", err)
@ -158,7 +164,7 @@ func TestCreate(t *testing.T) {
}
func TestCancel(t *testing.T) {
distroStruct := test_distro.New()
distroStruct := newTestDistro(t)
arch, err := distroStruct.GetArch(test_distro.TestArchName)
if err != nil {
t.Fatalf("error getting arch from distro: %v", err)
@ -199,7 +205,7 @@ func TestCancel(t *testing.T) {
}
func TestUpdate(t *testing.T) {
distroStruct := test_distro.New()
distroStruct := newTestDistro(t)
arch, err := distroStruct.GetArch(test_distro.TestArchName)
if err != nil {
t.Fatalf("error getting arch from distro: %v", err)
@ -237,7 +243,7 @@ func TestUpdate(t *testing.T) {
}
func TestArgs(t *testing.T) {
distroStruct := test_distro.New()
distroStruct := newTestDistro(t)
arch, err := distroStruct.GetArch(test_distro.TestArchName)
require.NoError(t, err)
imageType, err := arch.GetImageType(test_distro.TestImageTypeName)
@ -282,7 +288,7 @@ func TestArgs(t *testing.T) {
}
func TestUpload(t *testing.T) {
distroStruct := test_distro.New()
distroStruct := newTestDistro(t)
arch, err := distroStruct.GetArch(test_distro.TestArchName)
if err != nil {
t.Fatalf("error getting arch from distro: %v", err)
@ -316,7 +322,7 @@ func TestUpload(t *testing.T) {
}
func TestUploadNotAcceptingArtifacts(t *testing.T) {
distroStruct := test_distro.New()
distroStruct := newTestDistro(t)
arch, err := distroStruct.GetArch(test_distro.TestArchName)
if err != nil {
t.Fatalf("error getting arch from distro: %v", err)
@ -350,7 +356,7 @@ func TestUploadNotAcceptingArtifacts(t *testing.T) {
}
func TestUploadAlteredBasePath(t *testing.T) {
distroStruct := test_distro.New()
distroStruct := newTestDistro(t)
arch, err := distroStruct.GetArch(test_distro.TestArchName)
if err != nil {
t.Fatalf("error getting arch from distro: %v", err)
@ -390,7 +396,7 @@ func TestUploadAlteredBasePath(t *testing.T) {
}
func TestTimeout(t *testing.T) {
distroStruct := test_distro.New()
distroStruct := newTestDistro(t)
arch, err := distroStruct.GetArch(test_distro.TestArchName)
if err != nil {
t.Fatalf("error getting arch from distro: %v", err)
@ -409,7 +415,7 @@ func TestTimeout(t *testing.T) {
}
func TestRequestJobById(t *testing.T) {
distroStruct := test_distro.New()
distroStruct := newTestDistro(t)
arch, err := distroStruct.GetArch(test_distro.TestArchName)
if err != nil {
t.Fatalf("error getting arch from distro: %v", err)
@ -612,7 +618,7 @@ func TestMixedOSBuildJob(t *testing.T) {
}
func TestDepsolveLegacyErrorConversion(t *testing.T) {
distroStruct := test_distro.New()
distroStruct := newTestDistro(t)
arch, err := distroStruct.GetArch(test_distro.TestArchName)
if err != nil {
t.Fatalf("error getting arch from distro: %v", err)
@ -1642,7 +1648,7 @@ func TestRequestJobForWorker(t *testing.T) {
require.NoError(t, err)
test.TestRoute(t, server.Handler(), false, "POST", fmt.Sprintf("/api/worker/v1/workers/%s/status", workerID), "{}", 200, "")
distroStruct := test_distro.New()
distroStruct := newTestDistro(t)
arch, err := distroStruct.GetArch(test_distro.TestArchName)
if err != nil {
t.Fatalf("error getting arch from distro: %v", err)