Skip to content

Commit

Permalink
[metalos][vm] provide multi-kernel test API for default VM
Browse files Browse the repository at this point in the history
Summary:
The main reason I didn't want a multi-kernel API like antlir1 did is
to avoid bloated parameters. Most tests only ever customize one or two
parameters of the VM, but if we combine them together, it becomes a long list
of parameters with defaults that no one will use at the same time.

Thanks to comment on D49612785, I suddenly realized it shouldn't prevent me
from getting the default VM wrapped in a more restricted API. This also nicely
hide the target name I've been exposing to clients that can be satisfied with
the default VM.

Test Plan: CI should cover all tests. Double check that no test name changes.

Reviewed By: epilatow

Differential Revision: D49703243

fbshipit-source-id: a7067a769a0ccf93236ef1fe2b0ec4106cb35e00
  • Loading branch information
wujj123456 authored and facebook-github-bot committed Sep 28, 2023
1 parent e78acc7 commit 5b02356
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions antlir/antlir2/antlir2_vm/bzl/preconfigured.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,12 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

load("//metalos/vm/kernels:versions.bzl", "VM_KERNELS")

# Lists pre-configured VM targets that any test can refer to based on their needs.
# Refer to actual target for their detailed configuration.
PRECONFIGURED_VM = {
"disk-boot": "//antlir/antlir2/antlir2_vm:default-disk-boot",
"nondisk-boot": "//antlir/antlir2/antlir2_vm:default-nondisk-boot",
"nvme-disk-boot": "//antlir/antlir2/antlir2_vm:default-nvme-disk-boot",
} | {
# Must be kept in sync with metalos/vm/TARGETS
"kernel-{}-vm".format(uname): "//metalos/vm:kernel-{}-vm".format(uname)
for arch, uname in VM_KERNELS
if arch != "aarch64"
}

def get_vm(name: str = "nondisk-boot") -> str:
Expand Down

0 comments on commit 5b02356

Please sign in to comment.