distro: load ostree parameters from test manifest if specified

If the compose request in the test manifest contains ostree parameters,
add them to the test.
This commit is contained in:
Achilleas Koutsou 2022-02-24 17:14:33 +01:00 committed by Tom Gundersen
parent ccd0be8c34
commit 0a535ab09e

View file

@ -35,11 +35,12 @@ func TestDistro_Manifest(t *testing.T, pipelinePath string, prefix string, regis
CheckGPG bool `json:"check_gpg,omitempty"` CheckGPG bool `json:"check_gpg,omitempty"`
} }
type composeRequest struct { type composeRequest struct {
Distro string `json:"distro"` Distro string `json:"distro"`
Arch string `json:"arch"` Arch string `json:"arch"`
ImageType string `json:"image-type"` ImageType string `json:"image-type"`
Repositories []repository `json:"repositories"` Repositories []repository `json:"repositories"`
Blueprint *blueprint.Blueprint `json:"blueprint"` Blueprint *blueprint.Blueprint `json:"blueprint"`
OSTree *ostree.RequestParams `json:"ostree"`
} }
var tt struct { var tt struct {
ComposeRequest *composeRequest `json:"compose-request"` ComposeRequest *composeRequest `json:"compose-request"`
@ -101,12 +102,17 @@ func TestDistro_Manifest(t *testing.T, pipelinePath string, prefix string, regis
imgPackageSpecSets = tt.PackageSpecSets imgPackageSpecSets = tt.PackageSpecSets
} }
ostreeOptions := ostree.RequestParams{
Ref: imageType.OSTreeRef(),
}
if tt.ComposeRequest.OSTree != nil {
ostreeOptions = *tt.ComposeRequest.OSTree
}
got, err := imageType.Manifest(tt.ComposeRequest.Blueprint.Customizations, got, err := imageType.Manifest(tt.ComposeRequest.Blueprint.Customizations,
distro.ImageOptions{ distro.ImageOptions{
Size: imageType.Size(0), Size: imageType.Size(0),
OSTree: ostree.RequestParams{ OSTree: ostreeOptions,
Ref: imageType.OSTreeRef(),
},
}, },
repos, repos,
imgPackageSpecSets, imgPackageSpecSets,