All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [XTF PATCH 3/3] xtf-runner: support two modes for getting output
Date: Thu, 11 Aug 2016 11:05:11 +0100	[thread overview]
Message-ID: <20160811100511.GF20641@citrix.com> (raw)
In-Reply-To: <160347d1-355b-2e52-7bb7-2a709f53ebb3@citrix.com>

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@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-08-11 10:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-10 15:07 [XTF PATCH 0/3] Support getting output from either console or log file Wei Liu
2016-08-10 15:07 ` [XTF PATCH 1/3] xtf-runner: introduce get_xen_version Wei Liu
2016-08-11 10:10   ` Andrew Cooper
2016-08-11 10:12     ` Wei Liu
2016-08-11 10:14       ` Andrew Cooper
2016-08-10 15:07 ` [XTF PATCH 2/3] xtf-runner: options for different modes to get output Wei Liu
2016-08-10 15:07 ` [XTF PATCH 3/3] xtf-runner: support two modes for getting output Wei Liu
2016-08-11  8:33   ` Wei Liu
2016-08-11  9:44     ` Wei Liu
2016-08-11  9:56       ` Andrew Cooper
2016-08-11 10:05         ` Wei Liu [this message]
2016-08-11 11:08         ` Ian Jackson
2016-08-11 11:19           ` Wei Liu
2016-08-11 11:41             ` Andrew Cooper
2016-08-11 10:49   ` Ian Jackson
2016-08-11 11:03     ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160811100511.GF20641@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.