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

Re: [Xen-devel] [XTF PATCH 3/3] xtf-runner: support two modes for getting output



On Thu, Aug 11, 2016 at 10:56:23AM +0100, Andrew Cooper wrote:
> On 11/08/16 10:44, Wei Liu wrote:
> > On Thu, Aug 11, 2016 at 09:33:57AM +0100, Wei Liu wrote:
> >> On Wed, Aug 10, 2016 at 04:07:30PM +0100, Wei Liu wrote:
> >> [...]
> >>>  
> >>> +def run_test_logfile(opts, test):
> >>> +    """ Run a specific test via grepping log file"""
> >>> +
> >>> +    fn = opts.logfile_dir + (opts.logfile_pattern % test)
> >>> +    local_time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())
> >>> +
> >>> +    # Use time to generate unique stamps
> >>> +    start_stamp = "===== XTF TEST START %s =====" % local_time
> >>> +    end_stamp = "===== XTF TEST END %s =====" % local_time
> >>> +
> >>> +    print "Using %s" % fn
> >>> +
> >>> +    f = open(fn, "ab")
> >>> +    f.write(start_stamp + "\n")
> >>> +    f.close()
> >>> +
> >> I think it would make more sense for the micro VM itself to write
> >> stamps?
> > I want to pass a stamp generated by the runner to micro VMs, otherwise
> > runner wouldn't be able to tell which stamps are the right one.
> >
> > For PV guests it works because there is start_info->cmd_line.
> > Unfortunately I can't seem to find a place for putting in a command line
> > for hvm guest in the ABI. Newer version of Xen will have a boot ABI that
> > supports command line. This mode is mainly for old versions of Xen so I
> > don't see how it is possibly at this stage to uniformly support both old
> > and new versions of Xen.
> >
> > Maybe we need to live with running adding the stamp? Let me know if I
> > miss anything.
> 
> I haven't managed to come up with a reasonable way to get a command line
> into an HVM guest yet.  The best I managed was a xenstore key, but that
> gets in the way of doing xenstore ring testing in XTF, and still
> requires going behind the back of the toolstack.
> 
> Can't you just open the log file as read, seek to the end, run the test
> and read again from the same FD?  It would be rather more simple than
> marking the logs.
> 

The reason I want to put stamps (I think Ian's, too) is to make sure we
can still get the right bits out if same test case is run consequently,
multiple times. The only race-free way of doing it is to have the micro
vm itself prints out stamps. Using the runner to print stamps won't
solve it -- I only realised that after posting this series.

Given the current restrictions, I can live with the method you suggest,
too.

> Sadly, whatever method we use here is going to have to be clever enough
> to cope with the log files being rotated, and I can't think of a clever
> way of doing that ATM.
> 

Require logrorate to be disabled. :-)

Wei.

> ~Andrew

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

 


Rackspace

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