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