SIGN IN SIGN UP

tests: yield GuestKernel from the guest_kernel fixture

The kernel catalogues already carry logical GuestKernel artifacts, but
the fixture still yields the bare vmlinux path, so consumers keep
re-deriving kernel identity from the file name. Yield the GuestKernel
itself; consumers read its parsed fields, and the few that still want
the path read its vmlinux field.

MicroVMFactory.build takes the GuestKernel directly, stores it as
vm.guest_kernel, and boots its vmlinux, so the parsed identity reaches
the VM rather than being re-derived from the file name later. Accepting
a path and coercing it inside build would put that parsing back; instead
the two path callers (tools/sandbox.py, tools/test-popular-containers)
convert at their boundary, where a bad name fails against the file the
user actually named. pin_guest_kernel now takes a catalogue or
pytest.param; every callsite already passed one.

Consumers that treated the fixture value as a path now read what they
mean: the GDB target names the vmlinux, snapshot artifact directories
key on the stable pytest_id, the MSR baseline lookup reads the parsed
version, and the fcmetrics guest_kernel dimension reads the object's
metric_id.

Microvm.kernel_file becomes a property derived from guest_kernel.
Allow an explicit boot_image override before basic_config so the
bzImage test retains direct-boot coverage without assigning to the
read-only property. Keep GDB symbols and kernel version reporting
tied to the logical kernel rather than the selected boot image.

Snapshot metadata records the logical vmlinux identity, not the
override: restoration resumes guest state without booting a kernel.
This preserves the existing metadata format and gives built and
restored VMs the same source of kernel identity.
A restored VM now emits the same guest_kernel dimension as a built one
("linux-6.1", previously the patch-level "linux-6.1.168"). A snapshot
naming an artifact the catalogue cannot parse now fails with that value
named rather than degrading the dimension silently; only the out-of-tree
nonci artifact flows can produce one.

Signed-off-by: James Curtis <jxcurtis@amazon.co.uk>
J
James Curtis committed
24a81985ca2f87e2702b2106efe40caa4918001f
Parent: 41eaf62