blob: ff8cb0049e45ac5ffb0be75ad76a5bc33e3ec775 [file] [log] [blame]
Tim Windelschmidt82e6af72024-07-23 00:05:42 +00001load("@io_bazel_rules_go//go:def.bzl", "go_test")
Tim Windelschmidtbed76d92025-02-18 03:04:14 +01002load("//osbase/build/mkpayload:def.bzl", "efi_unified_kernel_image")
Mateusz Zalega43e21072021-10-08 18:05:29 +02003
4go_test(
Tim Windelschmidt82e6af72024-07-23 00:05:42 +00005 name = "test_test",
Mateusz Zalega898125b2022-04-25 13:38:35 +02006 size = "medium",
Tim Windelschmidt82e6af72024-07-23 00:05:42 +00007 srcs = ["run_test.go"],
Mateusz Zalega43e21072021-10-08 18:05:29 +02008 data = [
Mateusz Zalega098a8632021-12-08 15:51:24 +01009 ":kernel",
Tim Windelschmidt8f1efe92025-04-01 01:28:43 +020010 "//build/toolchain/toolchain-bundle:qemu-kvm",
Jan Schär5fdca562025-04-14 11:33:29 +000011 "//metropolis/installer/test/testos:testos_image",
Tim Windelschmidt12240f92025-04-28 14:59:33 +020012 "//third_party/edk2:CODE.fd",
13 "//third_party/edk2:VARS.fd",
Mateusz Zalega43e21072021-10-08 18:05:29 +020014 ],
Mateusz Zalegaedffbb52022-01-11 15:27:22 +010015 importpath = "source.monogon.dev/metropolis/installer/test",
Mateusz Zalega43e21072021-10-08 18:05:29 +020016 visibility = ["//visibility:private"],
Tim Windelschmidt82e6af72024-07-23 00:05:42 +000017 x_defs = {
Tim Windelschmidt12240f92025-04-28 14:59:33 +020018 "xOvmfVarsPath": "$(rlocationpath //third_party/edk2:VARS.fd )",
19 "xOvmfCodePath": "$(rlocationpath //third_party/edk2:CODE.fd )",
Tim Windelschmidt82e6af72024-07-23 00:05:42 +000020 "xInstallerPath": "$(rlocationpath :kernel )",
Jan Schär5fdca562025-04-14 11:33:29 +000021 "xImagePath": "$(rlocationpath //metropolis/installer/test/testos:testos_image )",
Tim Windelschmidt8f1efe92025-04-01 01:28:43 +020022 "xQEMUPath": "$(rlocationpath //build/toolchain/toolchain-bundle:qemu-kvm )",
Tim Windelschmidt82e6af72024-07-23 00:05:42 +000023 },
Mateusz Zalega43e21072021-10-08 18:05:29 +020024 deps = [
Lorenz Brund13c1c62022-03-30 19:58:58 +020025 "//metropolis/cli/metroctl/core",
Jan Schäre19d2792025-06-23 12:37:58 +000026 "//metropolis/installer/install",
Lorenz Brund13c1c62022-03-30 19:58:58 +020027 "//metropolis/proto/api",
Jan Schär5fdca562025-04-14 11:33:29 +000028 "//osbase/oci",
Jan Schär4b888262025-05-13 09:12:03 +000029 "//osbase/oci/osimage",
Jan Schärc1b6df42025-03-20 08:52:18 +000030 "//osbase/structfs",
Jan Schär341cd422025-09-04 10:33:21 +020031 "//osbase/test/cmd",
Lorenz Brund13c1c62022-03-30 19:58:58 +020032 "@com_github_diskfs_go_diskfs//:go-diskfs",
33 "@com_github_diskfs_go_diskfs//disk",
34 "@com_github_diskfs_go_diskfs//partition/gpt",
Tim Windelschmidt156248b2025-01-10 00:27:45 +010035 "@io_bazel_rules_go//go/runfiles",
Mateusz Zalega43e21072021-10-08 18:05:29 +020036 ],
37)
Mateusz Zalega098a8632021-12-08 15:51:24 +010038
39efi_unified_kernel_image(
40 name = "kernel",
Lorenz Brunc07d74e2023-08-03 17:41:23 +020041 cmdline = "quiet console=ttyS0",
Lorenz Brun304d42c2022-02-24 17:53:08 +010042 initrd = ["//metropolis/installer:initramfs"],
Mateusz Zalega098a8632021-12-08 15:51:24 +010043 kernel = "//third_party/linux",
44 visibility = ["//visibility:private"],
45)