From f89ada2de10af75a45229992d6bb78924f4a586a Mon Sep 17 00:00:00 2001 From: Chao Wu Date: Thu, 29 Sep 2022 10:38:23 +0800 Subject: [PATCH] dragonball: update ut for kernel config Since linux loader is updated in the Dragonball and the api for Cmdline has been changed ( as_str() changed to as_cstring() ), we need to update unit test in Dragonball. fixes: #5277 Signed-off-by: Chao Wu --- src/dragonball/src/vm/kernel_config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dragonball/src/vm/kernel_config.rs b/src/dragonball/src/vm/kernel_config.rs index 4798d8da3d..34516266af 100644 --- a/src/dragonball/src/vm/kernel_config.rs +++ b/src/dragonball/src/vm/kernel_config.rs @@ -66,7 +66,7 @@ mod tests { cmdline.insert_str("ro").unwrap(); let mut info = KernelConfigInfo::new(kernel.into_file(), Some(initrd.into_file()), cmdline); - assert_eq!(info.cmdline.as_str(), "ro"); + assert_eq!(info.cmdline.as_cstring().unwrap().as_bytes(), b"ro"); assert!(info.initrd_file_mut().is_some()); } }