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

2016-08-11 Thread Andrew Cooper
On 11/08/16 12:19, Wei Liu wrote: > On Thu, Aug 11, 2016 at 12:08:03PM +0100, Ian Jackson wrote: >> Andrew Cooper writes ("Re: [XTF PATCH 3/3] xtf-runner: support two modes for >> getting output"): >>> Can't you just open the log file as read, seek to the end, run the test >>> and read again from

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

2016-08-11 Thread Wei Liu
On Thu, Aug 11, 2016 at 12:08:03PM +0100, Ian Jackson wrote: > Andrew Cooper writes ("Re: [XTF PATCH 3/3] xtf-runner: support two modes for > getting output"): > > 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

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

2016-08-11 Thread Ian Jackson
Andrew Cooper writes ("Re: [XTF PATCH 3/3] xtf-runner: support two modes for getting output"): > 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. This is a good suggestion, I think.

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

2016-08-11 Thread Wei Liu
On Thu, Aug 11, 2016 at 11:49:29AM +0100, Ian Jackson wrote: > Wei Liu writes ("[XTF PATCH 3/3] xtf-runner: support two modes for getting > output"): > > We need two modes for getting output: > ... > > +# Use time to generate unique stamps > > +start_stamp = "= XTF TEST START %s

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

2016-08-11 Thread Ian Jackson
Wei Liu writes ("[XTF PATCH 3/3] xtf-runner: support two modes for getting output"): > We need two modes for getting output: ... > +# Use time to generate unique stamps > +start_stamp = "= XTF TEST START %s =" % local_time > +end_stamp = "= XTF TEST END %s =" %

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

2016-08-11 Thread Wei Liu
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): > >>> +"""

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

2016-08-11 Thread Andrew Cooper
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 =

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

2016-08-11 Thread Wei Liu
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) >

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

2016-08-11 Thread Wei Liu
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())

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

2016-08-10 Thread Wei Liu
We need two modes for getting output: 1. Use console directly with newer (>=4.8) Xen 2. Use log files for older Xen This patch implements both. The default behaviour is to choose mode automatically based on Xen version. User can also explicitly specify which mode to use. Signed-off-by: Wei Liu