sbsv2/raptor/test/smoke_suite/toolcheck.py
author Richard Taylor <richard.i.taylor@nokia.com>
Wed, 14 Jul 2010 14:50:01 +0100
changeset 616 24e4ef208cca
parent 591 22486c9c7b15
child 674 37ee82a83d43
permissions -rw-r--r--
sbs version 2.14.2
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.name = "toolcheck"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    24
	t.description = """Test toolcheck works properly, with 3 options: on, off and forced. 
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    25
				TOOL1 3 4 and 5 are expected to fail and 2 to pass"""
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    26
	result = SmokeTest.PASS
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    27
	toolcheckDir = os.environ["SBS_HOME"].replace("\\","/") + "/test/smoke_suite/test_resources/toolcheck"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    28
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    29
	# toolcheck ON
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
		]
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    43
	t.errors = 4
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
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    49
	# toolcheck OFF
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    50
	t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -n --configpath=" + toolcheckDir + \
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    51
			" -c default.toolcheck --toolcheck=off"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    52
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    53
	t.id = "0092b"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    54
	t.mustmatch = []
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    55
	t.mustnotmatch = [
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    56
		".*TOOLCHECK1.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    57
		".*TOOLCHECK3.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    58
		".*TOOLCHECK4.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    59
		".*TOOLCHECK5.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    60
		".*TOOLCHECK6.*"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    61
		]
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    62
	t.errors = 0
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    63
	t.returncode = 0
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    64
	t.run()
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    65
	if t.result == SmokeTest.FAIL:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    66
		result = SmokeTest.FAIL
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    67
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    68
	# force toolcheck
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    69
	t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -n --configpath=" + toolcheckDir + \
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    70
			" -c default.toolcheck --toolcheck=forced"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    71
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    72
	t.id = "0092c"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    73
	t.mustmatch = [
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    74
		".*tool 'TOOLCHECK1' from config 'none' did not return version.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    75
		".*tool 'TOOLCHECK3' from config 'none' did not return version.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    76
		".*tool 'TOOLCHECK4' from config 'none' did not return version.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    77
		".*tool 'TOOLCHECK5' from config 'none' did not return version.*"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    78
		]
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    79
	t.mustnotmatch = [
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    80
		".*TOOLCHECK2.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    81
		".*TOOLCHECK6.*"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    82
	]
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    83
	t.errors = 4
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    84
	t.returncode = 1
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    85
	t.run()
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
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    90
	t.id = "0092"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    91
	t.result = result
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    92
	t.print_result()
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    93
	return t
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    94