|
1 /* |
|
2 * Copyright (c) 2007-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 * Library to add s32strm support for IPC (ie. stream via multiple IPC read/writes instead of |
|
16 * copying to a buffer and streaming to/from there. |
|
17 * |
|
18 */ |
|
19 |
|
20 START_TESTCASE SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0001 |
|
21 |
|
22 //! @SYMTestCaseID SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0001 |
|
23 |
|
24 //! @SYMTestCaseDesc Script 2: Test authentication, paspphrase caching, etc |
|
25 |
|
26 //! |
|
27 |
|
28 //! ////////////////////////////////////////////////////////////////////////////// |
|
29 |
|
30 //! 0. Initialisation |
|
31 |
|
32 //! ////////////////////////////////////////////////////////////////////////////// |
|
33 |
|
34 //! |
|
35 |
|
36 //! First we delete the keystore data file, so that we know we are setting the |
|
37 |
|
38 //! passphrase with our first key add operation. |
|
39 |
|
40 //! Then we set up some keys for the rest of the test script to use: |
|
41 |
|
42 //! |
|
43 |
|
44 //! Key: Type: |
|
45 |
|
46 //! banana RSA |
|
47 |
|
48 //! mango DSA |
|
49 |
|
50 //! tomato DH |
|
51 |
|
52 //! |
|
53 |
|
54 //! test passphrase timeout affects all keys, and all processes |
|
55 |
|
56 //! @SYMTestActions 1) 0.1, Delete keystore data file |
|
57 |
|
58 //! 2) 0.2, Opening key store in manager mode |
|
59 |
|
60 //! 3) 0.3 Delete everything |
|
61 |
|
62 RUN_TEST_STEP -1 CTestHandler deletekeystoredata |
|
63 |
|
64 RUN_TEST_STEP -1 CTestHandler init authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-1-002 |
|
65 |
|
66 RUN_TEST_STEP -1 CTestHandler deletekeys |
|
67 |
|
68 END_TESTCASE SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0001 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 START_TESTCASE SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0002 |
|
75 |
|
76 //! @SYMTestCaseID SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0002 |
|
77 |
|
78 //! @SYMTestCaseDesc ////////////////////////////////////////////////////////////////////////////// |
|
79 |
|
80 //! 1. Test passphrase caching |
|
81 |
|
82 //! ////////////////////////////////////////////////////////////////////////////// |
|
83 |
|
84 //! |
|
85 |
|
86 //! 1.1 Test adding a key leaves it open and with default timeout of 30 seconds |
|
87 |
|
88 //! @SYMTestActions 1) 1.1.1, Add key banana |
|
89 |
|
90 //! 5) 1.1.5, Add key mango |
|
91 |
|
92 //! 6) 1.1.6, Add key tomato |
|
93 |
|
94 //! 7) 1.1.7, Check everything added ok |
|
95 |
|
96 RUN_TEST_STEP -1 CTestHandler addkey authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-2-001 |
|
97 |
|
98 RUN_TEST_STEP -1 CTestHandler addkey authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-2-005 |
|
99 |
|
100 RUN_TEST_STEP -1 CTestHandler addkey authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-2-006 |
|
101 |
|
102 RUN_TEST_STEP -1 CTestHandler listkeys authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-2-007 |
|
103 |
|
104 END_TESTCASE SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0002 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 START_TESTCASE SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0003 |
|
110 |
|
111 //! @SYMTestCaseID SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0003 |
|
112 |
|
113 //! @SYMTestCaseDesc ////////////////////////////////////////////////////////////////////////////// |
|
114 |
|
115 //! 6. Test security policies |
|
116 |
|
117 //! ////////////////////////////////////////////////////////////////////////////// |
|
118 |
|
119 //! |
|
120 |
|
121 //! 6.1 Test default policy is to police based on SID of the creator |
|
122 |
|
123 //! @SYMTestActions 1) 6.1.1, Get default use policy |
|
124 |
|
125 //! 2) 6.1.2, Get default management policy |
|
126 |
|
127 RUN_TEST_STEP -1 CTestHandler getusepolicy authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-3-001 |
|
128 |
|
129 RUN_TEST_STEP -1 CTestHandler getmanagementpolicy authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-3-002 |
|
130 |
|
131 END_TESTCASE SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0003 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 START_TESTCASE SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0004 |
|
138 |
|
139 //! @SYMTestCaseID SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0004 |
|
140 |
|
141 //! @SYMTestCaseDesc 6.2 Test setting policies for the keys |
|
142 |
|
143 //! @SYMTestActions 1) 6.2.1, Set banana's use policy based on SID and capabilities |
|
144 |
|
145 //! 2) 6.2.2, Check banana's use policy set correctly |
|
146 |
|
147 //! 3) 6.2.3, Set mango's use policy based on VID and capabilities |
|
148 |
|
149 //! 4) 6.2.4, Check mango's use policy set correctly |
|
150 |
|
151 //! 5) 6.2.5, Set tomato's use policy based on just capabilities |
|
152 |
|
153 //! 6) 6.2.6, Check tomato's use policy set correctly |
|
154 |
|
155 //! 7) 6.2.7.1, Test we can't set management policy that doesn't include the calling process |
|
156 |
|
157 //! 8) 6.2.7.2, Test we can't set management policy that doesn't include the calling process |
|
158 |
|
159 //! 9) 6.2.7.3, Test we can't set management policy that doesn't include the calling process |
|
160 |
|
161 //! 10) 6.2.7.4, Set banana's management policy based on just capabilities |
|
162 |
|
163 //! 11) 6.2.8, Check banana's management policy set correctly |
|
164 |
|
165 //! 12) 6.2.9, Set mango's management policy based on SID and capabilities |
|
166 |
|
167 //! 13) 6.2.10, Check mango's management policy set correctly |
|
168 |
|
169 //! 14) 6.2.11, Set tomato's management policy based on VID and capabilities |
|
170 |
|
171 //! 15) 6.2.12, Check tomato's management policy set correctly |
|
172 |
|
173 RUN_TEST_STEP -1 CTestHandler setusepolicy authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-4-001 |
|
174 |
|
175 RUN_TEST_STEP -1 CTestHandler getusepolicy authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-4-002 |
|
176 |
|
177 RUN_TEST_STEP -1 CTestHandler setusepolicy authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-4-003 |
|
178 |
|
179 RUN_TEST_STEP -1 CTestHandler getusepolicy authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-4-004 |
|
180 |
|
181 RUN_TEST_STEP -1 CTestHandler setusepolicy authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-4-005 |
|
182 |
|
183 RUN_TEST_STEP -1 CTestHandler getusepolicy authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-4-006 |
|
184 |
|
185 RUN_TEST_STEP !Error=-6 -1 CTestHandler setmanagementpolicy authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-4-007 |
|
186 |
|
187 RUN_TEST_STEP !Error=-6 -1 CTestHandler setmanagementpolicy authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-4-008 |
|
188 |
|
189 RUN_TEST_STEP !Error=-6 -1 CTestHandler setmanagementpolicy authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-4-009 |
|
190 |
|
191 RUN_TEST_STEP -1 CTestHandler setmanagementpolicy authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-4-010 |
|
192 |
|
193 RUN_TEST_STEP -1 CTestHandler getmanagementpolicy authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-4-011 |
|
194 |
|
195 RUN_TEST_STEP -1 CTestHandler setmanagementpolicy authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-4-012 |
|
196 |
|
197 RUN_TEST_STEP -1 CTestHandler getmanagementpolicy authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-4-013 |
|
198 |
|
199 RUN_TEST_STEP -1 CTestHandler setmanagementpolicy authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-4-014 |
|
200 |
|
201 RUN_TEST_STEP -1 CTestHandler getmanagementpolicy authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-4-015 |
|
202 |
|
203 END_TESTCASE SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0004 |
|
204 |
|
205 |
|
206 |
|
207 |
|
208 |
|
209 START_TESTCASE SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0005 |
|
210 |
|
211 //! @SYMTestCaseID SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0005 |
|
212 |
|
213 //! @SYMTestCaseDesc 6.3 Test enforcement of security policies |
|
214 |
|
215 //! @SYMTestActions 1) 6.3.1, Test use policy enforcement for SID and capabilities |
|
216 |
|
217 //! 2) 6.3.2, Test use policy enforcement for VID and capabilities |
|
218 |
|
219 //! 3) 6.3.3, Test use policy enforcement for just capabilities |
|
220 |
|
221 //! 4) 6.3.4, Test banana's management policy enforcement (just capabilities) |
|
222 |
|
223 //! 5) 6.3.5, Test mango's management policy enforcement (SID and capabilities) |
|
224 |
|
225 //! 6) 6.3.6, Test tomato's management policy enforcement (VID and capabilities) |
|
226 |
|
227 RUN_TEST_STEP -1 CTestHandler policytest authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-5-001 |
|
228 |
|
229 RUN_TEST_STEP -1 CTestHandler policytest authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-5-002 |
|
230 |
|
231 RUN_TEST_STEP -1 CTestHandler policytest authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-5-003 |
|
232 |
|
233 RUN_TEST_STEP -1 CTestHandler policytest authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-5-004 |
|
234 |
|
235 RUN_TEST_STEP -1 CTestHandler policytest authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-5-005 |
|
236 |
|
237 RUN_TEST_STEP -1 CTestHandler policytest authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-5-006 |
|
238 |
|
239 END_TESTCASE SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0005 |
|
240 |
|
241 |
|
242 |
|
243 |
|
244 |
|
245 START_TESTCASE SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0006 |
|
246 |
|
247 //! @SYMTestCaseID SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0006 |
|
248 |
|
249 //! @SYMTestCaseDesc ////////////////////////////////////////////////////////////////////////////// |
|
250 |
|
251 //! 7. Test policing of other APIs |
|
252 |
|
253 //! ////////////////////////////////////////////////////////////////////////////// |
|
254 |
|
255 //! |
|
256 |
|
257 //! 7.1 Test set timeout is policed with WriteDeviceData capability |
|
258 |
|
259 //! @SYMTestActions 1) 7.1, Test policing of set timeout |
|
260 |
|
261 //! 2) 7.2, Test policing of create and import by WriteUserData |
|
262 |
|
263 //! 3) 7.3, Test policing of list by ReadUserData |
|
264 |
|
265 RUN_TEST_STEP -1 CTestHandler policytest authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-6-001 |
|
266 |
|
267 RUN_TEST_STEP -1 CTestHandler policytest authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-6-002 |
|
268 |
|
269 END_TESTCASE SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0006 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 |
|
275 START_TESTCASE SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0007 |
|
276 |
|
277 //! @SYMTestCaseID SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0007 |
|
278 |
|
279 //! @SYMTestCaseDesc ////////////////////////////////////////////////////////////////////////////// |
|
280 |
|
281 //! Cleanup |
|
282 |
|
283 //! ////////////////////////////////////////////////////////////////////////////// |
|
284 |
|
285 //! @SYMTestActions 1) 8.0, List keys |
|
286 |
|
287 //! 2) 8.1, Delete keys |
|
288 |
|
289 //! 3) 8.2, Close key store |
|
290 |
|
291 //! 4) 8.3, Sleep 5 seconds |
|
292 |
|
293 //! 5) 8.4, Check for server heap error |
|
294 |
|
295 RUN_TEST_STEP -1 CTestHandler listkeys authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-7-001 |
|
296 |
|
297 RUN_TEST_STEP -1 CTestHandler deletekeys authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-7-002 |
|
298 |
|
299 RUN_TEST_STEP -1 CTestHandler delete |
|
300 |
|
301 RUN_TEST_STEP -1 CTestHandler sleep authobjects_useauth.ini SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-7-004 |
|
302 |
|
303 RUN_TEST_STEP -1 CTestHandler checkserverheaperror |
|
304 |
|
305 END_TESTCASE SEC-FILETOKENS-AUTHOBJECTS_V2_USEAUTH-0007 |
|
306 |
|
307 |
|
308 |
|
309 |
|
310 |