MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / test_large_vm

Function test_large_vm

cloud-hypervisor/tests/integration.rs:185–220  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

183 #[test]
184 #[cfg(not(feature = "mshv"))]
185 fn test_large_vm() {
186 let disk_config = UbuntuDiskConfig::new(JAMMY_IMAGE_NAME.to_string());
187 let guest = Guest::new(Box::new(disk_config));
188 let mut cmd = GuestCommand::new(&guest);
189 cmd.args(["--cpus", "boot=48"])
190 .args(["--memory", "size=5120M"])
191 .args(["--kernel", direct_kernel_boot_path().to_str().unwrap()])
192 .args(["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
193 .args(["--serial", "tty"])
194 .args(["--console", "off"])
195 .capture_output()
196 .default_disks()
197 .default_net();
198
199 let mut child = cmd.spawn().unwrap();
200
201 guest.wait_vm_boot().unwrap();
202
203 let r = std::panic::catch_unwind(|| {
204 assert_eq!(guest.get_cpu_count().unwrap_or_default(), 48);
205 assert_eq!(
206 guest
207 .ssh_command("lscpu | grep \"On-line\" | cut -f 2 -d \":\" | sed \"s# *##\"")
208 .unwrap()
209 .trim(),
210 "0-47"
211 );
212
213 assert!(guest.get_total_memory().unwrap_or_default() > 5_000_000);
214 });
215
216 kill_child(&mut child);
217 let output = child.wait_with_output().unwrap();
218
219 handle_child_output(r, &output);
220 }
221
222 #[test]
223 #[cfg(not(feature = "mshv"))]

Callers

nothing calls this directly

Calls 10

newFunction · 0.85
direct_kernel_boot_pathFunction · 0.85
kill_childFunction · 0.85
handle_child_outputFunction · 0.85
default_netMethod · 0.80
default_disksMethod · 0.80
capture_outputMethod · 0.80
argsMethod · 0.80
spawnMethod · 0.80
wait_vm_bootMethod · 0.80

Tested by

no test coverage detected