Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to use plain squashfs as the iso rootfs #1105

Merged
merged 6 commits into from
Dec 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions pkg/distro/distro_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ func listTestedDistros(t *testing.T) []string {
// needed for knowing the names of pipelines from the static object without
// having access to a manifest, which we need when parsing metadata from build
// results.
// NOTE: The static list of pipelines really only needs to include those that
// have rpm or ostree metadata in them.
func TestImageTypePipelineNames(t *testing.T) {
// types for parsing the opaque manifest with just the fields we care about
type rpmStageOptions struct {
Expand Down Expand Up @@ -138,11 +140,10 @@ func TestImageTypePipelineNames(t *testing.T) {
err = json.Unmarshal(mf, pm)
assert.NoError(err)

assert.Equal(len(allPipelines), len(pm.Pipelines))
var pmNames []string
for idx := range pm.Pipelines {
// manifest pipeline names should be identical to the ones
// defined in the image type and in the same order
assert.Equal(allPipelines[idx], pm.Pipelines[idx].Name)
// Gather the names of the manifest piplines for later
pmNames = append(pmNames, pm.Pipelines[idx].Name)

if pm.Pipelines[idx].Name == "os" {
rpmStagePresent := false
Expand Down Expand Up @@ -171,6 +172,15 @@ func TestImageTypePipelineNames(t *testing.T) {
// sure they match.
assert.Equal(imageType.Exports()[0], pm.Pipelines[len(pm.Pipelines)-1].Name)

// The pipelines named in allPipelines must exist in the manifest, and in the
// order specified (eg. 'build' first) but it does not need to be an exact
// match. Only the pipelines with rpm or ostree metadata are required.
bcl marked this conversation as resolved.
Show resolved Hide resolved
var order int
for _, name := range allPipelines {
idx := slices.Index(pmNames, name)
assert.True(idx >= order, "%s not in order %v", name, pmNames)
order = idx
}
})
}
}
Expand Down