Adjust AMI output to the Lorax one

This commit is contained in:
Martin Sehnoutka 2019-10-22 13:50:07 +02:00 committed by Tom Gundersen
parent 96d401b212
commit 4ef4112a12
3 changed files with 39 additions and 7 deletions

View file

@ -5,7 +5,34 @@ import "github.com/osbuild/osbuild-composer/internal/pipeline"
type amiOutput struct{}
func (t *amiOutput) translate(b *Blueprint) *pipeline.Pipeline {
p := getF30Pipeline()
p := &pipeline.Pipeline{
BuildPipeline: getF30BuildPipeline(),
}
options := &pipeline.DNFStageOptions{
ReleaseVersion: "30",
BaseArchitecture: "x86_64",
}
options.AddRepository(getF30Repository())
packages := [...]string{
"@Core",
"chrony",
"kernel",
"selinux-policy-targeted",
"grub2-pc",
"langpacks-en",
"libxcrypt-compat",
"xfsprogs",
"cloud-init",
"checkpolicy",
"net-tools",
}
for _, pkg := range packages {
options.AddPackage(pkg)
}
p.AddStage(pipeline.NewDNFStage(options))
addF30FixBlsStage(p)
addF30LocaleStage(p)
addF30FSTabStage(p)
addF30GRUB2Stage(p)
addF30SELinuxStage(p)

View file

@ -149,7 +149,10 @@ func TestBlueprint_ToPipeline(t *testing.T) {
}
if !tt.wantErr {
if !reflect.DeepEqual(got, &want) {
t.Errorf("Blueprint.ToPipeline() = %v, want %v", got, &want)
// Without this the "difference" is just a list of pointers.
gotJson, _ := json.Marshal(got)
fileJson, _ := json.Marshal(want)
t.Errorf("Blueprint.ToPipeline() =\n%v,\nwant =\n%v", string(gotJson), string(fileJson))
}
}
})

View file

@ -43,10 +43,12 @@
"kernel",
"selinux-policy-targeted",
"grub2-pc",
"spice-vdagent",
"qemu-guest-agent",
"xen-libs",
"langpacks-en"
"langpacks-en",
"libxcrypt-compat",
"xfsprogs",
"cloud-init",
"checkpolicy",
"net-tools"
],
"releasever": "30",
"basearch": "x86_64"
@ -102,4 +104,4 @@
"size": 3221225472
}
}
}
}