blob: 9971209ed6352c27a0c43c75b3ccb3676ca03e18 [file] [log] [blame]
Tim Windelschmidt82e6af72024-07-23 00:05:42 +00001load("@io_bazel_rules_go//go:def.bzl", "go_test")
Tim Windelschmidtc2290c22024-08-15 19:56:00 +02002load("//osbase/build:efi.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",
Mateusz Zalegaedffbb52022-01-11 15:27:22 +010010 "//metropolis/installer/test/testos:testos_bundle",
Tim Windelschmidt82e6af72024-07-23 00:05:42 +000011 "//third_party/edk2:OVMF_CODE.fd",
12 "//third_party/edk2:OVMF_VARS.fd",
Mateusz Zalega43e21072021-10-08 18:05:29 +020013 "@qemu//:qemu-x86_64-softmmu",
14 ],
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 = {
18 "xOvmfVarsPath": "$(rlocationpath //third_party/edk2:OVMF_VARS.fd )",
19 "xOvmfCodePath": "$(rlocationpath //third_party/edk2:OVMF_CODE.fd )",
20 "xQemuPath": "$(rlocationpath @qemu//:qemu-x86_64-softmmu )",
21 "xInstallerPath": "$(rlocationpath :kernel )",
22 "xBundlePath": "$(rlocationpath //metropolis/installer/test/testos:testos_bundle )",
23 },
Mateusz Zalega43e21072021-10-08 18:05:29 +020024 deps = [
Lorenz Brund13c1c62022-03-30 19:58:58 +020025 "//metropolis/cli/metroctl/core",
Lorenz Brund13c1c62022-03-30 19:58:58 +020026 "//metropolis/proto/api",
Tim Windelschmidtc2290c22024-08-15 19:56:00 +020027 "//osbase/build/mkimage/osimage",
Tim Windelschmidt9f21f532024-05-07 15:14:20 +020028 "//osbase/cmd",
Lorenz Brund13c1c62022-03-30 19:58:58 +020029 "@com_github_diskfs_go_diskfs//:go-diskfs",
30 "@com_github_diskfs_go_diskfs//disk",
31 "@com_github_diskfs_go_diskfs//partition/gpt",
Tim Windelschmidt2a1d1b22024-02-06 07:07:42 +010032 "@io_bazel_rules_go//go/runfiles:go_default_library",
Mateusz Zalega43e21072021-10-08 18:05:29 +020033 ],
34)
Mateusz Zalega098a8632021-12-08 15:51:24 +010035
36efi_unified_kernel_image(
37 name = "kernel",
Lorenz Brunc07d74e2023-08-03 17:41:23 +020038 cmdline = "quiet console=ttyS0",
Lorenz Brun304d42c2022-02-24 17:53:08 +010039 initrd = ["//metropolis/installer:initramfs"],
Mateusz Zalega098a8632021-12-08 15:51:24 +010040 kernel = "//third_party/linux",
41 visibility = ["//visibility:private"],
42)