mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-07-01 14:38:33 +00:00
test: add VFIO device cold-plug tests to nightly tests
This commit enhances the VFIO-AP testing suite by adding support for cold-plug testing in runtime-rs and updating configuration files to support the new cold_plug_vfio parameter. Changes include: 1. Configuration updates: - Added cold_plug_vfio parameter to configuration-qemu-runtime-rs.toml.in with default value "no-port" (disabled) - Added cold_plug_vfio parameter to configuration-qemu-se-runtime-rs.toml.in with value "root-port" (enabled for Secure Execution) 2. Test enhancements: - Updated setup_hotplug() to explicitly set cold_plug_vfio to "no-port" for runtime-rs to ensure hotplug-only mode - Implemented setup_coldplug() for runtime-rs (previously unsupported) to enable cold-plug testing with "root-port" configuration - Added new test case (Test 4) for runtime-rs VFIO-AP cold-plug functionality using zcrypttest validation This enables comprehensive testing of both hot-plug and cold-plug VFIO device assignment scenarios for s390x CEX devices in runtime-rs. Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
This commit is contained in:
@@ -381,6 +381,12 @@ disable_image_nvdimm = false
|
||||
# Default false
|
||||
hotplug_vfio_on_root_bus = false
|
||||
|
||||
# Enable cold-plugging of VFIO devices to a PCIe port type.
|
||||
# Accepted values: "no-port" (default, disabled), "root-port".
|
||||
# When set to "root-port", devices discovered via CDI / Pod Resources
|
||||
# are cold-plugged before VM boot.
|
||||
cold_plug_vfio = "no-port"
|
||||
|
||||
# Before hot plugging a PCIe device, you need to add a pcie_root_port device.
|
||||
# Use this parameter when using some large PCI bar devices, such as Nvidia GPU
|
||||
# The value means the number of pcie_root_port
|
||||
|
||||
@@ -365,6 +365,12 @@ disable_image_nvdimm = true
|
||||
# Default false
|
||||
hotplug_vfio_on_root_bus = false
|
||||
|
||||
# Enable cold-plugging of VFIO devices to a PCIe port type.
|
||||
# Accepted values: "no-port" (disabled), "root-port".
|
||||
# When set to "root-port", devices discovered via CDI / Pod Resources
|
||||
# are cold-plugged before VM boot.
|
||||
cold_plug_vfio = "root-port"
|
||||
|
||||
# Before hot plugging a PCIe device, you need to add a pcie_root_port device.
|
||||
# Use this parameter when using some large PCI bar devices, such as Nvidia GPU
|
||||
# The value means the number of pcie_root_port
|
||||
|
||||
@@ -63,6 +63,7 @@ setup_hotplug() {
|
||||
show_config_file
|
||||
elif [[ "${runtime}" == "runtime-rs" ]]; then
|
||||
setup_config_file "vfio_mode" "replace" "vfio" "runtime-rs"
|
||||
setup_config_file "cold_plug_vfio" "replace" "no-port" "runtime-rs"
|
||||
show_config_file "runtime-rs"
|
||||
else
|
||||
echo "Invalid runtime: ${runtime}" >&2
|
||||
@@ -79,8 +80,9 @@ setup_coldplug() {
|
||||
setup_config_file "cold_plug_vfio" "replace" "bridge-port"
|
||||
show_config_file
|
||||
elif [[ "${runtime}" == "runtime-rs" ]]; then
|
||||
echo "Coldplug is not supported for runtime-rs" >&2
|
||||
exit 1
|
||||
setup_config_file "vfio_mode" "replace" "vfio" "runtime-rs"
|
||||
setup_config_file "cold_plug_vfio" "replace" "root-port" "runtime-rs"
|
||||
show_config_file "runtime-rs"
|
||||
else
|
||||
echo "Invalid runtime: ${runtime}" >&2
|
||||
exit 1
|
||||
@@ -296,6 +298,9 @@ run_tests() {
|
||||
|
||||
setup_hotplug "runtime-rs"
|
||||
run_test "3" "runtime-rs" "Test can assign a CEX device inside the guest via VFIO-AP Hotplug" "&& zcrypttest -a -v"
|
||||
|
||||
setup_coldplug "runtime-rs"
|
||||
run_test "4" "runtime-rs" "Test can assign a CEX device inside the guest via VFIO-AP Coldplug" "&& zcrypttest -a -v"
|
||||
}
|
||||
|
||||
main() {
|
||||
|
||||
Reference in New Issue
Block a user