// Copyright (c) 2007-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:
// Note: Script ordering has the verify tests first, followed by the notifys where possible due to a fault in test harness design.
//

//! @File
//! @SYMTestSuiteName lbsprivfwparamnotifier_api2.script
//! @SYMScriptTestEnvironment

LOAD_SUITE LbsPrivFwTestServer -SharedData

PRINT Run LbsPrivFwTestServer

PREFIX RUN_UTILS
CopyFile c:\testdata\configs\lbstestconfig.txt c:\config.txt
DeleteFile c:\private\10202be9\persists\1028224b.cre
REMOVE_PREFIX

RUN_TEST_STEP 030 LbsPrivFwTestServer LbsStep_ResetDefaultAdmin
RUN_TEST_STEP 030 LbsPrivFwTestServer LbsStep_SetPrivacyHandler  c:\testdata\configs\lbsprivfw.ini NOTIFIER-HANDLER
RUN_TEST_STEP 030 LbsPrivFwTestServer LbsStep_SetupStandalonePrivacyMode

RUN_TEST_STEP 030 LbsPrivFwTestServer LbsStep_InitializeTestChannel


START_TESTCASE                LBS-PRIVFWAPI2-NOTIFIER-PARAM-0001
//! @SYMTestCaseID              LBS-PRIVFWAPI2-NOTIFIER-PARAM-0001
//! @SYMTestCaseDesc            Privacy Verification Requests using request info type TLbsExternalRequestInfo and
//!                             ensuring that all data items are exercised
//! @SYMTestPriority            Critical
//! @SYMTestActions             1. Set EExternalLocationON in admin settings
//!                             2. Set Admin settings to use Notifier
//!                             3. Create multiple request info records ensuring that all the separate data items are
//!                             used and the buffers used are greater than the buffers expected for the original
//!                             TlbsExternalRequestInfo type
//!                             4. Use all available data item 'getters' and check the returned values
//!                             5. Set notifier plug-in to return 'accept/reject' for each verification request
//!                             6. Issue multiple Network Privacy API VerifyLocationRequestL() using each of the request
//!                             Info records
//!                             7. The notifier should record and respond to each verification request
//! @SYMTestExpectedResults     1. All data item getter values should correspond with the equivalent setter
//!                             2. The appropriate 'accept/reject' respond should be returned to the network
//!                             3. The request info data received at the notifier should match a truncated version of
//!                             that sent from the network.
//! @SYMTestType                CIT
//! @SYMCreationDate            4/10/2007
//! @SYMAuthor                  brajendras
//! @SYMPREQ                    PREQ1660
//! @SYMREQ                     REQ8011, REQ8012, REQ8013
RUN_TEST_STEP 010 LbsPrivFwTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 030 LbsPrivFwTestServer KLbsPrivFwStep_Param  c:\testdata\configs\lbsprivfw.ini  LBS-PRIVFWAPI2-PARAM-0001
END_TESTCASE                   LBS-PRIVFWAPI2-NOTIFIER-PARAM-0001


START_TESTCASE                LBS-PRIVFWAPI2-NOTIFIER-PARAM-REQTYPE-0001
//! @SYMTestCaseID              LBS-PRIVFWAPI2-NOTIFIER-PARAM-REQTYPE-0001
//! @SYMTestCaseDesc            Test for different Request Type parameters in Verification request
//! @SYMTestPriority            High
//! @SYMTestActions             1. Set Admin settings to use Notifier.
//!                             2. Do not set RequestType.
//!                             3. Issue a Network Privacy API Verification request VerifyLocationRequestL()
//!                             4. Check the RequestType value transferred to Notifier.
//!                             
//!                             5. Set RequestType to ERequestSingleShot.
//!                             6. Issue a Network Privacy API Verification request VerifyLocationRequestL()
//!                             7. Check the RequestType value transferred to Notifier.
//!                             
//!                             8. Set RequestType to ERequestPeriodic.
//!                             9. Issue a Network Privacy API Verification request VerifyLocationRequestL()
//!                             10. Check the RequestType value transferred to Notifier.
//!                             
//!                             11. Set RequestType to ERequestAreaEvent.
//!                             12. Issue a Network Privacy API Verification request VerifyLocationRequestL()
//!                             13. Check the RequestType value transferred to Notifier.
//! @SYMTestExpectedResults     ERequestTypeUnknown, ERequestSingleShot, ERequestPeriodic, ERequestAreaEvent should
//!                             be transferred to Notifier in the order.
//! @SYMTESTSTATUS              Not Implemented
//! @SYMPREQ                    PREQ 1660
RUN_TEST_STEP 010 LbsPrivFwTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 030 LbsPrivFwTestServer KLbsPrivFwStep_Param  c:\testdata\configs\lbsprivfw.ini  LBS-PRIVFWAPI2-PARAM-0003
END_TESTCASE                   LBS-PRIVFWAPI2-NOTIFIER-PARAM-REQTYPE-0001


START_TESTCASE                LBS-PRIVFWAPI2-NOTIFIER-PARAM-SUPL-0001
//! @SYMTestCaseID              LBS-PRIVFWAPI2-NOTIFIER-PARAM-SUPL-0001
//! @SYMTestCaseDesc            Test for Privacy parameters (Identities) in Verification for SUPL
//! @SYMTestPriority            Critical
//! @SYMTestActions             1. Set Admin settings to use Privacy Notifier.
//!                             2. Set different SUPL Privacy Parameters. There are 8 SUPL Privacy parameters
//!                             3. Issue a Network Privacy API VerifyLocationRequestL() for each Privacy Parameter
//!                             4. Verify the paramenters received at Privacy Notifier client
//! @SYMTestExpectedResults     All Privacy parameters should match
//! @SYMTestType                CIT
//! @SYMCreationDate            4/10/2007
//! @SYMAuthor                  brajendras
//! @SYMPREQ                    PREQ1660
RUN_TEST_STEP 010 LbsPrivFwTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 030 LbsPrivFwTestServer KLbsPrivFwStep_Param  c:\testdata\configs\lbsprivfw.ini LBS-PRIVFWAPI2-PARAM-SUPL-0001
END_TESTCASE                   LBS-PRIVFWAPI2-NOTIFIER-PARAM-SUPL-0001


START_TESTCASE                LBS-PRIVFWAPI2-NOTIFIER-PARAM-GSM-0001
//! @SYMTestCaseID              LBS-PRIVFWAPI2-NOTIFIER-PARAM-GSM-0001
//! @SYMTestCaseDesc            Test for Privacy parameters (Identities) in Verification for GSM
//! @SYMTestPriority            Critical
//! @SYMTestActions             1. Set Admin settings to use Privacy Notifier.
//!                             2. Set different GSM Privacy Parameters. There are 6 GSM Privacy parameters
//!                             3. Issue a Network Privacy API VerifyLocationRequestL() for each Privacy Parameter
//!                             4. Verify the paramenters received at Privacy Notifier client
//! @SYMTestExpectedResults     All Privacy parameters should match
//! @SYMTestType                CIT
//! @SYMCreationDate            4/10/2007
//! @SYMAuthor                  brajendras
//! @SYMPREQ                    PREQ1660
RUN_TEST_STEP 010 LbsPrivFwTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 030 LbsPrivFwTestServer KLbsPrivFwStep_Param  c:\testdata\configs\lbsprivfw.ini LBS-PRIVFWAPI2-PARAM-GSM-0001
END_TESTCASE                   LBS-PRIVFWAPI2-NOTIFIER-PARAM-GSM-0001


START_TESTCASE                LBS-PRIVFWAPI2-NOTIFIER-PARAM-GSM-0002
//! @SYMTestCaseID              LBS-PRIVFWAPI2-NOTIFIER-PARAM-GSM-0002
//! @SYMTestCaseDesc            Test for Privacy parameters (Identities) in Notification for GSM
//! @SYMTestPriority            Critical
//! @SYMTestActions             1. Set Admin settings to use Privacy Notifier.
//!                             2. Set different GSM Privacy Parameters. There are 6 GSM privacy paramenters
//!                             3. Issue a Network Privacy API NotifyLocationRequestL() for each privacy parameter
//!                             4. Verify the paramenters received at Privacy Notifier client
//! @SYMTestExpectedResults     All Privacy parameters should match
//! @SYMTestType                CIT
//! @SYMCreationDate            4/10/2007
//! @SYMAuthor                  brajendras
//! @SYMPREQ                    PREQ1660
RUN_TEST_STEP 010 LbsPrivFwTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 030 LbsPrivFwTestServer KLbsPrivFwStep_Param  c:\testdata\configs\lbsprivfw.ini LBS-PRIVFWAPI2-PARAM-GSM-0002
END_TESTCASE                   LBS-PRIVFWAPI2-NOTIFIER-PARAM-GSM-0002


START_TESTCASE                LBS-PRIVFWAPI2-NOTIFIER-PARAM-GSM-0003
//! @SYMTestCaseID              LBS-PRIVFWAPI2-NOTIFIER-PARAM-GSM-0003
//! @SYMTestCaseDesc            Test for Invalid Privacy parameters (Identities) in Verification for GSM
//! @SYMTestPriority            Critical
//! @SYMTestActions             1. Set Admin settings to use Privacy Notifier.
//!                             2. Set GSP Privacy Parameters which is not supported.
//!                             3. Issue a Network Privacy API verification VerifyLocationRequestL()
//! @SYMTestExpectedResults     The LBS system should return proper error code to Client.
//! @SYMTestType                CIT
//! @SYMCreationDate            4/10/2007
//! @SYMAuthor                  brajendras
//! @SYMPREQ                    PREQ1660
RUN_TEST_STEP 010 LbsPrivFwTestServer LbsStep_InstallScheduler
RUN_TEST_STEP !PanicCode=0 030 LbsPrivFwTestServer KLbsPrivFwStep_Param  c:\testdata\configs\lbsprivfw.ini LBS-PRIVFWAPI2-PARAM-GSM-0003
END_TESTCASE                   LBS-PRIVFWAPI2-NOTIFIER-PARAM-GSM-0003


START_TESTCASE                LBS-PRIVFWAPI2-NOTIFIER-PARAM-GSM-0004
//! @SYMTestCaseID              LBS-PRIVFWAPI2-NOTIFIER-PARAM-GSM-0004
//! @SYMTestCaseDesc            Test for Invalid Privacy parameters (Identities) in Notification for GSM
//! @SYMTestPriority            Critical
//! @SYMTestActions             1. Set Admin settings to use Privacy Notifier.
//!                             2. Set GSP Privacy Parameters which is not supported.
//!                             3. Issue a Network Privacy API Notification request NotifyLocationRequestL()
//! @SYMTestExpectedResults     The LBS system should return proper error code to Client.
//! @SYMTestType                CIT
//! @SYMCreationDate            4/10/2007
//! @SYMAuthor                  brajendras
//! @SYMPREQ                    PREQ1660
RUN_TEST_STEP 010 LbsPrivFwTestServer LbsStep_InstallScheduler
RUN_TEST_STEP !PanicCode=0 030 LbsPrivFwTestServer KLbsPrivFwStep_Param  c:\testdata\configs\lbsprivfw.ini LBS-PRIVFWAPI2-PARAM-GSM-0004
END_TESTCASE                   LBS-PRIVFWAPI2-NOTIFIER-PARAM-GSM-0004


START_TESTCASE                LBS-PRIVFWAPI2-NOTIFIER-PARAM-SUPL-0002
//! @SYMTestCaseID              LBS-PRIVFWAPI2-NOTIFIER-PARAM-SUPL-0002
//! @SYMTestCaseDesc            Test for Privacy parameters (Identities) in Notification for SUPL
//! @SYMTestPriority            Critical
//! @SYMTestActions             1. Set Admin settings to use Privacy Notifier.
//!                             2. Set different SUPL Privacy Parameters. There are 8 SUPL privacy paramenters
//!                             3. Issue a Network Privacy API Notification request NotifyLocationRequestL() for each privacy parameter
//!                             4. Verify the paramenters received at Privacy Notifier client
//! @SYMTestExpectedResults     All Privacy parameters should match
//! @SYMTestType                CIT
//! @SYMCreationDate            4/10/2007
//! @SYMAuthor                  brajendras
//! @SYMPREQ                    PREQ1660
RUN_TEST_STEP 010 LbsPrivFwTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 030 LbsPrivFwTestServer KLbsPrivFwStep_Param  c:\testdata\configs\lbsprivfw.ini LBS-PRIVFWAPI2-PARAM-SUPL-0002
END_TESTCASE                   LBS-PRIVFWAPI2-NOTIFIER-PARAM-SUPL-0002


START_TESTCASE                LBS-PRIVFWAPI2-NOTIFIER-PARAM-SUPL-0003
//! @SYMTestCaseID              LBS-PRIVFWAPI2-NOTIFIER-PARAM-SUPL-0003
//! @SYMTestCaseDesc            Test for Invalid Privacy parameters (Identities) in Verification for SUPL
//! @SYMTestPriority            Critical
//! @SYMTestActions             1. Set Admin settings to use Privacy Notifier.
//!                             2. Set SUPL Privacy Parameters which is not supported.
//!                             3. Issue a Network Privacy API verification VerifyLocationRequestL()
//! @SYMTestExpectedResults     The LBS system should return proper error code to Client.
//! @SYMTestType                CIT
//! @SYMCreationDate            4/10/2007
//! @SYMAuthor                  brajendras
//! @SYMPREQ                    PREQ1660
RUN_TEST_STEP 010 LbsPrivFwTestServer LbsStep_InstallScheduler
RUN_TEST_STEP !PanicCode=4 030 LbsPrivFwTestServer KLbsPrivFwStep_Param  c:\testdata\configs\lbsprivfw.ini LBS-PRIVFWAPI2-PARAM-SUPL-0003
END_TESTCASE                   LBS-PRIVFWAPI2-NOTIFIER-PARAM-SUPL-0003


START_TESTCASE                LBS-PRIVFWAPI2-NOTIFIER-PARAM-SUPL-0004
//! @SYMTestCaseID              LBS-PRIVFWAPI2-NOTIFIER-PARAM-SUPL-0004
//! @SYMTestCaseDesc            Test for Invalid Privacy parameters (Identities) in Notification for SUPL
//! @SYMTestPriority            Critical
//! @SYMTestActions             1. Set Admin settings to use Privacy Notifier.
//!                             2. Set SUPL Privacy Parameters which is not supported.
//!                             3. Issue a Network Privacy API Notification request NotifyLocationRequestL()
//! @SYMTestExpectedResults     The LBS system should return proper error code to Client.
//! @SYMTestType                CIT
//! @SYMCreationDate            4/10/2007
//! @SYMAuthor                  brajendras
//! @SYMPREQ                    PREQ1660
RUN_TEST_STEP 010 LbsPrivFwTestServer LbsStep_InstallScheduler
RUN_TEST_STEP !PanicCode=4 030 LbsPrivFwTestServer KLbsPrivFwStep_Param  c:\testdata\configs\lbsprivfw.ini LBS-PRIVFWAPI2-PARAM-SUPL-0004
END_TESTCASE                   LBS-PRIVFWAPI2-NOTIFIER-PARAM-SUPL-0004


START_TESTCASE                LBS-PRIVFWAPI2-NOTIFIER-PARAM-0002
//! @SYMTestCaseID              LBS-PRIVFWAPI2-NOTIFIER-PARAM-0002
//! @SYMTestCaseDesc            Privacy Notification Requests using request info type TLbsExternalRequestInfo and
//!                             ensuring that all data items are exercised
//! @SYMTestPriority            Critical
//! @SYMTestActions             1. Set EExternalLocationON in admin settings
//!                             2. Set Admin settings to use Notifier
//!                             3. Create multiple request info records ensuring that all the separate data items are
//!                             used and the buffers used are greater than the buffers expected for the original
//!                             TlbsExternalRequestInfo type
//!                             4. Use all available data item 'getters' and check the returned values
//!                             5. Set notifier plug-in to return 'accept/reject' for each verification request
//!                             6. Issue multiple Network Privacy API NotifyLocationRequestL() using each of the request
//!                             Info records
//!                             7. The notifier should record each notification request
//! @SYMTestExpectedResults     1. All data item getter values should correspond with the equivalent setter
//!                             2. The request info data received at the notifier should match a truncated version of
//!                             that sent from the network.
//! @SYMTestType                CIT
//! @SYMCreationDate            4/10/2007
//! @SYMAuthor                  brajendras
//! @SYMPREQ                    PREQ1660
//! @SYMREQ                     REQ8011, REQ8012, REQ8013
RUN_TEST_STEP 010 LbsPrivFwTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 030 LbsPrivFwTestServer KLbsPrivFwStep_Param  c:\testdata\configs\lbsprivfw.ini  LBS-PRIVFWAPI2-PARAM-0002
END_TESTCASE                   LBS-PRIVFWAPI2-NOTIFIER-PARAM-0002


START_TESTCASE                LBS-PRIVFWAPI2-NOTIFIER-PARAM-REQTYPE-0002
//! @SYMTestCaseID              LBS-PRIVFWAPI2-NOTIFIER-PARAM-REQTYPE-0002
//! @SYMTestCaseDesc            Test for different Request Type parameters in Notificcation request
//! @SYMTestPriority            High
//! @SYMTestActions             1. Set Admin settings to use Notifier.
//!                             2. Do not set RequestType.
//!                             3. Issue a Network Privacy API Verification request NotifyLocationRequestL()
//!                             4. Check the RequestType value transferred to Notifier.
//!                             
//!                             5. Set RequestType to ERequestSingleShot.
//!                             6. Issue a Network Privacy API Verification request NotifyLocationRequestL()
//!                             7. Check the RequestType value transferred to Notifier.
//!                             
//!                             8. Set RequestType to ERequestPeriodic.
//!                             9. Issue a Network Privacy API Verification request NotifyLocationRequestL()
//!                             10. Check the RequestType value transferred to Notifier.
//!                             
//!                             11. Set RequestType to ERequestAreaEvent.
//!                             12. Issue a Network Privacy API Verification request NotifyLocationRequestL()
//!                             13. Check the RequestType value transferred to Notifier.
//! @SYMTestExpectedResults     ERequestTypeUnknown, ERequestSingleShot, ERequestPeriodic, ERequestAreaEvent should
//!                             be transferred to Notifier in the order.
//! @SYMTESTSTATUS              Not Implemented
//! @SYMPREQ                    PREQ 1660
RUN_TEST_STEP 010 LbsPrivFwTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 030 LbsPrivFwTestServer KLbsPrivFwStep_Param  c:\testdata\configs\lbsprivfw.ini  LBS-PRIVFWAPI2-PARAM-0004
END_TESTCASE                   LBS-PRIVFWAPI2-NOTIFIER-PARAM-REQTYPE-0002


START_TESTCASE                LBS-PRIVFWAPI2-NOTIFIER-PARAM-REQTYPE-0003
//! @SYMTestCaseID              LBS-PRIVFWAPI2-NOTIFIER-PARAM-REQTYPE-0003
//! @SYMTestCaseDesc		Test for different Request Type parameters in NotifyVerificationTimeout request
//!                             This test makes use of the fact that LBS will process a NotifyVerificationTimeoutL() request
//!                             without first receiving a verification request as long as the request Id is valid 
//! @SYMTestPriority            High
//! @SYMTestActions             1. Set Admin settings to use Notifier.
//!                             2. Do not set RequestType.
//!                             3. Issue a Network Privacy API verification timeout request NotifyVerificationTimeoutL()
//!                             4. Check the RequestType value transferred to Notifier.
//!                             
//!                             5. Set RequestType to ERequestSingleShot.
//!                             6. Issue a Network Privacy API verification timeout request NotifyVerificationTimeoutL()
//!                             7. Check the RequestType value transferred to Notifier.
//!                             
//!                             8. Set RequestType to ERequestPeriodic.
//!                             9. Issue a Network Privacy API verification timeout request NotifyVerificationTimeoutL()
//!                             10. Check the RequestType value transferred to Notifier.
//!                             
//!                             11. Set RequestType to ERequestAreaEvent.
//!                             12. Issue a Network Privacy API verification timeout request NotifyVerificationTimeoutL()
//!                             13. Check the RequestType value transferred to Notifier.
//! @SYMTestExpectedResults     ERequestTypeUnknown, ERequestSingleShot, ERequestPeriodic, ERequestAreaEvent should
//!                             be transferred to Notifier in the order.
//! @SYMTESTSTATUS              Implemented
//! @SYMPREQ                    PREQ 1660
RUN_TEST_STEP 010 LbsPrivFwTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 030 LbsPrivFwTestServer KLbsPrivFwStep_Param  c:\testdata\configs\lbsprivfw.ini  LBS-PRIVFWAPI2-PARAM-0005
END_TESTCASE                   LBS-PRIVFWAPI2-NOTIFIER-PARAM-REQTYPE-0003


START_TESTCASE                LBS-PRIVFWAPI2-NOTIFIER-PARAM-REQTYPE-0004
//! @SYMTestCaseID              LBS-PRIVFWAPI2-NOTIFIER-PARAM-REQTYPE-0004
//! @SYMTestCaseDesc		Test for an illegal Request Type parameter
//!                             This test attempts to make a request but it is rejected due to the illegal Request Type
//!                             Also make a request with bad requesterIdFormat value to get a returned KErrArgument
//! @SYMTestPriority            High
//! @SYMTestActions             1. Set Admin settings to use Notifier.
//!                             2. Set RequestType to an illegal value (ERequestAreaEvent + 2)
//!                             3. Issue a Privacy Request API Verification request using NewPrivacyRequest()
//!                             4. Check that the illegal Request Type caused the request to be rejected with error KErrNotSupported
//!                             5. Reset requestInfo and set a bad requesterIdFormat value
//!                             6. Re-issue the request
//!                             7. Check that the illegal Request Type caused the request to be rejected with error KErrNotSupported
//! @SYMTestExpectedResults     The request is rejected with error KErrNotSupported
//! @SYMTESTSTATUS              Implemented
//! @SYMPREQ                    PREQ 1660
RUN_TEST_STEP 010 LbsPrivFwTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 030 LbsPrivFwTestServer KLbsPrivFwStep_Param  c:\testdata\configs\lbsprivfw.ini  LBS-PRIVFWAPI2-PARAM-0007
END_TESTCASE                   LBS-PRIVFWAPI2-NOTIFIER-PARAM-REQTYPE-0004


RUN_TEST_STEP 030 LbsPrivFwTestServer LbsStep_CloseTestChannel
