|
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 |
|
38 // **************************************************************************** |
|
39 |
|
40 START_TESTCASE BT-USER-AccessRequirements-PublicApi-Passive-Slave-Auto-0001 |
|
41 //! @SYMTestCaseID BT-USER-AccessRequirements-PublicApi-Passive-Slave-Auto-0001 |
|
42 //! @SYMAPI CBluetoothSocket, TBTDevAddr, RHostResolver, TRfcommSockAddr, TBTServiceSecurity |
|
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 TBTServiceSecurity |
|
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-Auto.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-Auto-0001-0002 |
|
113 START_TEST_BLOCK 300 T_BTUserAPI \bluetooth\user\BT-USER-AccessRequirements-PublicApi-Passive-Slave-Auto.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-Auto-0001-0002 |
|
127 |
|
128 START_SYNCHRONISED_TESTCASE BT-USER-AccessRequirements-PublicApi-Active-Master-Auto-0001-0003 |
|
129 START_TEST_BLOCK 300 T_BTUserAPI \bluetooth\user\BT-USER-AccessRequirements-PublicApi-Passive-Slave-Auto.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-Auto-0001-0003 |
|
141 |
|
142 START_SYNCHRONISED_TESTCASE BT-USER-AccessRequirements-PublicApi-Active-Master-Auto-0001-0004 |
|
143 START_TEST_BLOCK 300 T_BTUserAPI \bluetooth\user\BT-USER-AccessRequirements-PublicApi-Passive-Slave-Auto.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-Auto-0001-0004 |
|
156 |
|
157 END_TESTCASE BT-USER-AccessRequirements-PublicApi-Passive-Slave-Auto-0001 |
|
158 |
|
159 |
|
160 DELAY 500 |