[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH V3 1/2] TestSupport.pm: introduce host_get_free_memory



On Tue, Apr 15, 2014 at 04:43:41PM +0100, Ian Jackson wrote:
> Wei Liu writes ("[PATCH V3 1/2] TestSupport.pm: introduce 
> host_get_free_memory"):
> > ... which returns the size of free memory in MB.
> 
> Thanks.
> 
> ...
> > +sub host_get_free_memory($$) {
> > +    my ($ho,$toolstack) = @_;
> > +    # The line is as followed:
> > +    # free_memory       :   XXXX
> > +    my $info = target_cmd_output_root($ho, "$toolstack info", 10);
> > +    my @matched = $info =~ /^free_memory\s*:\s*(\d+)\s*$/m;
> > +    @matched or die "fail to get host free memory";
> 
> I have one tiny quibble: the error message (which helpfully includes
> a descriptive string unlike much of the rest of osstest) fails to
> include the contents of $info.  In general it is a good idea in
> osstest to include the complete text which has failed a regexp match.
> That greatly assists debugging.
> 
> (When you do that you need to make sure that the $info doesn't appear
> right at the end of the message, because if the message ends in a
> newline it suppresses perl's addition of the script line number.
> Adding " ?" or "'" or something is sufficient.)
> 
> Can you change that, and then send me a git pull request style email
> with a reference to a git branch ?  I'll then send it into the osstest
> push gate as soon as it's free.

Please pull from

  git://xenbits.xen.org/people/liuw/osstest.git get-host-free-memory

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.