m/test/launch/cluster: make runfile aware
Resolving paths from metropolis/... doesn't seem to work in some tests
(noticed while reworking E2E test package layout, but I'm not exactly
sure why it's only surfacing then...).
Change-Id: Idc30ba79b188f60f0502910ad065aefacdb2db83
Reviewed-on: https://review.monogon.dev/c/monogon/+/2992
Tested-by: Jenkins CI
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/metropolis/test/launch/cluster/cluster.go b/metropolis/test/launch/cluster/cluster.go
index eadd7ef..f1b4166 100644
--- a/metropolis/test/launch/cluster/cluster.go
+++ b/metropolis/test/launch/cluster/cluster.go
@@ -819,10 +819,18 @@
} else {
serialPort = newPrefixedStdio(99)
}
+ kernelPath, err := runfiles.Rlocation("_main/metropolis/test/ktest/vmlinux")
+ if err != nil {
+ launch.Fatal("Failed to resolved nanoswitch kernel: %v", err)
+ }
+ initramfsPath, err := runfiles.Rlocation("_main/metropolis/test/nanoswitch/initramfs.cpio.zst")
+ if err != nil {
+ launch.Fatal("Failed to resolved nanoswitch initramfs: %v", err)
+ }
if err := launch.RunMicroVM(ctxT, &launch.MicroVMOptions{
Name: "nanoswitch",
- KernelPath: "metropolis/test/ktest/vmlinux",
- InitramfsPath: "metropolis/test/nanoswitch/initramfs.cpio.zst",
+ KernelPath: kernelPath,
+ InitramfsPath: initramfsPath,
ExtraNetworkInterfaces: switchPorts,
PortMap: portMap,
GuestServiceMap: guestSvcMap,