Skip to content

test: cross arch build/boot smoke test for ppc64le,s390x#2069

Merged
supakeen merged 3 commits intoosbuild:mainfrom
mvo5:vmtest-add-ppc64-s390x
Dec 17, 2025
Merged

test: cross arch build/boot smoke test for ppc64le,s390x#2069
supakeen merged 3 commits intoosbuild:mainfrom
mvo5:vmtest-add-ppc64-s390x

Conversation

@mvo5
Copy link
Contributor

@mvo5 mvo5 commented Dec 4, 2025

test: run cross arch smoke test on ppc64le, s390x

This commit adds a minimal smoke test for centos-10/qcow2 that
will create a qcow2 and boot it. It demos how we could do more
cross arch testing and keeps the qemu code tested.

We need to decide if we want to do more tests like this, its
a trade-off. OTOH its nice to have (some) assurance that our
images boot (we did break s390/ppc64 partition tables in the
past by accident). OTOH its a bit of a pain when something fails
to figure out of it is failing because of some qemu incompatibilites
or because there is a real issue in the image.

Having this at least for local testing/validation is probably
useful though.

Note that the s390x test needs qemu-user >= 7.2-rc2 so this will
not run currently (I did run it on my local machine and it works
but the kdump service takes > 5min to startup).


vmtest: add cross arch boot support for s390x/ppc64le

This adds basic support to boot ppc64le/s390x machine. This
allows to do:

$ ./test/scripts/build-image --arch ppc64le centos-10 qcow2 cfgpath
$ ./test/scripts/boot-image ./build/centos_10-ppc64le-qcow2-empty

to easily boot test machines that are not easily available otherwise.


build-image: add support for (optional) --arch to build

This is useful to do basic testing for architectures like s390x
or ppc64le that are not available easily (or even for a quick
local aarch64 test).

@mvo5 mvo5 requested a review from supakeen December 4, 2025 16:29
@mvo5 mvo5 force-pushed the vmtest-add-ppc64-s390x branch from f05edae to b85084f Compare December 8, 2025 11:28
@mvo5 mvo5 changed the title test: allow cross arch build/test test: allow cross arch build/test for ppc64le Dec 8, 2025
@mvo5 mvo5 force-pushed the vmtest-add-ppc64-s390x branch from b85084f to f07486e Compare December 8, 2025 11:42
@mvo5 mvo5 force-pushed the vmtest-add-ppc64-s390x branch from f07486e to 456beba Compare December 10, 2025 11:30
@mvo5 mvo5 changed the title test: allow cross arch build/test for ppc64le test: allow cross arch build/test for ppc64le,s390x Dec 10, 2025
@mvo5 mvo5 force-pushed the vmtest-add-ppc64-s390x branch 6 times, most recently from 0f50022 to f27edc2 Compare December 10, 2025 12:28
@mvo5 mvo5 force-pushed the vmtest-add-ppc64-s390x branch 5 times, most recently from af57b3a to 52e8aba Compare December 10, 2025 13:39
@mvo5 mvo5 changed the title test: allow cross arch build/test for ppc64le,s390x [RFC] test: allow cross arch build/test for ppc64le,s390x Dec 10, 2025
@mvo5 mvo5 force-pushed the vmtest-add-ppc64-s390x branch from 52e8aba to 099532d Compare December 10, 2025 14:26
@mvo5 mvo5 marked this pull request as ready for review December 10, 2025 15:14
@mvo5 mvo5 requested review from a team, achilleas-k and thozza as code owners December 10, 2025 15:14
bcl
bcl previously approved these changes Dec 11, 2025
Copy link
Contributor

@bcl bcl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than that one question this looks good.

Copy link
Member

@thozza thozza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this; I think that it makes sense.

That said, the default behavior of some of the scripts changes AFAICT, and I am not convinced that it is necessarily intentional. Requesting changes until this is sorted out.

mvo5 added 2 commits December 12, 2025 10:51
This is useful to do basic testing for architectures like s390x
or ppc64le that are not available easily (or even for a quick
local aarch64 test).
This adds basic support to boot ppc64le/s390x machine. This
allows to do:
```
$ ./test/scripts/build-image --arch ppc64le centos-10 qcow2 cfgpath
$ ./test/scripts/boot-image ./build/centos_10-ppc64le-qcow2-empty
```
to easily boot test machines that are not easily available otherwise.
@mvo5 mvo5 force-pushed the vmtest-add-ppc64-s390x branch 3 times, most recently from 718ed8e to c57a64e Compare December 12, 2025 09:59
@mvo5 mvo5 changed the title [RFC] test: allow cross arch build/test for ppc64le,s390x test: cross arch build/boot smoke test for ppc64le,s390x Dec 12, 2025
@mvo5 mvo5 force-pushed the vmtest-add-ppc64-s390x branch 2 times, most recently from 433584b to 8aa85f8 Compare December 12, 2025 10:09
This commit adds a minimal smoke test for centos-10/qcow2 that
will create a qcow2 and boot it. It demos how we could do more
cross arch testing and keeps the qemu code tested.

We need to decide if we want to do more tests like this, its
a trade-off. OTOH its nice to have (some) assurance that our
images boot (we did break s390/ppc64 partition tables in the
past by accident). OTOH its a bit of a pain when something fails
to figure out of it is failing because of some qemu incompatibilites
or because there is a real issue in the image.

Having this at least for local testing/validation is probably
useful though.

Note that the s390x test needs qemu-user >= 7.2-rc2 so this will
not run currently (I did run it on my local machine and it works
but the kdump service takes > 5min to startup).
@mvo5 mvo5 force-pushed the vmtest-add-ppc64-s390x branch from 8aa85f8 to 63263ad Compare December 15, 2025 08:01
@supakeen supakeen enabled auto-merge December 17, 2025 08:47
Copy link
Member

@thozza thozza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, thank you a lot!

if archName == "" {
archName = arch.Current().String()
}
archi, err := distribution.GetArch(archName)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: I don't have any problem with the rename of arch -> archi, just wanted to point it out in case this was not intentional.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its needed because we also import arch so if we have arch there the arch module is shadowed (and a few lines below iirc this code access the arch module now).

@supakeen supakeen added this pull request to the merge queue Dec 17, 2025
Merged via the queue into osbuild:main with commit 240ce62 Dec 17, 2025
25 checks passed
@lzap
Copy link
Contributor

lzap commented Dec 18, 2025

Somehow, in my PR I rebased on top of this commit CICD started erroring out with:

error obtaining VCS status: exit status 128
Use -buildvcs=false to disable VCS stamping.

My theory is that an environmental variable GOFLAGS is set for that test, but then in my PR I actually override that variable with some other value (tags) so I shadow it. Therefore I only see the problem in my own PR. I guess you can disregard this comment then :-)

#2100

"-device", "e1000,netdev=net.0",
"-qmp", f"unix:{self._qmp_socket},server,nowait",
# boot
"-drive", f"file={self._img},if=none,id=disk0,format=qcow2",
Copy link
Contributor

@lzap lzap Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hunk sneaked into main somehow and this does not appear to be correct. It renders as:

['qemu-system-x86_64', '-M', 'accel=kvm', '-cpu', 'host', '-device', 'virtio-scsi-pci,id=scsi', '-device', 'scsi-hd,drive=disk0', '-bios', '/usr/share/OVMF/OVMF_CODE.fd', '-m', '2048', '-serial', 'stdio', '-monitor', 'none', '-device', 'virtio-net-pci,netdev=net.0,id=net.0', '-netdev', 'user,id=net.0,hostfwd=tcp::49925-:22', '-qmp', 'unix:/tmp/vmtest-v614uhg7-disk.img/qmp.socket,server,nowait', '-drive', 'file=/var/tmp/tmpp40bxujp/disk.img,if=none,id=disk0,format=qcow2', '-nographic', '-cdrom', PosixPath('/var/tmp/tmpdk5gg6b6/netinst.iso'), PosixPath('/var/tmp/tmpp40bxujp/disk.img')]

Which ends with QEMU complaining about raw image not being qcow2. That can be fixed, but then the issue is the image is passed twice on the command line - once via -device and once via argument. When I remove the argument, then QEMU does not boot there is some problem with SCSI setup.

Another problem is few lines below when -cdrom is appended with Path object, but that is an easy fix with str.

I will look into this later next week. Actually, let me try to do a quick fix and see how many tests are fixed: #2103

croissanne added a commit to croissanne/osbuild-composer that referenced this pull request Jan 21, 2026
Changes with 0.231.0
----------------
  - Drop iommu.strict=0 from aarch64 EC2 images (osbuild/images#2090)
    - Author: Achilleas Koutsou, Reviewers: Lukáš Zapletal, Simon de Vlieger, Tomáš Hozza
  - bootc: Fix selinux labeling when using separate build container (osbuild/images#2092)
    - Author: Alexander Larsson, Reviewers: Lukáš Zapletal, Simon de Vlieger, Tomáš Hozza
  - ci: resolve dubious ownership for git (osbuild/images#2100)
    - Author: Lukáš Zapletal, Reviewers: Achilleas Koutsou, Michael Vogt
  - data: import RH v4 key on rhel-10.1+ only (osbuild/images#2097)
    - Author: Michael Vogt, Reviewers: Lukáš Zapletal, Simon de Vlieger
  - distrodefs: drop `use_syslinux` as it has no effect (osbuild/images#2088)
    - Author: Michael Vogt, Reviewers: Lukáš Zapletal, Simon de Vlieger
  - fedora: /boot on btrfs for Fedora Cloud 44 (HMS-9737) (osbuild/images#1960)
    - Author: Simon de Vlieger, Reviewers: Lukáš Zapletal, Neal Gompa (ニール・ゴンパ), Tomáš Hozza
  - fedora: add `server-network-installer` (osbuild/images#2094)
    - Author: Simon de Vlieger, Reviewers: Lukáš Zapletal, Tomáš Hozza
  - installer: only install `syslinux` when needed (osbuild/images#2089)
    - Author: Simon de Vlieger, Reviewers: Lukáš Zapletal, Tomáš Hozza
  - manifest: add `set -e` to `bootc switch...` kickstart %post (osbuild/images#2093)
    - Author: Michael Vogt, Reviewers: Lukáš Zapletal, Simon de Vlieger, Tomáš Hozza
  - many: include legal and license files in ISO (osbuild/images#2099)
    - Author: Simon de Vlieger, Reviewers: Lukáš Zapletal, Tomáš Hozza
  - osbuild: drop `valueIn` helper (osbuild/images#2086)
    - Author: Michael Vogt, Reviewers: Brian C. Lane, Simon de Vlieger
  - readme: update link to image definitions (osbuild/images#2070)
    - Author: Anna Vítová, Reviewers: Achilleas Koutsou, Lukáš Zapletal, Simon de Vlieger, Tomáš Hozza
  - test: cross arch build/boot smoke test for ppc64le,s390x (osbuild/images#2069)
    - Author: Michael Vogt, Reviewers: Lukáš Zapletal, Simon de Vlieger, Tomáš Hozza
achilleas-k pushed a commit to osbuild/osbuild-composer that referenced this pull request Jan 21, 2026
Changes with 0.231.0
----------------
  - Drop iommu.strict=0 from aarch64 EC2 images (osbuild/images#2090)
    - Author: Achilleas Koutsou, Reviewers: Lukáš Zapletal, Simon de Vlieger, Tomáš Hozza
  - bootc: Fix selinux labeling when using separate build container (osbuild/images#2092)
    - Author: Alexander Larsson, Reviewers: Lukáš Zapletal, Simon de Vlieger, Tomáš Hozza
  - ci: resolve dubious ownership for git (osbuild/images#2100)
    - Author: Lukáš Zapletal, Reviewers: Achilleas Koutsou, Michael Vogt
  - data: import RH v4 key on rhel-10.1+ only (osbuild/images#2097)
    - Author: Michael Vogt, Reviewers: Lukáš Zapletal, Simon de Vlieger
  - distrodefs: drop `use_syslinux` as it has no effect (osbuild/images#2088)
    - Author: Michael Vogt, Reviewers: Lukáš Zapletal, Simon de Vlieger
  - fedora: /boot on btrfs for Fedora Cloud 44 (HMS-9737) (osbuild/images#1960)
    - Author: Simon de Vlieger, Reviewers: Lukáš Zapletal, Neal Gompa (ニール・ゴンパ), Tomáš Hozza
  - fedora: add `server-network-installer` (osbuild/images#2094)
    - Author: Simon de Vlieger, Reviewers: Lukáš Zapletal, Tomáš Hozza
  - installer: only install `syslinux` when needed (osbuild/images#2089)
    - Author: Simon de Vlieger, Reviewers: Lukáš Zapletal, Tomáš Hozza
  - manifest: add `set -e` to `bootc switch...` kickstart %post (osbuild/images#2093)
    - Author: Michael Vogt, Reviewers: Lukáš Zapletal, Simon de Vlieger, Tomáš Hozza
  - many: include legal and license files in ISO (osbuild/images#2099)
    - Author: Simon de Vlieger, Reviewers: Lukáš Zapletal, Tomáš Hozza
  - osbuild: drop `valueIn` helper (osbuild/images#2086)
    - Author: Michael Vogt, Reviewers: Brian C. Lane, Simon de Vlieger
  - readme: update link to image definitions (osbuild/images#2070)
    - Author: Anna Vítová, Reviewers: Achilleas Koutsou, Lukáš Zapletal, Simon de Vlieger, Tomáš Hozza
  - test: cross arch build/boot smoke test for ppc64le,s390x (osbuild/images#2069)
    - Author: Michael Vogt, Reviewers: Lukáš Zapletal, Simon de Vlieger, Tomáš Hozza
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants