sbsv2/raptor/test/smoke_suite/toolcheck.py
author Ross Qin <ross.qin@nokia.com>
Tue, 30 Nov 2010 14:05:41 +0800
changeset 713 7b7f0409fc00
parent 674 37ee82a83d43
permissions -rw-r--r--
merge
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
from raptor_tests import SmokeTest
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    19
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    20
def run():
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    21
	t = SmokeTest()
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    22
	t.id = "0092a"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    23
	t.description = """Test toolcheck works properly, with 3 options: on, off and forced. 
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    24
				TOOL1 3 4 and 5 are expected to fail and 2 to pass"""
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    25
	result = SmokeTest.PASS
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    26
	toolcheckDir = os.environ["SBS_HOME"].replace("\\","/") + "/test/smoke_suite/test_resources/toolcheck"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    27
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    28
	# toolcheck ON
674
37ee82a83d43 sbs version 2.15.3
Jon Chatten
parents: 591
diff changeset
    29
	t.name = "toolcheck_on"
591
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    30
	t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -n --configpath=" + toolcheckDir + \
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    31
			" -c default.toolcheck --toolcheck=on"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    32
	
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    33
	t.mustmatch = [
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    34
		".*tool 'TOOLCHECK1' from config 'none' did not return version.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    35
		".*tool 'TOOLCHECK3' from config 'none' did not return version.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    36
		".*tool 'TOOLCHECK4' from config 'none' did not return version.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    37
		".*tool 'TOOLCHECK5' from config 'none' did not return version.*"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    38
		]
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    39
	t.mustnotmatch = [
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    40
		".*TOOLCHECK2.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    41
		".*TOOLCHECK6.*"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    42
		]
674
37ee82a83d43 sbs version 2.15.3
Jon Chatten
parents: 591
diff changeset
    43
	t.errors = 7
591
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    44
	t.returncode = 1
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    45
	t.run()
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    46
	if t.result == SmokeTest.FAIL:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    47
		result = SmokeTest.FAIL
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    48
674
37ee82a83d43 sbs version 2.15.3
Jon Chatten
parents: 591
diff changeset
    49
	t.name = "toolcheck_off"
591
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    50
	# toolcheck OFF
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    51
	t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -n --configpath=" + toolcheckDir + \
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    52
			" -c default.toolcheck --toolcheck=off"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    53
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    54
	t.id = "0092b"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    55
	t.mustmatch = []
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    56
	t.mustnotmatch = [
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    57
		".*TOOLCHECK1.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    58
		".*TOOLCHECK3.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    59
		".*TOOLCHECK4.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    60
		".*TOOLCHECK5.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    61
		".*TOOLCHECK6.*"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    62
		]
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    63
	t.errors = 0
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    64
	t.returncode = 0
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    65
	t.run()
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
	# force toolcheck
674
37ee82a83d43 sbs version 2.15.3
Jon Chatten
parents: 591
diff changeset
    70
	t.name = "toolcheck_force"
591
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    71
	t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -n --configpath=" + toolcheckDir + \
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    72
			" -c default.toolcheck --toolcheck=forced"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    73
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    74
	t.id = "0092c"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    75
	t.mustmatch = [
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    76
		".*tool 'TOOLCHECK1' from config 'none' did not return version.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    77
		".*tool 'TOOLCHECK3' from config 'none' did not return version.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    78
		".*tool 'TOOLCHECK4' from config 'none' did not return version.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    79
		".*tool 'TOOLCHECK5' from config 'none' did not return version.*"
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
		".*TOOLCHECK2.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    83
		".*TOOLCHECK6.*"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    84
	]
674
37ee82a83d43 sbs version 2.15.3
Jon Chatten
parents: 591
diff changeset
    85
	t.errors = 16
591
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    86
	t.returncode = 1
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    87
	t.run()
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    88
	if t.result == SmokeTest.FAIL:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    89
		result = SmokeTest.FAIL
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    90
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    91
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    92
	t.id = "0092"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    93
	t.result = result
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    94
	t.print_result()
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    95
	return t
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    96