Commit e7cceca
committed
test(qemu): replace Fedora Cloud image with Alpine Linux tiny image
## Motivation
The Fedora Cloud qcow2 images used in QEMU driver tests weigh ~556 MB
(x86_64) + ~519 MB (aarch64) = ~1.1 GB total, taking ~1 minute to
download on every CI cache miss and consuming significant bandwidth.
## Image replacement
Replace with Alpine Linux 3.22.4 UEFI tiny cloud images from
dl-cdn.alpinelinux.org:
x86_64: 556 MB → 127 MB (77% reduction)
aarch64: 519 MB → 151 MB (71% reduction)
Total: ~1076 MB → ~278 MB (74% reduction)
Alpine's nocloud tiny images support UEFI boot on both architectures
and use tiny-cloud (a minimal cloud-init alternative) that reads the
standard NoCloud CIDATA vfat volume the QEMU driver already generates.
## Driver changes (driver.py)
tiny-cloud has two behavioural differences from full cloud-init:
1. Hostname: tiny-cloud reads @hostname from the YAML key 'hostname'
in meta-data, not 'local-hostname'. Add 'hostname' alongside
'local-hostname' so both cloud-init and tiny-cloud set it correctly.
2. Password: tiny-cloud does not support plain_text_passwd in the users
stanza. Add a runcmd entry ('echo user:pass | chpasswd') which
tiny-cloud does execute. Full cloud-init images are unaffected.
## Test changes (driver_test.py)
Alpine has no SELinux and uses a different default shell prompt:
- Remove 'sudo setenforce 0' (no SELinux on Alpine).
- Update post-login prompt match from bash '[user@host ~]$' to
Alpine ash 'host:~$'.
- Relax 'uname -r' assertion from the Fedora-specific kernel string
to a non-empty check.
- Press Enter when the GRUB countdown appears to skip the 10 s wait
(detected via 'automatically in '; if the image already booted past
GRUB the code falls through directly to the login prompt).
## SSH: TCP hostfwd instead of vsock
Fedora cloud images ship systemd-ssh-generator (part of systemd ≥ 256)
which automatically binds sshd to AF_VSOCK port 22 when booting inside
a VM. Alpine uses OpenRC — no systemd, no generator — so sshd only
listens on TCP.
The fix: allocate a free host port at test start and pass it as
hostfwd={'ssh': {protocol, hostaddr, hostport, guestport=22}}. Because
hostfwd entries are written to children['ssh'] after the VsockNetwork,
they override it, so qemu.shell() transparently uses TCP without any
other code changes.1 parent ada5fa8 commit e7cceca
3 files changed
Lines changed: 33 additions & 14 deletions
File tree
- .github/workflows
- python/packages/jumpstarter-driver-qemu/jumpstarter_driver_qemu
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
| 123 | + | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | | - | |
131 | | - | |
| 130 | + | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
| 134 | + | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
| 515 | + | |
515 | 516 | | |
516 | 517 | | |
517 | 518 | | |
| |||
528 | 529 | | |
529 | 530 | | |
530 | 531 | | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
531 | 539 | | |
532 | 540 | | |
533 | 541 | | |
| |||
Lines changed: 18 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
62 | 70 | | |
63 | 71 | | |
64 | 72 | | |
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
68 | 76 | | |
| 77 | + | |
69 | 78 | | |
70 | 79 | | |
71 | 80 | | |
72 | 81 | | |
73 | 82 | | |
74 | 83 | | |
75 | | - | |
| 84 | + | |
76 | 85 | | |
77 | 86 | | |
78 | 87 | | |
79 | 88 | | |
80 | 89 | | |
81 | | - | |
| 90 | + | |
82 | 91 | | |
83 | 92 | | |
84 | 93 | | |
| |||
88 | 97 | | |
89 | 98 | | |
90 | 99 | | |
91 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
92 | 105 | | |
93 | 106 | | |
94 | 107 | | |
95 | | - | |
96 | | - | |
97 | | - | |
| 108 | + | |
98 | 109 | | |
99 | 110 | | |
100 | | - | |
| 111 | + | |
101 | 112 | | |
102 | 113 | | |
103 | 114 | | |
| |||
0 commit comments