On Tue, Feb 9, 2010 at 1:03 AM, Amos Kong <[email protected]> wrote:
>
> If mem_chk_cmd returns "2 GB", then re.findall("([0-9][0-9][0-9]+)", mem_str)
> will return a NULL list. mem_size will be the default 0.

In this case, we need to refine the code to catch the memory suffix
and then normalize it, otherwise our total mem_size will also be
incorrect (2 GB would give 2 MB of memory, which is incorrect).

Could you please re-create your patch taking this into account?

Cheers,

> Signed-off-by: Amos Kong <[email protected]>
> ---
>  client/tests/kvm/kvm_vm.py |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
> index 8985f25..7a43505 100755
> --- a/client/tests/kvm/kvm_vm.py
> +++ b/client/tests/kvm/kvm_vm.py
> @@ -939,7 +939,7 @@ class VM:
>             s, mem_str = session.get_command_status_output(cmd)
>             if s != 0:
>                 return None
> -            mem = re.findall("([0-9][0-9][0-9]+)", mem_str)
> +            mem = re.findall("([0-9]+)", mem_str)
>             mem_size = 0
>             for m in mem:
>                 mem_size += int(m)
> --
> 1.5.5.6
>
> _______________________________________________
> Autotest mailing list
> [email protected]
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
>



-- 
Lucas
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to