bluetoothapitest/bluetoothsvs/T_BTUserAPI/scripts/BT-USER-BluetoothPhysicalLinks-PublicApi.script
//
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//
///////////////////////////////////////////////////////////////////////////////
//! @file
//! @SYMTestSuiteName T_BTUserAPI
//! @SYMScriptTestEnvironment This test script requires a basic ROM with bluetooth dongle.
//! @SYMScriptDescription Tests all public elements of the CBluetoothPhysicalLinks classe
//! as a means of confidence that the API works as expected.
//! The purpose is to provide a regression test suite of PublishedAll APIs for
//! BT USER related classes.
//! Negative testing is performed to confirm that correct errors are returned
//! when incorrect parameters are given. The tests are fully automated.
//! @SYMAuthor Zoe Chen
//! @SYMCreationDate 06/03/2007
///////////////////////////////////////////////////////////////////////////////
RUN_UTILS MkDir ${SYSDRIVE}\bluetooth\
RUN_UTILS MkDir ${SYSDRIVE}\bluetooth\user\
LOAD_SUITE T_BTUserAPI
DELAY 500
// ****************************************************************************
// CBluetoothPhysicalLinks
// ****************************************************************************
START_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0001
//! @SYMTestCaseID BT-USER-BluetoothPhysicalLinks-PublicApi-0001
//! @SYMAPI CBluetoothPhysicalLinks and RSocketServ
//! @SYMTestCaseDesc Open a Bluetooth socket
//! Uses API elements: NewL() and destructor from CBluetoothPhysicalLinks
//! RSocketServ(), Connect() and Close() from RSocketServ
//! @SYMTestActions 1. Create and start a session on the socket server
//! 2. Open a Bluetooth socket using NewL() function. Return KErrNone if successful
//! 3. Delete the Bluetooth socket using destructor
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults Bluetooth socket was opened successfully
//! @SYMTestType CIT
START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BluetoothPhysicalLinks-PublicApi.ini
CREATE_OBJECT CBluetoothPhysicalLinks CBluetoothPhysicalLinks1
CREATE_OBJECT RSocketServ RSocketServ1
COMMAND RSocketServ1 RSocketServ
COMMAND RSocketServ1 Connect
COMMAND CBluetoothPhysicalLinks1 NewL BT-USER-BluetoothPhysicalLinks-PublicApi-0001-0001command5NewL
COMMAND CBluetoothPhysicalLinks1 ~
COMMAND RSocketServ1 Close
END_TEST_BLOCK
END_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0001
START_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0002
//! @SYMTestCaseID BT-USER-BluetoothPhysicalLinks-PublicApi-0002
//! @SYMAPI CBluetoothPhysicalLinks and RSocketServ
//! @SYMTestCaseDesc Open a Bluetooth socket
//! Uses API elements: NewLC() and destructor from CBluetoothPhysicalLinks
//! RSocketServ(), Connect() and Close() from RSocketServ
//! @SYMTestActions 1. Create and start a session on the socket server
//! 2. Open a Bluetooth socket using NewLC() function. Return KErrNone if successful
//! 3. Delete the Bluetooth socket using destructor
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults Bluetooth socket was opened successfully
//! @SYMTestType CIT
START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BluetoothPhysicalLinks-PublicApi.ini
CREATE_OBJECT CBluetoothPhysicalLinks CBluetoothPhysicalLinks1
CREATE_OBJECT RSocketServ RSocketServ1
COMMAND RSocketServ1 RSocketServ
COMMAND RSocketServ1 Connect
COMMAND CBluetoothPhysicalLinks1 NewLC BT-USER-BluetoothPhysicalLinks-PublicApi-0002-0001command5NewLC
COMMAND CBluetoothPhysicalLinks1 ~
COMMAND RSocketServ1 Close
END_TEST_BLOCK
END_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0002
START_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0003
//! @SYMTestCaseID BT-USER-BluetoothPhysicalLinks-PublicApi-0003
//! @SYMAPI CBluetoothPhysicalLinks and RSocketServ
//! @SYMTestCaseDesc Return a null aObject if the extension is not implemented, or a pointer to another interface if it is
//! Uses API elements: NewL(), MBPLN_ExtensionInterfaceL() and destructor from CBluetoothPhysicalLinks
//! RSocketServ(), Connect() and Close() from RSocketServ
//! @SYMTestActions 1. Create and start a session on the socket server
//! 2. Open a Bluetooth socket using NewL() function. Return KErrNone if successful
//! 3. Verify the pointer returned is null using MBPLN_ExtensionInterfaceL() function.
//! Return KErrNone if successful
//! 4. Delete the Bluetooth socket using destructor
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults A NULL pointer returned
//! @SYMTestType CIT
START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BluetoothPhysicalLinks-PublicApi.ini
CREATE_OBJECT CBluetoothPhysicalLinks CBluetoothPhysicalLinks1
CREATE_OBJECT RSocketServ RSocketServ1
COMMAND RSocketServ1 RSocketServ
COMMAND RSocketServ1 Connect
COMMAND CBluetoothPhysicalLinks1 NewL BT-USER-BluetoothPhysicalLinks-PublicApi-0003-0001command5NewL
COMMAND CBluetoothPhysicalLinks1 MBPLN_ExtensionInterfaceL BT-USER-BluetoothPhysicalLinks-PublicApi-0003-0001command6MBPLN_ExtensionInterfaceL
COMMAND CBluetoothPhysicalLinks1 ~
COMMAND RSocketServ1 Close
END_TEST_BLOCK
END_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0003
// ****************************************************************************
// Negative test cases
// ****************************************************************************
//!START_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0004
//! @SYMTestCaseID BT-USER-BluetoothPhysicalLinks-PublicApi-0004
//! @SYMAPI CBluetoothPhysicalLinks
//! @SYMTestCaseDesc Open a Bluetooth socket without connecting to the socket server first
//! Uses API elements: NewL()
//! @SYMTestActions 1. Open a Bluetooth socket using NewL() function.
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults Panic at step 1
//! @SYMTestType CIT
//! START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BluetoothPhysicalLinks-PublicApi.ini
//! CREATE_OBJECT CBluetoothPhysicalLinks CBluetoothPhysicalLinks1
//! CREATE_OBJECT RSocketServ RSocketServ1
//! COMMAND CBluetoothPhysicalLinks1 NewL BT-USER-BluetoothPhysicalLinks-PublicApi-0004-0001command1NewL
//! END_TEST_BLOCK !PanicCode=3 !PanicString=KERN-EXEC
//!END_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0004
//!START_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0005
//! @SYMTestCaseID BT-USER-BluetoothPhysicalLinks-PublicApi-0005
//! @SYMAPI CBluetoothPhysicalLinks
//! @SYMTestCaseDesc Open a Bluetooth socket without connecting to the socket server first
//! Uses API elements: NewLC()
//! @SYMTestActions 1. Open a Bluetooth socket using NewLC() function.
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults Panic at step 1
//! @SYMTestType CIT
//! START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BluetoothPhysicalLinks-PublicApi.ini
//! CREATE_OBJECT CBluetoothPhysicalLinks CBluetoothPhysicalLinks1
//! CREATE_OBJECT RSocketServ RSocketServ1
//! COMMAND CBluetoothPhysicalLinks1 NewLC BT-USER-BluetoothPhysicalLinks-PublicApi-0005-0001command1NewLC
//! END_TEST_BLOCK !PanicCode=3 !PanicString=KERN-EXEC
//!END_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0005
//!START_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0006
//! @SYMTestCaseID BT-USER-BluetoothPhysicalLinks-PublicApi-0006
//! @SYMAPI CBluetoothPhysicalLinks and RSocketServ
//! @SYMTestCaseDesc Bring in a new member to the piconet after closing the socket server
//! Uses API elements: NewL() and CreateConnection() from CBluetoothPhysicalLinks
//! RSocketServ(), Connect() and Close() from RSocketServ
//! @SYMTestActions 1. Create and start a session on the socket server
//! 2. Open a Bluetooth socket using NewL() function. Return KErrNone if successful
//! 3. Close the session on the socket server
//! 4. Bring in a new member to the piconet with a device address(33333333) using
//! CreateConnection() function.
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults Panic at step 4
//! @SYMTestType CIT
//! START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BluetoothPhysicalLinks-PublicApi.ini
//! CREATE_OBJECT CBluetoothPhysicalLinks CBluetoothPhysicalLinks1
//! CREATE_OBJECT RSocketServ RSocketServ1
//! COMMAND RSocketServ1 RSocketServ
//! COMMAND RSocketServ1 Connect
//! COMMAND CBluetoothPhysicalLinks1 NewL BT-USER-BluetoothPhysicalLinks-PublicApi-0006-0001command5NewL
//! COMMAND RSocketServ1 Close
//! COMMAND CBluetoothPhysicalLinks1 CreateConnection BT-USER-BluetoothPhysicalLinks-PublicApi-0006-0001command9CreateConnection
//! END_TEST_BLOCK !PanicCode=0 !PanicString=KERN-EXEC
//!END_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0006
//!START_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0007
//! @SYMTestCaseID BT-USER-BluetoothPhysicalLinks-PublicApi-0007
//! @SYMAPI CBluetoothPhysicalLinks and RSocketServ
//! @SYMTestCaseDesc Cancel bringing in a new member to the piconet after closing the socket server
//! Uses API elements: NewL() and CancelCreateConnection() from CBluetoothPhysicalLinks
//! RSocketServ(), Connect() and Close() from RSocketServ
//! @SYMTestActions 1. Create and start a session on the socket server
//! 2. Open a Bluetooth socket using NewL() function. Return KErrNone if successful
//! 3. Close the session on the socket server
//! 4. Cancel bringing in a new member to the piconet using CancelCreateConnection() function.
//!
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults Panic at step 4
//! @SYMTestType CIT
//! START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BluetoothPhysicalLinks-PublicApi.ini
//! CREATE_OBJECT CBluetoothPhysicalLinks CBluetoothPhysicalLinks1
//! CREATE_OBJECT RSocketServ RSocketServ1
//! COMMAND RSocketServ1 RSocketServ
//! COMMAND RSocketServ1 Connect
//! COMMAND CBluetoothPhysicalLinks1 NewL BT-USER-BluetoothPhysicalLinks-PublicApi-0007-0001command5NewL
//! COMMAND RSocketServ1 Close
//! COMMAND CBluetoothPhysicalLinks1 CancelCreateConnection
//! END_TEST_BLOCK !PanicCode=0 !PanicString=KERN-EXEC
//!END_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0007
START_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0008
//! @SYMTestCaseID BT-USER-BluetoothPhysicalLinks-PublicApi-0008
//! @SYMAPI CBluetoothPhysicalLinks and RSocketServ
//! @SYMTestCaseDesc Enumerate connected members of the piconet
//! Uses API elements: NewL(), Enumerate() and destructor from CBluetoothPhysicalLinks
//! RSocketServ(), Connect() and Close() from RSocketServ
//! @SYMTestActions 1. Create and start a session on the socket server
//! 2. Open a Bluetooth socket using NewL() function. Return KErrNone if successful
//! 3. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
//! Return KErrNone if successful
//! 4. Verify that if return RBTDevAddrArray size is 0 as expected 0
//! 5. Delete the Bluetooth socket using destructor
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults Zero member returned
//! @SYMTestType CIT
START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BluetoothPhysicalLinks-PublicApi.ini
CREATE_OBJECT CBluetoothPhysicalLinks CBluetoothPhysicalLinks1
CREATE_OBJECT RSocketServ RSocketServ1
COMMAND RSocketServ1 RSocketServ
COMMAND RSocketServ1 Connect
COMMAND CBluetoothPhysicalLinks1 NewL BT-USER-BluetoothPhysicalLinks-PublicApi-0008-0001command5NewL
COMMAND CBluetoothPhysicalLinks1 Enumerate BT-USER-BluetoothPhysicalLinks-PublicApi-0008-0001command6Enumerate
COMMAND CBluetoothPhysicalLinks1 ~
COMMAND RSocketServ1 Close
END_TEST_BLOCK
END_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0008
START_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0009
//! @SYMTestCaseID BT-USER-BluetoothPhysicalLinks-PublicApi-0009
//! @SYMAPI CBluetoothPhysicalLinks, MBluetoothPhysicalLinksNotifier and RSocketServ
//! @SYMTestCaseDesc Bring in a new member to the piconet
//! Uses API elements: NewL(), CreateConnection() and destructor from CBluetoothPhysicalLinks
//! RSocketServ(), Connect() and Close() from RSocketServ
//! HandleCreateConnectionCompleteL() from MBluetoothPhysicalLinksNotifier
//! @SYMTestActions 1. Create and start a session on the socket server
//! 2. Open a Bluetooth socket using NewL() function. Return KErrNone if successful
//! 3. Bring in a new member to the piconet with a device address(12121212) using
//! CreateConnection() function. Return KErrNone if successful
//! 4. Return Callback HandleCreateConnectionCompleteL() function
//! 5. Verify that if return result (Error -6004) from callback function is as expected. (Error -6004)
//! 6. Delete the Bluetooth socket using destructor
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults EPageTimedOut (-6004) returned as expected at step 4
//! @SYMTestType CIT
START_TEST_BLOCK 2000 T_BTUserAPI \bluetooth\user\BT-USER-BluetoothPhysicalLinks-PublicApi.ini
CREATE_OBJECT CBluetoothPhysicalLinks CBluetoothPhysicalLinks1
CREATE_OBJECT RSocketServ RSocketServ1
COMMAND RSocketServ1 RSocketServ
COMMAND RSocketServ1 Connect
COMMAND CBluetoothPhysicalLinks1 NewL BT-USER-BluetoothPhysicalLinks-PublicApi-0009-0001command5NewL
COMMAND CBluetoothPhysicalLinks1 CreateConnection BT-USER-BluetoothPhysicalLinks-PublicApi-0009-0001command6CreateConnection
OUTSTANDING
COMMAND CBluetoothPhysicalLinks1 ~
COMMAND RSocketServ1 Close
END_TEST_BLOCK
END_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0009
START_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0010
//! @SYMTestCaseID BT-USER-BluetoothPhysicalLinks-PublicApi-0010
//! @SYMAPI CBluetoothPhysicalLinks, MBluetoothPhysicalLinksNotifier and RSocketServ
//! @SYMTestCaseDesc Disconnect a single member of piconet
//! Uses API elements: NewL(), CreateConnection(), Disconnect() and destructor from CBluetoothPhysicalLinks
//! RSocketServ(), Connect() and Close() from RSocketServ
//! HandleCreateConnectionCompleteL() and HandleDisconnectCompleteL() from MBluetoothPhysicalLinksNotifier
//! @SYMTestActions 1. Create and start a session on the socket server
//! 2. Open a Bluetooth socket using NewL() function. Return KErrNone if successful
//! 3. Bring in a new member to the piconet with a device address(12121212) using
//! CreateConnection() function. Return KErrNone if successful
//! 4. Return Callback HandleCreateConnectionCompleteL() function
//! 5. Verify that if return result (Error -6004) from callback function is as expected. (Error -6004)
//! 6. Disconnect a single member of piconet using Disconnect() function.
//! 7. Return callback HandleDisconnectCompleteL() function
//! 8. Verify that if return result (decimal 0) is as expected (decimal 0)
//! 9. Delete the Bluetooth socket using destructor
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults A single member got disconnected
//! @SYMTestType CIT
START_TEST_BLOCK 2000 T_BTUserAPI \bluetooth\user\BT-USER-BluetoothPhysicalLinks-PublicApi.ini
CREATE_OBJECT CBluetoothPhysicalLinks CBluetoothPhysicalLinks1
CREATE_OBJECT RSocketServ RSocketServ1
COMMAND RSocketServ1 RSocketServ
COMMAND RSocketServ1 Connect
COMMAND CBluetoothPhysicalLinks1 NewL BT-USER-BluetoothPhysicalLinks-PublicApi-0010-0001command5NewL
COMMAND CBluetoothPhysicalLinks1 CreateConnection BT-USER-BluetoothPhysicalLinks-PublicApi-0010-0001command6CreateConnection
OUTSTANDING
COMMAND CBluetoothPhysicalLinks1 Disconnect BT-USER-BluetoothPhysicalLinks-PublicApi-0010-0001command8Disconnect
OUTSTANDING
COMMAND CBluetoothPhysicalLinks1 ~
COMMAND RSocketServ1 Close
END_TEST_BLOCK
END_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0010
START_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0011
//! @SYMTestCaseID BT-USER-BluetoothPhysicalLinks-PublicApi-0011
//! @SYMAPI CBluetoothPhysicalLinks, MBluetoothPhysicalLinksNotifier and RSocketServ
//! @SYMTestCaseDesc Disconnect all members of piconet
//! Uses API elements: NewL(), CreateConnection(), DisconnectAll() and destructor from CBluetoothPhysicalLinks
//! RSocketServ(), Connect() and Close() from RSocketServ
//! HandleCreateConnectionCompleteL() and HandleDisconnectAllCompleteL() from MBluetoothPhysicalLinksNotifier
//! @SYMTestActions 1. Create and start a session on the socket server
//! 2. Open a Bluetooth socket using NewL() function. Return KErrNone if successful
//! 3. Bring in a new member to the piconet with a device address(12121212) using
//! CreateConnection() function. Return KErrNone if successful
//! 4. Return callback HandleCreateConnectionCompleteL() function
//! 5. Verify that if return result (Error -6004) from callback function is as expected. (Error -6004)
//! 6. Disconnect all members of piconet using DisconnectAll() function. Return KErrNone
//! if successful
//! 7. Return callback HandleDisconnectAllCompleteL() function
//! 8. Verify that if return result (decimal 0) is as expected (decimal 0)
//! 9. Delete the Bluetooth socket using destructor
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults All members got disconnected
//! @SYMTestType CIT
START_TEST_BLOCK 2000 T_BTUserAPI \bluetooth\user\BT-USER-BluetoothPhysicalLinks-PublicApi.ini
CREATE_OBJECT CBluetoothPhysicalLinks CBluetoothPhysicalLinks1
CREATE_OBJECT RSocketServ RSocketServ1
COMMAND RSocketServ1 RSocketServ
COMMAND RSocketServ1 Connect
COMMAND CBluetoothPhysicalLinks1 NewL BT-USER-BluetoothPhysicalLinks-PublicApi-0011-0001command5NewL
COMMAND CBluetoothPhysicalLinks1 CreateConnection BT-USER-BluetoothPhysicalLinks-PublicApi-0011-0001command6CreateConnection
OUTSTANDING
COMMAND CBluetoothPhysicalLinks1 DisconnectAll BT-USER-BluetoothPhysicalLinks-PublicApi-0011-0001command8DisconnectAll
OUTSTANDING
COMMAND CBluetoothPhysicalLinks1 ~
COMMAND RSocketServ1 Close
END_TEST_BLOCK
END_TESTCASE BT-USER-BluetoothPhysicalLinks-PublicApi-0011
DELAY 2000