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

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



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 ?

Ian.

_______________________________________________
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®.