bluetoothapitest/bluetoothsvs/T_BTUserAPI/scripts/BT-USER-AccessRequirements-PublicApi-Active-Master-Auto.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 BuildRunAccessAutoPassiveSlave
       
    40 
       
    41 DELAY		20000
       
    42 // ****************************************************************************
       
    43 // TBTAccessRequirements Master
       
    44 // ****************************************************************************
       
    45 
       
    46 START_TESTCASE BT-USER-AccessRequirements-PublicApi-Active-Master-Auto-0001
       
    47 //! @SYMTestCaseID				BT-USER-AccessRequirements-PublicApi-Active-Master-Auto-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 FALSE
       
    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-Auto.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-Auto.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-Auto.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-Auto.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-Auto-0001
       
   156 
       
   157 
       
   158 RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini RetrieveExecutionResultAccessAutoPassiveSlave
       
   159 RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StopTDService
       
   160 RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StopSyncService