Skip to content

Commit ff6fb4c

Browse files
committed
ci: Test Ubuntu 26.04 generic OVMF with libvirt
Verify that Ubuntu 26.04 retains normal virtualization recommendations while selecting generic OVMF and excluding AMD-SEV firmware. Pull-request validation checks package state; manual dispatch carries the CentOS Stream 10 bcvk conversion and SSH probe separately from the required PR gate. Assisted-by: AI Signed-off-by: Colin Walters <walters@verbum.org>
1 parent 2c5dd85 commit ff6fb4c

2 files changed

Lines changed: 92 additions & 0 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { spawnSync } from 'node:child_process';
2+
3+
const image = 'quay.io/centos-bootc/centos-bootc:stream10';
4+
const localImage = 'localhost/bcvk-libvirt-smoke:latest';
5+
const vmName = process.env.VM_NAME;
6+
7+
function run(command, args, timeout = '2m') {
8+
const result = spawnSync('timeout', [
9+
'--foreground', '--signal=TERM', '--kill-after=30s', timeout, command, ...args,
10+
], { stdio: 'inherit' });
11+
if (result.error || result.status !== 0) {
12+
const status = result.status ?? 1;
13+
throw Object.assign(
14+
new Error(`${command} failed (${result.signal ?? `status ${status}`})`),
15+
{ status },
16+
);
17+
}
18+
}
19+
20+
if (!vmName) throw new Error('VM_NAME must be set');
21+
22+
let failure;
23+
try {
24+
run('podman', ['pull', image], '12m');
25+
run('podman', ['tag', image, localImage]);
26+
run('bcvk', [
27+
'libvirt', 'run', '--connect', 'qemu:///session', '--name', vmName,
28+
'--firmware=uefi-insecure', '--disable-tpm', '--ssh-wait',
29+
'--memory=2048', '--cpus=2', '--disk-size=12G', localImage,
30+
], '12m');
31+
run('bcvk', ['libvirt', 'ssh', '--connect', 'qemu:///session', vmName, '--', 'hostname']);
32+
console.log('CentOS Stream 10 bootc guest reached SSH through libvirt');
33+
} catch (error) {
34+
failure = error;
35+
} finally {
36+
try {
37+
run('bcvk', ['libvirt', 'rm', '--connect', 'qemu:///session', '--force', vmName]);
38+
} catch (error) {
39+
console.warn(`Warning: VM cleanup failed: ${error.message}`);
40+
}
41+
}
42+
43+
if (failure) {
44+
console.error(`Probe failed: ${failure.message}`);
45+
process.exitCode = failure.status;
46+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Test Ubuntu 26.04 generic OVMF selection
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
libvirt:
14+
runs-on: ubuntu-26.04
15+
timeout-minutes: 45
16+
steps:
17+
- uses: actions/checkout@v7
18+
19+
- name: Run bootc-ubuntu-setup
20+
uses: ./bootc-ubuntu-setup
21+
with:
22+
libvirt: true
23+
24+
- name: Verify generic OVMF package state
25+
shell: bash
26+
run: |
27+
set -euo pipefail
28+
test "$(dpkg-query -W -f='${db:Status-Abbrev}' ovmf-generic)" = 'ii '
29+
test "$(dpkg-query -W -f='${db:Status-Abbrev}' ovmf-amdsev 2>/dev/null || true)" != 'ii '
30+
test ! -e /usr/share/qemu/firmware/60-edk2-x86_64-amdsev.json
31+
for package in qemu-block-extra qemu-system-gui; do
32+
test "$(dpkg-query -W -f='${db:Status-Abbrev}' "${package}")" = 'ii '
33+
dpkg-query -W -f='${Package} ${Version} ${db:Status-Abbrev}\n' "${package}"
34+
done
35+
dpkg-query -W -f='${Package} ${Version} ${db:Status-Abbrev}\n' ovmf-generic
36+
printf '%s\n' 'ovmf-amdsev is absent and its AMD-SEV descriptor is absent'
37+
38+
- name: Check OVMF smoke script syntax
39+
run: node --check .github/scripts/ubuntu-2604-ovmf-smoke.mjs
40+
41+
- name: Probe CentOS Stream 10 libvirt conversion and SSH
42+
if: github.event_name == 'workflow_dispatch'
43+
env:
44+
RUST_LOG: bcvk=debug
45+
VM_NAME: actions-ovmf-${{ github.run_id }}
46+
run: node .github/scripts/ubuntu-2604-ovmf-smoke.mjs

0 commit comments

Comments
 (0)