Skip to content

Commit

Permalink
image: test for all the expected disk format pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
achilleas-k authored and mvo5 committed Mar 13, 2024
1 parent f0de636 commit 681fea8
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion pkg/image/bootc_disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func makeBootcDiskImageOsbuildManifest(t *testing.T, opts *bootcDiskImageTestOpt

m := &manifest.Manifest{}
runi := &runner.Fedora{}
_, err := img.InstantiateManifestFromContainers(m, containers, runi, nil)
err := img.InstantiateManifestFromContainers(m, containers, runi, nil)
require.Nil(t, err)

fakeSourceSpecs := map[string][]container.Spec{
Expand Down Expand Up @@ -161,3 +161,27 @@ func TestBootcDiskImageBootupdBiosSupport(t *testing.T) {
}
}
}

func TestBootcDiskImageExportPipelines(t *testing.T) {
require := require.New(t)

osbuildManifest := makeBootcDiskImageOsbuildManifest(t, &bootcDiskImageTestOpts{BIOS: true, ImageFormat: platform.FORMAT_QCOW2})
imagePipeline := findPipelineFromOsbuildManifest(t, osbuildManifest, "image")
require.NotNil(imagePipeline)
truncateStage := findStageFromOsbuildPipeline(t, imagePipeline, "org.osbuild.truncate") // check the truncate stage that creates the disk file
require.NotNil(truncateStage)
sfdiskStage := findStageFromOsbuildPipeline(t, imagePipeline, "org.osbuild.sfdisk") // and the sfdisk stage that creates partitions
require.NotNil(sfdiskStage)

// qcow2 pipeline for the qcow2
qcowPipeline := findPipelineFromOsbuildManifest(t, osbuildManifest, "qcow2")
require.NotNil(qcowPipeline)

// vmdk pipeline for the vmdk
vmdkPipeline := findPipelineFromOsbuildManifest(t, osbuildManifest, "vmdk")
require.NotNil(vmdkPipeline)

// tar pipeline for ova
tarPipeline := findPipelineFromOsbuildManifest(t, osbuildManifest, "archive")
require.NotNil(tarPipeline)
}

0 comments on commit 681fea8

Please sign in to comment.