bluetoothapitest/bluetoothsvs/T_BTUserAPI/scripts/BT-USER-BTAccessRequirements-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 TBTAccessRequirements 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 02/03/2007
///////////////////////////////////////////////////////////////////////////////
RUN_UTILS MkDir ${SYSDRIVE}\bluetooth\
RUN_UTILS MkDir ${SYSDRIVE}\bluetooth\user\
LOAD_SUITE T_BTUserAPI
DELAY 500
// ****************************************************************************
// TBTAccessRequirements
// ****************************************************************************
START_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0001
//! @SYMTestCaseID BT-USER-BTAccessRequirements-PublicApi-0001
//! @SYMAPI TBTAccessRequirements
//! @SYMTestCaseDesc Create a TBTAccessRequirements object
//! Uses API elements: TBTAccessRequirements()
//! @SYMTestActions 1. Create an empty TBTAccessRequirements object using TBTAccessRequirements() function
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults TBTAccessRequirements object was created successfully
//! @SYMTestType CIT
START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BTAccessRequirements-PublicApi.ini
CREATE_OBJECT TBTAccessRequirements TBTAccessRequirements1
COMMAND TBTAccessRequirements1 TBTAccessRequirements
END_TEST_BLOCK
END_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0001
START_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0002
//! @SYMTestCaseID BT-USER-BTAccessRequirements-PublicApi-0002
//! @SYMAPI TBTAccessRequirements
//! @SYMTestCaseDesc Set the authentication requirement
//! Uses API elements: TBTAccessRequirements() and SetAuthentication()
//! @SYMTestActions 1. Create an empty TBTAccessRequirements object using TBTAccessRequirements() function
//! 2. Set the authentication requirement to the object with a boolean value (TRUE)
//! using SetAuthentication() function
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults Authentication was set successfully
//! @SYMTestType CIT
START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BTAccessRequirements-PublicApi.ini
CREATE_OBJECT TBTAccessRequirements TBTAccessRequirements1
COMMAND TBTAccessRequirements1 TBTAccessRequirements
COMMAND TBTAccessRequirements1 SetAuthentication BT-USER-BTAccessRequirements-PublicApi-0002-0001command2SetAuthentication
END_TEST_BLOCK
END_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0002
START_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0003
//! @SYMTestCaseID BT-USER-BTAccessRequirements-PublicApi-0003
//! @SYMAPI TBTAccessRequirements
//! @SYMTestCaseDesc Sets the authorisation requirement
//! Uses API elements: TBTAccessRequirements() and SetAuthorisation()
//! @SYMTestActions 1. Create an empty TBTAccessRequirements object using TBTAccessRequirements() function
//! 2. Set the authorisation requirement to the object with a boolean value (TRUE)
//! using SetAuthorisation() function
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults Authorisation was set successfully
//! @SYMTestType CIT
START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BTAccessRequirements-PublicApi.ini
CREATE_OBJECT TBTAccessRequirements TBTAccessRequirements1
COMMAND TBTAccessRequirements1 TBTAccessRequirements
COMMAND TBTAccessRequirements1 SetAuthorisation BT-USER-BTAccessRequirements-PublicApi-0003-0001command2SetAuthorisation
END_TEST_BLOCK
END_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0003
START_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0004
//! @SYMTestCaseID BT-USER-BTAccessRequirements-PublicApi-0004
//! @SYMAPI TBTAccessRequirements
//! @SYMTestCaseDesc Set the encryption requirement
//! Uses API elements: TBTAccessRequirements() and SetEncryption()
//! @SYMTestActions 1. Create an empty TBTAccessRequirements object using TBTAccessRequirements() function
//! 2. Set the encryption requirement to the object with a boolean value (TRUE) using
//! SetEncryption() function
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults Encryption was set successfully
//! @SYMTestType CIT
START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BTAccessRequirements-PublicApi.ini
CREATE_OBJECT TBTAccessRequirements TBTAccessRequirements1
COMMAND TBTAccessRequirements1 TBTAccessRequirements
COMMAND TBTAccessRequirements1 SetEncryption BT-USER-BTAccessRequirements-PublicApi-0004-0001command2SetEncryption
END_TEST_BLOCK
END_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0004
START_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0005
//! @SYMTestCaseID BT-USER-BTAccessRequirements-PublicApi-0005
//! @SYMAPI TBTAccessRequirements
//! @SYMTestCaseDesc Set the denied attribute
//! Uses API elements: TBTAccessRequirements() and SetDenied()
//! @SYMTestActions 1. Create an empty TBTAccessRequirements object using TBTAccessRequirements() function
//! 2. Set the denied attribute to the object with a boolean value (TRUE) using
//! SetDenied() function
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults Denied attribute was set successfully
//! @SYMTestType CIT
START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BTAccessRequirements-PublicApi.ini
CREATE_OBJECT TBTAccessRequirements TBTAccessRequirements1
COMMAND TBTAccessRequirements1 TBTAccessRequirements
COMMAND TBTAccessRequirements1 SetDenied BT-USER-BTAccessRequirements-PublicApi-0005-0001command2SetDenied
END_TEST_BLOCK
END_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0005
START_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0006
//! @SYMTestCaseID BT-USER-BTAccessRequirements-PublicApi-0006
//! @SYMAPI TBTAccessRequirements
//! @SYMTestCaseDesc Set the minimal length requrement for passkey
//! Uses API elements: TBTAccessRequirements() and SetPasskeyMinLength()
//! @SYMTestActions 1. Create an empty TBTAccessRequirements object using TBTAccessRequirements() function
//! 2. Set the minimal length requrement for passkey to the object with an unsigned integer(12)
//! using SetPasskeyMinLength() function. Return KErrNone if successed
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults KErrNone returned
//! @SYMTestType CIT
START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BTAccessRequirements-PublicApi.ini
CREATE_OBJECT TBTAccessRequirements TBTAccessRequirements1
COMMAND TBTAccessRequirements1 TBTAccessRequirements
COMMAND TBTAccessRequirements1 SetPasskeyMinLength BT-USER-BTAccessRequirements-PublicApi-0006-0001command2SetPasskeyMinLength
END_TEST_BLOCK
END_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0006
START_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0007
//! @SYMTestCaseID BT-USER-BTAccessRequirements-PublicApi-0007
//! @SYMAPI TBTAccessRequirements
//! @SYMTestCaseDesc Getter for the authentification attribute
//! Uses API elements: TBTAccessRequirements(), SetAuthentication() and AuthenticationRequired()
//! @SYMTestActions 1. Create an empty TBTAccessRequirements object using TBTAccessRequirements() function
//! 2. Set the authentication requirement to the object with a boolean value (FALSE)
//! using SetAuthentication() function
//! 3. Get the authentification attribute using AuthenticationRequired() function.
//! Return FALSE if successed
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults FALSE returned
//! @SYMTestType CIT
START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BTAccessRequirements-PublicApi.ini
CREATE_OBJECT TBTAccessRequirements TBTAccessRequirements1
COMMAND TBTAccessRequirements1 TBTAccessRequirements
COMMAND TBTAccessRequirements1 SetAuthentication BT-USER-BTAccessRequirements-PublicApi-0007-0001command2SetAuthentication
COMMAND TBTAccessRequirements1 AuthenticationRequired BT-USER-BTAccessRequirements-PublicApi-0007-0001command3AuthenticationRequired
END_TEST_BLOCK
END_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0007
START_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0008
//! @SYMTestCaseID BT-USER-BTAccessRequirements-PublicApi-0008
//! @SYMAPI TBTAccessRequirements
//! @SYMTestCaseDesc Getter for the authorisation attribute
//! Uses API elements: TBTAccessRequirements(), SetAuthorisation() and AuthorisationRequired()
//! @SYMTestActions 1. Create an empty TBTAccessRequirements object using TBTAccessRequirements() function
//! 2. Set the authorisation requirement to the object with a boolean value (FALSE)
//! using SetAuthorisation() function
//! 3. Get the authorisation attribute using AuthorisationRequired() function.
//! Return FALSE if successed
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults FALSE returned
//! @SYMTestType CIT
START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BTAccessRequirements-PublicApi.ini
CREATE_OBJECT TBTAccessRequirements TBTAccessRequirements1
COMMAND TBTAccessRequirements1 TBTAccessRequirements
COMMAND TBTAccessRequirements1 SetAuthorisation BT-USER-BTAccessRequirements-PublicApi-0008-0001command2SetAuthorisation
COMMAND TBTAccessRequirements1 AuthorisationRequired BT-USER-BTAccessRequirements-PublicApi-0008-0001command3AuthorisationRequired
END_TEST_BLOCK
END_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0008
START_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0009
//! @SYMTestCaseID BT-USER-BTAccessRequirements-PublicApi-0009
//! @SYMAPI TBTAccessRequirements
//! @SYMTestCaseDesc Getter for the encryption attribute
//! Uses API elements: TBTAccessRequirements(), SetEncryption() and EncryptionRequired()
//! @SYMTestActions 1. Create an empty TBTAccessRequirements object using TBTAccessRequirements() function
//! 2. Set the encryption requirement to the object with a boolean value (FALSE) using
//! SetEncryption() function
//! 3. Get the encryption attribute using EncryptionRequired() function.
//! Return FALSE if successed
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults FALSE returned
//! @SYMTestType CIT
START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BTAccessRequirements-PublicApi.ini
CREATE_OBJECT TBTAccessRequirements TBTAccessRequirements1
COMMAND TBTAccessRequirements1 TBTAccessRequirements
COMMAND TBTAccessRequirements1 SetEncryption BT-USER-BTAccessRequirements-PublicApi-0009-0001command2SetEncryption
COMMAND TBTAccessRequirements1 EncryptionRequired BT-USER-BTAccessRequirements-PublicApi-0009-0001command3EncryptionRequired
END_TEST_BLOCK
END_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0009
START_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0010
//! @SYMTestCaseID BT-USER-BTAccessRequirements-PublicApi-0010
//! @SYMAPI TBTAccessRequirements
//! @SYMTestCaseDesc Getter for the denied attribute
//! Uses API elements: TBTAccessRequirements(), SetDenied() and Denied()
//! @SYMTestActions 1. Create an empty TBTAccessRequirements object using TBTAccessRequirements() function
//! 2. Set the denied attribute to the object with a boolean value (FALSE) using
//! SetDenied() function
//! 3. Get the denied attribute using Denied() function. Return FALSE if successed
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults FALSE returned
//! @SYMTestType CIT
START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BTAccessRequirements-PublicApi.ini
CREATE_OBJECT TBTAccessRequirements TBTAccessRequirements1
COMMAND TBTAccessRequirements1 TBTAccessRequirements
COMMAND TBTAccessRequirements1 SetDenied BT-USER-BTAccessRequirements-PublicApi-0010-0001command2SetDenied
COMMAND TBTAccessRequirements1 Denied BT-USER-BTAccessRequirements-PublicApi-0010-0001command3Denied
END_TEST_BLOCK
END_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0010
START_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0011
//! @SYMTestCaseID BT-USER-BTAccessRequirements-PublicApi-0011
//! @SYMAPI TBTAccessRequirements
//! @SYMTestCaseDesc Getter for the minimal passkey length
//! Uses API elements: TBTAccessRequirements(), SetPasskeyMinLength() and PasskeyMinLength()
//! @SYMTestActions 1. Create an empty TBTAccessRequirements object using TBTAccessRequirements() function
//! 2. Set the minimal length requrement for passkey to the object with an unsigned integer(2)
//! using SetPasskeyMinLength() function. Return KErrNone if successed
//! 3. Get the minimal passkey length using PasskeyMinLength() function and compare with the set length
//! 4. Set the minimal length requrement for passkey to the object with an unsigned integer(0)
//! using SetPasskeyMinLength() function. Return KErrNone if successed
//! 5. Get the minimal passkey length using PasskeyMinLength() function and compare with the set length
//! 6. Set the minimal length requrement for passkey to the object with an unsigned integer(17)
//! using SetPasskeyMinLength() function. Return KErrNone if successed
//! 7. Get the minimal passkey length using PasskeyMinLength() function and compare with the set length
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults Setp 3 decimal 2 returned, step 5 and 7 decimal 0 returned
//! @SYMTestType CIT
START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BTAccessRequirements-PublicApi.ini
CREATE_OBJECT TBTAccessRequirements TBTAccessRequirements1
COMMAND TBTAccessRequirements1 TBTAccessRequirements
COMMAND TBTAccessRequirements1 SetPasskeyMinLength BT-USER-BTAccessRequirements-PublicApi-0011-0001command2SetPasskeyMinLength
COMMAND TBTAccessRequirements1 PasskeyMinLength BT-USER-BTAccessRequirements-PublicApi-0011-0001command3PasskeyMinLength
COMMAND !Error=-9 TBTAccessRequirements1 SetPasskeyMinLength BT-USER-BTAccessRequirements-PublicApi-0011-0001command4SetPasskeyMinLength
COMMAND TBTAccessRequirements1 PasskeyMinLength BT-USER-BTAccessRequirements-PublicApi-0011-0001command5PasskeyMinLength
COMMAND !Error=-9 TBTAccessRequirements1 SetPasskeyMinLength BT-USER-BTAccessRequirements-PublicApi-0011-0001command6SetPasskeyMinLength
COMMAND TBTAccessRequirements1 PasskeyMinLength BT-USER-BTAccessRequirements-PublicApi-0011-0001command7PasskeyMinLength
END_TEST_BLOCK
END_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0011
// ****************************************************************************
// Negative test cases
// ****************************************************************************
START_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0012
//! @SYMTestCaseID BT-USER-BTAccessRequirements-PublicApi-0012
//! @SYMAPI TBTAccessRequirements
//! @SYMTestCaseDesc Set the minimal length requrement for passkey
//! Uses API elements: SetPasskeyMinLength()
//! @SYMTestActions 1. Create an empty TBTAccessRequirements object using TBTAccessRequirements() function
//! 2. Set the minimal length requrement for passkey to the object with an unsigned integer(0)
//! using SetPasskeyMinLength() function. Return KErrNone if successed.
//! Catch a error if error is thrown out
//! 3. Set the minimal length requrement for passkey to the object with an unsigned integer(20)
//! using SetPasskeyMinLength() function. Return KErrNone if successed
//! Catch a error if error is thrown out
//! @SYMTestStatus Implemented
//! @SYMTestPriority Low
//! @SYMTestExpectedResults Step 2 and 3 causes KErrOverflow (-9)
//! @SYMTestType CIT
START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-BTAccessRequirements-PublicApi.ini
CREATE_OBJECT TBTAccessRequirements TBTAccessRequirements1
COMMAND TBTAccessRequirements1 TBTAccessRequirements
COMMAND !Error=-9 TBTAccessRequirements1 SetPasskeyMinLength BT-USER-BTAccessRequirements-PublicApi-0012-0001command2SetPasskeyMinLength
COMMAND !Error=-9 TBTAccessRequirements1 SetPasskeyMinLength BT-USER-BTAccessRequirements-PublicApi-0012-0001command3SetPasskeyMinLength
END_TEST_BLOCK
END_TESTCASE BT-USER-BTAccessRequirements-PublicApi-0012
DELAY 2000