kata-proc-manager: fix unit tests

Change-Id: I7d48e9e31bbc2aae9f899e43bfc3f33331738a42
GitOrigin-RevId: 524e01589e114a541de292e41fa34021e5279703
This commit is contained in:
Sam Leffler 2021-09-19 16:45:48 -07:00
parent 0db63cfb4f
commit 0633ce6761

View File

@ -201,16 +201,13 @@ mod tests {
} }
} }
impl ProcessManagerInterface for FakeManager { impl ProcessManagerInterface for FakeManager {
fn install(&mut self, pkg_buffer: *const u8, pkg_buffer_size: u32) -> Result<Bundle, pme> { fn install(&mut self, pkg_buffer: *const u8, pkg_buffer_size: u32) -> Result<String, pme> {
let str = (pkg_buffer as usize).to_string(); let str = (pkg_buffer as usize).to_string();
if self.bundles.contains_key(&str) { if self.bundles.contains_key(&str) {
return Err(ProcessManagerError::BundleFound); return Err(ProcessManagerError::BundleFound);
} }
assert!(self.bundles.insert(str, pkg_buffer_size).is_none()); assert!(self.bundles.insert(str, pkg_buffer_size).is_none());
Ok(Bundle { Ok((pkg_buffer as usize).to_string())
app_id: (pkg_buffer as usize).to_string(),
data: [0u8; 64],
})
} }
fn uninstall(&mut self, bundle_id: &str) -> Result<(), pme> { fn uninstall(&mut self, bundle_id: &str) -> Result<(), pme> {
match self.bundles.remove(bundle_id) { match self.bundles.remove(bundle_id) {