|
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 LOAD_SUITE tuiscriptadaptors |
|
18 |
|
19 //! @file |
|
20 //! @SYMTestCaseID API-SEC-LaunchingThreadTerminated-0001 |
|
21 //! @SYMTestCaseDesc Abort installation and uninstallation by killing launching thread, make sure swi recovers |
|
22 //! @SYMDEF DEF086668 |
|
23 //! @SYMTestPriority Medium |
|
24 //! @SYMTestActions Use short testexecute step timeouts for various package install/uninstall operations to abort |
|
25 //! prematurely,test that SWI shuts down and can be used again. |
|
26 //! @SYMTestExpectedResults Recovery after failure is as expected. Note that no panics are expected; if these occur during |
|
27 //! the emulator test run they will be caught by the panicscan perl script. |
|
28 |
|
29 START_TESTCASE API-SEC-LaunchingThreadTerminated-0001 |
|
30 |
|
31 // Abort install in progress after delays from 4 down to 1 second into the install, making sure that |
|
32 // swis shuts down after each step. |
|
33 |
|
34 RUN_TEST_STEP_RESULT -39 4 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini cancelpackage |
|
35 RUN_TEST_STEP 50 tuiscriptadaptors SwisNotRunning |
|
36 |
|
37 RUN_TEST_STEP_RESULT -39 3 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini cancelpackage |
|
38 RUN_TEST_STEP 50 tuiscriptadaptors SwisNotRunning |
|
39 |
|
40 RUN_TEST_STEP_RESULT -39 2 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini cancelpackage |
|
41 RUN_TEST_STEP 50 tuiscriptadaptors SwisNotRunning |
|
42 |
|
43 RUN_TEST_STEP_RESULT -39 1 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini cancelpackage |
|
44 RUN_TEST_STEP 50 tuiscriptadaptors SwisNotRunning |
|
45 |
|
46 // Make sure install can actually complete now (and set up for further tests) |
|
47 RUN_TEST_STEP 400 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini cancelpackage |
|
48 |
|
49 // Abort install which runs exe to completion |
|
50 RUN_TEST_STEP_RESULT -39 3 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\testrun.ini exeRIRW |
|
51 |
|
52 // Make sure swis shuts down. It shouldn't happen until the synchronous file run completes |
|
53 run_program killrunningprocess 89334567 2000000 |
|
54 RUN_TEST_STEP 50 tuiscriptadaptors SwisNotRunning |
|
55 // Check exe is no longer running. |
|
56 RUN_TEST_STEP_RESULT 106 tuiscriptadaptors FindRunningExe z:\tswi\tuiscriptadaptors\scripts\testrun.ini consoleappRunning |
|
57 |
|
58 RUN_TEST_STEP_RESULT -1 10 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\testrun.ini u_exeRIRW |
|
59 |
|
60 // Abort uninstall in progress - note package is left installed for next test case to save the long install being repeated. |
|
61 RUN_TEST_STEP_RESULT -39 1 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini u_cancelpackage_delay |
|
62 |
|
63 // Make sure SWIS shuts down |
|
64 RUN_TEST_STEP 50 tuiscriptadaptors SwisNotRunning |
|
65 |
|
66 // Install package with run-on-uninstall exe and abort uninstall |
|
67 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini testrun_exe |
|
68 RUN_TEST_STEP_RESULT -39 3 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini u_testrun_exe |
|
69 // Exe should still be running |
|
70 RUN_TEST_STEP 50 tuiscriptadaptors FindRunningExe z:\tswi\tuiscriptadaptors\scripts\testrun.ini consoleappRunning |
|
71 |
|
72 // Make sure SWIS shuts down and that subsequent completed uninstall works. |
|
73 run_program killrunningprocess 89334567 2000000 |
|
74 RUN_TEST_STEP 50 tuiscriptadaptors SwisNotRunning |
|
75 // Exe should have stopped running |
|
76 RUN_TEST_STEP_RESULT 106 tuiscriptadaptors FindRunningExe z:\tswi\tuiscriptadaptors\scripts\testrun.ini consoleappRunning |
|
77 |
|
78 RUN_TEST_STEP 50 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini u_testrun_exe |
|
79 |
|
80 END_TESTCASE API-SEC-LaunchingThreadTerminated-0001 |
|
81 |
|
82 |
|
83 //! @SYMTestCaseID API-SEC-SwisTerminated-0001 |
|
84 //! @SYMTestCaseDesc Abort installation and uninstallation by killing installserver, make sure swi recovers and can be used again |
|
85 //! @SYMDEF DEF086668 |
|
86 //! @SYMTestPriority Medium |
|
87 //! @SYMTestActions Use exe with PowerMgmt capability to kill the installserver during various package install/uninstall |
|
88 //! operations to abort prematurely, test that SWI subsequent installs work. |
|
89 //! @SYMTestExpectedResults Recovery after failure is as expected. Note that no panics are expected; if these occur during |
|
90 //! the emulator test run they will be caught by the panicscan perl script. Depending on the precise timing of the failure, |
|
91 //! the aborted install/uninstall can complete with KErrDied, KErrServerTerminated or KErrNotFound. |
|
92 |
|
93 START_TESTCASE API-SEC-SwisTerminated-0001 |
|
94 |
|
95 // Run install that takes a while and kill installserver part of the way through |
|
96 CONCURRENT |
|
97 run_program killrunningprocess 101f7295 3000000 |
|
98 RUN_TEST_STEP 10 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini cancelpackage_swiskilled |
|
99 CONSECUTIVE |
|
100 |
|
101 // Check that a subsequent install succeeds |
|
102 RUN_TEST_STEP 10 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\tuiscriptadaptors.ini simple |
|
103 RUN_TEST_STEP 10 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\tuiscriptadaptors.ini u_simple |
|
104 |
|
105 CONCURRENT |
|
106 run_program killrunningprocess 101f7295 2500000 |
|
107 RUN_TEST_STEP 10 tuiscriptadaptors InstallFHStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini cancelpackage_swiskilled |
|
108 CONSECUTIVE |
|
109 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\tuiscriptadaptors.ini simple |
|
110 RUN_TEST_STEP 10 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\tuiscriptadaptors.ini u_simple |
|
111 |
|
112 CONCURRENT |
|
113 run_program killrunningprocess 101f7295 2000000 |
|
114 RUN_TEST_STEP 10 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini cancelpackage_swiskilled |
|
115 CONSECUTIVE |
|
116 RUN_TEST_STEP 10 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\tuiscriptadaptors.ini simple |
|
117 RUN_TEST_STEP 10 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\tuiscriptadaptors.ini u_simple |
|
118 |
|
119 CONCURRENT |
|
120 run_program killrunningprocess 101f7295 1500000 |
|
121 RUN_TEST_STEP 10 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini cancelpackage_swiskilled |
|
122 CONSECUTIVE |
|
123 |
|
124 CONCURRENT |
|
125 run_program killrunningprocess 101f7295 800000 |
|
126 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini def052175_swiskilled |
|
127 CONSECUTIVE |
|
128 |
|
129 CONCURRENT |
|
130 run_program killrunningprocess 101f7295 500000 |
|
131 RUN_TEST_STEP 20 tuiscriptadaptors InstallFHStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longname_rsa_l1_swiskilled |
|
132 CONSECUTIVE |
|
133 |
|
134 // Short delay before Killing SWIS above can mean it dies before connecting to sishelperserver, |
|
135 // which may then take 2 seconds to shut down. Delay just in case. |
|
136 DELAY 2000 |
|
137 |
|
138 CONCURRENT |
|
139 run_program killrunningprocess 101f7295 4000000 |
|
140 RUN_TEST_STEP 10 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini exeRIRW_swiskilled |
|
141 CONSECUTIVE |
|
142 |
|
143 // Exe will still be running. |
|
144 //RUN_TEST_STEP 50 tuiscriptadaptors FindRunningExe z:\tswi\tuiscriptadaptors\scripts\testrun.ini consoleappRunning |
|
145 RUN_TEST_STEP_RESULT -1 10 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini u_exeRIRW |
|
146 |
|
147 // Install package containing longrun exe. |
|
148 RUN_TEST_STEP 80 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longrun_base |
|
149 DELAY 2000 |
|
150 // Install PU which replaces the exe with a run-on-install version and make sure the exe is running |
|
151 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longrunRI_pu |
|
152 RUN_TEST_STEP 50 tuiscriptadaptors FindRunningExe z:\tswi\tuiscriptadaptors\scripts\testrun.ini longrunexeRunning |
|
153 |
|
154 // Repeatedly re-install the same PU, with ocsp checks and a 1 second delay at each dialog, in order to kill the installserver |
|
155 // with a variety of dialogs raised. |
|
156 CONCURRENT |
|
157 run_program killrunningprocess 101f7295 4000000 |
|
158 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longrunRI_pu_dialogtest0 |
|
159 CONSECUTIVE |
|
160 |
|
161 CONCURRENT |
|
162 run_program killrunningprocess 101f7295 4000000 |
|
163 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longrunRI_pu_dialogtest1 |
|
164 CONSECUTIVE |
|
165 |
|
166 CONCURRENT |
|
167 run_program killrunningprocess 101f7295 4000000 |
|
168 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longrunRI_pu_dialogtest2 |
|
169 CONSECUTIVE |
|
170 |
|
171 CONCURRENT |
|
172 run_program killrunningprocess 101f7295 4000000 |
|
173 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longrunRI_pu_dialogtest3 |
|
174 CONSECUTIVE |
|
175 |
|
176 CONCURRENT |
|
177 run_program killrunningprocess 101f7295 4000000 |
|
178 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longrunRI_pu_dialogtest4 |
|
179 CONSECUTIVE |
|
180 |
|
181 CONCURRENT |
|
182 run_program killrunningprocess 101f7295 4000000 |
|
183 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longrunRI_pu_dialogtest5 |
|
184 CONSECUTIVE |
|
185 |
|
186 CONCURRENT |
|
187 run_program killrunningprocess 101f7295 4000000 |
|
188 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longrunRI_pu_dialogtest6 |
|
189 CONSECUTIVE |
|
190 |
|
191 CONCURRENT |
|
192 run_program killrunningprocess 101f7295 4000000 |
|
193 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longrunRI_pu_dialogtest7 |
|
194 CONSECUTIVE |
|
195 |
|
196 CONCURRENT |
|
197 run_program killrunningprocess 101f7295 4000000 |
|
198 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longrunRI_pu_dialogtest8 |
|
199 CONSECUTIVE |
|
200 |
|
201 // Make sure the exe is running for the next test |
|
202 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longrunRI_pu |
|
203 RUN_TEST_STEP 50 tuiscriptadaptors FindRunningExe z:\tswi\tuiscriptadaptors\scripts\testrun.ini longrunexeRunning |
|
204 |
|
205 CONCURRENT |
|
206 run_program killrunningprocess 101f7295 5000000 |
|
207 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longrunRI_pu_dialogtest9 |
|
208 CONSECUTIVE |
|
209 |
|
210 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longrunRI_pu |
|
211 RUN_TEST_STEP 50 tuiscriptadaptors FindRunningExe z:\tswi\tuiscriptadaptors\scripts\testrun.ini longrunexeRunning |
|
212 |
|
213 CONCURRENT |
|
214 run_program killrunningprocess 101f7295 5000000 |
|
215 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longrunRI_pu_dialogtest10 |
|
216 CONSECUTIVE |
|
217 |
|
218 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longrunRI_pu |
|
219 RUN_TEST_STEP 50 tuiscriptadaptors FindRunningExe z:\tswi\tuiscriptadaptors\scripts\testrun.ini longrunexeRunning |
|
220 |
|
221 CONCURRENT |
|
222 run_program killrunningprocess 101f7295 5000000 |
|
223 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longrunRI_pu_dialogtest11 |
|
224 CONSECUTIVE |
|
225 |
|
226 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longrunRI_pu |
|
227 RUN_TEST_STEP 50 tuiscriptadaptors FindRunningExe z:\tswi\tuiscriptadaptors\scripts\testrun.ini longrunexeRunning |
|
228 |
|
229 CONCURRENT |
|
230 run_program killrunningprocess 101f7295 5000000 |
|
231 RUN_TEST_STEP 20 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini longrunRI_pu_dialogtest12 |
|
232 CONSECUTIVE |
|
233 |
|
234 // Uninstall package. |
|
235 RUN_TEST_STEP 50 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini u_longrun_base |
|
236 RUN_TEST_STEP_RESULT 106 tuiscriptadaptors FindRunningExe z:\tswi\tuiscriptadaptors\scripts\testrun.ini longrunexeRunning |
|
237 |
|
238 // Install package with run-on-uninstall exe and abort uninstall |
|
239 RUN_TEST_STEP 10 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini testrun_exe |
|
240 CONCURRENT |
|
241 run_program killrunningprocess 101f7295 2500000 |
|
242 RUN_TEST_STEP 20 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini u_testrun_exe_swiskilled |
|
243 CONSECUTIVE |
|
244 // Exe should still be running |
|
245 RUN_TEST_STEP 50 tuiscriptadaptors FindRunningExe z:\tswi\tuiscriptadaptors\scripts\testrun.ini consoleappRunning |
|
246 |
|
247 // Complete uninstall which will shut down the exe. |
|
248 RUN_TEST_STEP 50 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini u_testrun_exe |
|
249 RUN_TEST_STEP_RESULT 106 tuiscriptadaptors FindRunningExe z:\tswi\tuiscriptadaptors\scripts\testrun.ini consoleappRunning |
|
250 |
|
251 // Delete flagging file left behind by testrun exe |
|
252 RUN_UTILS DeleteFile c:\testrun_flag_file.out |
|
253 |
|
254 // Abort uninstall of cancelpackage with delays on dialogs |
|
255 CONCURRENT |
|
256 run_program killrunningprocess 101f7295 2000000 |
|
257 RUN_TEST_STEP 20 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini u_cancelpackage_swiskilled |
|
258 CONSECUTIVE |
|
259 |
|
260 DELAY 4000 |
|
261 // Complete uninstall of cancelpackage. |
|
262 RUN_TEST_STEP 15 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\switermination.ini u_cancelpackage |
|
263 |
|
264 END_TESTCASE API-SEC-SwisTerminated-0001 |
|
265 |
|
266 |
|
267 // Ensure Swis shuts down at end of all tests |
|
268 RUN_TEST_STEP 50 tuiscriptadaptors SwisNotRunning |
|
269 |
|
270 |
|
271 |