mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
tests: validate CPU count in the test infra
Instead of validating number of CPU in the test case itself, moving the checking of the CPU count to Guest struct with a new function as The Guest already has the Default CPU number. Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
60c6242bde
commit
45a5c7a04e
@@ -1385,6 +1385,14 @@ impl Guest {
|
||||
if self.nested { "" } else { ",nested=off" }
|
||||
)
|
||||
}
|
||||
|
||||
pub fn validate_cpu_count(&self, expected_cpu_count: Option<u32>) {
|
||||
let cpu = match expected_cpu_count {
|
||||
Some(count) => count,
|
||||
None => self.num_cpu,
|
||||
};
|
||||
assert_eq!(self.get_cpu_count().unwrap_or_default(), cpu);
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
|
||||
Reference in New Issue
Block a user