591
|
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.description = """Test toolcheck works properly, with 3 options: on, off and forced.
|
|
24 |
TOOL1 3 4 and 5 are expected to fail and 2 to pass"""
|
|
25 |
result = SmokeTest.PASS
|
|
26 |
toolcheckDir = os.environ["SBS_HOME"].replace("\\","/") + "/test/smoke_suite/test_resources/toolcheck"
|
|
27 |
|
|
28 |
# toolcheck ON
|
674
|
29 |
t.name = "toolcheck_on"
|
591
|
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 |
]
|
674
|
43 |
t.errors = 7
|
591
|
44 |
t.returncode = 1
|
|
45 |
t.run()
|
|
46 |
if t.result == SmokeTest.FAIL:
|
|
47 |
result = SmokeTest.FAIL
|
|
48 |
|
674
|
49 |
t.name = "toolcheck_off"
|
591
|
50 |
# toolcheck OFF
|
|
51 |
t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -n --configpath=" + toolcheckDir + \
|
|
52 |
" -c default.toolcheck --toolcheck=off"
|
|
53 |
|
|
54 |
t.id = "0092b"
|
|
55 |
t.mustmatch = []
|
|
56 |
t.mustnotmatch = [
|
|
57 |
".*TOOLCHECK1.*",
|
|
58 |
".*TOOLCHECK3.*",
|
|
59 |
".*TOOLCHECK4.*",
|
|
60 |
".*TOOLCHECK5.*",
|
|
61 |
".*TOOLCHECK6.*"
|
|
62 |
]
|
|
63 |
t.errors = 0
|
|
64 |
t.returncode = 0
|
|
65 |
t.run()
|
|
66 |
if t.result == SmokeTest.FAIL:
|
|
67 |
result = SmokeTest.FAIL
|
|
68 |
|
|
69 |
# force toolcheck
|
674
|
70 |
t.name = "toolcheck_force"
|
591
|
71 |
t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -n --configpath=" + toolcheckDir + \
|
|
72 |
" -c default.toolcheck --toolcheck=forced"
|
|
73 |
|
|
74 |
t.id = "0092c"
|
|
75 |
t.mustmatch = [
|
|
76 |
".*tool 'TOOLCHECK1' from config 'none' did not return version.*",
|
|
77 |
".*tool 'TOOLCHECK3' from config 'none' did not return version.*",
|
|
78 |
".*tool 'TOOLCHECK4' from config 'none' did not return version.*",
|
|
79 |
".*tool 'TOOLCHECK5' from config 'none' did not return version.*"
|
|
80 |
]
|
|
81 |
t.mustnotmatch = [
|
|
82 |
".*TOOLCHECK2.*",
|
|
83 |
".*TOOLCHECK6.*"
|
|
84 |
]
|
674
|
85 |
t.errors = 16
|
591
|
86 |
t.returncode = 1
|
|
87 |
t.run()
|
|
88 |
if t.result == SmokeTest.FAIL:
|
|
89 |
result = SmokeTest.FAIL
|
|
90 |
|
|
91 |
|
|
92 |
t.id = "0092"
|
|
93 |
t.result = result
|
|
94 |
t.print_result()
|
|
95 |
return t
|
|
96 |
|