# HG changeset patch # User timothy.murphy@nokia.com # Date 1268757650 0 # Node ID 0ff20a0b1aa9ecc33c3e1da036d29be3cc8b9cda # Parent e17a12b3db40f6558f47df1c431b2627dc25d8df add a test for annofile2log workaround for log corruption diff -r e17a12b3db40 -r 0ff20a0b1aa9 sbsv2/raptor/test/smoke_suite/annofile2log.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/annofile2log.py Tue Mar 16 16:40:50 2010 +0000 @@ -0,0 +1,43 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of the License "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +from raptor_tests import SmokeTest + +def run(): + t = SmokeTest() + t.id = "43563" + t.name = "annofile2log_canned" + t.description = "test workaround for log corruption from a make engine whose name begins with 'e'" + + t.usebash = True + t.errors = 0 + t.returncode = 1 + t.exceptions = 0 + t.command = "cd smoke_suite/test_resources/annofile2log && ( diff -wB <(python testanno2log.py <(bzip2 -dc scrubbed_ncp_dfs_resource.anno.bz2)) <(bzip2 -dc scrubbed_ncp_dfs_resource.stdout.bz2))" + + t.mustmatch_multiline = [ + ".*1a2.*" + + "Starting build: 488235.*" + + "14009c12884.*" + + "---.*" + + "Finished build: 488235 Duration: 1:15 \(m:s\) Cluster availability: 100%.*" + ] + + + t.run() + + t.print_result() + return t diff -r e17a12b3db40 -r 0ff20a0b1aa9 sbsv2/raptor/test/smoke_suite/test_resources/annofile2log/scrubbed_ncp_dfs_resource.anno.bz2 Binary file sbsv2/raptor/test/smoke_suite/test_resources/annofile2log/scrubbed_ncp_dfs_resource.anno.bz2 has changed diff -r e17a12b3db40 -r 0ff20a0b1aa9 sbsv2/raptor/test/smoke_suite/test_resources/annofile2log/scrubbed_ncp_dfs_resource.stdout.bz2 Binary file sbsv2/raptor/test/smoke_suite/test_resources/annofile2log/scrubbed_ncp_dfs_resource.stdout.bz2 has changed diff -r e17a12b3db40 -r 0ff20a0b1aa9 sbsv2/raptor/test/smoke_suite/test_resources/annofile2log/testanno2log.py --- a/sbsv2/raptor/test/smoke_suite/test_resources/annofile2log/testanno2log.py Tue Mar 16 11:49:03 2010 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/annofile2log/testanno2log.py Tue Mar 16 16:40:50 2010 +0000 @@ -1,64 +1,38 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of the License "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# Component description file +# + + import sys import os sys.path.append(os.path.join(os.environ['SBS_HOME'],"python")) -from xml.sax.saxutils import escape -from xml.sax.saxutils import unescape -def XMLEscapeLog(stream): - inRecipe = False - - for line in stream: - if line.startswith(""): - inOutput = True - yield unescape(line[8:]) - # This is make output so don't unescape it. - elif line.startswith(''): - line = line[19:] - inOutput = True - yield unescape(line) - else: - end_output = line.find("") - - if end_output != -1: - line = line[:end_output] - inOutput = False - - yield unescape(line) - - af.close() +from raptor_make import XMLEscapeLog +from raptor_make import AnnoFileParseOutput retcode=0 annofile = sys.argv[1] -#print "File = ", annofile sys.stdout.write("\n") try: for l in XMLEscapeLog(AnnoFileParseOutput(annofile)): - sys.stdout.write(l+"\n") + sys.stdout.write(l) except Exception,e: sys.stderr.write("error: " + str(e) + "\n")