// Copyright (c) 2006-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:
//

LOAD_SUITE LbsClockTestServer -SharedData

PRINT Run LbsClockTestServer
PRINT

//Before we start LBS, select the network reg status txt file to use.
RUN_UTILS CopyFile c:\testdata\configs\lbstestconfig.txt c:\config.txt
PREFIX RUN_UTILS
MkDir c:\private\10282253\
MkDir c:\private\10282253\lbs\
MkDir c:\private\10282253\lbs\locmods\
CopyFile z:\testdata\configs\sirfdatasource.ini c:\private\10282253\lbs\locmods\agpsintegmodule.ini
REMOVE_PREFIX
// Re-select the profile ini
RUN_UTILS DeleteFile c:\private\10282253\lbs\lbsprofile.ini

RUN_TEST_STEP 010 LbsClockTestServer LbsStep_ResetDefaultAdmin 
RUN_TEST_STEP 030 LbsClockTestServer LbsStep_StartLbs
RUN_TEST_STEP 010 LbsClockTestServer LbsStep_SetAutonomousMode

START_TESTCASE LBS-Clock-Real-0012

//!@SYMTestCaseID			LBS-Clock-Real-0012
//!@SYMTestCaseDesc			Automatic clock adjust with the Auto Clock API switched on.
//!
//!@SYMTestActions			1. Switch on the Auto Clock API from the admin KSettingClockAdjust setting.
//!							2. Request and process a position update.
//!
//!@SYMTestExpectedResults	Verify the time is set correctly in step 3, the following approach is
//!							taken to verify time is updated correctly:
//!								a. Record current time.
//!								b. Put clock forward by 2 hours.
//!								c. Sync the clock back to the actual time by carrying out a position update which
//!									in turn will re-adjust the clock via the location manager and its integration module.
//!									During the sync keep updating the record of current time, by an fixed interval, to allow later verification in step d.
//!								d. Ensure the time before and after adjust is roughly equal by 5 seconds.
//!								e. Repeat steps a - d and ensure time in d are equal by 2 seconds. 
//!
//!@SYMPREQ					PREQ 1616
//!@SYMREQ					REQ 1616.04
//!@SYMREQ					REQ 1616.06
//!@SYMREQ					REQ 1616.07
//!@SYMREQ					REQ 1616.10
//!@SYMREQ					REQ 1616.11
//!
//!@SYMTestType				CIT
//!@SYMTestPriority			1
//!@SYMTestStatus			Implemented.

RUN_TEST_STEP 010 LbsClockTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 020 LbsClockTestServer LbsStep_SetUpPsy c:\testdata\configs\lbsclock_real.ini  LBS-Clock
RUN_TEST_STEP 010 LbsClockTestServer LbsStep_CreateVerifyPosInfos c:\testdata\configs\lbsclock_real.ini LBS-Clock-0020
RUN_TEST_STEP 020 LbsClockTestServer LbsClockStep_Main c:\testdata\configs\lbsclock_real.ini LBS-Clock-0020
RUN_TEST_STEP 010 LbsClockTestServer LbsStep_VerifyLogInfo

END_TESTCASE LBS-Clock-Real-0012


START_TESTCASE LBS-Clock-Real-0013

//!@SYMTestCaseID			LBS-Clock-Real-0013
//!@SYMTestCaseDesc			Automatic clock adjust with the Auto Clock API switched on (adjust clock back).
//!
//!@SYMTestActions			1. Switch on the Auto Clock API from the admin KSettingClockAdjust setting.
//!							2. Request and process a position update.
//!
//!@SYMTestExpectedResults	Verify the time is set correctly in step 3, the following approach is
//!							taken to verify time is updated correctly:
//!								a. Record current time.
//!								b. Put clock back by 2 hours.
//!								c. Sync the clock back to the actual time by carrying out a position update which
//!									in turn will re-adjust the clock via the location manager and its integration module.
//!									During the sync keep updating the record of current time, by an fixed interval, to allow later verification in step d.
//!								d. Ensure the time before and after adjust is roughly equal by 5 seconds.
//!								e. Repeat steps a - d and ensure time in d are equal by 2 seconds. 
//!
//!@SYMPREQ					PREQ 1616
//!@SYMREQ					REQ 1616.04
//!@SYMREQ					REQ 1616.06
//!@SYMREQ					REQ 1616.07
//!@SYMREQ					REQ 1616.11
//!
//!@SYMTestType				CIT
//!@SYMTestPriority			1
//!@SYMTestStatus			Implemented.

RUN_TEST_STEP 010 LbsClockTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 020 LbsClockTestServer LbsStep_SetUpPsy c:\testdata\configs\lbsclock_real.ini  LBS-Clock
RUN_TEST_STEP 010 LbsClockTestServer LbsStep_CreateVerifyPosInfos c:\testdata\configs\lbsclock_real.ini LBS-Clock-0021
RUN_TEST_STEP 020 LbsClockTestServer LbsClockStep_Main c:\testdata\configs\lbsclock_real.ini LBS-Clock-0021
RUN_TEST_STEP 010 LbsClockTestServer LbsStep_VerifyLogInfo

END_TESTCASE LBS-Clock-Real-0013


RUN_TEST_STEP 030 LbsClockTestServer LbsStep_StopLbs
RUN_TEST_STEP 030 LbsClockTestServer LbsStep_StartLbs


START_TESTCASE LBS-Clock-Real-0019

//!@SYMTestCaseID			LBS-Clock-Real-0019
//!@SYMTestCaseDesc			Automatic clock adjust with the Auto Clock API switched on.
//!
//!@SYMTestActions			1. Switch on the Auto Clock API from the admin KSettingClockAdjust setting.
//!							2. Request and process a position update.
//!
//!@SYMTestExpectedResults	Verify the time is set correctly in step 3, the following approach is
//!							taken to verify time is updated correctly:
//!								a. Record current time.
//!								b. Put clock forward by 2 hours.
//!								c. Sync the clock back to the actual time by carrying out a position update which
//!									in turn will re-adjust the clock via the location manager and its integration module.
//!									During the sync keep updating the record of current time, by an fixed interval, to allow later verification in step d.
//!								d. Ensure the time before and after adjust is roughly equal by 5 seconds.
//!								e. Repeat steps a - d and ensure time in d are equal by 2 seconds. 
//!
//!@SYMPREQ					PREQ 1616
//!@SYMREQ					REQ 1616.04
//!@SYMREQ					REQ 1616.06
//!@SYMREQ					REQ 1616.07
//!@SYMREQ					REQ 1616.10
//!@SYMREQ					REQ 1616.11
//!
//!@SYMTestType				CIT
//!@SYMTestPriority			1
//!@SYMTestStatus			Implemented.

RUN_TEST_STEP 010 LbsClockTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 020 LbsClockTestServer LbsStep_SetUpPsy c:\testdata\configs\lbsclock_real.ini  LBS-Clock
RUN_TEST_STEP 010 LbsClockTestServer LbsStep_CreateVerifyPosInfos c:\testdata\configs\lbsclock_real.ini LBS-Clock-RefPos-0120
RUN_TEST_STEP 020 LbsClockTestServer LbsClockStep_Main c:\testdata\configs\lbsclock_real.ini LBS-Clock-RefPos-0120
RUN_TEST_STEP 010 LbsClockTestServer LbsStep_VerifyLogInfo

END_TESTCASE LBS-Clock-Real-0019


START_TESTCASE LBS-Clock-Real-0020

//!@SYMTestCaseID			LBS-Clock-Real-0020
//!@SYMTestCaseDesc			Automatic clock adjust with the Auto Clock API switched on (adjust clock back).
//!
//!@SYMTestActions			1. Switch on the Auto Clock API from the admin KSettingClockAdjust setting.
//!							2. Request and process a position update.
//!
//!@SYMTestExpectedResults	Verify the time is set correctly in step 3, the following approach is
//!							taken to verify time is updated correctly:
//!								a. Record current time.
//!								b. Put clock back by 2 hours.
//!								c. Sync the clock back to the actual time by carrying out a position update which
//!									in turn will re-adjust the clock via the location manager and its integration module.
//!									During the sync keep updating the record of current time, by an fixed interval, to allow later verification in step d.
//!								d. Ensure the time before and after adjust is roughly equal by 5 seconds.
//!								e. Repeat steps a - d and ensure time in d are equal by 2 seconds. 
//!
//!@SYMPREQ					PREQ 1616
//!@SYMREQ					REQ 1616.04
//!@SYMREQ					REQ 1616.06
//!@SYMREQ					REQ 1616.07
//!@SYMREQ					REQ 1616.11
//!
//!@SYMTestType				CIT
//!@SYMTestPriority			1
//!@SYMTestStatus			Implemented.

RUN_TEST_STEP 010 LbsClockTestServer LbsStep_InstallScheduler
RUN_TEST_STEP 020 LbsClockTestServer LbsStep_SetUpPsy c:\testdata\configs\lbsclock_real.ini  LBS-Clock
RUN_TEST_STEP 010 LbsClockTestServer LbsStep_CreateVerifyPosInfos c:\testdata\configs\lbsclock_real.ini LBS-Clock-RefPos-0121
RUN_TEST_STEP 020 LbsClockTestServer LbsClockStep_Main c:\testdata\configs\lbsclock_real.ini LBS-Clock-RefPos-0121
RUN_TEST_STEP 010 LbsClockTestServer LbsStep_VerifyLogInfo

END_TESTCASE LBS-Clock-Real-0020


PRINT Stop LBS
RUN_TEST_STEP 020 LbsClockTestServer LbsStep_StopLbs

// Delete network registration status text file
RUN_UTILS DeleteFile c:\config.txt
