bluetoothapitest/bluetoothsvs/T_BTUserAPI/scripts/BT-USER-AccessRequirements-PublicApi-Active-Master.script
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     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	UCCControlTE
       
    34 LOAD_SUITE	T_BTUserAPI	-SharedData
       
    35 DELAY		2000
       
    36 
       
    37 RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartSyncService
       
    38 RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartTDService
       
    39 RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini BuildRunAccessPassiveSlave
       
    40 
       
    41 DELAY		5000
       
    42 // ****************************************************************************
       
    43 // TBTAccessRequirements - Master (Auto Tests)
       
    44 // ****************************************************************************	 
       
    45 
       
    46 START_TESTCASE BT-USER-AccessRequirements-PublicApi-Active-Master-0001
       
    47 //! @SYMTestCaseID				BT-USER-AccessRequirements-PublicApi-Active-Master-0001
       
    48 //! @SYMAPI						CBluetoothSocket, TBTDevAddr, RHostResolver, TRfcommSockAddr, TBTAccessRequirements, TBTServiceSecurity
       
    49 //! @SYMTestCaseDesc			Open a connection to a specific Bluetooth device
       
    50 //!								Set SetEncryption() to FALSE
       
    51 //!								Set SetDenied() to FALSE
       
    52 //!								Set SetPasskeyMinLength() to 4
       
    53 //!								Set SetAuthentication() to FALSE
       
    54 //!								Set SetAuthorisation() to FALS
       
    55 //!								Connection creates with those setting successfully and test case passes without any error.
       
    56 //!								Uses API elements: 	NewL()1, Connect()1 and Shutdown() from CBluetoothSocket
       
    57 //!													TBTDevAddr() from TBTDevAddr
       
    58 //!													Open(), SetHostName(), GetDeviceAddress() from RHostResolver
       
    59 //!													TRfcommSockAddr(), SetSecurity(), SetBTAddr(), BTAddr(), SetPort() from TRfcommSockAddr
       
    60 //!													SetEncryption(), SetDenied(), SetPasskeyMinLength(), SetAuthentication() and SetAuthorisation() from TBTAccessRequirements
       
    61 //! @SYMTestActions				1. Order slave to set up connection
       
    62 //!								2. Get result from slave to wait for it to be ready
       
    63 //!								3. Create a connection to the RSocket server
       
    64 //!								4. Create the CBluetoothSocket object using NewL()1 (Standard constructor)
       
    65 //!								5. Create an empty TBTServiceSecurity object
       
    66 //!								6. Set the encryption requirement using SetEncryption() function (FALSE)
       
    67 //!								7. Set the denied requirement using SetDenied() function (FALSE)
       
    68 //!								8. Set the minimal length requrement for passkey using SetPasskeyMinLength() function (4)
       
    69 //!								9. Set the authentication requirement using SetAuthentication() function (FALSE)
       
    70 //!								10. Set the authorisation requirement using SetAuthorisation() function (FALSE)
       
    71 //!								11. Create an empty TBTDevAddr object (slave)
       
    72 //!								12. Create and initialise an RHostResolver
       
    73 //!								13. Set Hostname (MasterDevice) of the device
       
    74 //!								14. Get the slave device address
       
    75 //!								15. Create a TRfcommSockAddr object
       
    76 //!								16. Set the Security of the TRfcommSockAddr (Use default/empty as on server)
       
    77 //!								17. Set the BT address of the TRfcommSockAddr to the one of the Casira pod of the slave that we connect to
       
    78 //!								18. Verify the set BT Address
       
    79 //!								19. Set the port to the specific one of the protocol we use
       
    80 //!								20. Use the TRfcommSockAddr in the connect of the CBluetoothSocket object
       
    81 //!								21. Shut down the CBluetoothSocket object
       
    82 //!								22. Delete CBluetoothSocket object
       
    83 //!
       
    84 //! @SYMTestStatus				Implemented
       
    85 //! @SYMTestPriority			Critical
       
    86 //! @SYMTestExpectedResults		Connection creates successfully and closes successfully.
       
    87 //! @SYMTestType				CIT
       
    88 
       
    89 	START_TEST_BLOCK	500	T_BTUserAPI	\bluetooth\user\BT-USER-AccessRequirements-PublicApi-Active-Master.ini
       
    90 			SHARED_ACTIVE_SCHEDULER
       
    91 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
    92 			CREATE_OBJECT	TBTServiceSecurity	TBTServiceSecurity1	
       
    93 			COMMAND		CBluetoothSocket1	RSocketServerConnect		
       
    94 			COMMAND		CBluetoothSocket1	NewL		BT-USER-AccessRequirements-PublicApi-Active-0001-0001command2NewL
       
    95 			COMMAND		TBTServiceSecurity1	Construct		
       
    96 			COMMAND		TBTServiceSecurity1	SetEncryption		BT-USER-AccessRequirements-PublicApi-Active-0001-0001command5SetEncryption
       
    97 			COMMAND		TBTServiceSecurity1	SetDenied		BT-USER-AccessRequirements-PublicApi-Active-0001-0001command6SetDenied
       
    98 			COMMAND		TBTServiceSecurity1	SetPasskeyMinLength	BT-USER-AccessRequirements-PublicApi-Active-0001-0001command7SetPasskeyMinLength
       
    99 			COMMAND		TBTServiceSecurity1	SetAuthentication	BT-USER-AccessRequirements-PublicApi-Active-0001-0001command8SetAuthentication					
       
   100 			COMMAND		TBTServiceSecurity1	SetAuthorisation	BT-USER-AccessRequirements-PublicApi-Active-0001-0001command9SetAuthorisation	
       
   101 			STORE	CBluetoothSocket1	
       
   102 			STORE	TBTServiceSecurity1	
       
   103 			STORE_ACTIVE_SCHEDULER
       
   104 	END_TEST_BLOCK
       
   105 	DELAY	2000
       
   106 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartSyncTestCase
       
   107 	DELAY	5000
       
   108 	START_TEST_BLOCK	500	T_BTUserAPI	\bluetooth\user\BT-USER-AccessRequirements-PublicApi-Active-Master.ini
       
   109 			SHARED_ACTIVE_SCHEDULER
       
   110 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   111 			CREATE_OBJECT	TRfcommSockAddr	TRfcommSockAddr1	
       
   112 			CREATE_OBJECT	TBTDevAddr	TBTDevAddrRemote	
       
   113 			RESTORE_OBJECT	TBTServiceSecurity	TBTServiceSecurity1	
       
   114 			COMMAND		TBTDevAddrRemote	Construct		
       
   115 			COMMAND		TBTDevAddrRemote	OpenHostResolver	BT-USER-AccessRequirements-PublicApi-Active-0001-0002command3OpenHostResolver
       
   116 			COMMAND		TBTDevAddrRemote	SetHostNameL		BT-USER-AccessRequirements-PublicApi-Active-0001-0002command4SetHostNameL
       
   117 			COMMAND		TBTDevAddrRemote	GetDeviceAddress	BT-USER-AccessRequirements-PublicApi-Active-0001-0002command5GetDeviceAddress
       
   118 			OUTSTANDING
       
   119 			COMMAND		TRfcommSockAddr1	Construct		
       
   120 			COMMAND		TRfcommSockAddr1	SetSecurity	BT-USER-AccessRequirements-PublicApi-Active-0001-0002command8SetSecurity
       
   121 			COMMAND		TRfcommSockAddr1	SetBTAddr	BT-USER-AccessRequirements-PublicApi-Active-0001-0002command9SetBTAddr
       
   122 			COMMAND		TRfcommSockAddr1	BTAddr		BT-USER-AccessRequirements-PublicApi-Active-0001-0002command10BTAddr
       
   123 			COMMAND		TRfcommSockAddr1	SetPort		BT-USER-AccessRequirements-PublicApi-Active-0001-0002command11SetPort
       
   124 			STORE	CBluetoothSocket1	
       
   125 			STORE	TRfcommSockAddr1	
       
   126 			STORE_ACTIVE_SCHEDULER
       
   127 	END_TEST_BLOCK
       
   128 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini RetrieveSyncTestCaseResult
       
   129 	DELAY	2000
       
   130 	
       
   131 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartSyncTestCase
       
   132 	DELAY	5000
       
   133 	START_TEST_BLOCK	2000	T_BTUserAPI	\bluetooth\user\BT-USER-AccessRequirements-PublicApi-Active-Master.ini
       
   134 			SHARED_ACTIVE_SCHEDULER
       
   135 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   136 			RESTORE_OBJECT	TRfcommSockAddr		TRfcommSockAddr1
       
   137 			COMMAND		CBluetoothSocket1	Connect		BT-USER-AccessRequirements-PublicApi-Active-0001-0003command1Connect
       
   138 			OUTSTANDING
       
   139 			STORE	CBluetoothSocket1	
       
   140 			STORE_ACTIVE_SCHEDULER
       
   141 	END_TEST_BLOCK
       
   142 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini RetrieveSyncTestCaseResult
       
   143 	
       
   144 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartSyncTestCase
       
   145 	START_TEST_BLOCK	500	T_BTUserAPI	\bluetooth\user\BT-USER-AccessRequirements-PublicApi-Active-Master.ini
       
   146 			SHARED_ACTIVE_SCHEDULER
       
   147 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   148 			COMMAND		CBluetoothSocket1	Shutdown		BT-USER-AccessRequirements-PublicApi-Active-0001-0004command1Shutdown
       
   149 			OUTSTANDING
       
   150 			COMMAND		CBluetoothSocket1	~		
       
   151 			COMMAND		CBluetoothSocket1	RSocketServerClose	
       
   152 	END_TEST_BLOCK
       
   153 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini RetrieveSyncTestCaseResult
       
   154 
       
   155 END_TESTCASE BT-USER-AccessRequirements-PublicApi-Active-Master-0001
       
   156 
       
   157 
       
   158 // ****************************************************************************
       
   159 // TBTAccessRequirement - Master (Manual Tests)
       
   160 // ****************************************************************************	
       
   161 // Connected
       
   162 
       
   163 START_TESTCASE BT-USER-Access-PublicApi-Active-Master-0001
       
   164 //! @SYMTestCaseID				BT-USER-Access-PublicApi-Active-Master-0001
       
   165 //! @SYMAPI						CBluetoothSocket, TBTDevAddr, RHostResolver, TRfcommSockAddr, TBTAccessRequirements, TBTServiceSecurity
       
   166 //! @SYMTestCaseDesc			Open a connection to a specific Bluetooth device
       
   167 //!								Set SetEncryption() to FALSE
       
   168 //!								Set SetDenied() to FALSE
       
   169 //!								Set SetPasskeyMinLength() to 4
       
   170 //!								Set SetAuthentication() to FALSE
       
   171 //!								Set SetAuthorisation() to FALS
       
   172 //!								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.
       
   173 //!								Uses API elements: 	NewL()1, Connect()1 and Shutdown() from CBluetoothSocket
       
   174 //!													TBTDevAddr() from TBTDevAddr
       
   175 //!													Open(), SetHostName(), GetDeviceAddress() from RHostResolver
       
   176 //!													TRfcommSockAddr(), SetSecurity(), SetBTAddr(), BTAddr(), SetPort() from TRfcommSockAddr
       
   177 //!													SetEncryption(), SetDenied(), SetPasskeyMinLength(), SetAuthentication() and SetAuthorisation() from TBTAccessRequirements
       
   178 //! @SYMTestActions				1. Order slave to set up connection
       
   179 //!								2. Get result from slave to wait for it to be ready
       
   180 //!								3. Create a connection to the RSocket server
       
   181 //!								4. Create the CBluetoothSocket object using NewL()1 (Standard constructor)
       
   182 //!								5. Create an empty TBTServiceSecurity object
       
   183 //!								6. Set the encryption requirement using SetEncryption() function (FALSE)
       
   184 //!								7. Set the denied requirement using SetDenied() function (FALSE)
       
   185 //!								8. Set the minimal length requrement for passkey using SetPasskeyMinLength() function (4)
       
   186 //!								9. Set the authentication requirement using SetAuthentication() function (FALSE)
       
   187 //!								10. Set the authorisation requirement using SetAuthorisation() function (FALSE)
       
   188 //!								11. Create an empty TBTDevAddr object (slave)
       
   189 //!								12. Create and initialise an RHostResolver
       
   190 //!								13. Set Hostname (MasterDevice) of the device
       
   191 //!								14. Get the slave device address
       
   192 //!								15. Create a TRfcommSockAddr object
       
   193 //!								16. Set the Security of the TRfcommSockAddr (Use default/empty as on server)
       
   194 //!								17. Set the BT address of the TRfcommSockAddr to the one of the Casira pod of the slave that we connect to
       
   195 //!								18. Verify the set BT Address
       
   196 //!								19. Set the port to the specific one of the protocol we use
       
   197 //!								20. Use the TRfcommSockAddr in the connect of the CBluetoothSocket object
       
   198 //!								21. Shut down the CBluetoothSocket object
       
   199 //!								22. delete CBluetoothSocket object
       
   200 //!
       
   201 //! @SYMTestStatus				Implemented
       
   202 //! @SYMTestPriority			Critical
       
   203 //! @SYMTestExpectedResults		Pre-condition : no authenticated devices in both emulators.
       
   204 //!								Passkey is asked first in slave and then in master while connecting. The min passkey lengthis specified as 4 in the passkey entrance window.
       
   205 //!								In the master emulator, slave is seen as authenticated. In the slave emulator, master is seen as authenticated.
       
   206 //!								The test case passes without any error.
       
   207 //! @SYMTestType				CIT
       
   208 
       
   209 	START_TEST_BLOCK	500	T_BTUserAPI	\bluetooth\user\BT-USER-AccessRequirements-PublicApi-Active-Master.ini
       
   210 			SHARED_ACTIVE_SCHEDULER
       
   211 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   212 			CREATE_OBJECT	TBTServiceSecurity	TBTServiceSecurity1	
       
   213 			COMMAND		CBluetoothSocket1	RSocketServerConnect		
       
   214 			COMMAND		CBluetoothSocket1	NewL		BT-USER-Access-PublicApi-Active-0001-0001command2NewL
       
   215 			COMMAND		TBTServiceSecurity1	Construct		
       
   216 			COMMAND		TBTServiceSecurity1	SetEncryption		BT-USER-Access-PublicApi-Active-0001-0001command5SetEncryption
       
   217 			COMMAND		TBTServiceSecurity1	SetDenied			BT-USER-Access-PublicApi-Active-0001-0001command6SetDenied
       
   218 			COMMAND		TBTServiceSecurity1	SetPasskeyMinLength		BT-USER-Access-PublicApi-Active-0001-0001command7SetPasskeyMinLength
       
   219 			COMMAND		TBTServiceSecurity1	SetAuthentication		BT-USER-Access-PublicApi-Active-0001-0001command8SetAuthentication
       
   220 			COMMAND		TBTServiceSecurity1	SetAuthorisation		BT-USER-Access-PublicApi-Active-0001-0001command9SetAuthorisation
       
   221 			STORE	CBluetoothSocket1	
       
   222 			STORE	TBTServiceSecurity1	
       
   223 			STORE_ACTIVE_SCHEDULER
       
   224 	END_TEST_BLOCK
       
   225 	DELAY	2000
       
   226 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartSyncTestCase
       
   227 	DELAY	5000
       
   228 	START_TEST_BLOCK	500	T_BTUserAPI	\bluetooth\user\BT-USER-AccessRequirements-PublicApi-Active-Master.ini
       
   229 			SHARED_ACTIVE_SCHEDULER
       
   230 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   231 			CREATE_OBJECT	TRfcommSockAddr	TRfcommSockAddr1	
       
   232 			CREATE_OBJECT	TBTDevAddr	TBTDevAddrRemote	
       
   233 			RESTORE_OBJECT	TBTServiceSecurity	TBTServiceSecurity1	
       
   234 			COMMAND		TBTDevAddrRemote	Construct		
       
   235 			COMMAND		TBTDevAddrRemote	OpenHostResolver		BT-USER-Access-PublicApi-Active-0001-0002command3OpenHostResolver
       
   236 			COMMAND		TBTDevAddrRemote	SetHostNameL		BT-USER-Access-PublicApi-Active-0001-0002command4SetHostNameL
       
   237 			COMMAND		TBTDevAddrRemote	GetDeviceAddress		BT-USER-Access-PublicApi-Active-0001-0002command5GetDeviceAddress
       
   238 			OUTSTANDING
       
   239 			COMMAND		TRfcommSockAddr1	Construct		
       
   240 			COMMAND		TRfcommSockAddr1	SetSecurity		BT-USER-Access-PublicApi-Active-0001-0002command8SetSecurity
       
   241 			COMMAND		TRfcommSockAddr1	SetBTAddr		BT-USER-Access-PublicApi-Active-0001-0002command9SetBTAddr
       
   242 			COMMAND		TRfcommSockAddr1	BTAddr		BT-USER-Access-PublicApi-Active-0001-0002command10BTAddr
       
   243 			COMMAND		TRfcommSockAddr1	SetPort		BT-USER-Access-PublicApi-Active-0001-0002command11SetPort
       
   244 			STORE	CBluetoothSocket1	
       
   245 			STORE	TRfcommSockAddr1	
       
   246 			STORE_ACTIVE_SCHEDULER
       
   247 	END_TEST_BLOCK
       
   248 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini RetrieveSyncTestCaseResult
       
   249 	DELAY	2000
       
   250 
       
   251 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartSyncTestCase
       
   252 	DELAY	5000
       
   253 	START_TEST_BLOCK	2000	T_BTUserAPI	\bluetooth\user\BT-USER-AccessRequirements-PublicApi-Active-Master.ini
       
   254 			SHARED_ACTIVE_SCHEDULER
       
   255 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   256 			RESTORE_OBJECT	TRfcommSockAddr	TRfcommSockAddr1	
       
   257 			COMMAND		CBluetoothSocket1	Connect		BT-USER-Access-PublicApi-Active-0001-0003command1Connect
       
   258 			OUTSTANDING
       
   259 			STORE	CBluetoothSocket1	
       
   260 			STORE_ACTIVE_SCHEDULER
       
   261 	END_TEST_BLOCK
       
   262 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini RetrieveSyncTestCaseResult
       
   263 	
       
   264 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartSyncTestCase
       
   265 	START_TEST_BLOCK	500	T_BTUserAPI	\bluetooth\user\BT-USER-AccessRequirements-PublicApi-Active-Master.ini
       
   266 			SHARED_ACTIVE_SCHEDULER
       
   267 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   268 			COMMAND		CBluetoothSocket1	Shutdown		BT-USER-Access-PublicApi-Active-0001-0004command1Shutdown
       
   269 			OUTSTANDING
       
   270 			COMMAND		CBluetoothSocket1	~		
       
   271 			COMMAND		CBluetoothSocket1	RSocketServerClose		
       
   272 	END_TEST_BLOCK
       
   273 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini RetrieveSyncTestCaseResult
       
   274 
       
   275 END_TESTCASE BT-USER-Access-PublicApi-Active-Master-0001
       
   276 
       
   277 
       
   278 START_TESTCASE BT-USER-Access-PublicApi-Active-Master-0002
       
   279 //! @SYMTestCaseID				BT-USER-Access-PublicApi-Active-Master-0002
       
   280 //! @SYMAPI						CBluetoothSocket, TBTDevAddr, RHostResolver, TRfcommSockAddr, TBTAccessRequirements, TBTServiceSecurity
       
   281 //! @SYMTestCaseDesc			Open a connection to a specific Bluetooth device
       
   282 //!								Set SetEncryption() to FALSE
       
   283 //!								Set SetDenied() to FALSE
       
   284 //!								Set SetPasskeyMinLength() to 4
       
   285 //!								Set SetAuthentication() to TRUE
       
   286 //!								Set SetAuthorisation() to FALS
       
   287 //!								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.
       
   288 //!								Uses API elements: 	NewL()1, Connect()1 and Shutdown() from CBluetoothSocket
       
   289 //!													TBTDevAddr() from TBTDevAddr
       
   290 //!													Open(), SetHostName(), GetDeviceAddress() from RHostResolver
       
   291 //!													TRfcommSockAddr(), SetSecurity(), SetBTAddr(), BTAddr(), SetPort() from TRfcommSockAddr
       
   292 //!													SetEncryption(), SetDenied(), SetPasskeyMinLength(), SetAuthentication() and SetAuthorisation() from TBTAccessRequirements
       
   293 //! @SYMTestActions				1. Order slave to set up connection
       
   294 //!								2. Get result from slave to wait for it to be ready
       
   295 //!								3. Create a connection to the RSocket server
       
   296 //!								4. Create the CBluetoothSocket object using NewL()1 (Standard constructor)
       
   297 //!								5. Create an empty TBTServiceSecurity object
       
   298 //!								6. Set the encryption requirement using SetEncryption() function (FALSE)
       
   299 //!								7. Set the denied requirement using SetDenied() function (FALSE)
       
   300 //!								8. Set the minimal length requrement for passkey using SetPasskeyMinLength() function (4)
       
   301 //!								9. Set the authentication requirement using SetAuthentication() function (TRUE)
       
   302 //!								10. Set the authorisation requirement using SetAuthorisation() function (FALSE)
       
   303 //!								11. Create an empty TBTDevAddr object (slave)
       
   304 //!								12. Create and initialise an RHostResolver
       
   305 //!								13. Set Hostname (MasterDevice) of the device
       
   306 //!								14. Get the slave device address
       
   307 //!								15. Create a TRfcommSockAddr object
       
   308 //!								16. Set the Security of the TRfcommSockAddr (Use default/empty as on server)
       
   309 //!								17. Set the BT address of the TRfcommSockAddr to the one of the Casira pod of the slave that we connect to
       
   310 //!								18. Verify the set BT Address
       
   311 //!								19. Set the port to the specific one of the protocol we use
       
   312 //!								20. Use the TRfcommSockAddr in the connect of the CBluetoothSocket object
       
   313 //!								21. Shut down the CBluetoothSocket object
       
   314 //!								22. delete CBluetoothSocket object
       
   315 //!
       
   316 //! @SYMTestStatus				Implemented
       
   317 //! @SYMTestPriority			Critical
       
   318 //! @SYMTestExpectedResults		Because authentication has already been done in the previous test case, 
       
   319 //!								the Passkey will not be asked again in master and then in slave while connecting.
       
   320 //!								In the master emulator, slave is seen as authenticated. In the slave emulator, master is seen as authenticated.
       
   321 //!								The test case passes without any error.
       
   322 //! @SYMTestType				CIT
       
   323 
       
   324 	START_TEST_BLOCK	500	T_BTUserAPI	\bluetooth\user\BT-USER-AccessRequirements-PublicApi-Active-Master.ini
       
   325 			SHARED_ACTIVE_SCHEDULER
       
   326 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   327 			CREATE_OBJECT	TBTServiceSecurity	TBTServiceSecurity1	
       
   328 			COMMAND		CBluetoothSocket1	RSocketServerConnect		
       
   329 			COMMAND		CBluetoothSocket1	NewL		BT-USER-Access-PublicApi-Active-0002-0001command2NewL
       
   330 			COMMAND		TBTServiceSecurity1	Construct		
       
   331 			COMMAND		TBTServiceSecurity1	SetEncryption		BT-USER-Access-PublicApi-Active-0002-0001command5SetEncryption
       
   332 			COMMAND		TBTServiceSecurity1	SetDenied			BT-USER-Access-PublicApi-Active-0002-0001command6SetDenied
       
   333 			COMMAND		TBTServiceSecurity1	SetPasskeyMinLength		BT-USER-Access-PublicApi-Active-0002-0001command7SetPasskeyMinLength
       
   334 			COMMAND		TBTServiceSecurity1	SetAuthentication		BT-USER-Access-PublicApi-Active-0002-0001command8SetAuthentication
       
   335 			COMMAND		TBTServiceSecurity1	SetAuthorisation		BT-USER-Access-PublicApi-Active-0002-0001command9SetAuthorisation
       
   336 			STORE	CBluetoothSocket1	
       
   337 			STORE	TBTServiceSecurity1	
       
   338 			STORE_ACTIVE_SCHEDULER
       
   339 	END_TEST_BLOCK
       
   340 	DELAY	2000
       
   341 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartSyncTestCase
       
   342 	DELAY	5000
       
   343 	START_TEST_BLOCK	500	T_BTUserAPI	\bluetooth\user\BT-USER-AccessRequirements-PublicApi-Active-Master.ini
       
   344 			SHARED_ACTIVE_SCHEDULER
       
   345 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   346 			CREATE_OBJECT	TRfcommSockAddr	TRfcommSockAddr1	
       
   347 			CREATE_OBJECT	TBTDevAddr	TBTDevAddrRemote	
       
   348 			RESTORE_OBJECT	TBTServiceSecurity	TBTServiceSecurity1	
       
   349 			COMMAND		TBTDevAddrRemote	Construct		
       
   350 			COMMAND		TBTDevAddrRemote	OpenHostResolver		BT-USER-Access-PublicApi-Active-0002-0002command3OpenHostResolver
       
   351 			COMMAND		TBTDevAddrRemote	SetHostNameL		BT-USER-Access-PublicApi-Active-0002-0002command4SetHostNameL
       
   352 			COMMAND		TBTDevAddrRemote	GetDeviceAddress		BT-USER-Access-PublicApi-Active-0002-0002command5GetDeviceAddress
       
   353 			OUTSTANDING
       
   354 			COMMAND		TRfcommSockAddr1	Construct		
       
   355 			COMMAND		TRfcommSockAddr1	SetSecurity		BT-USER-Access-PublicApi-Active-0002-0002command8SetSecurity
       
   356 			COMMAND		TRfcommSockAddr1	SetBTAddr		BT-USER-Access-PublicApi-Active-0002-0002command9SetBTAddr
       
   357 			COMMAND		TRfcommSockAddr1	BTAddr		BT-USER-Access-PublicApi-Active-0002-0002command10BTAddr
       
   358 			COMMAND		TRfcommSockAddr1	SetPort		BT-USER-Access-PublicApi-Active-0002-0002command11SetPort
       
   359 			STORE	CBluetoothSocket1	
       
   360 			STORE	TRfcommSockAddr1	
       
   361 			STORE_ACTIVE_SCHEDULER
       
   362 	END_TEST_BLOCK
       
   363 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini RetrieveSyncTestCaseResult
       
   364 	DELAY	2000
       
   365 	
       
   366 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartSyncTestCase
       
   367 	DELAY	5000
       
   368 	START_TEST_BLOCK	2000	T_BTUserAPI	\bluetooth\user\BT-USER-AccessRequirements-PublicApi-Active-Master.ini
       
   369 			SHARED_ACTIVE_SCHEDULER
       
   370 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   371 			RESTORE_OBJECT	TRfcommSockAddr	TRfcommSockAddr1	
       
   372 			COMMAND		CBluetoothSocket1	Connect		BT-USER-Access-PublicApi-Active-0002-0003command1Connect
       
   373 			OUTSTANDING
       
   374 			STORE	CBluetoothSocket1	
       
   375 			STORE_ACTIVE_SCHEDULER
       
   376 	END_TEST_BLOCK
       
   377 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini RetrieveSyncTestCaseResult
       
   378 	
       
   379 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartSyncTestCase
       
   380 	START_TEST_BLOCK	500	T_BTUserAPI	\bluetooth\user\BT-USER-AccessRequirements-PublicApi-Active-Master.ini
       
   381 			SHARED_ACTIVE_SCHEDULER
       
   382 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   383 			COMMAND		CBluetoothSocket1	Shutdown		BT-USER-Access-PublicApi-Active-0002-0004command1Shutdown
       
   384 			OUTSTANDING
       
   385 			COMMAND		CBluetoothSocket1	~		
       
   386 			COMMAND		CBluetoothSocket1	RSocketServerClose		
       
   387 	END_TEST_BLOCK
       
   388 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini RetrieveSyncTestCaseResult
       
   389 
       
   390 END_TESTCASE BT-USER-Access-PublicApi-Active-Master-0002
       
   391 
       
   392 
       
   393 RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini RetrieveExecutionResultAccessPassiveSlave
       
   394 RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StopTDService
       
   395 RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StopSyncService
       
   396