blob: 7390cf665683d32a19457cafa2c334ed21a4450b [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 ],
Mateusz Zalegaedffbb52022-01-11 15:27:22 +010014 importpath = "source.monogon.dev/metropolis/installer/test",
Mateusz Zalega43e21072021-10-08 18:05:29 +020015 visibility = ["//visibility:private"],
Tim Windelschmidt82e6af72024-07-23 00:05:42 +000016 x_defs = {
17 "xOvmfVarsPath": "$(rlocationpath //third_party/edk2:OVMF_VARS.fd )",
18 "xOvmfCodePath": "$(rlocationpath //third_party/edk2:OVMF_CODE.fd )",
Tim Windelschmidt82e6af72024-07-23 00:05:42 +000019 "xInstallerPath": "$(rlocationpath :kernel )",
20 "xBundlePath": "$(rlocationpath //metropolis/installer/test/testos:testos_bundle )",
21 },
Mateusz Zalega43e21072021-10-08 18:05:29 +020022 deps = [
Lorenz Brund13c1c62022-03-30 19:58:58 +020023 "//metropolis/cli/metroctl/core",
Lorenz Brund13c1c62022-03-30 19:58:58 +020024 "//metropolis/proto/api",
Tim Windelschmidtc2290c22024-08-15 19:56:00 +020025 "//osbase/build/mkimage/osimage",
Tim Windelschmidt9f21f532024-05-07 15:14:20 +020026 "//osbase/cmd",
Lorenz Brund13c1c62022-03-30 19:58:58 +020027 "@com_github_diskfs_go_diskfs//:go-diskfs",
28 "@com_github_diskfs_go_diskfs//disk",
29 "@com_github_diskfs_go_diskfs//partition/gpt",
Tim Windelschmidt156248b2025-01-10 00:27:45 +010030 "@io_bazel_rules_go//go/runfiles",
Mateusz Zalega43e21072021-10-08 18:05:29 +020031 ],
32)
Mateusz Zalega098a8632021-12-08 15:51:24 +010033
34efi_unified_kernel_image(
35 name = "kernel",
Lorenz Brunc07d74e2023-08-03 17:41:23 +020036 cmdline = "quiet console=ttyS0",
Lorenz Brun304d42c2022-02-24 17:53:08 +010037 initrd = ["//metropolis/installer:initramfs"],
Mateusz Zalega098a8632021-12-08 15:51:24 +010038 kernel = "//third_party/linux",
39 visibility = ["//visibility:private"],
40)