[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 1/2] TestSupport.pm: introduce host_get_free_memory
... which returns the size of free memory in MB. Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx> --- Osstest/TestSupport.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index b11eb17..17a43a4 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -79,6 +79,7 @@ BEGIN { remote_perl_script_open remote_perl_script_done host_reboot target_reboot target_reboot_hard target_choose_vg target_umount_lv target_await_down + host_get_free_memory target_ping_check_down target_ping_check_up target_kernkind_check target_kernkind_console_inittab @@ -915,6 +916,15 @@ sub host_reboot ($) { }); } +sub host_get_free_memory($$) { + my ($ho,$toolstack) = @_; + # The line is as followed: + # free_memory : XXXX + my $cmd = "$toolstack info | grep free_memory | awk {'print \$3'}"; + my $free_memory_mb = target_cmd_root($ho, $cmd, 10); + return $free_memory_mb; +} + sub target_reboot ($) { my ($ho) = @_; target_cmd_root($ho, "init 6"); -- 1.7.10.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |