rust_vmm_mshv: git clone mshv crate with a ref from a variable

Get variable "mshv_crate_ref". Default to "main" if not found in the
variables Dict.

Signed-off-by: Nuno Das Neves <nudasnev@microsoft.com>
This commit is contained in:
Nuno Das Neves 2024-05-15 16:33:21 +00:00 коммит произвёл LiliDeng
Родитель 934cf16993
Коммит f018201252
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -49,8 +49,9 @@ class RustVmmTestSuite(TestSuite):
variables: Dict[str, Any], variables: Dict[str, Any],
) -> None: ) -> None:
repo = "https://github.com/rust-vmm/mshv.git" repo = "https://github.com/rust-vmm/mshv.git"
ref = variables.get("mshv_crate_ref", "main")
git = node.tools[Git] git = node.tools[Git]
repo_root = git.clone(repo, node.get_working_path()) repo_root = git.clone(repo, node.get_working_path(), ref=ref)
mshv_bindings_path = variables.get("mshv_bindings_path", "") mshv_bindings_path = variables.get("mshv_bindings_path", "")
if mshv_bindings_path: if mshv_bindings_path:
git_bindings_path = repo_root / "mshv-bindings" / "src" git_bindings_path = repo_root / "mshv-bindings" / "src"