Пример #1
0
def run():
    t = SmokeTest()
    t.id = "71"
    t.name = "metadep"
    t.description = """Tests metadata dependency generation.  Changes 
			to bld.infs and mmps can be detected."""
    t.usebash = True
    t.command = """export SBSLOGFILE SBSMAKEFILE; bash smoke_suite/test_resources/metadep.sh 2>&1"""

    t.targets = []

    t.mustmatch_multiline = [
        """.*Step 1 .*no warnings or errors.*
sbs: build log in.*
\+ sleep 1.*
.*make -rf .*epoc32/build/metadata_all.mk.*
.*make.*epoc32/build/metadata_all.mk. is up to date.*
Step 2 .*
.*RE-RUNNING SBS with previous parameters.*
Step 3 .*
.*RE-RUNNING SBS with previous parameters.*
.*RE-RUNNING SBS with previous parameters.*"""
    ]
    t.mustnotmatch_multiline = [
        """RE-RUNNING SBS with previous parameters.*
RE-RUNNING SBS with previous parameters.*
RE-RUNNING SBS with previous parameters.*
RE-RUNNING SBS with previous parameters.*"""
    ]
    t.run()
    return t
Пример #2
0
def run():
	t = SmokeTest()
	t.id = "71"
	t.name = "metadep"
	t.description =  """Tests metadata dependency generation.  Changes 
			to bld.infs and mmps can be detected."""
	t.usebash = True
	t.command = """export SBSLOGFILE SBSMAKEFILE; bash smoke_suite/test_resources/metadep.sh 2>&1"""
			
	t.targets = [
		]

	t.mustmatch_multiline = [
""".*Step 1 .*no warnings or errors.*
sbs: build log in.*
\+ sleep 1.*
.*make -rf .*epoc32/build/metadata_all.mk.*
.*make.*epoc32/build/metadata_all.mk. is up to date.*
Step 2 .*
.*RE-RUNNING SBS with previous parameters.*
Step 3 .*
.*RE-RUNNING SBS with previous parameters.*
.*RE-RUNNING SBS with previous parameters.*"""
	]
	t.mustnotmatch_multiline = [
"""RE-RUNNING SBS with previous parameters.*
RE-RUNNING SBS with previous parameters.*
RE-RUNNING SBS with previous parameters.*
RE-RUNNING SBS with previous parameters.*"""
	]
	t.run()
	return t
Пример #3
0
def run():
	t = SmokeTest()
	t.usebash = True
	
	t.description = "Test that dependency crunching for resource dependency files produces expected output" 

	t.id = "43562999"
	t.name = "depcrunch"
	t.command = "python $SBS_HOME/bin/depcrunch.py --extensions mbg,rsg --assume EPOCROOT < smoke_suite/test_resources/depcrunch/dep2.rpp.d"
	t.mustmatch_multiline = [
		r"EPOCROOT/epoc32/build/resource/c_98665870f0168225/dependentresource_/dependentresource_dependentresource_sc.rpp: \\\n"+
		r" EPOCROOT/testresource1.mbg \\\n"+
		r" EPOCROOT/testresource2.rsg \\\n"+
		r" EPOCROOT/testresource3.rsg \\\n"+
		r" EPOCROOT/testresource4.mbg \\\n"+
		r" EPOCROOT/testresource5.rsg \\\n"+
		r" EPOCROOT/testresource6.mbg \\\n"+
		r" EPOCROOT/testresource7.rsg \\\n"+
		r" EPOCROOT/testresource8.mbg \\\n"+
		r" EPOCROOT/testresource9.rsg \n"
		]
	t.run()


	t.print_result()
	
	return t
Пример #4
0
def run():
    t = SmokeTest()
    t.usebash = True

    t.description = "Test that dependency crunching for resource dependency files produces expected output"

    t.id = "43562999"
    t.name = "depcrunch"
    t.command = "python $SBS_HOME/bin/depcrunch.py --extensions mbg,rsg --assume EPOCROOT < smoke_suite/test_resources/depcrunch/dep2.rpp.d"
    t.mustmatch_multiline = [
        r"EPOCROOT/epoc32/build/resource/c_98665870f0168225/dependentresource_/dependentresource_dependentresource_sc.rpp: \\\n"
        + r" EPOCROOT/testresource1.mbg \\\n" +
        r" EPOCROOT/testresource2.rsg \\\n" +
        r" EPOCROOT/testresource3.rsg \\\n" +
        r" EPOCROOT/testresource4.mbg \\\n" +
        r" EPOCROOT/testresource5.rsg \\\n" +
        r" EPOCROOT/testresource6.mbg \\\n" +
        r" EPOCROOT/testresource7.rsg \\\n" +
        r" EPOCROOT/testresource8.mbg \\\n" + r" EPOCROOT/testresource9.rsg \n"
    ]
    t.run()

    t.print_result()

    return t
Пример #5
0
def run():
	t = SmokeTest()
	t.id = "43563"
	t.name = "annofile2log"
	t.description = "test workaround for log corruption from a make engine whose name begins with 'e'"
	
	t.usebash = True
	t.errors = 0
	t.returncode = 0
	t.exceptions = 0
	t.command = 'cd smoke_suite/test_resources/annofile2log && ( FROMANNO="`mktemp`" ; bzip2 -dc scrubbed_ncp_dfs_resource.anno.bz2 | python testanno2log.py  >"${FROMANNO}" && FROMSTDOUT="`mktemp`"; bzip2 -dc scrubbed_ncp_dfs_resource.stdout.bz2 > "${FROMSTDOUT}" && diff -wB "${FROMANNO}" "${FROMSTDOUT}"; RET=$? ; rm "${FROMANNO}" "${FROMSTDOUT}"; exit $RET )'
	
	t.mustmatch_multiline = [ 
		"^ *.?"
                ]


	t.run()

	t.print_result()
	return t
Пример #6
0
def run():
	t = SmokeTest()
	t.description =  """talon_test: two part test
	1) Test talon's -c option
	2) Test talon with a script file that has some blank lines and a single non-blank command line
	"""

	# Don't need these as we are not invoking Raptor
	t.logfileOption = lambda : ""
	t.makefileOption = lambda : ""

	# Set up variables for talon
	bindir = ReplaceEnvs("$(SBS_HOME)/$(HOSTPLATFORM_DIR)/bin")
	bash = bindir + "/bash"
	talon = bindir + "/talon"

	# Adjust if on Windows - three "tries" for Bash on Windows.
	# 1 Default try
	if "win" in sys.platform.lower():
		bash = ReplaceEnvs("$(SBS_HOME)/win32/cygwin/bin/bash.exe")
		talon = ReplaceEnvs("$(SBS_HOME)/$(HOSTPLATFORM_DIR)/bin/talon.exe")
	
	# 2 Bash from a Cygwin
	if os.environ.has_key("SBS_CYGWIN"):
		bash = ReplaceEnvs("$(SBS_CYGWIN)/bin/bash.exe")
	
	# 3 Bash from an env. var.
	if os.environ.has_key("SBS_SHELL"):
		bash = os.environ["SBS_SHELL"]
	
	# Talon's command line
	commandline="\"|name=commandlinetest;COMPONENT_META=commandline/group/bld.inf;PROJECT_META=commandline.mmp;|echo Command line invocation output\""
	
	# Talon's "shell script"
	scriptfile=ReplaceEnvs("$(SBS_HOME)/test/smoke_suite/test_resources/talon_test/script")
	
	# Environment variables needed by talon - TALON_SHELL must be bash; the other two can be arbitrary.
	os.environ["TALON_SHELL"]=bash
	os.environ["TALON_BUILDID"]=str(t.id)
	os.environ["TALON_RECIPEATTRIBUTES"]="component=talontest"

	# First part of test - command line
	t.name = "talon_test command line"
	t.id = "100a"
	t.command = "%s -c %s" % (talon, commandline)
	t.targets = []
	t.mustmatch_multiline = ["<recipe component=talontest>.*<!\[CDATA\[.*\+ echo Command line invocation output" + 
			".*\]\]><time start='\d+\.\d+' elapsed='\d+\.\d+' />" + 
			".*<status exit='ok' attempt='1' />.*</recipe>"]

	t.run()
	if t.result == SmokeTest.FAIL:
		result = SmokeTest.FAIL

	# Second part of test - script file
	t.name = "talon_test script file"
	t.id = "100b"
	t.command = "%s %s" % (talon, scriptfile)
	t.targets = []
	t.mustmatch_multiline = ["<recipe component=talontest>.*<!\[CDATA\[.*\+ echo Script file output" + 
			".*\]\]><time start='\d+\.\d+' elapsed='\d+\.\d+' />" + 
			".*<status exit='ok' attempt='1' />.*</recipe>"]

	t.run()
	if t.result == SmokeTest.FAIL:
		result = SmokeTest.FAIL
	

	# Print final result
	t.name = "talon_test"
	t.id = "100"
	t.print_result()

	# Delete the added environment variables
	del os.environ["TALON_SHELL"]
	del os.environ["TALON_BUILDID"]
	del os.environ["TALON_RECIPEATTRIBUTES"]

	return t
Пример #7
0
def run():
	t = SmokeTest()
	t.usebash = True
	result = SmokeTest.PASS

	abs_epocroot = os.path.abspath(os.environ["EPOCROOT"])
	cwd = os.getcwd().replace("\\","/")

	relative_epocroot = os.path.relpath(abs_epocroot.replace("\\","/"),cwd)

	
	description = """This tests the whatcomp filter.  As a byproduct it uses (and thus smoke-tests) sbs_filter.py"""
	command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c %s -m ${SBSMAKEFILE} -f ${SBSLOGFILE} what  && " + \
		  "EPOCROOT='%s' sbs_filter --filters FilterWhatComp < ${SBSLOGFILE} &&" % relative_epocroot + \
		  "EPOCROOT='%s' sbs_filter --filters FilterWhatComp < ${SBSLOGFILE}"  % abs_epocroot
	targets = [
		]	
	buildtargets = [
		]

	mustmatch_pre = [
		"-- abld -w",
		".*Chdir .*/smoke_suite/test_resources/simple.*",
		relative_epocroot + "/epoc32/release/armv5/urel/test.exe",
		relative_epocroot + "/epoc32/release/armv5/urel/test.exe.map",
		abs_epocroot + "/epoc32/release/armv5/urel/test.exe",
		abs_epocroot + "/epoc32/release/armv5/urel/test.exe.map",
	] 
	
	if os.sep == '\\':
		mustmatch = [ i.replace("\\", "\\\\" ).replace("/","\\\\") for i in mustmatch_pre ]
	else:
		mustmatch = mustmatch_pre

	mustnotmatch = [
	"error: no (CHECK|WHAT) information found"
	]
	warnings = 0
	
	t.id = "0106a"
	t.name = "whatcomp_basic"
	t.description = description
	t.command = command % "arm.v5.urel.gcce4_4_1"
	t.targets = targets
	t.mustmatch = mustmatch
	t.mustnotmatch = mustnotmatch
	t.warnings = warnings
	t.run()

	t.id = "0106b"
	t.name = "whatcomp_component_repeated"
	t.description = """
			It is possible for what information about a component to not be grouped
			(i.e. for multiple whatlogs tags relating to a single component to be 
			interspersed with whatlog tags relating to other components).  
			Raptor must cope with that and must *not* report missing files under 
			the wrong component name."""
	t.command = "sbs_filter --filters=FilterWhatComp < smoke_suite/test_resources/logexamples/what_component_repeated.log"
	t.targets = []
	t.mustmatch = [] 
	t.mustmatch_multiline = [ 
		"Chdir y:.ext.app.emailwizard.*epoc32.data.something.*"+
		"Chdir y:.sf.mw.gsprofilesrv.ftuwizardmodel.*epoc32.release.armv5.something.*"+
		"Chdir y:.ext.app.emailwizard.*epoc32.data.something_else"
		]

	t.mustnotmatch = []
	t.warnings = 0
	t.run()

	t.id = "0106"
	t.name = "whatcomp"
	t.print_result()
	return t
Пример #8
0
def run():
    t = SmokeTest()
    t.usebash = True
    result = SmokeTest.PASS

    abs_epocroot = os.path.abspath(os.environ["EPOCROOT"])
    cwd = os.getcwd().replace("\\", "/")

    relative_epocroot = os.path.relpath(abs_epocroot.replace("\\", "/"), cwd)

    description = """This tests the whatcomp filter.  As a byproduct it uses (and thus smoke-tests) sbs_filter.py"""
    command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c {0} -m ${{SBSMAKEFILE}} -f ${{SBSLOGFILE}} what  && " + \
       "EPOCROOT='{0}' sbs_filter --filters FilterWhatComp < ${{{{SBSLOGFILE}}}} &&".format(relative_epocroot) + \
       "EPOCROOT='{0}' sbs_filter --filters FilterWhatComp < ${{{{SBSLOGFILE}}}}".format(abs_epocroot)
    targets = []
    buildtargets = []

    mustmatch_pre = [
        "-- abld -w",
        ".*Chdir .*/smoke_suite/test_resources/simple.*",
        relative_epocroot + "/epoc32/release/armv5/urel/test.exe",
        relative_epocroot + "/epoc32/release/armv5/urel/test.exe.map",
        abs_epocroot + "/epoc32/release/armv5/urel/test.exe",
        abs_epocroot + "/epoc32/release/armv5/urel/test.exe.map",
    ]

    if os.sep == '\\':
        mustmatch = [
            i.replace("\\", "\\\\").replace("/", "\\\\") for i in mustmatch_pre
        ]
    else:
        mustmatch = mustmatch_pre

    mustnotmatch = ["error: no (CHECK|WHAT) information found"]
    warnings = 0

    t.name = "whatcomp_basic"
    t.description = description
    t.command = command.format("arm.v5.urel.gcce4_4_1")
    t.targets = targets
    t.mustmatch = mustmatch
    t.mustnotmatch = mustnotmatch
    t.warnings = warnings
    t.run()

    t.name = "whatcomp_component_repeated"
    t.description = """
			It is possible for what information about a component to not be grouped
			(i.e. for multiple whatlogs tags relating to a single component to be 
			interspersed with whatlog tags relating to other components).  
			Raptor must cope with that and must *not* report missing files under 
			the wrong component name."""
    t.command = "sbs_filter --filters=FilterWhatComp < smoke_suite/test_resources/logexamples/what_component_repeated.log"
    t.targets = []
    t.mustmatch = []
    t.mustmatch_multiline = [
        "Chdir y:.ext.app.emailwizard.*epoc32.data.something.*" +
        "Chdir y:.sf.mw.gsprofilesrv.ftuwizardmodel.*epoc32.release.armv5.something.*"
        + "Chdir y:.ext.app.emailwizard.*epoc32.data.something_else"
    ]

    t.mustnotmatch = []
    t.warnings = 0
    t.run()

    t.name = "whatcomp"
    t.print_result()
    return t
Пример #9
0
def run():
	t = SmokeTest()
	t.description =  """talon_test: three part test
	1) Test talon's -c option
	2) Test talon with a script file that has some blank lines and a single non-blank command line
	3) Test talon with a command that outputs control characters
	"""

	# Don't need these as we are not invoking Raptor
	t.logfileOption = lambda : ""
	t.makefileOption = lambda : ""

	# Set up variables for talon
	bindir = ReplaceEnvs("$(SBS_HOME)/$(HOSTPLATFORM_DIR)/bin")
	bash = "/bin/bash"
	talon = bindir + "/talon"

	# Adjust if on Windows - three "tries" for Bash on Windows.
	# 1 Default try
	if "win" in sys.platform.lower():
		bash = ReplaceEnvs("$(SBS_HOME)/win32/cygwin/bin/bash.exe")
		talon = ReplaceEnvs("$(SBS_HOME)/$(HOSTPLATFORM_DIR)/bin/talon.exe")
	
	# 2 Bash from a Cygwin
	if "SBS_CYGWIN" in os.environ:
		bash = ReplaceEnvs("$(SBS_CYGWIN)/bin/bash.exe")
	
	# 3 Bash from an env. var.
	if "SBS_SHELL" in os.environ:
		bash = os.environ["SBS_SHELL"]
	
	# Talon's command line
	commandline="\"|name=commandlinetest;COMPONENT_META=commandline/group/bld.inf;PROJECT_META=commandline.mmp;|echo Command line invocation output\""
	
	# Talon's "shell script"
	scriptfile=ReplaceEnvs("$(SBS_HOME)/test/smoke_suite/test_resources/talon_test/script")
	
	# Environment variables needed by talon - TALON_SHELL must be bash; the other two can be arbitrary.
	os.environ["TALON_SHELL"]=bash
	os.environ["TALON_BUILDID"]="{0}_{1}".format("talon_buildid", os.getpid())
	os.environ["TALON_RECIPEATTRIBUTES"]="component=talontest"

	# First part of test - command line
	t.name = "talon_test_command_line"
	t.command = "{0} -c {1}".format(talon, commandline)
	t.targets = []
	t.mustmatch_multiline = ["<recipe component=talontest>.*<!\[CDATA\[.*\+ echo Command line invocation output" + 
			".*\]\]><time start='\d+\.\d+' elapsed='\d+\.\d+' />" + 
			".*<status exit='ok' attempt='1' />.*</recipe>"]

	t.run()

	# Second part of test - script file
	t.name = "talon_test_script_file"
	t.command = "{0} {1}".format(talon, scriptfile)
	t.targets = []
	t.mustmatch_multiline = ["<recipe component=talontest>.*<!\[CDATA\[.*\+ echo Script file output" + 
			".*\]\]><time start='\d+\.\d+' elapsed='\d+\.\d+' />" + 
			".*<status exit='ok' attempt='1' />.*</recipe>"]

	t.run()
	
	# a script which outputs control characters
	scriptfile=ReplaceEnvs("$(SBS_HOME)/test/smoke_suite/test_resources/talon_test/ctrl.py")

	t.name = "talon_test_control_chars"
	t.command = '{0} -c "|name=ctrl;|python {1}"'.format(talon, scriptfile)
	t.targets = []
	# the script writes "AAA", then each char from 0 to 255, then "ZZZ".
	# 0-31 and 127-255 decimal are not allowed in the output, except for 9, 10 and 13.
	# check that the non-printable codes are missing and also that CTRL-I, CTRL-J and
	# CTRL-M are not converted.
	t.mustnotmatch = [ '[\000-\010\013\014\016-\037\177-\377]', '&#x0[9ad];' ]
	# do not try and match CTRL-J and CTRL-M explicitly because line ending
	# conversions between talon and here will mess things up.
	t.mustmatch_multiline = ["<recipe component=talontest>.*<!\[CDATA\[.*" +
							 "AAA&#x00;&#x01;&#x02;&#x03;&#x04;&#x05;&#x06;&#x07;&#x08;\011.*&#x0b;&#x0c;.*&#x0e;&#x0f;&#x10;&#x11;&#x12;&#x13;&#x14;&#x15;&#x16;&#x17;&#x18;&#x19;&#x1a;&#x1b;&#x1c;&#x1d;&#x1e;&#x1f; !\"#\$%&'()\*\+,-\./0123456789:;<=>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]\^_`abcdefghijklmnopqrstuvwxyz{|}~&#x7f;&#x80;&#x81;&#x82;&#x83;&#x84;&#x85;&#x86;&#x87;&#x88;&#x89;&#x8a;&#x8b;&#x8c;&#x8d;&#x8e;&#x8f;&#x90;&#x91;&#x92;&#x93;&#x94;&#x95;&#x96;&#x97;&#x98;&#x99;&#x9a;&#x9b;&#x9c;&#x9d;&#x9e;&#x9f;&#xa0;&#xa1;&#xa2;&#xa3;&#xa4;&#xa5;&#xa6;&#xa7;&#xa8;&#xa9;&#xaa;&#xab;&#xac;&#xad;&#xae;&#xaf;&#xb0;&#xb1;&#xb2;&#xb3;&#xb4;&#xb5;&#xb6;&#xb7;&#xb8;&#xb9;&#xba;&#xbb;&#xbc;&#xbd;&#xbe;&#xbf;&#xc0;&#xc1;&#xc2;&#xc3;&#xc4;&#xc5;&#xc6;&#xc7;&#xc8;&#xc9;&#xca;&#xcb;&#xcc;&#xcd;&#xce;&#xcf;&#xd0;&#xd1;&#xd2;&#xd3;&#xd4;&#xd5;&#xd6;&#xd7;&#xd8;&#xd9;&#xda;&#xdb;&#xdc;&#xdd;&#xde;&#xdf;&#xe0;&#xe1;&#xe2;&#xe3;&#xe4;&#xe5;&#xe6;&#xe7;&#xe8;&#xe9;&#xea;&#xeb;&#xec;&#xed;&#xee;&#xef;&#xf0;&#xf1;&#xf2;&#xf3;&#xf4;&#xf5;&#xf6;&#xf7;&#xf8;&#xf9;&#xfa;&#xfb;&#xfc;&#xfd;&#xfe;&#xff;ZZZ" +
							 ".*\]\].*</recipe>"]
	
	t.run()
	
	# Print final result
	t.name = "talon_test"
	t.print_result()

	# Delete the added environment variables
	del os.environ["TALON_SHELL"]
	del os.environ["TALON_BUILDID"]
	del os.environ["TALON_RECIPEATTRIBUTES"]

	return t