sbsv2/raptor/test/smoke_suite/toolcheck.py
changeset 591 22486c9c7b15
child 674 37ee82a83d43
equal deleted inserted replaced
590:360bd6b35136 591:22486c9c7b15
       
     1 #
       
     2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 # All rights reserved.
       
     4 # This component and the accompanying materials are made available
       
     5 # under the terms of the License "Eclipse Public License v1.0"
       
     6 # which accompanies this distribution, and is available
       
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 #
       
     9 # Initial Contributors:
       
    10 # Nokia Corporation - initial contribution.
       
    11 #
       
    12 # Contributors:
       
    13 #
       
    14 # Description: 
       
    15 #
       
    16 
       
    17 import os
       
    18 from raptor_tests import SmokeTest
       
    19 
       
    20 def run():
       
    21 	t = SmokeTest()
       
    22 	t.id = "0092a"
       
    23 	t.name = "toolcheck"
       
    24 	t.description = """Test toolcheck works properly, with 3 options: on, off and forced. 
       
    25 				TOOL1 3 4 and 5 are expected to fail and 2 to pass"""
       
    26 	result = SmokeTest.PASS
       
    27 	toolcheckDir = os.environ["SBS_HOME"].replace("\\","/") + "/test/smoke_suite/test_resources/toolcheck"
       
    28 
       
    29 	# toolcheck ON
       
    30 	t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -n --configpath=" + toolcheckDir + \
       
    31 			" -c default.toolcheck --toolcheck=on"
       
    32 	
       
    33 	t.mustmatch = [
       
    34 		".*tool 'TOOLCHECK1' from config 'none' did not return version.*",
       
    35 		".*tool 'TOOLCHECK3' from config 'none' did not return version.*",
       
    36 		".*tool 'TOOLCHECK4' from config 'none' did not return version.*",
       
    37 		".*tool 'TOOLCHECK5' from config 'none' did not return version.*"
       
    38 		]
       
    39 	t.mustnotmatch = [
       
    40 		".*TOOLCHECK2.*",
       
    41 		".*TOOLCHECK6.*"
       
    42 		]
       
    43 	t.errors = 4
       
    44 	t.returncode = 1
       
    45 	t.run()
       
    46 	if t.result == SmokeTest.FAIL:
       
    47 		result = SmokeTest.FAIL
       
    48 
       
    49 	# toolcheck OFF
       
    50 	t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -n --configpath=" + toolcheckDir + \
       
    51 			" -c default.toolcheck --toolcheck=off"
       
    52 
       
    53 	t.id = "0092b"
       
    54 	t.mustmatch = []
       
    55 	t.mustnotmatch = [
       
    56 		".*TOOLCHECK1.*",
       
    57 		".*TOOLCHECK3.*",
       
    58 		".*TOOLCHECK4.*",
       
    59 		".*TOOLCHECK5.*",
       
    60 		".*TOOLCHECK6.*"
       
    61 		]
       
    62 	t.errors = 0
       
    63 	t.returncode = 0
       
    64 	t.run()
       
    65 	if t.result == SmokeTest.FAIL:
       
    66 		result = SmokeTest.FAIL
       
    67 
       
    68 	# force toolcheck
       
    69 	t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -n --configpath=" + toolcheckDir + \
       
    70 			" -c default.toolcheck --toolcheck=forced"
       
    71 
       
    72 	t.id = "0092c"
       
    73 	t.mustmatch = [
       
    74 		".*tool 'TOOLCHECK1' from config 'none' did not return version.*",
       
    75 		".*tool 'TOOLCHECK3' from config 'none' did not return version.*",
       
    76 		".*tool 'TOOLCHECK4' from config 'none' did not return version.*",
       
    77 		".*tool 'TOOLCHECK5' from config 'none' did not return version.*"
       
    78 		]
       
    79 	t.mustnotmatch = [
       
    80 		".*TOOLCHECK2.*",
       
    81 		".*TOOLCHECK6.*"
       
    82 	]
       
    83 	t.errors = 4
       
    84 	t.returncode = 1
       
    85 	t.run()
       
    86 	if t.result == SmokeTest.FAIL:
       
    87 		result = SmokeTest.FAIL
       
    88 
       
    89 
       
    90 	t.id = "0092"
       
    91 	t.result = result
       
    92 	t.print_result()
       
    93 	return t
       
    94