sbsv2/raptor/test/smoke_suite/toolcheck.py
author jjkang
Fri, 25 Jun 2010 19:56:45 +0800
changeset 604 b33dd54aaa52
parent 602 3145852acc89
child 674 37ee82a83d43
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
from raptor_tests import SmokeTest
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    19
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    20
def run():
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    21
	t = SmokeTest()
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    22
	t.id = "0092a"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    23
	t.name = "toolcheck"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    24
	t.description = """Test toolcheck works properly, with 3 options: on, off and forced. 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    25
				TOOL1 3 4 and 5 are expected to fail and 2 to pass"""
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    26
	result = SmokeTest.PASS
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    27
	toolcheckDir = os.environ["SBS_HOME"].replace("\\","/") + "/test/smoke_suite/test_resources/toolcheck"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    28
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    29
	# toolcheck ON
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    30
	t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -n --configpath=" + toolcheckDir + \
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    31
			" -c default.toolcheck --toolcheck=on"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    32
	
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    33
	t.mustmatch = [
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    34
		".*tool 'TOOLCHECK1' from config 'none' did not return version.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    35
		".*tool 'TOOLCHECK3' from config 'none' did not return version.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    36
		".*tool 'TOOLCHECK4' from config 'none' did not return version.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    37
		".*tool 'TOOLCHECK5' from config 'none' did not return version.*"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    38
		]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    39
	t.mustnotmatch = [
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    40
		".*TOOLCHECK2.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    41
		".*TOOLCHECK6.*"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    42
		]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    43
	t.errors = 4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    44
	t.returncode = 1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    45
	t.run()
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    46
	if t.result == SmokeTest.FAIL:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    47
		result = SmokeTest.FAIL
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    48
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    49
	# toolcheck OFF
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    50
	t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -n --configpath=" + toolcheckDir + \
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    51
			" -c default.toolcheck --toolcheck=off"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    52
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    53
	t.id = "0092b"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    54
	t.mustmatch = []
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    55
	t.mustnotmatch = [
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    56
		".*TOOLCHECK1.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    57
		".*TOOLCHECK3.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    58
		".*TOOLCHECK4.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    59
		".*TOOLCHECK5.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    60
		".*TOOLCHECK6.*"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    61
		]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    62
	t.errors = 0
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    63
	t.returncode = 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
	if t.result == SmokeTest.FAIL:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    66
		result = SmokeTest.FAIL
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    67
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    68
	# force toolcheck
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    69
	t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -n --configpath=" + toolcheckDir + \
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    70
			" -c default.toolcheck --toolcheck=forced"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    71
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    72
	t.id = "0092c"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    73
	t.mustmatch = [
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    74
		".*tool 'TOOLCHECK1' from config 'none' did not return version.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    75
		".*tool 'TOOLCHECK3' from config 'none' did not return version.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    76
		".*tool 'TOOLCHECK4' from config 'none' did not return version.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    77
		".*tool 'TOOLCHECK5' from config 'none' did not return version.*"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    78
		]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    79
	t.mustnotmatch = [
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    80
		".*TOOLCHECK2.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    81
		".*TOOLCHECK6.*"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    82
	]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    83
	t.errors = 4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    84
	t.returncode = 1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    85
	t.run()
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
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    90
	t.id = "0092"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    91
	t.result = result
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    92
	t.print_result()
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    93
	return t
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    94