[openstack-qa] console output handling in tempest

Christopher Yeoh cyeoh at au1.ibm.com
Sat Jan 26 09:18:43 UTC 2013


On Sat, 26 Jan 2013 18:54:03 +1030
Christopher Yeoh <cyeoh at au1.ibm.com> wrote:
> I'm actually sort of surprised that in a Linux env we are putting ^M
> on the wire on the console. I wonder where that comes from....

Yes it is kind of odd.

> Out of curiosity is "Truncated console log returned" in the logs 
> anywhere (n-cpu probably)?

No, I can't find that in any of the logs.

> It wouldn't hurt to track this one as a nova bug as well, and get it
> on -dev or into #openstack-nova to see what folks think about
> solutions there.

Ok. I'll do that.

Chris


> 
> 	-Sean
> 
> On Fri, 25 Jan 2013 16:51:11 +1030
> Christopher Yeoh <cyeoh at au1.ibm.com> wrote:
> 
> > Hi,
> > 
> > I've been debugging an error that pops up in the tempest test errors
> > occasionally:
> > 
> > ======================================================================
> > FAIL:
> > tempest.tests.compute.servers.test_console_output.ConsoleOutputTestXML.test_get_console_output
> > tags: worker-0
> > ----------------------------------------------------------------------
> > Traceback (most recent call last): File
> > "/opt/stack/tempest/tempest/tests/compute/servers/test_console_output.py",
> > line 60, in test_get_console_output self.wait_for(get_output) File
> > "/opt/stack/tempest/tempest/tests/compute/base.py", line 230, in
> > wait_for condition() File
> > "/opt/stack/tempest/tempest/tests/compute/servers/test_console_output.py",
> > line 58, in get_output self.assertEqual(lines, 10) AssertionError:
> > 12 != 10
> > 
> > I had originally thought it was a parallel testing error, but it
> > also turns up when the tests are run serially if the system is
> > slow. The test attempts to get get the last 10 lines of console
> > output. Depending on how long the instance takes to boot it can get
> > different output. It fails when the output looks like this:
> > 
> > ================START====================
> >  WARN: /etc/rc3.d/S99-cloud-userdata failed^M
> >   ____               ____  ____^M
> >  / __/ __ ____ ____ / __ \/ __/^M
> > / /__ / // __// __// /_/ /\ \ ^M
> > \___//_//_/  /_/   \____/___/ ^M
> >  http://launchpad.net/cirros^M
> > ^M
> > ^M^M
> > login as 'cirros' user. default password: 'cubswin:)'. use 'sudo'
> > for root.^M cirros login: 
> > ==================END================
> > 
> > I've replicated the carriage returns (^M) manually so email programs
> > don't eat them and make them invisible or convert them.
> > 
> > The JSON version of the test passes, but the XML version fails
> > because when lxml/etree is used to convert the output and it finds a
> > ^M without a corresponding line feed it converts it into an addition
> > LF. Thus there are 12 lines of console output rather than.
> > 
> > The easy way to fix this is just to strip the ^M characters in the
> > ConsoleOutputsClientXML tempest class. But I was wondering if there
> > is a better way to fix this by getting lxml/etree to be a bit
> > smarter?
> > 
> > Also I'm wondering if the nova api should just be stripping ^M
> > characters before sending the console output to the clients - it
> > does strip some already
> > 
> >         # XML output is not correctly escaped, so remove invalid
> > characters remove_re = re.compile('[\x00-\x08\x0B-\x0C\x0E-\x1F]')
> > 
> > Thoughts anyone?
> > 
> > Regards,
> > 
> > Chris




More information about the openstack-qa mailing list