/** Perform CNiLrStep1 test step. This test verifies that the Test Protocol Module correctly handles a Network Induced location request. @return TVerdict test result code */ TVerdict CNiLrStep1::doTestStepL() { INFO_PRINTF1(_L("\t********************************************************************")); INFO_PRINTF1(_L("\tNILR basic procedure")); INFO_PRINTF1(_L("\t********************************************************************")); INFO_PRINTF1(_L("- START -")); // Initiate NI-LR INFO_PRINTF1(_L("\t ProcessMeasurementControlLocation <- NET")); TPositionInfo refLoc; TPosition refPos; refPos.SetHorizontalAccuracy(KRefPosHorizAcc); refLoc.SetPosition(refPos); RLbsAssistanceDataBuilderSet assistData; CleanupClosePushL(assistData); assistData.OpenL(); SetDummyAssistanceData(assistData, EAssistanceDataReferenceTime); TLbsNetPosRequestQuality quality; quality.SetMinHorizontalAccuracy(KLocReqHorizAcc); iNetworkObserver->ProcessMeasurementControlLocationL(refLoc, assistData, quality); CleanupStack::PopAndDestroy(&assistData); // Check gateway receives Assistance data if (EFail == CheckGatewayCallbackL( CGatewayObserver::EProcessAssistanceData) || EAssistanceDataReferenceTime != iGatewayObserver->AssistanceDataSetMask()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\tLBS <- ProcessAssistanceData")); // Check gateway receives Network Based location if (EFail == CheckGatewayCallbackL( CGatewayObserver::EProcessLocationUpdate) || KRefPosHorizAcc != iGatewayObserver->ReferencePos().HorizontalAccuracy()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\tLBS <- ProcessLocationUpdate")); // Check gateway receives Location Request if (EFail == CheckGatewayCallbackL( CGatewayObserver::EProcessLocationRequest) || iGatewayObserver->IsLocEmergency() || MLbsNetworkProtocolObserver::EServiceNetworkInduced != iGatewayObserver->LocType() || KLocReqHorizAcc != iGatewayObserver->LocQuality().MinHorizontalAccuracy()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\tLBS <- ProcessLocationRequest")); // Generate Location Response INFO_PRINTF1(_L("\tLBS -> RespondLocationRequest")); TInt reason = KErrNone; TPositionInfo mobilePosInfo; TPosition mobilePos; mobilePos.SetHorizontalAccuracy(KMobilePosHorizAcc); mobilePosInfo.SetPosition(mobilePos); iModule->RespondLocationRequest(iGatewayObserver->SessionIdValue(), reason, mobilePosInfo); // Check network receives Location Response if (EFail == CheckNetworkCallbackL( CNetworkObserver::EMeasurementReportLocation) || KMobilePosHorizAcc != iNetworkObserver->MobilePos().HorizontalAccuracy()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\t MeasurementReportLocation -> NET")); // Check gateway session completed if (EFail == CheckGatewayCallbackL( CGatewayObserver::EProcessSessionComplete)) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\tLBS <- ProcessSessionComplete")); // Check if more observer activity takes place if (iGatewayObserver->IsMoreObserverActivity() || iNetworkObserver->IsMoreObserverActivity()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("- END -")); SetTestStepResult(EPass); return TestStepResult(); }
/** Perform CMtLrStep2 test step. This test verifies that the Test Protocol Module correctly handles an MT-LR sequence - with measurement control before privacy response. @return TVerdict test result code */ TVerdict CMtLrStep2::doTestStepL() { INFO_PRINTF1(_L("\t********************************************************************")); INFO_PRINTF1(_L("\tMTLR basic procedure - measurement control before privacy response")); INFO_PRINTF1(_L("\t********************************************************************")); INFO_PRINTF1(_L("- START -")); // Initiate MT-LR INFO_PRINTF1(_L("\t ProcessRegisterLcsLocationNotification <- NET")); TLbsExternalRequestInfo reqInfo; reqInfo.SetRequesterId(KRequesterId()); TLbsNetPosRequestPrivacy privacyReq; privacyReq.SetRequestAction(TLbsNetPosRequestPrivacy::ERequestActionAllow); iNetworkObserver->ProcessRegisterLcsLocationNotificationL(reqInfo, privacyReq); // Check gateway receives privacy request TBuf8<KLbsMaxRequesterIdSize> id; if (EFail == CheckGatewayCallbackL(CGatewayObserver::EProcessPrivacyRequest)) { SetTestStepResult(EFail); return TestStepResult(); } iGatewayObserver->RequesterId(id); TLbsNetSessionId sessionId = iGatewayObserver->SessionIdValue(); if (TLbsNetPosRequestPrivacy::ERequestActionAllow != iGatewayObserver->PrivacyNotifType().RequestAction() || KRequesterId() != id) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\tLBS <- ProcessPrivacyRequest")); // Generate network Measurement Control INFO_PRINTF1(_L("\t ProcessMeasurementControlLocation <- NET")); TPositionInfo refLoc; TPosition refPos; refPos.SetHorizontalAccuracy(KRefPosHorizAcc); refLoc.SetPosition(refPos); RLbsAssistanceDataBuilderSet assistData; CleanupClosePushL(assistData); assistData.OpenL(); SetDummyAssistanceData(assistData, EAssistanceDataReferenceTime); TLbsNetPosRequestQuality quality; quality.SetMinHorizontalAccuracy(KLocReqHorizAcc); iNetworkObserver->ProcessMeasurementControlLocationL(refLoc, assistData, quality); CleanupStack::PopAndDestroy(&assistData); // Check gateway receives Assistance data if (EFail == CheckGatewayCallbackL( CGatewayObserver::EProcessAssistanceData) || EAssistanceDataReferenceTime != iGatewayObserver->AssistanceDataSetMask()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\tLBS <- ProcessAssistanceData")); // Check gateway receives Network Based location if (EFail == CheckGatewayCallbackL( CGatewayObserver::EProcessLocationUpdate) || KRefPosHorizAcc != iGatewayObserver->ReferencePos().HorizontalAccuracy()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\tLBS <- ProcessLocationUpdate")); // Check gateway receives Location Request if (EFail == CheckGatewayCallbackL( CGatewayObserver::EProcessLocationRequest) || iGatewayObserver->IsLocEmergency() || MLbsNetworkProtocolObserver::EServiceMobileTerminated != iGatewayObserver->LocType() || KLocReqHorizAcc != iGatewayObserver->LocQuality().MinHorizontalAccuracy() || sessionId != iGatewayObserver->SessionIdValue()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\tLBS <- ProcessLocationRequest")); // Generate privacy response INFO_PRINTF1(_L("\tLBS -> RespondPrivacyRequest")); iModule->RespondPrivacyRequest(iGatewayObserver->SessionIdValue(), CLbsNetworkProtocolBase::EPrivacyResponseAccepted); // Check network receives privacy response if (EFail == CheckNetworkCallbackL( CNetworkObserver::EReleaseLcsLocationNotification) || CLbsNetworkProtocolBase::EPrivacyResponseAccepted != iNetworkObserver->PrivacyResponse()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\t ReleaseLcsLocationNotification -> NET")); // Generate Location Response INFO_PRINTF1(_L("\tLBS -> RespondLocationRequest")); TInt reason = KErrNone; TPositionInfo mobilePosInfo; TPosition mobilePos; mobilePos.SetHorizontalAccuracy(KMobilePosHorizAcc); mobilePosInfo.SetPosition(mobilePos); iModule->RespondLocationRequest(iGatewayObserver->SessionIdValue(), reason, mobilePosInfo); // Check network receives Location Response if (EFail == CheckNetworkCallbackL( CNetworkObserver::EMeasurementReportLocation) || KMobilePosHorizAcc != iNetworkObserver->MobilePos().HorizontalAccuracy()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\t MeasurementReportLocation -> NET")); // Check gateway session completed if (EFail == CheckGatewayCallbackL( CGatewayObserver::EProcessSessionComplete) || KErrNone != iGatewayObserver->SessionCloseReason()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\tLBS <- ProcessSessionComplete")); // Check if more observer activity takes place if (iGatewayObserver->IsMoreObserverActivity() || iNetworkObserver->IsMoreObserverActivity()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("- END -")); SetTestStepResult(EPass); return TestStepResult(); }
/** Perform CNiLrStep2 test step. This test verifies that the Test Protocol Module correctly handles a NI-LR with location response timeout. @return TVerdict test result code */ TVerdict CNiLrStep2::doTestStepL() { INFO_PRINTF1(_L("\t********************************************************************")); INFO_PRINTF1(_L("\tNILR - location response timeout")); INFO_PRINTF1(_L("\t********************************************************************")); INFO_PRINTF1(_L("- START -")); // Initiate NI-LR INFO_PRINTF1(_L("\t ProcessMeasurementControlLocation <- NET")); TPositionInfo refLoc; TPosition refPos; refPos.SetHorizontalAccuracy(KRefPosHorizAcc); refLoc.SetPosition(refPos); RLbsAssistanceDataBuilderSet assistData; CleanupClosePushL(assistData); assistData.OpenL(); SetDummyAssistanceData(assistData, EAssistanceDataReferenceTime); TLbsNetPosRequestQuality quality; quality.SetMinHorizontalAccuracy(KLocReqHorizAcc); iNetworkObserver->ProcessMeasurementControlLocationL(refLoc, assistData, quality); CleanupStack::PopAndDestroy(&assistData); // Check gateway receives Assistance data if (EFail == CheckGatewayCallbackL( CGatewayObserver::EProcessAssistanceData) || EAssistanceDataReferenceTime != iGatewayObserver->AssistanceDataSetMask()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\tLBS <- ProcessAssistanceData")); // Check gateway receives Network Based location if (EFail == CheckGatewayCallbackL( CGatewayObserver::EProcessLocationUpdate) || KRefPosHorizAcc != iGatewayObserver->ReferencePos().HorizontalAccuracy()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\tLBS <- ProcessLocationUpdate")); // Check gateway receives Location Request if (EFail == CheckGatewayCallbackL( CGatewayObserver::EProcessLocationRequest) || iGatewayObserver->IsLocEmergency() || MLbsNetworkProtocolObserver::EServiceNetworkInduced != iGatewayObserver->LocType() || KLocReqHorizAcc != iGatewayObserver->LocQuality().MinHorizontalAccuracy()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\tLBS <- ProcessLocationRequest")); // Delay activity by 70 secs INFO_PRINTF1(_L("*** DELAY 70 SECONDS ***")); User::After(TTimeIntervalMicroSeconds32(25000000)); // Check network receives Location error response if (EFail == CheckNetworkCallbackL( CNetworkObserver::EMeasurementControlFailure) || KErrTimedOut != iNetworkObserver->MeasurementFailure()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\t MeasurementControlFailure (TIMEOUT) -> NET")); // Check gateway session timeout is reported if (EFail == CheckGatewayCallbackL( CGatewayObserver::EProcessSessionComplete) || KErrTimedOut != iGatewayObserver->SessionCloseReason()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\tLBS <- ProcessSessionComplete (TIMEOUT)")); // Check if more observer activity takes place if (iGatewayObserver->IsMoreObserverActivity() || iNetworkObserver->IsMoreObserverActivity()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("- END -")); SetTestStepResult(EPass); return TestStepResult(); }
/** Perform CMtLrStep7 test step. This test verifies that the Test Protocol Module correctly handles an MT-LR sequence with a timeout when waiting for the privacy response. @return TVerdict test result code */ TVerdict CMtLrStep7::doTestStepL() { INFO_PRINTF1(_L("\t********************************************************************")); INFO_PRINTF1(_L("\tMTLR - privacy response timeout")); INFO_PRINTF1(_L("\t********************************************************************")); INFO_PRINTF1(_L("- START -")); // Initiate MT-LR INFO_PRINTF1(_L("\t ProcessRegisterLcsLocationNotification <- NET")); TLbsExternalRequestInfo reqInfo; reqInfo.SetRequesterId(KRequesterId()); TLbsNetPosRequestPrivacy privacyReq; privacyReq.SetRequestAction(TLbsNetPosRequestPrivacy::ERequestActionAllow); iNetworkObserver->ProcessRegisterLcsLocationNotificationL(reqInfo, privacyReq); // Generate network Measurement Control INFO_PRINTF1(_L("\t ProcessMeasurementControlLocation <- NET")); TPositionInfo refLoc; TPosition refPos; refPos.SetHorizontalAccuracy(KRefPosHorizAcc); refLoc.SetPosition(refPos); RLbsAssistanceDataBuilderSet assistData; CleanupClosePushL(assistData); assistData.OpenL(); SetDummyAssistanceData(assistData, EAssistanceDataReferenceTime); TLbsNetPosRequestQuality quality; quality.SetMinHorizontalAccuracy(KLocReqHorizAcc); iNetworkObserver->ProcessMeasurementControlLocationL(refLoc, assistData, quality); CleanupStack::PopAndDestroy(&assistData); // Check gateway receives Assistance data if (EFail == CheckGatewayCallbackL( CGatewayObserver::EProcessAssistanceData) || EAssistanceDataReferenceTime != iGatewayObserver->AssistanceDataSetMask()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\tLBS <- ProcessAssistanceData")); // Check gateway receives privacy request TBuf8<KLbsMaxRequesterIdSize> id; if (EFail == CheckGatewayCallbackL(CGatewayObserver::EProcessPrivacyRequest)) { SetTestStepResult(EFail); return TestStepResult(); } iGatewayObserver->RequesterId(id); TLbsNetSessionId sessionId = iGatewayObserver->SessionIdValue(); if (TLbsNetPosRequestPrivacy::ERequestActionAllow != iGatewayObserver->PrivacyNotifType().RequestAction() || KRequesterId() != id) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\tLBS <- ProcessPrivacyRequest")); // Check gateway receives Network Based location if (EFail == CheckGatewayCallbackL( CGatewayObserver::EProcessLocationUpdate) || KRefPosHorizAcc != iGatewayObserver->ReferencePos().HorizontalAccuracy()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\tLBS <- ProcessLocationUpdate")); // Check gateway receives Location Request if (EFail == CheckGatewayCallbackL( CGatewayObserver::EProcessLocationRequest) || iGatewayObserver->IsLocEmergency() || MLbsNetworkProtocolObserver::EServiceMobileTerminated != iGatewayObserver->LocType() || KLocReqHorizAcc != iGatewayObserver->LocQuality().MinHorizontalAccuracy() || sessionId != iGatewayObserver->SessionIdValue()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\tLBS <- ProcessLocationRequest")); // Delay activity by 25 secs INFO_PRINTF1(_L("*** DELAY 25 SECONDS ***")); User::After(TTimeIntervalMicroSeconds32(25000000)); // Check network receives privacy response if (EFail == CheckNetworkCallbackL( CNetworkObserver::EReleaseLcsLocationNotification) || CLbsNetworkProtocolBase::EPrivacyResponseUnknown != iNetworkObserver->PrivacyResponse()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\t ReleaseLcsLocationNotification (unknown?) -> NET")); // Check gateway session closes if (EFail == CheckGatewayCallbackL( CGatewayObserver::EProcessSessionComplete) || KErrTimedOut != iGatewayObserver->SessionCloseReason()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\tLBS <- ProcessSessionComplete (TIMEOUT)")); // Generate Location Response with error INFO_PRINTF1(_L("\tLBS -> RespondLocationRequest")); TInt reason = KErrGeneral; TPositionInfo mobilePosInfo; iModule->RespondLocationRequest(iGatewayObserver->SessionIdValue(), reason, mobilePosInfo); // Check network receives Location error response if (EFail == CheckNetworkCallbackL( CNetworkObserver::EMeasurementControlFailure) || KErrGeneral != iNetworkObserver->MeasurementFailure()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\t MeasurementControlFailure (KErrGeneral) -> NET")); // Check if more observer activity takes place if (iGatewayObserver->IsMoreObserverActivity() || iNetworkObserver->IsMoreObserverActivity()) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("- END -")); SetTestStepResult(EPass); return TestStepResult(); }