|
1 // |
|
2 // Copyright (c) 2005-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 "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 //! @file |
|
18 //! @SYMTestSuiteName T_BTUserAPI |
|
19 //! @SYMScriptTestEnvironment This test script requires a basic ROM with bluetooth dongle. |
|
20 //! @SYMScriptDescription Tests all public elements of the TBTAccessRequirements class |
|
21 //! as a means of confidence that the API works as expected. |
|
22 //! The purpose is to provide a regression test suite of PublishedAll APIs for |
|
23 //! BT USER related classes. |
|
24 //! Negative testing is performed to confirm that correct errors are returned |
|
25 //! when incorrect parameters are given. The tests are fully automated. |
|
26 //! @SYMAuthor Cliff Chuang |
|
27 //! @SYMCreationDate 21/09/2007 |
|
28 /////////////////////////////////////////////////////////////////////////////// |
|
29 |
|
30 RUN_UTILS MkDir ${SYSDRIVE}\bluetooth\ |
|
31 RUN_UTILS MkDir ${SYSDRIVE}\bluetooth\user\ |
|
32 |
|
33 LOAD_SUITE T_BTUserAPI -SharedData |
|
34 DELAY 500 |
|
35 |
|
36 // **************************************************************************** |
|
37 // TBTAccessRequirements - Slave (Auto Tests) |
|
38 // **************************************************************************** |
|
39 |
|
40 START_TESTCASE BT-USER-AccessRequirements-PublicApi-Passive-Slave-0001 |
|
41 //! @SYMTestCaseID BT-USER-AccessRequirements-PublicApi-Passive-Slave-0001 |
|
42 //! @SYMAPI CBluetoothSocket, TBTDevAddr, RHostResolver, TRfcommSockAddr, TBTAccessRequirements |
|
43 //! @SYMTestCaseDesc Set up a Bluetooth endpoint |
|
44 //! Set SetEncryption() to FALSE |
|
45 //! Set SetDenied() to FALSE |
|
46 //! Set SetPasskeyMinLength() to 4 |
|
47 //! Set SetAuthentication() to FALSE |
|
48 //! Set SetAuthorisation() to FALSE |
|
49 //! Connection creates with those setting successfully and test case passes without any error. |
|
50 //! Uses API elements: SetEncryption(), SetDenied(), SetPasskeyMinLength(), SetAuthentication(), SetAuthorisation() from TBTAccessRequirements |
|
51 //! NewL()1, Bind(), listen()1, Accept(), Shutdown() and NewL()4 from CBluetoothSocket |
|
52 //! TBTDevAddr() from TBTDevAddr |
|
53 //! Open(), SetHostName(), SetDiscoverable() from RHostResolver |
|
54 //! TRfcommSockAddr(), SetFamily(), SetSecurity() and SetPort() from TRfcommSockAddr |
|
55 //! @SYMTestActions Wait for master to order start |
|
56 //! 1. Create and start a session on the socket server |
|
57 //! 2. Create an empty TBTServiceSecurity object |
|
58 //! 3. Set the encryption requirement using SetEncryption() function (FALSE) |
|
59 //! 4. Set the denied requirement using SetDenied() function (FALSE) |
|
60 //! 5. Set the minimal length requrement for passkey using SetPasskeyMinLength() function (4) |
|
61 //! 6. Set the authentication requirement using SetAuthentication() function (FALSE) |
|
62 //! 7. Set the authorisation requirement using SetAuthorisation() function (FALSE) |
|
63 //! 8. Create a CBluetoothSocket using the NewL()1 (Standard constructor) |
|
64 //! 9. Create an TRfcommSockAddr object |
|
65 //! 10. Set the Family to Bluetooth (257) |
|
66 //! 11. Set the security to TBTServiceSecurity |
|
67 //! 12. Set the port to the one matching the protocol to use |
|
68 //! 13. Use the Bind method of the CBluetoothSocket to bind the socket using the TRfcommSockAddr object |
|
69 //! 14. Call the listen()10 method of the CBluetoothSocket object |
|
70 //! 15. Create a new empty CBluetoothSocket using NewL()4 |
|
71 //! 16. Create an TBTDevAddr object (slave) |
|
72 //! 17. Create and initialise an RHostResolver |
|
73 //! 18. Set Hostname (SlaveDevice) of the device |
|
74 //! 19. Set discover of the device |
|
75 //! 20. Accept the bluetooth connection |
|
76 //! 21. Shut down the CBluetoothSocket object |
|
77 //! 22. Delete CBluetoothSocket object |
|
78 //! |
|
79 //! @SYMTestStatus Implemented |
|
80 //! @SYMTestPriority Critical |
|
81 //! @SYMTestExpectedResults Connection creates successfully and closes successfully. |
|
82 //! @SYMTestType CIT |
|
83 |
|
84 START_TEST_BLOCK 100 T_BTUserAPI \bluetooth\user\BT-USER-AccessRequirements-PublicApi-Passive-Slave.ini |
|
85 SHARED_ACTIVE_SCHEDULER |
|
86 CREATE_OBJECT CBluetoothSocket CBluetoothSocket1 |
|
87 CREATE_OBJECT TRfcommSockAddr TRfcommSockAddr1 |
|
88 CREATE_OBJECT CBluetoothSocket CBluetoothSessionSocket |
|
89 CREATE_OBJECT TBTServiceSecurity TBTServiceSecurity1 |
|
90 COMMAND TBTServiceSecurity1 Construct |
|
91 COMMAND TBTServiceSecurity1 SetEncryption BT-USER-AccessRequirements-PublicApi-Passive-0001-0001command1SetEncryption |
|
92 COMMAND TBTServiceSecurity1 SetDenied BT-USER-AccessRequirements-PublicApi-Passive-0001-0001command2SetDenied |
|
93 COMMAND TBTServiceSecurity1 SetPasskeyMinLength BT-USER-AccessRequirements-PublicApi-Passive-0001-0001command3SetPasskeyMinLength |
|
94 COMMAND TBTServiceSecurity1 SetAuthentication BT-USER-AccessRequirements-PublicApi-Passive-0001-0001command4SetAuthentication |
|
95 COMMAND TBTServiceSecurity1 SetAuthorisation BT-USER-AccessRequirements-PublicApi-Passive-0001-0001command5SetAuthorisation |
|
96 COMMAND CBluetoothSocket1 RSocketServerConnect |
|
97 COMMAND CBluetoothSocket1 NewL BT-USER-AccessRequirements-PublicApi-Passive-0001-0001command3NewL |
|
98 COMMAND TRfcommSockAddr1 Construct |
|
99 COMMAND TRfcommSockAddr1 SetFamily BT-USER-AccessRequirements-PublicApi-Passive-0001-0001command6SetFamily |
|
100 COMMAND TRfcommSockAddr1 SetSecurity BT-USER-AccessRequirements-PublicApi-Passive-0001-0001command6SetSecurity |
|
101 COMMAND TRfcommSockAddr1 SetPort BT-USER-AccessRequirements-PublicApi-Passive-0001-0001command7SetPort |
|
102 COMMAND CBluetoothSocket1 Bind BT-USER-AccessRequirements-PublicApi-Passive-0001-0001command9Bind |
|
103 COMMAND CBluetoothSocket1 Listen BT-USER-AccessRequirements-PublicApi-Passive-0001-0001command10Listen |
|
104 COMMAND CBluetoothSessionSocket SetRsocketServerFromCBTSocket BT-USER-AccessRequirements-PublicApi-Passive-0001-0001command12SetRsocketServerFromCBTSocket |
|
105 COMMAND CBluetoothSessionSocket NewL BT-USER-AccessRequirements-PublicApi-Passive-0001-0001command13NewL |
|
106 STORE CBluetoothSocket1 |
|
107 STORE CBluetoothSessionSocket |
|
108 STORE TRfcommSockAddr1 |
|
109 STORE_ACTIVE_SCHEDULER |
|
110 END_TEST_BLOCK |
|
111 |
|
112 START_SYNCHRONISED_TESTCASE BT-USER-AccessRequirements-PublicApi-Active-Master-0001-0002 |
|
113 START_TEST_BLOCK 300 T_BTUserAPI \bluetooth\user\BT-USER-AccessRequirements-PublicApi-Passive-Slave.ini |
|
114 SHARED_ACTIVE_SCHEDULER |
|
115 RESTORE_OBJECT CBluetoothSocket CBluetoothSocket1 |
|
116 RESTORE_OBJECT CBluetoothSocket CBluetoothSessionSocket |
|
117 CREATE_OBJECT TBTDevAddr TBTDevAddrLocal |
|
118 COMMAND TBTDevAddrLocal Construct |
|
119 COMMAND TBTDevAddrLocal OpenHostResolver BT-USER-AccessRequirements-PublicApi-Passive-0001-0002command3OpenHostResolver |
|
120 COMMAND TBTDevAddrLocal SetHostNameL BT-USER-AccessRequirements-PublicApi-Passive-0001-0002command4SetHostNameL |
|
121 COMMAND TBTDevAddrLocal SetDiscoverable |
|
122 STORE CBluetoothSocket1 |
|
123 STORE CBluetoothSessionSocket |
|
124 STORE_ACTIVE_SCHEDULER |
|
125 END_TEST_BLOCK |
|
126 END_SYNCHRONISED_TESTCASE BT-USER-AccessRequirements-PublicApi-Active-Master-0001-0002 |
|
127 |
|
128 START_SYNCHRONISED_TESTCASE BT-USER-AccessRequirements-PublicApi-Active-Master-0001-0003 |
|
129 START_TEST_BLOCK 300 T_BTUserAPI \bluetooth\user\BT-USER-AccessRequirements-PublicApi-Passive-Slave.ini |
|
130 SHARED_ACTIVE_SCHEDULER |
|
131 RESTORE_OBJECT CBluetoothSocket CBluetoothSocket1 |
|
132 RESTORE_OBJECT CBluetoothSocket CBluetoothSessionSocket |
|
133 RESTORE_OBJECT TRfcommSockAddr TRfcommSockAddr1 |
|
134 COMMAND CBluetoothSocket1 Accept BT-USER-AccessRequirements-PublicApi-Passive-0001-0003command1Accept |
|
135 OUTSTANDING |
|
136 STORE CBluetoothSocket1 |
|
137 STORE CBluetoothSessionSocket |
|
138 STORE_ACTIVE_SCHEDULER |
|
139 END_TEST_BLOCK |
|
140 END_SYNCHRONISED_TESTCASE BT-USER-AccessRequirements-PublicApi-Active-Master-0001-0003 |
|
141 |
|
142 START_SYNCHRONISED_TESTCASE BT-USER-AccessRequirements-PublicApi-Active-Master-0001-0004 |
|
143 START_TEST_BLOCK 300 T_BTUserAPI \bluetooth\user\BT-USER-AccessRequirements-PublicApi-Passive-Slave.ini |
|
144 SHARED_ACTIVE_SCHEDULER |
|
145 RESTORE_OBJECT CBluetoothSocket CBluetoothSessionSocket |
|
146 RESTORE_OBJECT CBluetoothSocket CBluetoothSocket1 |
|
147 COMMAND CBluetoothSessionSocket Shutdown BT-USER-AccessRequirements-PublicApi-Passive-0001-0004command1Shutdown |
|
148 OUTSTANDING |
|
149 COMMAND CBluetoothSessionSocket ~ |
|
150 COMMAND CBluetoothSocket1 Shutdown BT-USER-AccessRequirements-PublicApi-Passive-0001-0004command4Shutdown |
|
151 OUTSTANDING |
|
152 COMMAND CBluetoothSocket1 ~ |
|
153 COMMAND CBluetoothSocket1 RSocketServerClose |
|
154 END_TEST_BLOCK |
|
155 END_SYNCHRONISED_TESTCASE BT-USER-AccessRequirements-PublicApi-Active-Master-0001-0004 |
|
156 |
|
157 END_TESTCASE BT-USER-AccessRequirements-PublicApi-Passive-Slave-0001 |
|
158 |
|
159 |
|
160 // **************************************************************************** |
|
161 // TBTAccessRequirement - Slave (Manual Tests) |
|
162 // **************************************************************************** |
|
163 // Connected |
|
164 |
|
165 START_TESTCASE BT-USER-Access-PublicApi-Passive-Slave-0001 |
|
166 //! @SYMTestCaseID BT-USER-Access-PublicApi-Passive-Slave-0001 |
|
167 //! @SYMAPI CBluetoothSocket, TBTDevAddr, RHostResolver, TRfcommSockAddr, TBTAccessRequirements |
|
168 //! @SYMTestCaseDesc Set up a Bluetooth endpoint |
|
169 //! Set SetEncryption() to FALSE |
|
170 //! Set SetDenied() to FALSE |
|
171 //! Set SetPasskeyMinLength() to 4 |
|
172 //! Set SetAuthentication() to TRUE |
|
173 //! Set SetAuthorisation() to FALSE |
|
174 //! Passkey is asked first in slave and then in master while connecting. The min passkey lengthis specified as 4 in the passkey entrance window. The test case passes without any error. |
|
175 //! Uses API elements: SetEncryption(), SetDenied(), SetPasskeyMinLength(), SetAuthentication(), SetAuthorisation() from TBTAccessRequirements |
|
176 //! NewL()1, Bind(), listen()1, Accept(), Shutdown() and NewL()4 from CBluetoothSocket |
|
177 //! TBTDevAddr() from TBTDevAddr |
|
178 //! Open(), SetHostName(), SetDiscoverable() from RHostResolver |
|
179 //! TRfcommSockAddr(), SetFamily(), SetSecurity() and SetPort() from TRfcommSockAddr |
|
180 //! @SYMTestActions Wait for master to order start |
|
181 //! 1. Create and start a session on the socket server |
|
182 //! 2. Create an empty TBTServiceSecurity object |
|
183 //! 3. Set the encryption requirement using SetEncryption() function (FALSE) |
|
184 //! 4. Set the denied requirement using SetDenied() function (FALSE) |
|
185 //! 5. Set the minimal length requrement for passkey using SetPasskeyMinLength() function (4) |
|
186 //! 6. Set the authentication requirement using SetAuthentication() function (TRUE) |
|
187 //! 7. Set the authorisation requirement using SetAuthorisation() function (FALSE) |
|
188 //! 8. Create a CBluetoothSocket using the NewL()1 (Standard constructor) |
|
189 //! 9. Create an TRfcommSockAddr object |
|
190 //! 10. Set the Family to Bluetooth (257) |
|
191 //! 11. Set the security to TBTServiceSecurity |
|
192 //! 12. Set the port to the one matching the protocol to use |
|
193 //! 13. Use the Bind method of the CBluetoothSocket to bind the socket using the TRfcommSockAddr object |
|
194 //! 14. Call the listen()10 method of the CBluetoothSocket object |
|
195 //! 15. Create a new empty CBluetoothSocket using NewL()4 |
|
196 //! 16. Create an TBTDevAddr object (slave) |
|
197 //! 17. Create and initialise an RHostResolver |
|
198 //! 18. Set Hostname (SlaveDevice) of the device |
|
199 //! 19. Set discover of the device |
|
200 //! 20. Accept the bluetooth connection |
|
201 //! 21. Shut down the CBluetoothSocket object |
|
202 //! 22. delete CBluetoothSocket object |
|
203 //! |
|
204 //! @SYMTestStatus Implemented |
|
205 //! @SYMTestPriority Critical |
|
206 //! @SYMTestExpectedResults Pre-condition : no authenticated devices in both emulators. |
|
207 //! Passkey is asked first in slave and then in master while connecting. The min passkey lengthis specified as 4 in the passkey entrance window. |
|
208 //! In the master emulator, slave is seen as authenticated. In the slave emulator, master is seen as authenticated. |
|
209 //! The test case passes without any error. |
|
210 //! @SYMTestType CIT |
|
211 |
|
212 START_TEST_BLOCK 100 T_BTUserAPI \bluetooth\user\BT-USER-AccessRequirements-PublicApi-Passive-Slave.ini |
|
213 SHARED_ACTIVE_SCHEDULER |
|
214 CREATE_OBJECT CBluetoothSocket CBluetoothSocket1 |
|
215 CREATE_OBJECT TRfcommSockAddr TRfcommSockAddr1 |
|
216 CREATE_OBJECT CBluetoothSocket CBluetoothSessionSocket |
|
217 CREATE_OBJECT TBTServiceSecurity TBTServiceSecurity1 |
|
218 COMMAND TBTServiceSecurity1 Construct |
|
219 COMMAND TBTServiceSecurity1 SetEncryption BT-USER-Access-PublicApi-Passive-0001-0001command1SetEncryption |
|
220 COMMAND TBTServiceSecurity1 SetDenied BT-USER-Access-PublicApi-Passive-0001-0001command2SetDenied |
|
221 COMMAND TBTServiceSecurity1 SetPasskeyMinLength BT-USER-Access-PublicApi-Passive-0001-0001command3SetPasskeyMinLength |
|
222 COMMAND TBTServiceSecurity1 SetAuthentication BT-USER-Access-PublicApi-Passive-0001-0001command4SetAuthentication |
|
223 COMMAND TBTServiceSecurity1 SetAuthorisation BT-USER-Access-PublicApi-Passive-0001-0001command5SetAuthorisation |
|
224 COMMAND CBluetoothSocket1 RSocketServerConnect |
|
225 COMMAND CBluetoothSocket1 NewL BT-USER-Access-PublicApi-Passive-0001-0001command3NewL |
|
226 COMMAND TRfcommSockAddr1 Construct |
|
227 COMMAND TRfcommSockAddr1 SetFamily BT-USER-Access-PublicApi-Passive-0001-0001command6SetFamily |
|
228 COMMAND TRfcommSockAddr1 SetSecurity BT-USER-Access-PublicApi-Passive-0001-0001command6SetSecurity |
|
229 COMMAND TRfcommSockAddr1 SetPort BT-USER-Access-PublicApi-Passive-0001-0001command7SetPort |
|
230 COMMAND CBluetoothSocket1 Bind BT-USER-Access-PublicApi-Passive-0001-0001command9Bind |
|
231 COMMAND CBluetoothSocket1 Listen BT-USER-Access-PublicApi-Passive-0001-0001command10Listen |
|
232 COMMAND CBluetoothSessionSocket SetRsocketServerFromCBTSocket BT-USER-Access-PublicApi-Passive-0001-0001command12SetRsocketServerFromCBTSocket |
|
233 COMMAND CBluetoothSessionSocket NewL BT-USER-Access-PublicApi-Passive-0001-0001command13NewL |
|
234 STORE CBluetoothSocket1 |
|
235 STORE CBluetoothSessionSocket |
|
236 STORE TRfcommSockAddr1 |
|
237 STORE_ACTIVE_SCHEDULER |
|
238 END_TEST_BLOCK |
|
239 |
|
240 START_SYNCHRONISED_TESTCASE BT-USER-Access-PublicApi-Active-Master-0001-0002 |
|
241 START_TEST_BLOCK 300 T_BTUserAPI \bluetooth\user\BT-USER-AccessRequirements-PublicApi-Passive-Slave.ini |
|
242 SHARED_ACTIVE_SCHEDULER |
|
243 RESTORE_OBJECT CBluetoothSocket CBluetoothSocket1 |
|
244 CREATE_OBJECT TBTDevAddr TBTDevAddrLocal |
|
245 COMMAND TBTDevAddrLocal Construct |
|
246 COMMAND TBTDevAddrLocal OpenHostResolver BT-USER-Access-PublicApi-Passive-0001-0002command3OpenHostResolver |
|
247 COMMAND TBTDevAddrLocal SetHostNameL BT-USER-Access-PublicApi-Passive-0001-0002command4SetHostNameL |
|
248 COMMAND TBTDevAddrLocal SetDiscoverable |
|
249 STORE CBluetoothSocket1 |
|
250 STORE_ACTIVE_SCHEDULER |
|
251 END_TEST_BLOCK |
|
252 END_SYNCHRONISED_TESTCASE BT-USER-Access-PublicApi-Active-Master-0001-0002 |
|
253 |
|
254 START_SYNCHRONISED_TESTCASE BT-USER-Access-PublicApi-Active-Master-0001-0003 |
|
255 START_TEST_BLOCK 300 T_BTUserAPI \bluetooth\user\BT-USER-AccessRequirements-PublicApi-Passive-Slave.ini |
|
256 SHARED_ACTIVE_SCHEDULER |
|
257 RESTORE_OBJECT CBluetoothSocket CBluetoothSocket1 |
|
258 RESTORE_OBJECT CBluetoothSocket CBluetoothSessionSocket |
|
259 RESTORE_OBJECT TRfcommSockAddr TRfcommSockAddr1 |
|
260 COMMAND CBluetoothSocket1 Accept BT-USER-Access-PublicApi-Passive-0001-0003command1Accept |
|
261 OUTSTANDING |
|
262 STORE CBluetoothSocket1 |
|
263 STORE CBluetoothSessionSocket |
|
264 STORE_ACTIVE_SCHEDULER |
|
265 END_TEST_BLOCK |
|
266 END_SYNCHRONISED_TESTCASE BT-USER-Access-PublicApi-Active-Master-0001-0003 |
|
267 |
|
268 START_SYNCHRONISED_TESTCASE BT-USER-Access-PublicApi-Active-Master-0001-0004 |
|
269 START_TEST_BLOCK 300 T_BTUserAPI \bluetooth\user\BT-USER-AccessRequirements-PublicApi-Passive-Slave.ini |
|
270 SHARED_ACTIVE_SCHEDULER |
|
271 RESTORE_OBJECT CBluetoothSocket CBluetoothSessionSocket |
|
272 RESTORE_OBJECT CBluetoothSocket CBluetoothSocket1 |
|
273 COMMAND CBluetoothSessionSocket Shutdown BT-USER-Access-PublicApi-Passive-0001-0004command1Shutdown |
|
274 OUTSTANDING |
|
275 COMMAND CBluetoothSessionSocket ~ |
|
276 COMMAND CBluetoothSocket1 Shutdown BT-USER-Access-PublicApi-Passive-0001-0004command4Shutdown |
|
277 OUTSTANDING |
|
278 COMMAND CBluetoothSocket1 ~ |
|
279 COMMAND CBluetoothSocket1 RSocketServerClose |
|
280 END_TEST_BLOCK |
|
281 END_SYNCHRONISED_TESTCASE BT-USER-Access-PublicApi-Active-Master-0001-0004 |
|
282 |
|
283 END_TESTCASE BT-USER-Access-PublicApi-Passive-Slave-0001 |
|
284 |
|
285 |
|
286 START_TESTCASE BT-USER-Access-PublicApi-Passive-Slave-0002 |
|
287 //! @SYMTestCaseID BT-USER-Access-PublicApi-Passive-Slave-0002 |
|
288 //! @SYMAPI CBluetoothSocket, TBTDevAddr, RHostResolver, TRfcommSockAddr, TBTAccessRequirements |
|
289 //! @SYMTestCaseDesc Set up a Bluetooth endpoint |
|
290 //! Set SetEncryption() to FALSE |
|
291 //! Set SetDenied() to FALSE |
|
292 //! Set SetPasskeyMinLength() to 4 |
|
293 //! Set SetAuthentication() to FALSE |
|
294 //! Set SetAuthorisation() to FALSE |
|
295 //! Passkey is asked first in master and then in slave while connecting. The min passkey lengthis specified as 4 in the passkey entrance window. The test case passes without any error. |
|
296 //! Uses API elements: SetEncryption(), SetDenied(), SetPasskeyMinLength(), SetAuthentication(), SetAuthorisation() from TBTAccessRequirements |
|
297 //! NewL()1, Bind(), listen()1, Accept(), Shutdown() and NewL()4 from CBluetoothSocket |
|
298 //! TBTDevAddr() from TBTDevAddr |
|
299 //! Open(), SetHostName(), SetDiscoverable() from RHostResolver |
|
300 //! TRfcommSockAddr(), SetFamily(), SetSecurity() and SetPort() from TRfcommSockAddr |
|
301 //! @SYMTestActions Wait for master to order start |
|
302 //! 1. Create and start a session on the socket server |
|
303 //! 2. Create an empty TBTServiceSecurity object |
|
304 //! 3. Set the encryption requirement using SetEncryption() function (FALSE) |
|
305 //! 4. Set the denied requirement using SetDenied() function (FALSE) |
|
306 //! 5. Set the minimal length requrement for passkey using SetPasskeyMinLength() function (4) |
|
307 //! 6. Set the authentication requirement using SetAuthentication() function (FALSE) |
|
308 //! 7. Set the authorisation requirement using SetAuthorisation() function (FALSE) |
|
309 //! 8. Create a CBluetoothSocket using the NewL()1 (Standard constructor) |
|
310 //! 9. Create an TRfcommSockAddr object |
|
311 //! 10. Set the Family to Bluetooth (257) |
|
312 //! 11. Set the security to TBTServiceSecurity |
|
313 //! 12. Set the port to the one matching the protocol to use |
|
314 //! 13. Use the Bind method of the CBluetoothSocket to bind the socket using the TRfcommSockAddr object |
|
315 //! 14. Call the listen()10 method of the CBluetoothSocket object |
|
316 //! 15. Create a new empty CBluetoothSocket using NewL()4 |
|
317 //! 16. Create an TBTDevAddr object (slave) |
|
318 //! 17. Create and initialise an RHostResolver |
|
319 //! 18. Set Hostname (SlaveDevice) of the device |
|
320 //! 19. Set discover of the device |
|
321 //! 20. Accept the bluetooth connection |
|
322 //! 21. Shut down the CBluetoothSocket object |
|
323 //! 22. delete CBluetoothSocket object |
|
324 //! |
|
325 //! @SYMTestStatus Implemented |
|
326 //! @SYMTestPriority Critical |
|
327 //! @SYMTestExpectedResults Because authentication has already been done in the previous test case, |
|
328 //! the Passkey will not be asked again in master and then in slave while connecting. |
|
329 //! In the master emulator, slave is seen as authenticated. In the slave emulator, master is seen as authenticated. |
|
330 //! The test case passes without any error. |
|
331 //! @SYMTestType CIT |
|
332 |
|
333 START_TEST_BLOCK 100 T_BTUserAPI \bluetooth\user\BT-USER-AccessRequirements-PublicApi-Passive-Slave.ini |
|
334 SHARED_ACTIVE_SCHEDULER |
|
335 CREATE_OBJECT CBluetoothSocket CBluetoothSocket1 |
|
336 CREATE_OBJECT TRfcommSockAddr TRfcommSockAddr1 |
|
337 CREATE_OBJECT CBluetoothSocket CBluetoothSessionSocket |
|
338 CREATE_OBJECT TBTServiceSecurity TBTServiceSecurity1 |
|
339 COMMAND TBTServiceSecurity1 Construct |
|
340 COMMAND TBTServiceSecurity1 SetEncryption BT-USER-Access-PublicApi-Passive-0002-0001command1SetEncryption |
|
341 COMMAND TBTServiceSecurity1 SetDenied BT-USER-Access-PublicApi-Passive-0002-0001command2SetDenied |
|
342 COMMAND TBTServiceSecurity1 SetPasskeyMinLength BT-USER-Access-PublicApi-Passive-0002-0001command3SetPasskeyMinLength |
|
343 COMMAND TBTServiceSecurity1 SetAuthentication BT-USER-Access-PublicApi-Passive-0002-0001command4SetAuthentication |
|
344 COMMAND TBTServiceSecurity1 SetAuthorisation BT-USER-Access-PublicApi-Passive-0002-0001command5SetAuthorisation |
|
345 COMMAND CBluetoothSocket1 RSocketServerConnect |
|
346 COMMAND CBluetoothSocket1 NewL BT-USER-Access-PublicApi-Passive-0002-0001command3NewL |
|
347 COMMAND TRfcommSockAddr1 Construct |
|
348 COMMAND TRfcommSockAddr1 SetFamily BT-USER-Access-PublicApi-Passive-0002-0001command6SetFamily |
|
349 COMMAND TRfcommSockAddr1 SetSecurity BT-USER-Access-PublicApi-Passive-0002-0001command6SetSecurity |
|
350 COMMAND TRfcommSockAddr1 SetPort BT-USER-Access-PublicApi-Passive-0002-0001command7SetPort |
|
351 COMMAND CBluetoothSocket1 Bind BT-USER-Access-PublicApi-Passive-0002-0001command9Bind |
|
352 COMMAND CBluetoothSocket1 Listen BT-USER-Access-PublicApi-Passive-0002-0001command10Listen |
|
353 COMMAND CBluetoothSessionSocket SetRsocketServerFromCBTSocket BT-USER-Access-PublicApi-Passive-0002-0001command12SetRsocketServerFromCBTSocket |
|
354 COMMAND CBluetoothSessionSocket NewL BT-USER-Access-PublicApi-Passive-0002-0001command13NewL |
|
355 STORE CBluetoothSocket1 |
|
356 STORE CBluetoothSessionSocket |
|
357 STORE TRfcommSockAddr1 |
|
358 STORE_ACTIVE_SCHEDULER |
|
359 END_TEST_BLOCK |
|
360 |
|
361 START_SYNCHRONISED_TESTCASE BT-USER-Access-PublicApi-Active-Master-0002-0002 |
|
362 START_TEST_BLOCK 300 T_BTUserAPI \bluetooth\user\BT-USER-AccessRequirements-PublicApi-Passive-Slave.ini |
|
363 SHARED_ACTIVE_SCHEDULER |
|
364 RESTORE_OBJECT CBluetoothSocket CBluetoothSocket1 |
|
365 CREATE_OBJECT TBTDevAddr TBTDevAddrLocal |
|
366 COMMAND TBTDevAddrLocal Construct |
|
367 COMMAND TBTDevAddrLocal OpenHostResolver BT-USER-Access-PublicApi-Passive-0002-0002command3OpenHostResolver |
|
368 COMMAND TBTDevAddrLocal SetHostNameL BT-USER-Access-PublicApi-Passive-0002-0002command4SetHostNameL |
|
369 COMMAND TBTDevAddrLocal SetDiscoverable |
|
370 STORE CBluetoothSocket1 |
|
371 STORE_ACTIVE_SCHEDULER |
|
372 END_TEST_BLOCK |
|
373 END_SYNCHRONISED_TESTCASE BT-USER-Access-PublicApi-Active-Master-0002-0002 |
|
374 |
|
375 START_SYNCHRONISED_TESTCASE BT-USER-Access-PublicApi-Active-Master-0002-0003 |
|
376 START_TEST_BLOCK 300 T_BTUserAPI \bluetooth\user\BT-USER-AccessRequirements-PublicApi-Passive-Slave.ini |
|
377 SHARED_ACTIVE_SCHEDULER |
|
378 RESTORE_OBJECT CBluetoothSocket CBluetoothSocket1 |
|
379 RESTORE_OBJECT CBluetoothSocket CBluetoothSessionSocket |
|
380 RESTORE_OBJECT TRfcommSockAddr TRfcommSockAddr1 |
|
381 COMMAND CBluetoothSocket1 Accept BT-USER-Access-PublicApi-Passive-0002-0003command1Accept |
|
382 OUTSTANDING |
|
383 STORE CBluetoothSocket1 |
|
384 STORE CBluetoothSessionSocket |
|
385 STORE_ACTIVE_SCHEDULER |
|
386 END_TEST_BLOCK |
|
387 END_SYNCHRONISED_TESTCASE BT-USER-Access-PublicApi-Active-Master-0002-0003 |
|
388 |
|
389 START_SYNCHRONISED_TESTCASE BT-USER-Access-PublicApi-Active-Master-0002-0004 |
|
390 START_TEST_BLOCK 300 T_BTUserAPI \bluetooth\user\BT-USER-AccessRequirements-PublicApi-Passive-Slave.ini |
|
391 SHARED_ACTIVE_SCHEDULER |
|
392 RESTORE_OBJECT CBluetoothSocket CBluetoothSessionSocket |
|
393 RESTORE_OBJECT CBluetoothSocket CBluetoothSocket1 |
|
394 COMMAND CBluetoothSessionSocket Shutdown BT-USER-Access-PublicApi-Passive-0002-0004command1Shutdown |
|
395 OUTSTANDING |
|
396 COMMAND CBluetoothSessionSocket ~ |
|
397 COMMAND CBluetoothSocket1 Shutdown BT-USER-Access-PublicApi-Passive-0002-0004command4Shutdown |
|
398 OUTSTANDING |
|
399 COMMAND CBluetoothSocket1 ~ |
|
400 COMMAND CBluetoothSocket1 RSocketServerClose |
|
401 END_TEST_BLOCK |
|
402 END_SYNCHRONISED_TESTCASE BT-USER-Access-PublicApi-Active-Master-0002-0004 |
|
403 |
|
404 END_TESTCASE BT-USER-Access-PublicApi-Passive-Slave-0002 |
|
405 |
|
406 |
|
407 DELAY 500 |