kata-types: fix bug in kata-types several test cases

(1) As mis-use of cap.set causing previous Caps lost which
causing assert! failed, just replacing cap.set with cap.add.

(2) It will return error if there's no such name setting when
do update_config_by_annotation {
    ...
if config.runtime.name.is_empty() {
            return Err(io::Error::new(
                io::ErrorKind::InvalidData,
                "Runtime name is missing in the configuration",
            ));
        }
...
}

Fixes #9783

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
This commit is contained in:
Alex Lyn
2024-06-06 16:58:39 +08:00
parent b30d085271
commit 27685c91e5
3 changed files with 3 additions and 1 deletions

View File

@@ -127,7 +127,7 @@ mod tests {
assert!(cap.is_fs_sharing_supported());
// test set hybrid-vsock support
cap.set(CapabilityBits::HybridVsockSupport);
cap.add(CapabilityBits::HybridVsockSupport);
assert!(cap.is_hybrid_vsock_supported());
// test append capabilities
cap.add(CapabilityBits::GuestMemoryProbe);

View File

@@ -84,6 +84,7 @@ sandbox_bind_mounts=["/proc/self"]
vfio_mode="vfio"
experimental=["a", "b"]
enable_pprof = true
name="virt-container"
hypervisor_name = "qemu"
agent_name = "agent0"

View File

@@ -83,6 +83,7 @@ sandbox_bind_mounts=["/proc/self"]
vfio_mode="vfio"
experimental=["a", "b"]
enable_pprof = true
name="virt-container"
hypervisor_name = "qemu"
agent_name = "agent0"