xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>,
	andrew.cooper3@citrix.com
Subject: Re: [XTF PATCH v2] xtf-runner: support two modes for getting output
Date: Thu, 11 Aug 2016 18:51:00 +0100	[thread overview]
Message-ID: <20160811175100.GF20641@citrix.com> (raw)
In-Reply-To: <22444.45867.376224.437799@mariner.uk.xensource.com>

On Thu, Aug 11, 2016 at 06:17:31PM +0100, Ian Jackson wrote:
> Wei Liu writes ("Re: [XTF PATCH v2] xtf-runner: support two modes for getting output"):
> > On Thu, Aug 11, 2016 at 05:27:56PM +0100, Ian Jackson wrote:
> > > This is perverse.  Why not just open it O_CREAT|O_RDONLY ?  If Python
> > > can't do that then unconditionally opening it O_CREAT|O_RDWR would do.
> > 
> > The open call doesn't accept O_CREAT|O_RDONLY.
> 
> open("t", O_RDONLY|O_CREAT, 0666)       = 3
> 
> But maybe you mean Python's open doesn't.
> 
> > Andy my experiment showed that "rb" doesn't create the file.
> 
> Yes, it wouldn't.  If you want a fopen mode, "a+" may be of some use.
> 
> > > > +    logfile.seek(0, 2) # Go to end of file
> > > 
> > > Does Python not have SEEK_END somewhere ?
> > 
> > There is one, but that's in os module.
> > Python official document is using numeric values directly.
> 
> Seriously?  Fine, whatever.
> 
> > > > +    lines = logfile.readlines()
> > > > +    logfile.close()
> > > > +
> > > > +    if len(lines) == 0:
> > > > +        raise RunnerError("Test output empty")
> > > 
> > > I think you are racing with xenconsoled here.  How do you know that
> > > all the output has arrived ?
> > 
> > Unfortunately there doesn't seem to be a direct way to synchronise
> > between the two.
> > 
> > Maybe the best bet is to watch the tty node for it to go away?
> 
> Does xenconsole write the remaining output to the logfile before
> deleting the tty node from xenstore ?
> 

Unfortunately no, watching tty node in xenstore won't work.  In fact,
xenconsoled doesn't delete the tty node at all. It's libxl that deletes
it AFAICT.

It is sure that xenconsoled will close the tty before closing the file,
so stat'ing the actual device node won't work either.

I'm pretty out of idea here.

Wei.

> Ian.

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

  parent reply	other threads:[~2016-08-11 17:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-11 14:14 [XTF PATCH v2] xtf-runner: support two modes for getting output Wei Liu
2016-08-11 16:27 ` Ian Jackson
2016-08-11 16:50   ` Wei Liu
2016-08-11 17:17     ` Ian Jackson
2016-08-11 17:21       ` Andrew Cooper
2016-08-11 17:23         ` Wei Liu
2016-08-11 17:51       ` Wei Liu [this message]
2016-08-11 17:54         ` Andrew Cooper
2016-08-11 18:29           ` Ian Jackson
2016-08-12  9:23             ` Wei Liu
2016-08-12  9:51               ` Ian Jackson
2016-08-12 13:28                 ` Wei Liu
2016-08-15 10:58                 ` 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=20160811175100.GF20641@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).