mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-02 11:35:46 +00:00
tests: Reliably trigger a guest OOM
Rely on /proc/sysrq-trigger to forcibly trigger an OOM in the guest. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
857edc71a9
commit
561791ed22
@ -5062,11 +5062,9 @@ mod parallel {
|
|||||||
assert!(orig_balloon == 2147483648);
|
assert!(orig_balloon == 2147483648);
|
||||||
|
|
||||||
// Two steps to verify if the 'deflate_on_oom' parameter works.
|
// Two steps to verify if the 'deflate_on_oom' parameter works.
|
||||||
// 1st: run a command in guest to eat up memory heavily, which
|
// 1st: run a command to trigger an OOM in the guest.
|
||||||
// will consume much more memory than $(total_mem - balloon_size)
|
|
||||||
// to trigger an oom.
|
|
||||||
guest
|
guest
|
||||||
.ssh_command("stress --vm 25 --vm-keep --vm-bytes 1G --timeout 20")
|
.ssh_command("echo f | sudo tee /proc/sysrq-trigger")
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
// Give some time for the OOM to happen in the guest and be reported
|
// Give some time for the OOM to happen in the guest and be reported
|
||||||
|
Loading…
Reference in New Issue
Block a user