-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KVM: move get_baremetal_dir in common library
Signed-off-by: Xudong Hao <[email protected]>
- Loading branch information
Showing
2 changed files
with
28 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/python3 | ||
|
||
# SPDX-License-Identifier: GPL-2.0-only | ||
# Copyright (c) 2024 Intel Corporation | ||
|
||
# Author: Xudong Hao <[email protected]> | ||
# | ||
# History: Sept. 2024 - Xudong Hao - creation | ||
|
||
import os | ||
from virttest import data_dir, asset | ||
|
||
|
||
def get_baremetal_dir(params): | ||
""" | ||
Get the test provider's BM absolute path. | ||
:param params: Dictionary with the test parameters | ||
""" | ||
provider = params["provider"] | ||
provider_info = asset.get_test_provider_info(provider) | ||
if provider_info["uri"].startswith("file://"): | ||
provider_dir = provider_info["uri"][7:] | ||
else: | ||
provider_dir = data_dir.get_test_provider_dir(provider) | ||
baremetal_dir = os.path.join(provider_dir, "BM") | ||
|
||
return baremetal_dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters