tests: add metal output to fedora-coreos-container manifest

Also switch the qcow2 output to be a "qemu" platform image. This
change takes advantage of the recent org.osbuild.kernel-cmdline.bls-append
stage addition to modify kernel arguments in later pipelines.

To get a qemu image output:

- osbuild --output-directory out/ --export qemu test/data/manifests/fedora-coreos-container.json

To get a metal image output:

- osbuild --output-directory out/ --export metal test/data/manifests/fedora-coreos-container.json
This commit is contained in:
Dusty Mabe 2023-11-06 20:23:43 -05:00 committed by Achilleas Koutsou
parent 52adfe01f7
commit 0529ae79d1
3 changed files with 233 additions and 20 deletions

View file

@ -95,8 +95,11 @@ def run_tests(args, tmpdir):
"fedora-coreos-container": { "fedora-coreos-container": {
"manifest": "fedora-coreos-container.json", "manifest": "fedora-coreos-container.json",
"exports": { "exports": {
"qcow2": { "qemu": {
"artifact": "disk.qcow2" "artifact": "qemu.qcow2"
},
"metal": {
"artifact": "metal.raw"
} }
}, },
} }

View file

@ -442,7 +442,7 @@
] ]
}, },
{ {
"name": "image-tree", "name": "tree",
"build": "name:build", "build": "name:build",
"source-epoch": 1659397331, "source-epoch": 1659397331,
"stages": [ "stages": [
@ -492,9 +492,6 @@
], ],
"kernel_opts": [ "kernel_opts": [
"rw", "rw",
"console=tty0",
"console=ttyS0",
"ignition.platform.id=qemu",
"$ignition_firstboot" "$ignition_firstboot"
] ]
}, },
@ -541,7 +538,7 @@
] ]
}, },
{ {
"name": "image", "name": "raw-image",
"build": "name:build", "build": "name:build",
"stages": [ "stages": [
{ {
@ -654,7 +651,7 @@
"type": "org.osbuild.tree", "type": "org.osbuild.tree",
"origin": "org.osbuild.pipeline", "origin": "org.osbuild.pipeline",
"references": [ "references": [
"name:image-tree" "name:tree"
] ]
} }
}, },
@ -735,7 +732,141 @@
] ]
}, },
{ {
"name": "qcow2", "name": "raw-metal-image",
"build": "name:build",
"stages": [
{
"type": "org.osbuild.copy",
"inputs": {
"tree": {
"type": "org.osbuild.tree",
"origin": "org.osbuild.pipeline",
"references": [
"name:raw-image"
]
}
},
"options": {
"paths": [
{
"from": "input://tree/disk.img",
"to": "tree:///disk.img"
}
]
}
},
{
"type": "org.osbuild.kernel-cmdline.bls-append",
"options": {
"bootpath": "mount:///",
"kernel_opts": [
"ignition.platform.id=metal"
]
},
"devices": {
"boot": {
"type": "org.osbuild.loopback",
"options": {
"filename": "disk.img",
"start": 264192,
"size": 786432
}
}
},
"mounts": [
{
"name": "boot",
"type": "org.osbuild.ext4",
"source": "boot",
"target": "/"
}
]
}
]
},
{
"name": "raw-qemu-image",
"build": "name:build",
"stages": [
{
"type": "org.osbuild.copy",
"inputs": {
"tree": {
"type": "org.osbuild.tree",
"origin": "org.osbuild.pipeline",
"references": [
"name:raw-image"
]
}
},
"options": {
"paths": [
{
"from": "input://tree/disk.img",
"to": "tree:///disk.img"
}
]
}
},
{
"type": "org.osbuild.kernel-cmdline.bls-append",
"options": {
"bootpath": "mount:///",
"kernel_opts": [
"console=tty0",
"console=ttyS0,115200n8",
"ignition.platform.id=qemu"
]
},
"devices": {
"boot": {
"type": "org.osbuild.loopback",
"options": {
"filename": "disk.img",
"start": 264192,
"size": 786432
}
}
},
"mounts": [
{
"name": "boot",
"type": "org.osbuild.ext4",
"source": "boot",
"target": "/"
}
]
}
]
},
{
"name": "metal",
"build": "name:build",
"stages": [
{
"type": "org.osbuild.copy",
"inputs": {
"tree": {
"type": "org.osbuild.tree",
"origin": "org.osbuild.pipeline",
"references": [
"name:raw-metal-image"
]
}
},
"options": {
"paths": [
{
"from": "input://tree/disk.img",
"to": "tree:///metal.raw"
}
]
}
}
]
},
{
"name": "qemu",
"build": "name:build", "build": "name:build",
"stages": [ "stages": [
{ {
@ -745,14 +876,14 @@
"type": "org.osbuild.files", "type": "org.osbuild.files",
"origin": "org.osbuild.pipeline", "origin": "org.osbuild.pipeline",
"references": { "references": {
"name:image": { "name:raw-qemu-image": {
"file": "disk.img" "file": "disk.img"
} }
} }
} }
}, },
"options": { "options": {
"filename": "disk.qcow2", "filename": "qemu.qcow2",
"format": { "format": {
"type": "qcow2", "type": "qcow2",
"compat": "1.1" "compat": "1.1"

View file

@ -33,7 +33,7 @@ pipelines:
id: build id: build
runner: runner:
mpp-format-string: org.osbuild.fedora{release} mpp-format-string: org.osbuild.fedora{release}
- name: image-tree - name: tree
build: name:build build: name:build
source-epoch: 1659397331 source-epoch: 1659397331
stages: stages:
@ -63,9 +63,6 @@ pipelines:
- /boot/efi - /boot/efi
kernel_opts: kernel_opts:
- rw - rw
- console=tty0
- console=ttyS0
- ignition.platform.id=qemu
- '$ignition_firstboot' - '$ignition_firstboot'
inputs: inputs:
images: images:
@ -93,7 +90,7 @@ pipelines:
write_defaults: false write_defaults: false
greenboot: false greenboot: false
ignition: true ignition: true
- name: image - name: raw-image
build: name:build build: name:build
stages: stages:
- type: org.osbuild.truncate - type: org.osbuild.truncate
@ -157,7 +154,7 @@ pipelines:
type: org.osbuild.tree type: org.osbuild.tree
origin: org.osbuild.pipeline origin: org.osbuild.pipeline
references: references:
- name:image-tree - name:tree
options: options:
paths: paths:
- from: input://tree/ - from: input://tree/
@ -217,7 +214,89 @@ pipelines:
number: number:
mpp-format-int: '{image.layout[''boot''].index}' mpp-format-int: '{image.layout[''boot''].index}'
path: /grub2 path: /grub2
- name: qcow2 - name: raw-metal-image
build: name:build
stages:
- type: org.osbuild.copy
inputs:
tree:
type: org.osbuild.tree
origin: org.osbuild.pipeline
references:
- name:raw-image
options:
paths:
- from: input://tree/disk.img
to: tree:///disk.img
- type: org.osbuild.kernel-cmdline.bls-append
options:
bootpath: mount:///
kernel_opts:
- ignition.platform.id=metal
devices:
boot:
type: org.osbuild.loopback
options:
filename: disk.img
start:
mpp-format-int: '{image.layout[''boot''].start}'
size:
mpp-format-int: '{image.layout[''boot''].size}'
mounts:
- name: boot
type: org.osbuild.ext4
source: boot
target: /
- name: raw-qemu-image
build: name:build
stages:
- type: org.osbuild.copy
inputs:
tree:
type: org.osbuild.tree
origin: org.osbuild.pipeline
references:
- name:raw-image
options:
paths:
- from: input://tree/disk.img
to: tree:///disk.img
- type: org.osbuild.kernel-cmdline.bls-append
options:
bootpath: mount:///
kernel_opts:
- console=tty0
- console=ttyS0,115200n8
- ignition.platform.id=qemu
devices:
boot:
type: org.osbuild.loopback
options:
filename: disk.img
start:
mpp-format-int: '{image.layout[''boot''].start}'
size:
mpp-format-int: '{image.layout[''boot''].size}'
mounts:
- name: boot
type: org.osbuild.ext4
source: boot
target: /
- name: metal
build: name:build
stages:
- type: org.osbuild.copy
inputs:
tree:
type: org.osbuild.tree
origin: org.osbuild.pipeline
references:
- name:raw-metal-image
options:
paths:
- from: input://tree/disk.img
to: tree:///metal.raw
- name: qemu
build: name:build build: name:build
stages: stages:
- type: org.osbuild.qemu - type: org.osbuild.qemu
@ -226,10 +305,10 @@ pipelines:
type: org.osbuild.files type: org.osbuild.files
origin: org.osbuild.pipeline origin: org.osbuild.pipeline
references: references:
name:image: name:raw-qemu-image:
file: disk.img file: disk.img
options: options:
filename: disk.qcow2 filename: qemu.qcow2
format: format:
type: qcow2 type: qcow2
compat: '1.1' compat: '1.1'