sbsv2/raptor/test/smoke_suite/configpath.py
author jjkang
Fri, 25 Jun 2010 19:56:45 +0800
changeset 604 b33dd54aaa52
parent 602 3145852acc89
permissions -rw-r--r--
add cpptoolsplat
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
602
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     1
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     2
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     3
# All rights reserved.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     4
# This component and the accompanying materials are made available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     6
# which accompanies this distribution, and is available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     8
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     9
# Initial Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    11
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    12
# Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    13
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    14
# Description: 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    15
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    16
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    17
import os
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    18
import os.path
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    19
from raptor_tests import SmokeTest
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    20
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    21
def run():
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    22
	t = SmokeTest()
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    23
	t.logfileOption = lambda :""
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    24
	t.id = "0074a"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    25
	t.name = "configpath"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    26
	t.description = """Test --configpath option for sbs. Specify two remote
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    27
			locations and use the variants in those folders along with ones in
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    28
			each of the default folders."""
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    29
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    30
	# the variants here affect compile steps so we only need to see a single compile
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    31
	# to know whether the variant is doing its thing or not.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    32
	t.addbuildtargets("smoke_suite/test_resources/simple/bld.inf",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    33
	                  ["test_/armv5/udeb/test.o"])
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    34
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    35
	result = SmokeTest.PASS
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    36
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    37
	# the extra config folders are
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    38
	# smoke_suite/test_resources/configpathtest/v{2,3}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    39
	sbshome = os.environ["SBS_HOME"].replace("\\","/")
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    40
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    41
	aFolder = sbshome + "/test/smoke_suite/test_resources/configpathtest/v2"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    42
	bFolder = sbshome + "/test/smoke_suite/test_resources/configpathtest/v3"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    43
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    44
	common = "sbs -b smoke_suite/test_resources/simple/bld.inf " + \
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    45
			"-c armv5.configpathtest1.configpathtest2.configpathtest3"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    46
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    47
	# run the command using the built-in default systemConfig
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    48
	t.command = common + " --configpath=" + aFolder + os.pathsep + bFolder + \
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    49
			" -f -"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    50
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    51
	t.mustmatch = [
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    52
		".*armv5_udeb.configpathtest1.configpathtest2.configpathtest3.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    53
		".*armv5_urel.configpathtest1.configpathtest2.configpathtest3.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    54
		".*Duplicate variant 'configpathtest3'.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    55
		".*-DTESTPASSED.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    56
		".*-DOSVARIANT95WASAPPLIED.*"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    57
		]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    58
	t.mustnotmatch = [
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    59
		".*sbs: error: Unknown variant.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    60
		".*-DTESTFAILED.*"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    61
		]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    62
	# Duplicate variant is Info not Warn
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    63
	t.warnings = 0
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    64
	t.run()
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    65
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    66
	if t.result == SmokeTest.FAIL:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    67
		result = SmokeTest.FAIL
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    68
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    69
	# run the command again using a systemConfig from $HOME/.sbs_init.xml
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    70
	# and the configpath as two separate options.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    71
	t.usebash = True
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    72
	homedir = sbshome + "/test/smoke_suite/test_resources/configpathtest/home"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    73
	t.command = "export HOME=" + homedir + "; " + common + \
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    74
			" --configpath=" + aFolder + " --configpath=" + bFolder + " -f -"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    75
	t.id = "0074b"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    76
	t.mustmatch = [
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    77
		".*armv5_udeb.configpathtest1.configpathtest2.configpathtest3.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    78
		".*armv5_urel.configpathtest1.configpathtest2.configpathtest3.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    79
		".*Duplicate variant 'configpathtest3'.*"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    80
		]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    81
	t.mustnotmatch = [
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    82
		".*sbs: error: Unknown variant.*"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    83
		]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    84
	t.run()
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    85
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    86
	if t.result == SmokeTest.FAIL:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    87
		result = SmokeTest.FAIL
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    88
	
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    89
	# Clean
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    90
	t.mustmatch = []
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    91
	t.targets = []
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    92
	t.id = "0074c"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    93
	t.name = "CLEAN"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    94
	t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c armv5 " + \
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    95
			"REALLYCLEAN"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    96
	t.run() # Does not contribute to results
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    97
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    98
	t.id = "74"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    99
	t.name = "configpath"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   100
	t.result = result
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   101
	t.print_result()
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   102
	return t
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   103