TVerdict CTestLtsySmsDeleteInvalidIndex::doTestStepPostambleL() { INFO_PRINTF1(_L("CTestLtsySmsDeleteInvalidIndex::doTestStepPostambleL called")); return TestStepResult(); }
TVerdict CProcessLaunchTest0Step::doTestStepL() /** * @return - TVerdict code * Override of base class pure virtual * Our implementation only gets called if the base class doTestStepPreambleL() did * not leave. That being the case, the current test result value will be EPass. */ { _LIT(KThreadName, "*lbsgpslocmanager*"); TProcessStartParams processParams; _LIT(KDummyFileName, "\\sys\\bin\\lbsgpslocmanager.exe"); _LIT(KDummyProcessName, "DummyAgpsManager"); processParams.SetProcessFileName(KDummyFileName); processParams.SetProcessName(KDummyProcessName); processParams.SetRendezvousRequired(EFalse); if (TestStepResult()==EPass) { CProcessLaunch::ProcessLaunch(processParams); // now we have to look for this thread. TFindThread threadFinder(KThreadName); TFullName matchedThreadName; // see how many instances we have of the thread TInt matchCount = 0; while(threadFinder.Next(matchedThreadName) == KErrNone) { ++matchCount; } // match count must be one at this point if(matchCount!=1) { // fail the test, its all gone very wrong - there are 2 processes SetTestStepResult(EFail); } // now we want to grab the ThreadID (we can just use thead id's, don't need handles) RThread processThread; User::LeaveIfError(processThread.Open(matchedThreadName)); TThreadId tid = processThread.Id(); // now try and break things, by starting a 2nd copy of the process. CProcessLaunch::ProcessLaunch(processParams); // NB we use the same process params matchCount = 0; threadFinder.Find(KThreadName); while(threadFinder.Next(matchedThreadName)==KErrNone) { ++matchCount; } // match count must be one at this point if(matchCount!=1) { // fail the test, its all gone very wrong - there are 2 processes // this is were we will fail with the current code. SetTestStepResult(EFail); } // check the thread ID's RThread newProcessThread; User::LeaveIfError(newProcessThread.Open(matchedThreadName)); TThreadId newTid = newProcessThread.Id(); if(newTid.Id() != tid.Id()) { // fail the test these are different thread id's // This is to be expected in the current code base SetTestStepResult(EFail); } else { // test passes - there is only one instance of the process SetTestStepResult(EPass); } } // now kill the process we started _LIT(KStar, "*"); TFullName wildCardPattern; wildCardPattern.Append(KStar); wildCardPattern.Append(KThreadName); wildCardPattern.Append(KStar); TFindProcess pf(wildCardPattern); TFullName name; TInt findError = pf.Next(name); RProcess p; TInt pErr = 0; pErr = p.Open(name); User::LeaveIfError(pErr); // nuke it p.Kill(0); p.Close(); return TestStepResult(); }
/** Override of base class virtual @return - TVerdict code */ TVerdict CTDirectGdiDriver::doTestStepPreambleL() { CTDirectGdiStepBase::doTestStepPreambleL(); INFO_PRINTF1(_L("DirectGdi Driver pre-test setup")); return TestStepResult(); }
TVerdict CTestIfioctls::doTestStepL() { int err; if(TestStepName() == KExampleL) { INFO_PRINTF1(_L("ExampleL():")); err = ExampleL(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == KListInterfaces) { INFO_PRINTF1(_L("ListInterfaces():")); err = ListInterfaces(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == KCreateManyActiveInterfaces) { INFO_PRINTF1(_L("CreateManyActiveInterfaces():")); err = CreateManyActiveInterfaces(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == KChooseInterface) { INFO_PRINTF1(_L("ChooseInterface():")); err = ChooseInterface(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == KChooseActiveInterface) { INFO_PRINTF1(_L("ChooseActiveInterface():")); err = ChooseActiveInterface(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == KTestIfNameIndex) { INFO_PRINTF1(_L("TestIfNameIndex():")); err = TestIfNameIndex(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == KTestIfIndexToName) { INFO_PRINTF1(_L("TestIfIndexToName():")); err = TestIfIndexToName(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == KTestIfNameToIndex) { INFO_PRINTF1(_L("TestIfNameToIndex():")); err = TestIfNameToIndex(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == KTestSiocGIfIndex) { INFO_PRINTF1(_L("TestSiocGIfIndex():")); err = TestSiocGIfIndex(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == KConnectToIpUsingConnection) { INFO_PRINTF1(_L("ConnectToIpUsingConnection():")); err = ConnectToIpUsingConnection(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == KSendtoIpUsingConnection ) { INFO_PRINTF1(_L("SendtoIpUsingConnection():")); err = SendtoIpUsingConnection(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == KConnectToUrlUsingConnection ) { INFO_PRINTF1(_L("ConnectToUrlUsingConnection():")); err = ConnectToUrlUsingConnection(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == Kioctltest) { INFO_PRINTF1(_L("ioctltest():")); err = ioctltest(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == Kreadtest) { INFO_PRINTF1(_L("readtest():")); err = readtest(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == KTestAddDelRoute) { INFO_PRINTF1(_L("TestAddDelRoute():")); err = TestAddDelRoute(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == KTestAddDelRouteNegative1) { INFO_PRINTF1(_L("TestAddDelRouteNegative1():")); err = TestAddDelRouteNegative1(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == KTestAddDelRouteNegative2) { INFO_PRINTF1(_L("TestAddDelRouteNegative2():")); err = TestAddDelRouteNegative2(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == KTestMacAddress) { INFO_PRINTF1(_L("TestMacAddress():")); err = TestMacAddress(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == KTestMacAddressNegative1) { INFO_PRINTF1(_L("TestMacAddressNegative1():")); err = TestMacAddressNegative1(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == KTestioctlfile ) { INFO_PRINTF1(_L("Testioctlfile():")); err = Testioctlfile(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } else if(TestStepName() == KTestioctl1) { INFO_PRINTF1(_L("Testioctl1():")); err = Testioctl1(); SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass); } return TestStepResult(); }
TVerdict CSimOutGoingDataTest::doTestStepL() { INFO_PRINTF1(_L("BeginOutGoingDataTest")); CreateConfigFileL(_L("c:\\config3.txt")); SetTestNumberL(0); TInt ret = iPhone.Open(iTelServer,KPhoneName); INFO_PRINTF2(_L("Result: %d"),ret); TESTL(ret == KErrNone); INFO_PRINTF1(_L("Opened phone object")); TESTL(iPhone.Initialise()==KErrNone); INFO_PRINTF1(_L("Opened phone object")); TESTL(iLine.Open(iPhone,KDataLineName)==KErrNone); INFO_PRINTF1(_L("Opened Line object")); TName callName; TESTL(iCall.OpenNewCall(iLine,callName)==KErrNone); INFO_PRINTF1(_L("Opened Call object")); // Test a Dial with Core Call Params... INFO_PRINTF1(_L("Get Bearer Information")); RCall::TBearerService bearerServiceInfo; TESTL(iCall.GetBearerServiceInfo(bearerServiceInfo)==KErrEtelCallNotActive); INFO_PRINTF1(_L("Get DataCall Capabilities")); RMobileCall::TMobileCallDataCapsV1 callCaps; RMobileCall::TMobileCallDataCapsV1Pckg callCapsPckg(callCaps); ret=iCall.GetMobileDataCallCaps(callCapsPckg); CHECKPOINTL(ret,KErrNone,CHP_DATA_CASE("B.7")); INFO_PRINTF1(_L("Get DataCall RLP Range")); TRequestStatus stat0; RMobileCall::TMobileDataRLPRangesV1 rlp; RMobileCall::TMobileDataRLPRangesV1Pckg rlpPckg(rlp); iCall.GetMobileDataCallRLPRange(stat0,1,rlpPckg); User::WaitForRequest(stat0); CHECKPOINTL(stat0,KErrNone,CHP_DATA_CASE("B.6")); INFO_PRINTF1(_L("Get DataCall Hscsd information")); RMobileCall::TMobileCallHscsdInfoV1 info; RMobileCall::TMobileCallHscsdInfoV1Pckg infoPckg(info); ret=iCall.GetCurrentHscsdInfo(infoPckg); CHECKPOINTL(ret,KErrNone,CHP_DATA_CASE("B.9")); INFO_PRINTF1(_L("Get Hscsd Call Params")); RMobileCall::TMobileHscsdCallParamsV1 callParams; RMobileCall::TMobileHscsdCallParamsV1Pckg callParamsPckg(callParams); TESTL(iCall.GetCallParams(callParamsPckg)==KErrEtelCallNotActive); StartNTRasSimulation(); INFO_PRINTF2(_L("Dialling %S "),&KTelephoneNumber); TRequestStatus reqStatus0; callParams.iSpeakerControl=RCall::EMonitorSpeakerControlAlwaysOn; callParams.iSpeakerVolume=RCall::EMonitorSpeakerVolumeHigh; callParams.iWaitForDialTone=RCall::EDialToneWait; callParams.iInterval=1234; callParams.iWantedAiur=RMobileCall::EAiurBps9600; callParams.iWantedRxTimeSlots=5; callParams.iMaxTimeSlots=30; callParams.iCodings=RMobileCall::ETchCoding48; iCall.Dial(reqStatus0,callParamsPckg,KTelephoneNumber); User::WaitForRequest(reqStatus0); // Wait for the Call Status Change notification TESTL(reqStatus0==KErrNone); INFO_PRINTF2(_L("Result: %d"),reqStatus0.Int()); CHECKPOINTL(reqStatus0,KErrNone,CHP_DATA_CASE("B.1")); INFO_PRINTF1(_L("Get Bearer Information again...")); TESTL(iCall.GetBearerServiceInfo(bearerServiceInfo)==KErrNone); TESTL(bearerServiceInfo.iBearerCaps==RCall::KBearerCapsCompressionV42bis); TESTL(bearerServiceInfo.iBearerSpeed==RCall::EBearerData19200); INFO_PRINTF1(_L("Check call state...")); RMobileCall::TMobileCallStatus state; TESTL(iCall.GetMobileCallStatus(state)==KErrNone); TESTL(state==RMobileCall::EStatusConnected); INFO_PRINTF1(_L("Check call params...")); TESTL(iCall.GetCallParams(callParamsPckg)==KErrNone); TESTL(callParams.iSpeakerControl==RCall::EMonitorSpeakerControlAlwaysOn); TESTL(callParams.iSpeakerVolume==RCall::EMonitorSpeakerVolumeHigh); TESTL(callParams.iWaitForDialTone==RCall::EDialToneWait); TESTL(callParams.iInterval==1234); INFO_PRINTF1(_L("Notification for Hscsd info changes")); TRequestStatus reqStatus1; iCall.NotifyHscsdInfoChange(reqStatus1,infoPckg); INFO_PRINTF1(_L("Set DataCall Hscsd Dynamic Parameters")); iCall.SetDynamicHscsdParams(reqStatus0,RMobileCall::EAiurBps57600, 15); User::WaitForRequest(reqStatus0); CHECKPOINTL(reqStatus0,KErrNone,CHP_DATA_CASE("B.8")); User::WaitForRequest(reqStatus1); CHECKPOINTL(reqStatus1,KErrNone,CHP_DATA_CASE("B.10")); INFO_PRINTF1(_L("Completed notification...")); INFO_PRINTF1(_L("Hanging up call")); TESTL(iCall.HangUp()==KErrNone); INFO_PRINTF1(_L("Check call state...")); TESTL(iCall.GetMobileCallStatus(state)==KErrNone); TESTL(state==RMobileCall::EStatusIdle); // Start another session, this time using Multimode Call Params, so re-start the // NTRasSimulator StartNTRasSimulation(); INFO_PRINTF2(_L("Dialling %S "),&KTelephoneNumber); RMobileCall::TMobileCallParamsV1 mobileCallParams; RMobileCall::TMobileCallParamsV1Pckg mobileCallParamsPckg(mobileCallParams); mobileCallParams.iSpeakerControl=RCall::EMonitorSpeakerControlOnExceptDuringDialling; mobileCallParams.iSpeakerVolume=RCall::EMonitorSpeakerVolumeUnknown; mobileCallParams.iWaitForDialTone=RCall::EDialToneNoWait; mobileCallParams.iInterval=5678; mobileCallParams.iAutoRedial=ETrue; mobileCallParams.iCug.iCugIndex=99; mobileCallParams.iIdRestrict=RMobileCall::ESendMyId; iCall.Dial(reqStatus0,mobileCallParamsPckg,KTelephoneNumber); User::WaitForRequest(reqStatus0); // Wait for the Call Status Change notification TESTL(reqStatus0==KErrNone); CHECKPOINTL(reqStatus0,KErrNone,CHP_DATA_CASE("B.2")); INFO_PRINTF1(_L("Check call state...")); TESTL(iCall.GetMobileCallStatus(state)==KErrNone); TESTL(state==RMobileCall::EStatusConnected); INFO_PRINTF1(_L("Check call params...")); TESTL(iCall.GetCallParams(mobileCallParamsPckg)==KErrNone); TESTL(mobileCallParams.iSpeakerControl==RCall::EMonitorSpeakerControlOnExceptDuringDialling); TESTL(mobileCallParams.iSpeakerVolume==RCall::EMonitorSpeakerVolumeUnknown); TESTL(mobileCallParams.iWaitForDialTone==RCall::EDialToneNoWait); TESTL(mobileCallParams.iInterval==5678); TESTL(mobileCallParams.iAutoRedial/*==ETrue*/); TESTL(mobileCallParams.iCug.iCugIndex==99); TESTL(mobileCallParams.iIdRestrict==RMobileCall::ESendMyId); TESTL(iCall.HangUp()==KErrNone); INFO_PRINTF1(_L("Check call state...")); TESTL(iCall.GetMobileCallStatus(state)==KErrNone); TESTL(state==RMobileCall::EStatusIdle); CHECKPOINTL(state,RMobileCall::EStatusIdle,CHP_DATA_CASE("B.3")); iCall.Close(); iLine.Close(); iPhone.Close(); ASSERT(RThread().RequestCount()==0); return TestStepResult(); }
TVerdict CUpsClientStep::doTestStepPreambleL() /** * @return - TVerdict code * Override of base class virtual */ { __UHEAP_MARK; // Read values to config servers from INI file. (ARRAY of values) // Read how many times the test step needs to be repeated. TName fStepRepeat(_L("StepRepeat")); TInt repeats; if(GetIntFromConfig(ConfigSection(),fStepRepeat,repeats)) { iStepRepeat=repeats; } else { iStepRepeat=1; } // Read values for test sequence from INI file. (ARRAY of values) TInt index=0; TName fUseServiceUID; fUseServiceUID.Format(_L("UseServiceUID_%d"),index); TName fUseServerName; fUseServerName.Format(_L("UseServerName_%d"),index); TName fDestination; fDestination.Format(_L("Destination_%d"),index); TName fExpectedError; fExpectedError.Format(_L("ExpectedError_%d"),index); TName fUseOpaqueData; fUseOpaqueData.Format(_L("UseOpaqueData_%d"),index); TName fSelectDialogOption; fSelectDialogOption.Format(_L("SelectDialogOption_%d"),index); TName fButtonsDisplayed; fButtonsDisplayed.Format(_L("ButtonsDisplayed_%d"),index); TName fDialogCreatorInvoked; fDialogCreatorInvoked.Format(_L("DialogCreatorInvoked_%d"),index); TName fPolicyEvaluatorInvoked; fPolicyEvaluatorInvoked.Format(_L("PolicyEvaluatorInvoked_%d"),index); TName fAccessGranted; fAccessGranted.Format(_L("AccessGranted_%d"), index); TName fCloseSession; fCloseSession.Format(_L("CloseSession_%d"), index); TName fHoldEvaluatorOpen; fHoldEvaluatorOpen.Format(_L("HoldEvaluatorOpen_%d"), index); TName fHoldPrepareDialogOpen; fHoldPrepareDialogOpen.Format(_L("HoldPrepareDialogOpen_%d"), index); TName fHoldDisplayDialogOpen; fHoldDisplayDialogOpen.Format(_L("HoldDisplayDialogOpen_%d"), index); TName fRequestDurationThreshold; fRequestDurationThreshold.Format(_L("RequestDurationThreshold_%d"), index); TName fLeaveDialog; fLeaveDialog.Format(_L("LeaveDialog_%d"), index); TName fLeaveEvaluator; fLeaveEvaluator.Format(_L("LeaveEvaluator_%d"), index); TName fCancelUpsRequest; fCancelUpsRequest.Format(_L("CancelUpsRequest_%d"), index); TName fPlatSecPass; fPlatSecPass.Format(_L("PlatSecPass_%d"), index); TName fForcePrompt; fForcePrompt.Format(_L("ForcePrompt_%d"), index); TName fExpectedEvaInfo; fExpectedEvaInfo.Format(_L("ExpectedEvaluatorInfo_%d"), index); TName fSelectFingerprint; fSelectFingerprint.Format(_L("SelectFingerprint_%d"), index); TName fWaitUntilFileAppears; fWaitUntilFileAppears.Format(_L("WaitUntilFileAppears_%d"), index); TInt useServiceUID; TPtrC useServerName; TPtrC destination; TInt expectedError; TPtrC useOpaqueData; TPtrC selectDialogOption; TInt buttonsDisplayed; TInt dialogCreatorInvoked; TInt policyEvaluatorInvoked; TPtrC accessGranted; TBool closeSession; TBool holdEvaluatorOpen; TBool holdPrepareDialogOpen; TBool holdDisplayDialogOpen; TInt requestDurationThreshold; TBool leaveDialog; TBool leaveEvaluator; TBool cancelUpsRequest; TBool platSecPass; TBool forcePrompt; TInt expectedEvaInfo; TInt selectFingerprint; TPtrC waitUntilFileAppears; while (GetHexFromConfig(ConfigSection(), fUseServiceUID,useServiceUID) && GetStringFromConfig(ConfigSection(),fUseServerName,useServerName) && GetStringFromConfig(ConfigSection(),fDestination,destination) && GetStringFromConfig(ConfigSection(),fAccessGranted,accessGranted)) { TServiceRequestParameters newSerReq; newSerReq.iServiceUID = useServiceUID; newSerReq.iServerName = useServerName; newSerReq.iDestination = destination; newSerReq.iAccessGranted = accessGranted; // Close session is optional. if(GetBoolFromConfig(ConfigSection(),fCloseSession,closeSession)) { newSerReq.iCloseSession = closeSession; } // use of dialog creator is optional. if(GetStringFromConfig(ConfigSection(),fSelectDialogOption,selectDialogOption) && GetIntFromConfig(ConfigSection(),fButtonsDisplayed,buttonsDisplayed) && GetIntFromConfig(ConfigSection(),fDialogCreatorInvoked,dialogCreatorInvoked)) { newSerReq.iSelectDialogOption = selectDialogOption; newSerReq.iButtonsDisplayed = buttonsDisplayed; newSerReq.iDialogCreatorInvoked = dialogCreatorInvoked; } // use of policy evaluator is optional. if(GetIntFromConfig(ConfigSection(),fPolicyEvaluatorInvoked,policyEvaluatorInvoked)) { newSerReq.iPolicyEvaluatorInvoked = policyEvaluatorInvoked; } // Opaque data is optional if(GetStringFromConfig(ConfigSection(),fUseOpaqueData,useOpaqueData)) { HBufC8* converter = HBufC8::NewLC(useOpaqueData.Length()); converter->Des().Copy(useOpaqueData); newSerReq.iOpaqueData = converter->Ptr() ; CleanupStack::PopAndDestroy(); //converter } // Expected error is optional. if(GetIntFromConfig(ConfigSection(),fExpectedError,expectedError)) { newSerReq.iExpectedError = expectedError; } // hold policy evaluator open is optional. if(GetBoolFromConfig(ConfigSection(),fHoldEvaluatorOpen, holdEvaluatorOpen)) { newSerReq.iHoldEvaluatorOpen = holdEvaluatorOpen; } // hold prepare dialog open is optional. if(GetBoolFromConfig(ConfigSection(),fHoldPrepareDialogOpen, holdPrepareDialogOpen)) { newSerReq.iHoldPrepareDialogOpen = holdPrepareDialogOpen; } // hold display dialog open is optional. if(GetBoolFromConfig(ConfigSection(),fHoldDisplayDialogOpen, holdDisplayDialogOpen)) { newSerReq.iHoldDisplayDialogOpen = holdDisplayDialogOpen; } // request duration threshold - if a request takes // longer than this threshold it will fail the test if(GetIntFromConfig(ConfigSection(),fRequestDurationThreshold, requestDurationThreshold)) { newSerReq.iRequestDurationThreshold = requestDurationThreshold; } // leave dialog is optional. if(GetBoolFromConfig(ConfigSection(),fLeaveDialog,leaveDialog)) { newSerReq.iLeaveDialog = leaveDialog; } // leave Evaluator is optional. if(GetBoolFromConfig(ConfigSection(),fLeaveEvaluator,leaveEvaluator)) { newSerReq.iLeaveEvaluator = leaveEvaluator; } // Cancel ups request is optional. if(GetBoolFromConfig(ConfigSection(),fCancelUpsRequest,cancelUpsRequest)) { newSerReq.iCancelUpsRequest = cancelUpsRequest; } // plat sec pass is optional. if(GetBoolFromConfig(ConfigSection(),fPlatSecPass,platSecPass)) { newSerReq.iPlatSecPass = platSecPass; } // Force prompt is optional. if(GetBoolFromConfig(ConfigSection(),fForcePrompt,forcePrompt)) { newSerReq.iForcePrompt = forcePrompt; } // use of policy evaluator is optional. if(GetIntFromConfig(ConfigSection(),fExpectedEvaInfo,expectedEvaInfo)) { newSerReq.iExpectedEvaluatorInfo = expectedEvaInfo; } // Fingerprint selection is optional. if(GetIntFromConfig(ConfigSection(),fSelectFingerprint,selectFingerprint)) { newSerReq.iSelectFingerprint = selectFingerprint; } // iRepeatUntilFileAppears is optional. if(GetStringFromConfig(ConfigSection(),fWaitUntilFileAppears,waitUntilFileAppears)) { newSerReq.iWaitUntilFileAppears = waitUntilFileAppears; } // Add the new service to be requested to array. iArraySersToRequest.Append(newSerReq); index++; fUseServiceUID.Format(_L("UseServiceUID_%d"),index); fUseServerName.Format(_L("UseServerName_%d"),index); fDestination.Format(_L("Destination_%d"),index); fExpectedError.Format(_L("ExpectedError_%d"),index); fUseOpaqueData.Format(_L("UseOpaqueData_%d"),index); fSelectDialogOption.Format(_L("SelectDialogOption_%d"),index); fButtonsDisplayed.Format(_L("ButtonsDisplayed_%d"),index); fDialogCreatorInvoked.Format(_L("DialogCreatorInvoked_%d"),index); fPolicyEvaluatorInvoked.Format(_L("PolicyEvaluatorInvoked_%d"),index); fAccessGranted.Format(_L("AccessGranted_%d"), index); fCloseSession.Format(_L("CloseSession_%d"), index); fHoldEvaluatorOpen.Format(_L("HoldEvaluatorOpen_%d"), index); fHoldPrepareDialogOpen.Format(_L("HoldPrepareDialogOpen_%d"), index); fHoldDisplayDialogOpen.Format(_L("HoldDisplayDialogOpen_%d"), index); fRequestDurationThreshold.Format(_L("RequestDurationThreshold_%d"), index); fLeaveDialog.Format(_L("LeaveDialog_%d"), index); fLeaveEvaluator.Format(_L("LeaveEvaluator_%d"), index); fCancelUpsRequest.Format(_L("CancelUpsRequest_%d"), index); fPlatSecPass.Format(_L("PlatSecPass_%d"), index); fForcePrompt.Format(_L("ForcePrompt_%d"), index); fExpectedEvaInfo.Format(_L("ExpectedEvaluatorInfo_%d"), index); fSelectFingerprint.Format(_L("SelectFingerprint_%d"), index); fWaitUntilFileAppears.Format(_L("WaitUntilFileAppears_%d"), index); } // now try for some clientStep specific stuff // this ini file entry specifies the property key value for the hold flag // If the hold flag property is true then monitor it until it becomes false // then continue TInt holdKey; if(GetIntFromConfig(ConfigSection(),_L("HoldClientStepKey"), holdKey)) { iHoldClientStepKey = holdKey; // as this property is present then set it to true using a direct call to p&s api because // the ups p&s api only handles policy evaluators and dialog creators and not test steps User::LeaveIfError(RProperty::Set(KPropertyCreatorUid, iHoldClientStepKey, 2)); } // Instantiates property reader and seter iPropertyReader= CUpsProperty::NewL(KPropertyCreatorUid); // reads client name and SID TParse clientFullName; RThread client; clientFullName.Set(client.FullName(),NULL, NULL); iTEFServerName=clientFullName.Name(); iExpectedClientSid = client.SecureId() ; client.Close(); SetTestStepResult(EPass); return TestStepResult(); }
TVerdict CTestIfioctls::doTestStepPreambleL() { __UHEAP_MARK; SetTestStepResult(EPass); return TestStepResult(); }
TVerdict CMultipleClientsStep::doTestStepL() /** * @return - TVerdict code * Override of base class pure virtual * Our implementation only gets called if the base class doTestStepPreambleL() did * not leave. That being the case, the current test result value will be EPass. */ { StandardPrepareL(); InitPsySettingsL(3, KExtGpsPsy1, 1, KIntGpsPsy1, 1, KNetworkPsy2, 1); TRequestStatus status; TPositionInfo posInfo; TPositionUpdateOptions options; TRequestStatus status2; TPositionInfo posInfo2; TPositionUpdateOptions options2; RPositioner positioner2; User::LeaveIfError(positioner2.Open(iServer)); CleanupClosePushL(positioner2); User::LeaveIfError(positioner2.SetRequestor( CRequestor::ERequestorService, CRequestor::EFormatApplication, KTdDefProxyTestName)); //1. Make location request from both PSYs. All should succeed from ExtGpsPsy1 positioner2.NotifyPositionUpdate(posInfo2,status2); PositionRequestWithCheck(posInfo, KErrNone, KExtGpsPsy1); User::WaitForRequest(status2); CheckExpectedResult(status2.Int(), KErrNone, KWrongRequestResult); CheckExpectedResult(posInfo2.ModuleId(), KExtGpsPsy1, KWrongModuleIdReturned); \ //2. When all PSYs returns error code, both PSYs shall //get error code from the first PSY ConfigPsyL(KExtGpsPsy1, 1, KConfigLRErrNoMemory //KErrNoMemory 1s ); ConfigPsyL(KIntGpsPsy1, 1, KConfigLRErrGeneral1s //KErrGeneral 1s ); ConfigPsyL(KNetworkPsy2, 1, KConfigLRErrNoMemory //KErrNoMemory 1s ); ConfigPsyL(positioner2, KExtGpsPsy1, 1, KConfigLRErrNoMemory //KErrNoMemory 1s ); ConfigPsyL(positioner2, KIntGpsPsy1, 1, KConfigLRErrGeneral1s //KErrGeneral 1s ); ConfigPsyL(positioner2, KNetworkPsy2, 1, KConfigLRErrNoMemory //KErrNoMemory 1s ); InitPsyListInDefaultProxyL(); iPositioner.NotifyPositionUpdate(posInfo, status); positioner2.NotifyPositionUpdate(posInfo2, status2); User::WaitForRequest(status); CheckExpectedResult(status.Int(), KErrNoMemory, KWrongRequestResult); User::WaitForRequest(status2); CheckExpectedResult(status2.Int(), KErrNoMemory, KWrongRequestResult); //3. When PSY1 returns error code to to client 1. Location request //from PSY2 shall fallback imediately ConfigPsyL(KExtGpsPsy1, 1, KConfigLRErrNoMemory //KErrNoMemory 1s ); ConfigPsyL(KIntGpsPsy1, 1, KConfigLRErrGeneral1s //KErrGeneral 1s ); ConfigPsyL(KNetworkPsy2, 1, KConfigLRNoError1s //No error 1s ); ConfigPsyL(positioner2, KExtGpsPsy1, 1, KConfigLRNoError10s //No error in 10s ); ConfigPsyL(positioner2, KIntGpsPsy1, 1, KConfigLRNoError10s //KErrGeneral 1s ); ConfigPsyL(positioner2, KNetworkPsy2, 1, KConfigLRNoError1s //KErrNoMemory 1s ); InitPsyListInDefaultProxyL(); User::After(KSecond * 7); //Delay after configuration SET_TIME PositionRequestWithCheck(posInfo, KErrNone, KNetworkPsy2); INFO_PRINTF1(_L("1 3")); CHECK_TIME(3) //LR from second PSY positioner2.NotifyPositionUpdate(posInfo2, status2); User::WaitForRequest(status2); INFO_PRINTF1(_L("2 1")); CHECK_TIME(1) //PSY1 and PSY2 fallback imediately, LR completed from PSY3 in 1s CheckExpectedResult(status2.Int(), KErrNone, KWrongRequestResult); CheckExpectedResult(posInfo2.ModuleId(), KNetworkPsy2, KWrongModuleIdReturned); //4. PSY state change beause of LR for client1 shall affect LR for client2 as well // ConfigPsyL(KExtGpsPsy1, 1, KConfigLRErrNoMemory //KErrNoMemory 1s ); ConfigPsyL(positioner2, KExtGpsPsy1, 1, KConfigLRNoError10s //No error in 10s ); InitPsyListInDefaultProxyL(); User::After(KSecond * 7); //Delay after configuration SET_TIME positioner2.NotifyPositionUpdate(posInfo2, status2); PositionRequestWithCheck(posInfo, KErrNone, KIntGpsPsy1); INFO_PRINTF1(_L("3 1")); CHECK_TIME(1); User::WaitForRequest(status2); CheckExpectedResult(status2.Int(), KErrNone, KWrongRequestResult); CheckExpectedResult(posInfo2.ModuleId(), KIntGpsPsy1, KWrongModuleIdReturned); INFO_PRINTF1(_L("4 0")); CHECK_TIME(0); //5. Dynamic list change caused by PSY1 shall not affect PSY list orders of client2 //if location request is already made. ConfigPsyL(KExtGpsPsy1, 1, KConfigLRErrNoMemory //KErrNoMemory 1s ); ConfigPsyL(KIntGpsPsy1, 2, KConfigLRNoError1s, //No error in 10s KConfigLRErrNoMemory //KErrNoMemory 1s ); ConfigPsyL(positioner2, KIntGpsPsy1, 2, KConfigLRNoError1s, //No error in 10s KConfigLRNoError20s //No error in 10s ); ConfigPsyL(positioner2, KExtGpsPsy1, 1, KConfigLRNoError45s //No error in 45s ); InitPsyListInDefaultProxyL(); User::After(KSecond * 7); //Delay after configuration PositionRequestWithCheck(posInfo, KErrNone, KIntGpsPsy1); //Location request from client 2 shall be completed imediatelly, since //IntGpsPsy shall be the first on the dynamic list SET_TIME positioner2.NotifyPositionUpdate(posInfo2, status2); User::WaitForRequest(status2); CheckExpectedResult(status2.Int(), KErrNone, KWrongRequestResult); CheckExpectedResult(posInfo2.ModuleId(), KIntGpsPsy1, KWrongModuleIdReturned); INFO_PRINTF1(_L("5 1")); CHECK_TIME(1); //Make location request from client 2 positioner2.NotifyPositionUpdate(posInfo2, status2); SET_TIME PositionRequestWithCheck(posInfo, KErrNone, KExtGpsPsy1); INFO_PRINTF1(_L("6 1")); CHECK_TIME(1) User::WaitForRequest(status2); CheckExpectedResult(status2.Int(), KErrNone, KWrongRequestResult); CheckExpectedResult(posInfo2.ModuleId(), KNetworkPsy2, KWrongModuleIdReturned); INFO_PRINTF1(_L("7 0")); CHECK_TIME(0) CleanupStack::PopAndDestroy(&positioner2); //Cleanup StandardCleanup(); return TestStepResult(); }
TVerdict CTPKCS7ValidTest::doTestStepL() { if (TestStepResult() != EPass) { return TestStepResult(); } __UHEAP_MARK; TBool expectedValid; if (GetBoolFromConfig(ConfigSection(),_L("IsValid"), expectedValid) == EFalse) { expectedValid = ETrue; } TInt err; CPKCS7ContentInfo * contentInfo = NULL; TRAP (err, contentInfo = CPKCS7ContentInfo::NewL(iRawData->Des())); if(err == KErrNone) { CPKCS7SignedObject * p7 = NULL; if( contentInfo->ContentType() == KPkcs7SignedData) { TRAP (err, p7 = CPKCS7SignedObject::NewL(*contentInfo)); //expired, and the case where certificate chain root is not on the device if (!expectedValid) { if (err != KErrNone) { SetTestStepResult(EPass); INFO_PRINTF2(_L("Got %d building PKCS7 object"), err); return TestStepResult(); } } if (err != KErrNone) { SetTestStepResult(EFail); INFO_PRINTF2(_L("Got %d building PKCS7 object"), err); } else { CleanupStack::PushL (p7); const RPointerArray<CPKCS7SignerInfo>& signers = p7->SignerInfo(); TBool isValid = EFalse; HBufC8* certificateEncoding = NULL; if(!p7->ValidateSignerL(*signers[0], certificateEncoding)) { INFO_PRINTF1(_L("Couldn't validate signer")); } else { CActiveScheduler* sched = NULL; if (CActiveScheduler::Current() == NULL) { INFO_PRINTF1(_L("Installing scheduler")); sched = new (ELeave) CActiveScheduler(); CleanupStack::PushL (sched); __UHEAP_MARK; CActiveScheduler::Install (sched); } RPointerArray<CX509Certificate> roots (&iRootCertificate, 1); CPKIXCertChain * chain = CPKIXCertChain::NewLC(iFs, *certificateEncoding, roots); TTime tm; _LIT(KDateCorrect1,"20040801:"); TBuf <24> theDate(KDateCorrect1); TInt err=tm.Set(theDate); if(err) { tm.HomeTime(); } CPKIXValidationResult* result = CPKIXValidationResult::NewLC(); CTPKCS7Validator* validator = new (ELeave) CTPKCS7Validator (chain, result, &tm); CleanupStack::PushL (validator); validator->doValidate (); sched->Start (); if (result->Error().iReason == EValidatedOK) { isValid = ETrue; INFO_PRINTF1(_L("Validation success")); } else { INFO_PRINTF2(_L("Validation failed: %d"), result->Error().iReason); } CleanupStack::PopAndDestroy(validator); CleanupStack::PopAndDestroy(result); CleanupStack::PopAndDestroy(chain); if (sched) { CActiveScheduler::Install (NULL); CleanupStack::PopAndDestroy (sched); } } if (certificateEncoding) { CleanupStack::PopAndDestroy(certificateEncoding); } CleanupStack::PopAndDestroy (p7); if (isValid != expectedValid) { SetTestStepResult(EFail); if (expectedValid) { INFO_PRINTF1(_L("Expected valid, got invalid")); } else { INFO_PRINTF1(_L("Expected invalid, got valid")); } } } } } else { SetTestStepResult(EFail); } __UHEAP_MARKEND; return TestStepResult(); }
/** Perform CMoLrStep1 test step. This test verifies that the SUPL Protocol Module correctly handles an MO-LR Self Locate Terminal Based sequence (assistance data delivered via an RRLP payload). @return TVerdict test result code */ TVerdict Cmolr1Step::doTestStepL() { INFO_PRINTF1(_L("\t********************************************************************")); INFO_PRINTF1(_L("\tMOLR basic procedure followed - Assistance Data in RRLP message")); INFO_PRINTF1(_L("\t********************************************************************")); INFO_PRINTF1(_L("- START -")); // Initiate MO-LR TLbsNetSessionId sessionId1(TUid::Uid(0x87654321), 0x1111); TLbsNetPosRequestOptionsAssistance options1; options1.SetNewClientConnected(ETrue); TLbsNetPosRequestQuality quality1; options1.SetRequestQuality(quality1); TLbsAsistanceDataGroup dataRequestMask1 = EAssistanceDataBadSatList; options1.SetDataRequestMask(dataRequestMask1); INFO_PRINTF1(_L("\tLBS -> RequestSelfLocation")); iModule->RequestSelfLocation(sessionId1, options1); // Check Connection Manager receives a request for connecting if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::EConnectReq)) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t ConnectionRequest -> NET")); // Simulate the connection is up (inject that event) INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t Connected <- NET")); iNetworkObserver->InjectConnectedIndication(iNetworkObserver->SessionId()); // Check Connection Manager receives a request to send a SUPL START if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::ESuplStartSendReq)) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL START -> NET")); // Inject a SUPL RESPONSE INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL RESPONSE <- NET")); CSuplMessageBase* resp = BuildSuplResponseL(TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted); iNetworkObserver->InjectSuplMessage(iNetworkObserver->SessionId(), resp); // Check gateway receives Location Request INFO_PRINTF1(_L("\tLBS <- ProcessLocationRequest()")); if (EFail == CheckGatewayCallbackL( CSuplGatewayObserver::EProcessLocationRequest) || MLbsNetworkProtocolObserver::EServiceSelfLocation != iGatewayObserver->LocType()) { SetTestStepResult(EFail); return TestStepResult(); } // LBS Requests assistance data INFO_PRINTF1(_L("\tLBS -> RequestAssistanceData ()")); TLbsNetSessionIdArray dummyIdArray; iModule->RequestAssistanceData(dataRequestMask1, dummyIdArray); // Check Connection Manager receives a request to send a SUPL POS INIT // with the assistance data mask requested by the gateway if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::ESendSuplPosInitSendReq)) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL POS INIT -> NET")); // Inject a SUPL POS with some of the Assistance data requested INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL POS - RRLP Assitance Data <- NET")); CSuplMessageBase* suplPos = BuildSuplPosAssitDataL(EAssistanceDataAquisitionAssistance|EAssistanceDataBadSatList, EFalse); iNetworkObserver->InjectSuplMessage(iNetworkObserver->SessionId(), suplPos); // Check gateway receives the assistance data types requested. INFO_PRINTF1(_L("\tLBS <- ProcessAssistanceData()")); if (EFail == CheckGatewayCallbackL( CSuplGatewayObserver::EProcessAssistanceData) || (dataRequestMask1 & iGatewayObserver->AssistanceDataSetMask() != dataRequestMask1)) { SetTestStepResult(EFail); return TestStepResult(); } // Check the Connection Manager receives a request to send a SUPL POS (ack to assistance data) if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::ESendSuplPosSendReq)) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL POS - RRLP Assistance Data Ack -> NET")); // Inject a SUPL END (without position) INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL END <- NET")); CSuplMessageBase* suplEnd = BuildSuplEndL(EFalse); iNetworkObserver->InjectSuplMessage(iNetworkObserver->SessionId(), suplEnd); // Check gateway session completed if (EFail == CheckGatewayCallbackL( CSuplGatewayObserver::EProcessSessionComplete)) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\tLBS <- ProcessSessionComplete")); // Check Connection Manager receives a disconnection request if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::EDisconnectReq)) { SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t DisconnectRequest -> 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(); }
TVerdict CTestLtsySmsReceive::doTestStepPreambleL() { INFO_PRINTF1(_L("CTestLtsySmsReceive::doTestStepPreambleL called")); SetTestStepResult(EPass); return TestStepResult(); }
/** Function : doTestStepL Description : Sets the priority of an email message via the IMAP \Flagged flag @return : TVerdict - Test step result */ TVerdict CT_MsgSetImap4EmailPriority::doTestStepL() { INFO_PRINTF1( _L("Test Step : SetSmtpEmailPriority") ); if (ReadIni()) { TMsvId parentFolderId; // Local parent folder location... if(iLocation.Compare(_L("LOCAL"))==0) { // Retrieves the folder Id based on the local folder name read from the ini file parentFolderId = CT_MsgUtilsEnumConverter::FindFolderIdByName(iParentFolderName); if(parentFolderId == KErrNotFound) { ERR_PRINTF1(_L("Invalid local parent folder name specified")); SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF2(_L("The local parent folder Id is %d"),parentFolderId); } // Remote parent folder location... else if(iLocation.Compare(_L("REMOTE"))==0) { TRAPD(err,parentFolderId = CT_MsgUtils::GetRemoteFolderIdByNameL(iSharedDataIMAP.iSession, iImapAccountName, iParentFolderName)); if(err == KErrNotFound) { ERR_PRINTF1(_L("Invalid remote parent folder name specified")); SetTestStepResult(EFail); return TestStepResult(); } INFO_PRINTF2(_L(" The remote parent folder Id is %d"),parentFolderId); } // Location Local or Remote not specified... else { ERR_PRINTF1(_L("Invalid parent folder location")); SetTestStepResult(EFail); return TestStepResult(); } // Retrieves the message Id based on the message subject of the email under the given parent folder TMsvId messageId; TRAPD(err,messageId = CT_MsgUtils::SearchMessageBySubjectL(iSharedDataIMAP.iSession, parentFolderId, iEmailSubject)); if(err == KErrNotFound) { ERR_PRINTF1(_L("The given message is not found")); SetTestStepResult(EFail); } // Message found else { INFO_PRINTF2(_L("The Message Id is %d"),messageId); // Retrieve the default Smtp service Id TMsvId smtpServiceId(0); TRAPD(err, smtpServiceId = CT_MsgUtilsCentralRepository::GetDefaultSmtpServiceIdL()); if(err != KErrNone) { ERR_PRINTF2(_L("Failure while getting the default SMTP Service Id. Error = %d"),err); SetTestStepResult(EFail); } else { INFO_PRINTF2(_L("The Default Smtp Service Id is %d"),smtpServiceId); CT_MsgActive& active = Active(); delete iOperation; iOperation=NULL; // Setting the current context to the parent of the mesage CMsvEntry* entry = CMsvEntry::NewL(*iSharedDataIMAP.iSession, messageId, TMsvSelectionOrdering()); CleanupStack::PushL(entry); TMsvEmailEntry emailEntry(entry->Entry()); if(iEmailPriority==1) { emailEntry.SetFlaggedIMAP4Flag(ETrue); iOperation = entry->ChangeL(emailEntry,active.iStatus); active.Activate(); CActiveScheduler::Start(); User::LeaveIfError(active.Result()); INFO_PRINTF1(_L("The state of the Flagged IMAP4 flag of the email is set for urgent/special attention")); } else if (iEmailPriority==0) { emailEntry.SetFlaggedIMAP4Flag(EFalse); iOperation = entry->ChangeL(emailEntry,active.iStatus); active.Activate(); CActiveScheduler::Start(); User::LeaveIfError(active.Result()); INFO_PRINTF1(_L("The state of the Flagged IMAP4 flag of the email is NOT set for urgent/special attention")); } else { ERR_PRINTF1(_L("Error in setting the Flagged IMAP4 flag! Usage: 1=ETrue and 0=EFalse")); SetTestStepResult(EFail); } CleanupStack::PopAndDestroy(entry); } } } return TestStepResult(); }
TVerdict CEntryStatusStep::doTestStepPreambleL() { InitializeL(); SetTestStepResult(EPass); _LIT(KRequestChangeNotify, "requestchangenotify"); _LIT(KCertEntryState, "state"); _LIT(KNewEntryString, "ENewEntry"); _LIT(KEntryAwaitingApprovalString, "EEntryAwaitingApproval"); _LIT(KEntryDeniedString, "EEntryDenied"); _LIT(KEntryApprovedString, "EEntryApproved"); _LIT(KCancelPoint, "cancelpoint"); _LIT(KOpen, "Open"); _LIT(KGetState, "GetStateL"); _LIT(KChangeNotify, "ChangeNotify"); TPtrC cancelPoint; _LIT(KCancelMessageFmt, "This test step will call Cancel() on the cert cache session after %S()"); if (!GetStringFromConfig(ConfigSection(), KCancelPoint, cancelPoint)) { iCancelPoint = ENoCancel; } else if (cancelPoint.CompareF(KOpen) == 0) { iCancelPoint = EAfterOpen; Logger().WriteFormat(KCancelMessageFmt, &KOpen); } else if (cancelPoint.CompareF(KGetState) == 0) { iCancelPoint = EAfterGetState; Logger().WriteFormat(KCancelMessageFmt, &KGetState); } else if (cancelPoint.CompareF(KChangeNotify) == 0) { iCancelPoint = EAfterChangeNotify; Logger().WriteFormat(KCancelMessageFmt, &KChangeNotify); } // Check if this step should wait for change notification. if (!GetBoolFromConfig(ConfigSection(), KRequestChangeNotify, iRequestChangeNotify)) { iRequestChangeNotify = EFalse; } else if (iRequestChangeNotify) { if (iCancelPoint == ENoCancel) { _LIT(KMessage, "This test step will wait for change notification."); Logger().Write(KMessage); } else if (iCancelPoint != EAfterChangeNotify) { _LIT(KErrorMessage, "Invalid test config, requesting notification but cancelling earlier."); Logger().Write(KErrorMessage); SetTestStepResult(EAbort); return EAbort; } _LIT(KRequirePendingApproval, "requirependingapproval"); if (!GetBoolFromConfig(ConfigSection(), KRequirePendingApproval, iRequirePendingApproval)) { iRequirePendingApproval = ETrue; } if (iRequirePendingApproval) { _LIT(KMessage2, "This step will fail if the state is not initially EEntryAwaitingApproval."); Logger().Write(KMessage2); } else { _LIT(KMessage2, "Notification will be requested even if the state is not initially EEntryAwaitingApproval."); Logger().Write(KMessage2); } } TPtrC expectedState; if (!GetStringFromConfig(ConfigSection(), KCertEntryState, expectedState)) { _LIT(KMessage, "Could not read expected certificate approval state from INI, abort."); Logger().Write(KMessage); SetTestStepResult(EAbort); } else { _LIT(KMessageFmt, "Certificate state is expected to be %S."); if (expectedState.CompareF(KNewEntryString) == 0) { iExpectedState = ENewEntry; Logger().WriteFormat(KMessageFmt, &KNewEntryString); } else if (expectedState.CompareF(KEntryAwaitingApprovalString) == 0) { iExpectedState = EEntryAwaitingApproval; Logger().WriteFormat(KMessageFmt, &KEntryAwaitingApprovalString); } else if (expectedState.CompareF(KEntryApprovedString) == 0) { iExpectedState = EEntryApproved; Logger().WriteFormat(KMessageFmt, &KEntryApprovedString); } else if (expectedState.CompareF(KEntryDeniedString) == 0) { iExpectedState = EEntryDenied; Logger().WriteFormat(KMessageFmt, &KEntryDeniedString); } else { _LIT(KMessage, "Invalid expected certificate state, abort."); Logger().Write(KMessage); SetTestStepResult(EAbort); } } return TestStepResult(); }
TVerdict CEntryStatusStep::doTestStepL() { // don't continue if previous phases have aborted if (TestStepResult() != EPass) { return TestStepResult(); } // Delay briefly to ensure that any update entry steps in concurrent tests can // check first (which sets the state to EAwaitingApproval.) User::After(KStateCheckDelay); _LIT(KCancelMessage, "Cancelling..."); // Cancel if set to do so before checking state. if (iCancelPoint == EAfterOpen) { Logger().Write(KCancelMessage); Session().Cancel(); } iState = Session().GetStateL(); // log the action _LIT(KMessageFmt, "State of cache entry for certificate '%S' is %d."); Logger().WriteFormat(KMessageFmt, SubjectLC(), iState); CleanupStack::PopAndDestroy(1); // subject if (iCancelPoint == EAfterGetState) { Logger().Write(KCancelMessage); Session().Cancel(); iState = Session().GetStateL(); Logger().WriteFormat(KMessageFmt, SubjectLC(), iState); CleanupStack::PopAndDestroy(1); // subject } else if (iRequestChangeNotify) { if (iState == EEntryAwaitingApproval || !iRequirePendingApproval) { TRequestStatus status; Session().RequestNotify(status); if (iCancelPoint == EAfterChangeNotify) { Logger().Write(KCancelMessage); Session().Cancel(); } User::WaitForRequest(status); User::LeaveIfError(status.Int()); iState = Session().GetStateL(); // log the action _LIT(KMessageFormat, "Got cache change notify for certificate '%S', state = %d."); Logger().WriteFormat(KMessageFormat, SubjectLC(), iState); CleanupStack::PopAndDestroy(1); // certificate status } else { // log the action _LIT(KMessageFormat, "Cannot wait for change notify, entry state is not %d (EEntryAwaitingApproval.)"); Logger().WriteFormat(KMessageFormat, EEntryAwaitingApproval); SetTestStepResult(EFail) ; } } return TestStepResult(); }
TVerdict CTestCalIndexFileModifyEntryStep::doTestStepPostambleL() { return TestStepResult(); }
// Step 3 Content TVerdict CTPKCS7ContentTest::doTestStepL() { if (TestStepResult() != EPass) { return TestStepResult(); } TBool checkType; TBool checkLength; TBool checkContent; TInt expectedType; TInt expectedLength; TPtrC expectedString; HBufC8 * expectedContent = NULL; checkType = GetIntFromConfig (ConfigSection(),_L("ContentType"), expectedType); checkLength = GetIntFromConfig (ConfigSection(),_L("ContentLength"), expectedLength); checkContent = GetStringFromConfig(ConfigSection(),_L("ContentString"), expectedString); if (checkContent) { if (expectedString.Length() & 1) { SetTestStepResult(ETestSuiteError); INFO_PRINTF1(_L("ContentString is not a multiple of 2 long")); checkContent = EFalse; } else { // workaround to parse the expectedstring expectedContent = HBufC8::NewLC (expectedString.Length()/2); TPtr8 des = expectedContent->Des (); for (TInt i = 0; i < expectedString.Length()/2; i++) { TInt top = expectedString[2*i]; TInt low = expectedString[2*i+1]; if (top >= 0x61) top -= (0x61-10); else top -= 0x30; if (low >= 0x61) low -= (0x61-10); else low -= 0x30; des.Append (top*16+low); } } } TInt err; CPKCS7ContentInfo * contentInfo = NULL; TRAP (err, contentInfo = CPKCS7ContentInfo::NewL(iRawData->Des())); if(err == KErrNone) { CPKCS7SignedObject * p7 = NULL; if( contentInfo->ContentType() == 2) { TRAPD (err, p7 = CPKCS7SignedObject::NewL(*contentInfo)); if (err != KErrNone) { SetTestStepResult(EFail); INFO_PRINTF2(_L("Got %d building PKCS7 object"), err); } else { CleanupStack::PushL (p7); const CPKCS7ContentInfo& p7info = p7->ContentInfo (); if (checkType) { if (p7info.ContentType() != expectedType) { SetTestStepResult(EFail); INFO_PRINTF3(_L("Expected ContentType %d, got %d"), expectedType, p7info.ContentType()); } } const TDesC8& content = p7info.ContentData(); if (checkLength) { if (content.Length() != expectedLength) { SetTestStepResult(EFail); INFO_PRINTF3(_L("Expected ContentLength %d, got %d"), expectedLength, content.Length()); } } if (checkContent) { if (content.Length() != expectedContent->Length()) { SetTestStepResult(EFail); INFO_PRINTF3(_L("Expected ContentString length %d does not correspond to PKCS7 data length %d"), expectedContent->Length(), content.Length()); } else { if (expectedContent->Compare(content) != 0) { SetTestStepResult(EFail); INFO_PRINTF1(_L("Expected ContentString does not match PKCS7 content")); } } } CleanupStack::PopAndDestroy (p7); } } } else { SetTestStepResult(EFail); } if (expectedContent) { CleanupStack::PopAndDestroy (expectedContent); } if (!checkType && !checkLength && !checkContent && (TestStepResult()==EPass)) { SetTestStepResult(EInconclusive); INFO_PRINTF1(_L("No test performed in this step")); } return TestStepResult(); }
TVerdict CUpsClientStep::doTestStepPostambleL() { return TestStepResult(); }
//Encrypted Data TVerdict CTPKCS7EncryptedDataTest::doTestStepL() { if (TestStepResult() != EPass) { return TestStepResult(); } TInt reason; // Read from INI file. GetIntFromConfig(ConfigSection(),_L("Reason"),reason); //Is Valid TBool expectedValid; TBool checkValid; checkValid = GetBoolFromConfig(ConfigSection(),_L("IsValid"), expectedValid); __UHEAP_MARK; CPKCS7ContentInfo *contentInfo = NULL; TRAPD (err, contentInfo = CPKCS7ContentInfo::NewL(iRawData->Des())); CleanupStack::PushL(contentInfo); if(err == KErrNone) { CPKCS7EncryptedDataObject* p7 = NULL; TInt type = contentInfo->ContentType(); if( contentInfo->ContentType() == CPKCS7ContentInfo::EContentTypeEncryptedData) { TRAPD (err, p7 = CPKCS7EncryptedDataObject::NewL(*contentInfo)); CleanupStack::PushL(p7); __UHEAP_MARK; if (checkValid) { if(!expectedValid && err == reason) { CleanupStack::PopAndDestroy(2,contentInfo);//p7, contentInfo return TestStepResult(); } if(!expectedValid && contentInfo->ContentType() == 1) { CleanupStack::PopAndDestroy(2,contentInfo);//p7, contentInfo return TestStepResult(); } } if (err != KErrNone) { SetTestStepResult(EFail); ERR_PRINTF2(_L("Got %d building PKCS7 object"), err); } //CONTENT TYPE CPKCS7EncryptedDataObject::TContentType contentType = p7->ContentType(); if(contentType != CPKCS7EncryptedDataObject::EPkcs7Data) { SetTestStepResult(EFail); ERR_PRINTF1(_L("ContentType does not match")); CleanupStack::PopAndDestroy(3,contentInfo);//expectedContentType, p7, contentInfo return TestStepResult(); } else { INFO_PRINTF1(_L("ContentType matches")); } //ENCRYPTEDCONTENT DATA const TDesC8& contentData = p7->EncryptedContentInfoData(); if(contentData.Compare(*iContentData) != 0) { SetTestStepResult(EFail); ERR_PRINTF1(_L("EncryptedContentData does not match")); CleanupStack::PopAndDestroy(2,contentInfo); //p7, contentInfo return TestStepResult(); } else { INFO_PRINTF1(_L("EncryptedContentData matches")); } //SALT const CPBEncryptParms& encryptParams = p7->EncryptParams(); if((encryptParams.Salt()).Compare(*iSaltValue) != 0) { SetTestStepResult(EFail); ERR_PRINTF1(_L("Salt Value does not match")); CleanupStack::PopAndDestroy(2, contentInfo);//p7,contentInfo return TestStepResult(); } else { INFO_PRINTF1(_L("Salt Value matches")); } //ITERATION COUNT TBool checkIteration; TInt expectedIterationCount; checkIteration = GetIntFromConfig(ConfigSection(),_L("Iteration"), expectedIterationCount); if(checkIteration) { if(encryptParams.Iterations() != expectedIterationCount) { SetTestStepResult(EFail); ERR_PRINTF1(_L("Iterations does not match")); CleanupStack::PopAndDestroy(2, contentInfo);//p7, contentInfo return TestStepResult(); } else { INFO_PRINTF1(_L("Iteration matches")); } } //CIPHER TBool checkCipher; TPtrC expectedCipher; TPBECipher cipherValue = (TPBECipher) -1;//assign to impossible value checkCipher = GetStringFromConfig(ConfigSection(),_L("Algorithm"), expectedCipher); if(checkCipher) { if(expectedCipher.Compare(_L("pbeWithSHA1And40BitRC2_CBC")) == 0) { cipherValue = ECipherRC2_CBC_40_5; } else if(expectedCipher.Compare(_L("pbeWithSHA1And128BitRC4")) == 0) { cipherValue = ECipherARC4_128; } else if(expectedCipher.Compare(_L("pbeWithSHA1AndDES-CBC")) == 0) { cipherValue = ECipherDES_CBC; } else if(expectedCipher.Compare(_L("pbeWithSHAAnd3_KeyTripleDES_CBC")) == 0) { cipherValue = ECipher3DES_CBC; } else if(expectedCipher.Compare(_L("pbeWithSHAAnd2-KeyTripleDES-CBC"))==0) { cipherValue = ECipher2Key3DES_CBC; } else if(expectedCipher.Compare(_L("pbeWithSHA1And40BitRC4")) == 0) { cipherValue = ECipherARC4_40; } else if(expectedCipher.Compare(_L("pbewithSHAAnd128BitRC2CBC")) == 0) { cipherValue = ECipherRC2_CBC_128_16; } else if(expectedCipher.Compare(_L("pbeWithSHA1AndRC2_CBC")) == 0) { cipherValue = ECipherRC2_CBC_40; } if(encryptParams.Cipher() != cipherValue) { SetTestStepResult(EFail); ERR_PRINTF1(_L("Cipher does not match")); CleanupStack::PopAndDestroy(3, contentInfo);//expectedCipher,p7,contentInfo return TestStepResult(); } else { INFO_PRINTF1(_L("Cipher matches")); } } if(contentData.Length() != 0) { //Decryption TBool checkPassword; TPtrC password; checkPassword = GetStringFromConfig(ConfigSection(),_L("Password"), password); if(checkPassword) { HBufC8* plainText = p7->DecryptDataL(password); delete plainText; SetTestStepResult(EPass); } } CleanupStack::PopAndDestroy(p7); } //If ContentType is not Encrypted Data else { if(checkValid) { if(!expectedValid && err == reason) { CleanupStack::PopAndDestroy(contentInfo); return TestStepResult(); } else { SetTestStepResult(EFail); } } } } else if(err != reason) { SetTestStepResult(EFail); } CleanupStack::PopAndDestroy(contentInfo); __UHEAP_MARKEND; return TestStepResult(); }
TVerdict CTestLtsyPhoneStoreBase::doTestStepPostambleL() { return TestStepResult(); }
//Digest Info TVerdict CTPKCS7DigestInfoTest::doTestStepL() { if (TestStepResult() != EPass) { return TestStepResult(); } __UHEAP_MARK; TInt reason; // Read from INI file. GetIntFromConfig(ConfigSection(),_L("Reason"),reason); CPKCS7DigestInfo* p7 = NULL; TRAPD (err, p7 = CPKCS7DigestInfo::NewL(iRawData->Des())); CleanupStack::PushL(p7); if (err != KErrNone) { if(err == reason) { CleanupStack::PopAndDestroy(p7); SetTestStepResult(EPass); return TestStepResult(); } else { SetTestStepResult(EFail); ERR_PRINTF2(_L("Got %d building PKCS7 object"), err); } } //DIGEST const TDesC8& digest = p7->Digest(); if(digest.Compare(*iDigest) != 0) { SetTestStepResult(EFail); ERR_PRINTF1(_L("Digest does not match")); } else { INFO_PRINTF1(_L("Digest matches")); } //ALGORITHM ID TBool checkAlgorithm; TPtrC expectedAlgorithm; TAlgorithmId algorithmId = (TAlgorithmId) -1; checkAlgorithm = GetStringFromConfig(ConfigSection(),_L("AlgorithmId"), expectedAlgorithm); if(checkAlgorithm) { if(expectedAlgorithm.Compare(_L("SHA1")) == 0) { algorithmId = ESHA1; } else if(expectedAlgorithm.Compare(_L("MD5")) == 0) { algorithmId = EMD5; } if(algorithmId != p7->Algorithm()) { SetTestStepResult(EFail); ERR_PRINTF1(_L("Algorithm Id does not match")); } else { INFO_PRINTF1(_L("Algorithm Id matches")); } } //ENCODED PARAMS const TDesC8& encodedParams= p7->EncodedParams(); if(encodedParams.Length() != 0) { if(encodedParams.Compare(*iEncodedParams)) { SetTestStepResult(EFail); ERR_PRINTF1(_L("EncodedParams does not match")); } else { INFO_PRINTF1(_L("EncodedParams match")); } } else if(!iEncodedParams) { INFO_PRINTF1(_L("EncodedParams not present")); } CleanupStack::PopAndDestroy(p7); __UHEAP_MARKEND; return TestStepResult(); }
TVerdict CTestIfioctls::doTestStepPostambleL() { __UHEAP_MARKEND; return TestStepResult(); }
enum TVerdict CTestPhoneInfo::doTestStepL() { INFO_PRINTF1(_L("Test Phone Info")); RTelServer server; TInt ret = server.Connect(); TESTCHECK(ret, KErrNone); TInt originalNumPhones; ret = server.EnumeratePhones(originalNumPhones); TESTCHECK(ret, KErrNone); ret=server.LoadPhoneModule(DSTD_MODULE_NAME); TESTCHECK(ret, KErrNone); ret=server.LoadPhoneModule(DSTDNC_MODULE_NAME); TESTCHECK(ret, KErrNone); TInt numPhones; ret=server.EnumeratePhones(numPhones); TESTCHECK(ret, KErrNone); INFO_PRINTF2(_L("EnumeratePhones returned %d"),numPhones); INFO_PRINTF4(_L("Should equal %d + %d + %d"), DSTDNC_NUMBER_OF_PHONES, DSTD_NUMBER_OF_PHONES, originalNumPhones); TESTCHECK(numPhones, (DSTDNC_NUMBER_OF_PHONES + DSTD_NUMBER_OF_PHONES + originalNumPhones)); RTelServer::TPhoneInfo info; TName tsyName; TInt phoneIndex = originalNumPhones; // first phone ret=server.GetPhoneInfo(phoneIndex,info); TESTCHECK(ret, KErrNone); TESTCHECK(info.iNetworkType, DSTD_NETWORK_TYPE); TESTCHECKSTR(info.iName, DSTD_PHONE_NAME); TESTCHECK(info.iNumberOfLines, DSTD_NUMBER_OF_LINES); ret=server.GetTsyName(phoneIndex,tsyName); TESTCHECK(ret, KErrNone); TESTCHECKSTR(tsyName, DSTD_MODULE_NAME); phoneIndex++; // second phone ret=server.GetPhoneInfo(phoneIndex,info); TESTCHECK(ret, KErrNone); TESTCHECK(info.iNetworkType, DSTDFC_NETWORK_TYPE); TESTCHECKSTR(info.iName, DSTDFC_PHONE_NAME); TESTCHECK(info.iNumberOfLines, DSTDFC_NUMBER_OF_LINES); ret=server.GetTsyName(phoneIndex,tsyName); TESTCHECK(ret, KErrNone); TESTCHECKSTR(tsyName, DSTD_MODULE_NAME); phoneIndex++; // third phone ret=server.GetPhoneInfo(phoneIndex,info); TESTCHECK(ret, KErrNone); TESTCHECK(info.iNetworkType, DSTDPM_NETWORK_TYPE); TESTCHECKSTR(info.iName, DSTDPM_PHONE_NAME); TESTCHECK(info.iNumberOfLines, DSTDPM_NUMBER_OF_LINES); ret=server.GetTsyName(phoneIndex,tsyName); TESTCHECK(ret, KErrNone); TESTCHECKSTR(tsyName, DSTD_MODULE_NAME); phoneIndex++; // fourth phone ret=server.GetPhoneInfo(phoneIndex,info); TESTCHECK(ret, KErrNone); TESTCHECK(info.iNetworkType, DSTDPM_NETWORK_TYPE); TESTCHECKSTR(info.iName, DSTD_SLOW_PHONE_NAME); TESTCHECK(info.iNumberOfLines, DSTDPM_NUMBER_OF_LINES); ret=server.GetTsyName(phoneIndex,tsyName); TESTCHECK(ret, KErrNone); TESTCHECKSTR(tsyName, DSTD_MODULE_NAME); phoneIndex++; // fifth phone ret=server.GetPhoneInfo(phoneIndex,info); TESTCHECK(ret, KErrNone); TESTCHECK(info.iNetworkType, DSTDNC_NETWORK_TYPE); TESTCHECKSTR(info.iName, DSTDNC_PHONE_NAME); TESTCHECK(info.iNumberOfLines, DSTDNC_NUMBER_OF_LINES); ret=server.GetTsyName(phoneIndex,tsyName); TESTCHECK(ret, KErrNone); TESTCHECKSTR(tsyName, DSTDNC_MODULE_NAME); phoneIndex++; // sixth phone ret=server.GetPhoneInfo(phoneIndex,info); TESTCHECK(ret, KErrNotFound); ret=server.GetTsyName(phoneIndex,tsyName); TESTCHECK(ret, KErrNotFound); phoneIndex++; ret=server.UnloadPhoneModule(DSTD_MODULE_NAME); TESTCHECK(ret, KErrNone); ret=server.UnloadPhoneModule(DSTDNC_MODULE_NAME); TESTCHECK(ret, KErrNone); ServerClose(server); ret = server.Connect(); TESTCHECK(ret, KErrNone); ret=server.LoadPhoneModule(DSTDNC_MODULE_NAME); TESTCHECK(ret, KErrNone); ret=server.LoadPhoneModule(DSTD_MODULE_NAME); TESTCHECK(ret, KErrNone); ret=server.EnumeratePhones(numPhones); TESTCHECK(ret, KErrNone); TESTCHECK(numPhones, (DSTD_NUMBER_OF_PHONES + DSTDNC_NUMBER_OF_PHONES + originalNumPhones)); phoneIndex = originalNumPhones; ret=server.GetPhoneInfo(phoneIndex,info); TESTCHECK(ret, KErrNone); TESTCHECK(info.iNetworkType, DSTDNC_NETWORK_TYPE); TESTCHECKSTR(info.iName, DSTDNC_PHONE_NAME); TESTCHECK(info.iNumberOfLines, DSTDNC_NUMBER_OF_LINES); phoneIndex++; ret=server.GetPhoneInfo(phoneIndex,info); TESTCHECK(ret, KErrNone); TESTCHECK(info.iNetworkType, DSTD_NETWORK_TYPE); TESTCHECKSTR(info.iName, DSTD_PHONE_NAME); TESTCHECK(info.iNumberOfLines, DSTD_NUMBER_OF_LINES); phoneIndex++; ret=server.GetPhoneInfo(phoneIndex,info); TESTCHECK(ret, KErrNone); TESTCHECK(info.iNetworkType, DSTDFC_NETWORK_TYPE); TESTCHECKSTR(info.iName, DSTDFC_PHONE_NAME); TESTCHECK(info.iNumberOfLines, DSTDFC_NUMBER_OF_LINES); phoneIndex++; ret=server.GetPhoneInfo(phoneIndex,info); TESTCHECK(ret, KErrNone); TESTCHECK(info.iNetworkType, DSTDPM_NETWORK_TYPE); TESTCHECKSTR(info.iName, DSTDPM_PHONE_NAME); TESTCHECK(info.iNumberOfLines, DSTDPM_NUMBER_OF_LINES); phoneIndex++; ret=server.GetPhoneInfo(phoneIndex,info); TESTCHECK(ret, KErrNone); TESTCHECK(info.iNetworkType, DSTDPM_NETWORK_TYPE); TESTCHECKSTR(info.iName, DSTD_SLOW_PHONE_NAME); TESTCHECK(info.iNumberOfLines, DSTDPM_NUMBER_OF_LINES); phoneIndex++; ret=server.GetPhoneInfo(phoneIndex,info); TESTCHECK(ret, KErrNotFound); phoneIndex++; ret=server.UnloadPhoneModule(DSTD_MODULE_NAME); TESTCHECK(ret, KErrNone); ret=server.UnloadPhoneModule(DSTDNC_MODULE_NAME); TESTCHECK(ret, KErrNone); ServerClose(server); return TestStepResult(); }
TVerdict CPsyVisibleStep::doTestStepL() /** * @return - TVerdict code * Override of base class pure virtual * Our implementation only gets called if the base class doTestStepPreambleL() did * not leave. That being the case, the current test result value will be EPass. */ { StandardPrepareL(); InitPsySettingsL(3, KNetworkPsy1, 1, KIntGpsPsy1, 1, KNetworkPsy2, 1); ConfigPsyL(KIntGpsPsy1, 3, KConfigLRNoError5s, //Step 1. no error in 5s KConfigLRErrGeneral1s, //Step 2. error in 1s KConfigLRErrGeneral1s //Step 3. error in 1s ); User::After(KSecond*7); TRequestStatus status; TPositionInfo posInfo; TPositionUpdateOptions options; ToggleModuleVisibleL(KNetworkPsy1, EFalse); //1. Set PSY1 visible shall not affect location request SET_TIME iPositioner.NotifyPositionUpdate(posInfo, status); User::After(KTinyDelay); ToggleModuleVisibleL(KNetworkPsy1, ETrue); User::WaitForRequest(status); CHECK_TIME(5) CheckExpectedResult(status.Int(), KErrNone, KFailedPositionRequest); CheckExpectedResult(posInfo.ModuleId(), KIntGpsPsy1, KWrongModuleIdReturned); ToggleModuleVisibleL(KNetworkPsy2, EFalse); ConfigPsyL(KNetworkPsy1, 2, KConfigLRNoError35s, //Step2. no error in 35s KConfigLRErrNoMemory //Step 3. error in 1s ); User::After(KSecond*7); //2. Set PSY3 visible during fallback shall has no effect SET_TIME iPositioner.NotifyPositionUpdate(posInfo, status); User::After(KSecond*5); ToggleModuleVisibleL(KNetworkPsy2, ETrue); User::WaitForRequest(status); CHECK_TIME(35) //PSY1 response time CheckExpectedResult(status.Int(), KErrNone, KFailedPositionRequest); CheckExpectedResult(posInfo.ModuleId(), KNetworkPsy1, KWrongModuleIdReturned); //3. PSY3 shall be used in next LR SET_TIME iPositioner.NotifyPositionUpdate(posInfo, status); User::WaitForRequest(status); CheckExpectedResult(status.Int(), KErrNone, KFailedPositionRequest); CheckExpectedResult(posInfo.ModuleId(), KNetworkPsy2, KWrongModuleIdReturned); // cleanup StandardCleanup(); return TestStepResult(); }
TVerdict CWapDgrmTestStep::doTestStepPreambleL() { const TInt KMBuf_MaxAvail = 393216; const TInt KMBuf_MBufSize = 128; const TInt KMBuf_MBufSizeBig = 1600; const TInt KMBuf_InitialAllocation = 128; const TInt KMBuf_MinGrowth = 64; const TInt KMBuf_GrowthThreshold = 40; __UHEAP_MARK; #ifdef __CFLOG_ACTIVE __CFLOG_CREATEL; __CFLOG_OPEN; #endif iIsFlushReserveArray = EFalse; iReserveArray = NULL; iInsertSms = 0; iIsRunParsing = ETrue; iIsPrintEncoded = ETrue; // Create and install the active scheduler iScheduler=new (ELeave) CActiveScheduler; CActiveScheduler::Install(iScheduler); // The WAP protocol unpacking code uses MBufs, so we need a local MBufManager #ifdef SYMBIAN_ZERO_COPY_NETWORKING // Initialize the commsbuf pond RArray<TCommsBufPoolCreateInfo> createInfos; TCommsBufPoolCreateInfo createInfo; createInfo.iBufSize = KMBuf_MBufSize; createInfo.iInitialBufs = KMBuf_InitialAllocation; createInfo.iGrowByBufs = KMBuf_MinGrowth; createInfo.iMinFreeBufs = KMBuf_GrowthThreshold; createInfo.iCeiling = (KMBuf_MaxAvail/2) / KMBuf_MBufSize; createInfos.AppendL(createInfo); TCommsBufPoolCreateInfo createInfo2; createInfo2.iBufSize = KMBuf_MBufSizeBig; createInfo2.iInitialBufs = KMBuf_InitialAllocation; createInfo2.iGrowByBufs = KMBuf_MinGrowth; createInfo2.iMinFreeBufs = KMBuf_GrowthThreshold; createInfo2.iCeiling = (KMBuf_MaxAvail/2) / KMBuf_MBufSize; createInfos.AppendL(createInfo2); User::LeaveIfError(iCommsBufPond.Open(createInfos)); createInfos.Close(); #else MMBufSizeAllocator* mBufSizeAllocator; iBufMgr = CMBufManager::NewL(KMBuf_MaxAvail, mBufSizeAllocator); if (iBufMgr != NULL && mBufSizeAllocator != NULL) { mBufSizeAllocator->AddL(KMBuf_MBufSize, KMBuf_InitialAllocation, KMBuf_MinGrowth, KMBuf_GrowthThreshold); mBufSizeAllocator->AddL(KMBuf_MBufSizeBig, KMBuf_InitialAllocation, KMBuf_MinGrowth, KMBuf_GrowthThreshold); } iBufMgr->SetContext(); #endif iWapDgrmTable[0] = &KWapDgrm1; iWapDgrmTable[1] = &KWapDgrm2; iWapDgrmTable[2] = &KWapDgrm3; iWapDgrmTable[3] = &KWapDgrm4; iWapDgrmTable[4] = &KWapDgrm5; iWapDgrmTable[5] = &KWapDgrm6; iWapDgrmTable[6] = NULL; TInt ret = iFs.Connect(); TESTL(ret == KErrNone); return TestStepResult() ; }
TVerdict CTestLtsyPhbkWrite::doTestStepPostambleL() { INFO_PRINTF1(_L("CTestLtsyPhbkWrite::doTestStepPostambleL called")); return TestStepResult(); }
TVerdict CAppFwkStartSafeTestStepAppStartAppArcInit::doTestStepL( void ) { CStartSafe* startSafe = CStartSafe::NewL(); CleanupStack::PushL( startSafe ); CStartupProperties* prop = CStartupProperties::NewL(); CleanupStack::PushL( prop ); RProcess proc; CleanupClosePushL( proc ); prop->SetFileParamsL( KTestAppGood, KNullDesC ); prop->SetStartupType( EStartApp ); prop->SetStartMethod( EDeferredWaitForStart ); TRequestStatus startupTRS; TRequestStatus apparcSessionTRS; INFO_PRINTF1(_L("Starting the Test-App process asynchronously")); startSafe->StartL( *prop, proc, startupTRS ); User::WaitForRequest( startupTRS ); INFO_PRINTF2( _L("Rendezvous completed with %d"), startupTRS.Int() ); // StartL should have left if it was unsuccessful, // but ensure that the process's name is that of the test-app. TPtrC procNamePtr = proc.FileName().Right( KTestAppGood().Length() ); TInt nameComparison = procNamePtr.Compare( KTestAppGood() ); if( 0 == nameComparison ) { INFO_PRINTF2( _L("Application \"%S\" started correctly"), &procNamePtr ); } else { ERR_PRINTF1( _L("Application-start unsuccessful. Test not completed") ); SetTestStepResult( EFail ); return TestStepResult(); } startSafe->InitAppArcServer( apparcSessionTRS ); // try to initiate apparc, to see if that causes any problems User::WaitForRequest( apparcSessionTRS ); if ( ( startupTRS == KErrNone) && ( apparcSessionTRS == KErrNone) ) { SetTestStepResult( EPass ); INFO_PRINTF1( _L("Test passed") ); // Dispose of the test-app proc.Kill( KErrNone ); } else { SetTestStepResult( EFail ); ERR_PRINTF3( _L("Test failed.startupTRS = %d apparcSessionTRS = %d "), startupTRS.Int(), apparcSessionTRS.Int() ); } CleanupStack::PopAndDestroy( 3, startSafe ); return TestStepResult(); }
/** * @return - TVerdict code * Override of base class virtual */ TVerdict CTestContactsPBAPExportContents::doTestStepPostambleL() { return TestStepResult(); }
TVerdict CSimSmsRxTest::doTestStepL() { INFO_PRINTF1(_L("BeginSmsRxTest")); CreateConfigFileL(_L("c:\\config3.txt")); SetTestNumberL(8); TInt ret = iPhone.Open(iTelServer,KPhoneName); INFO_PRINTF2(_L("Result: %d"),ret); TESTL(ret == KErrNone); INFO_PRINTF1(_L("Opened phone object")); TESTL(iSmsMessaging.Open(iPhone)==KErrNone); INFO_PRINTF1(_L("Opened SMS Messaging object")); INFO_PRINTF1(_L("Testing GetCaps")); RMobileSmsMessaging::TMobileSmsCapsV1 caps; RMobileSmsMessaging::TMobileSmsCapsV1Pckg capsPckg(caps); iSmsMessaging.GetCaps(capsPckg); TESTL(caps.iSmsMode==RMobileSmsMessaging::KCapsGsmSms); TESTL(caps.iSmsControl==KSmsMessagingCaps); RMobileSmsMessaging::TMobileSmsReceiveMode rxMode; iSmsMessaging.GetReceiveMode(rxMode); TESTL(rxMode==RMobileSmsMessaging::EReceiveUnstoredClientAck); CHECKPOINTL(rxMode,RMobileSmsMessaging::EReceiveUnstoredClientAck,CHP_SMS_CASE("C.1")); INFO_PRINTF1(_L("Testing SMS PDU Retrieval")); TSmsPdu smsPdu; TRequestStatus stat0; RMobileSmsMessaging::TMobileSmsReceiveAttributesV1 attrib; RMobileSmsMessaging::TMobileSmsReceiveAttributesV1Pckg attribPckg(attrib); iSmsMessaging.ReceiveMessage(stat0,smsPdu,attribPckg); INFO_PRINTF1(_L("1st receive Request sent")); //test message received 1 User::WaitForRequest(stat0); CHECKPOINTL(stat0,KErrNone,CHP_SMS_CASE("C.4")); INFO_PRINTF1(_L("Message received")); TESTL(smsPdu.Length()==sizeof(KTestPduA)); TInt i; for(i=0;i<smsPdu.Length();i++) TESTL(smsPdu[i]==KTestPduA[i]); TESTL(attrib.iGsmServiceCentre.iTelNumber==KScaNumberA); TESTL(attrib.iGsmServiceCentre.iTypeOfNumber==RMobilePhone::EInternationalNumber); TESTL(attrib.iGsmServiceCentre.iNumberPlan==RMobilePhone::EIsdnNumberPlan); //ack message iSmsMessaging.AckSmsStored(stat0,KTestDeliveryReport,EFalse); iSmsMessaging.CancelAsyncRequest(EMobileSmsMessagingAckSmsStored);//no implementation-does nothing User::WaitForRequest(stat0); TESTL(stat0==KErrNone); CHECKPOINTL(stat0,KErrNone,CHP_SMS_CASE("C.7")); INFO_PRINTF1(_L("Message 1 ack")); iSmsMessaging.ReceiveMessage(stat0,smsPdu,attribPckg); INFO_PRINTF1(_L("2nd receive Request sent")); User::WaitForRequest(stat0); CHECKPOINTL(stat0,KErrNone,CHP_SMS_CASE("C.5")); INFO_PRINTF1(_L("Message 2 received")); TESTL(smsPdu.Length()==sizeof(KTestPduB)); for(i=0;i<smsPdu.Length();i++) TESTL(smsPdu[i]==KTestPduB[i]); TESTL(attrib.iGsmServiceCentre.iTelNumber==KScaNumberB); TESTL(attrib.iGsmServiceCentre.iTypeOfNumber==RMobilePhone::EInternationalNumber); TESTL(attrib.iGsmServiceCentre.iNumberPlan==RMobilePhone::EIsdnNumberPlan); iSmsMessaging.AckSmsStored(stat0,KTestDeliveryReport,ETrue);//store is full iSmsMessaging.CancelAsyncRequest(EMobileSmsMessagingNackSmsStored);//no implementation-does nothing INFO_PRINTF1(_L("Message 2 Nack (full)")); User::WaitForRequest(stat0); TESTL(stat0==KErrNone); CHECKPOINTL(stat0,KErrNone,CHP_SMS_CASE("C.8")); iSmsMessaging.ResumeSmsReception(stat0); iSmsMessaging.CancelAsyncRequest(EMobileSmsMessagingResumeSmsReception); User::WaitForRequest(stat0); INFO_PRINTF1(_L("Resume reception ")); TESTL(stat0==KErrNone); CHECKPOINTL(stat0,KErrNone,CHP_SMS_CASE("C.10")); iSmsMessaging.ReceiveMessage(stat0,smsPdu,attribPckg); INFO_PRINTF1(_L("3rd receive Request sent")); User::WaitForRequest(stat0); INFO_PRINTF1(_L("Message 3 received")); iSmsMessaging.Close(); iPhone.Close(); ASSERT(RThread().RequestCount()==0); return TestStepResult(); }
TVerdict CTestStepInit::doTestStepL() { User::LeaveIfError(iParent.iSocketServer.Connect()); iParent.iLinks = CBluetoothPhysicalLinks::NewL(iParent, iParent.iSocketServer); return TestStepResult(); }
/** * @return - TVerdict code * Override of base class pure virtual * Our implementation only gets called if the base class doTestStepPreambleL() did * not leave. That being the case, the current test result value will be EPass. */ TVerdict CT_LbsX3PStep_Cancel::doTestStepL() { // Generic test step used to test the LBS Client Notify position update API. INFO_PRINTF1(_L(">>CT_LbsX3PStep_Cancel::doTestStepL()")); if (TestStepResult() == EPass) { TInt err = KErrNone; RLbsTransmitPositionServer server; // Carry out common test actions (such as connecting to a server). User::LeaveIfError(server.Connect()); CleanupClosePushL(server); INFO_PRINTF1(_L("server opened")); User::LeaveIfError(iTransmitPositioner.Open(server)); CleanupClosePushL(iTransmitPositioner); // Create the active object to carry out the Transmit Position functionality. iDoTransmitPosAO = CT_LbsX3PDoTransmitPos::NewL(this, iTransmitPositioner); //T_LbsUtils utils; //TModuleDataIn modDataIn; // Used to send test information to the test module. iRefPosFlag = GetIntFromConfig(ConfigSection(), KLbsRefPos, iRefPosFlag); // Carry out unique test actions. if (GetIntFromConfig(ConfigSection(), KTestCaseId, iTestCaseId)) { switch (iTestCaseId) { // Test case LBS-X3P-Cancel-0001 case 1: { //Try to cancel Transmition without X3P iTransmitPositioner.CancelTransmitPosition(); //Below code might not be needed...added as Netsim panics if I dont start scheduler iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect; } break; // Test case LBS-X3P-Cancel-0002 case 2: { iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect| KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr | KLbsCallback_NetSim_Got_NotifyReleaseLcsMoLr | (iRefPosFlag? KLbsCallback_Got_NotifyDoTransmitReferencePos:0)| KLbsCallback_Got_NotifyDoTransmitPos; } break; // Test case LBS-X3P-Cancel-0003 case 3: { iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect | KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr | KLbsCallback_NetSim_Got_NotifyReleaseLcsMoLr | (iRefPosFlag? KLbsCallback_Got_NotifyDoTransmitReferencePos:0)| KLbsCallback_Got_NotifyDoTransmitPos; } break; // Test case LBS-X3P-Cancel-0004 case 4: { //SetExtendedTimerInterval(30000000); iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect | KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr | KLbsCallback_NetSim_Got_NotifyMeasurementControlLocation | KLbsCallback_NetSim_Got_NotifyMeasurementReportLocation | KLbsCallback_NetSim_Got_NotifyFacilityLcsMoLrResult | KLbsCallback_NetSim_Got_NotifyReleaseLcsMoLr| (iRefPosFlag? KLbsCallback_Got_NotifyDoTransmitReferencePos:0)| KLbsCallback_Got_NotifyDoTransmitPos; } break; // Test case LBS-X3P-Cancel-0005 case 5: case 6: { iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect | KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr | KLbsCallback_NetSim_Got_NotifyMeasurementControlLocation | KLbsCallback_NetSim_Got_NotifyMeasurementReportLocation | KLbsCallback_NetSim_Got_NotifyFacilityLcsMoLrResult | KLbsCallback_NetSim_Got_NotifyReleaseLcsMoLr| (iRefPosFlag? KLbsCallback_Got_NotifyDoTransmitReferencePos:0)| KLbsCallback_Got_NotifyDoTransmitPos; } break; // Test case LBS-X3P-Cancel-0007 case 7: { iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect | KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr | KLbsCallback_NetSim_Got_NotifyReleaseLcsMoLr | (iRefPosFlag? KLbsCallback_Got_NotifyDoTransmitReferencePos:0); //Not sure how we will get status in this case when the request is cancelled from Cancel() - TBD } break; // Test case LBS-X3P-Cancel-0009-0010 case 8: case 9: { User::LeaveIfError(iTransmitPositioner2.Open(server)); CleanupClosePushL(iTransmitPositioner2); // Create the active object to carry out the Transmit Position functionality. iDoTransmitPosAO2 = CT_LbsX3PDoTransmitPos::NewL(this, iTransmitPositioner2); iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect | KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr | KLbsCallback_NetSim_Got_NotifyMeasurementControlLocation | KLbsCallback_NetSim_Got_NotifyMeasurementReportLocation | KLbsCallback_NetSim_Got_NotifyFacilityLcsMoLrResult | KLbsCallback_NetSim_Got_NotifyReleaseLcsMoLr| (iRefPosFlag? KLbsCallback_Got_NotifyDoTransmitReferencePos:0)| KLbsCallback_Got_NotifyDoTransmitPos; } break; case 10: { //Cancel at NotifyMeasurementReportRequestMoreAssitanceData //Configure gps-test-module to request for more assitance data. if(iParent.iSharedData->iTestModuleInUse) { T_LbsUtils utils; TModuleDataIn modDataIn; // Used to send test information to the test module. modDataIn.iRequestType = TModuleDataIn::EModuleRequestTestMode; modDataIn.iAssDataEventType = TModuleDataIn::EAssDataEventExpectSingle; modDataIn.iAssDataTestMode = TModuleDataIn::EModuleTestModeAssDataOn_SomeDataNotAvailable; utils.NotifyModuleOfConfigChangeL(modDataIn); } iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect | KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr | KLbsCallback_NetSim_Got_NotifyMeasurementReportRequestMoreAssistanceData | KLbsCallback_NetSim_Got_NotifyMeasurementReportControlFailure | KLbsCallback_NetSim_Got_NotifyMeasurementControlLocation | KLbsCallback_NetSim_Got_NotifyReleaseLcsMoLr| (iRefPosFlag? KLbsCallback_Got_NotifyDoTransmitReferencePos:0)| KLbsCallback_Got_NotifyDoTransmitPos; } break; case 11: { iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect | KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr | KLbsCallback_NetSim_Got_NotifyMeasurementControlLocation | KLbsCallback_NetSim_Got_NotifyMeasurementReportLocation | KLbsCallback_NetSim_Got_NotifyFacilityLcsMoLrResult | KLbsCallback_NetSim_Got_NotifyReleaseLcsMoLr| (iRefPosFlag? KLbsCallback_Got_NotifyDoTransmitReferencePos:0)| KLbsCallback_Got_NotifyDoTransmitPos; } break; case 12: { //Note sure which callbacks would be needed - TBD if(iRefPosFlag) { iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect | KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr | KLbsCallback_NetSim_Got_NotifyMeasurementControlLocation | KLbsCallback_NetSim_Got_NotifyMeasurementReportLocation | KLbsCallback_NetSim_Got_NotifyFacilityLcsMoLrResult | KLbsCallback_NetSim_Got_NotifyReleaseLcsMoLr| KLbsCallback_Got_NotifyDoTransmitPos; } else { INFO_PRINTF2(_L("This test case is invalid for this interface: Testcase ID- %d"), iTestCaseId); ASSERT(FALSE); } } break; case 13: { if(iRefPosFlag) { iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect | KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr | KLbsCallback_NetSim_Got_NotifyMeasurementControlLocation | KLbsCallback_NetSim_Got_NotifyMeasurementReportControlFailure | KLbsCallback_NetSim_Got_NotifyReleaseLcsMoLr| KLbsCallback_Got_NotifyDoTransmitReferencePos| KLbsCallback_Got_NotifyDoTransmitPos; } else { INFO_PRINTF2(_L("This test case is invalid for this interface: Testcase ID- %d"), iTestCaseId); ASSERT(FALSE); } } break; default: { INFO_PRINTF2(_L("Unrecognised test case id %d"), iTestCaseId); ASSERT(FALSE); } } } else { INFO_PRINTF1(_L("Error in reading config file")); ASSERT(FALSE); } RPointerArray<TAny>& srcPosInfoArr = iParent.iSharedData->iVerifyPosInfoArr; TPositionInfo* srcPosInfo = reinterpret_cast<TPositionInfo*>(srcPosInfoArr[0]); TPosition srcPos; srcPosInfo->GetPosition(srcPos); // Conect to the NetSim. iNetSim.ConnectL(this); // Once we have connected, we will get NetSim callbacks. //iNetSim.SetStepMode(ETrue); // Set plugin to use. TUid pluginUid; if(iParent.iSharedData->iTestModuleInUse) { pluginUid = TUid::Uid(KSimpleAssistanceDataProviderPluginUidValue); } else { pluginUid = TUid::Uid(KSuplAssistanceDataProviderPluginUidValue); } if (!iNetSim.SetAssistanceDataProvider(pluginUid)) { INFO_PRINTF1(_L("Failed test, can't set NetSim's assistance data plugin uid.")); SetTestStepResult(EFail); iNetSim.Close(); return TestStepResult(); } if (!iNetSim.SetReferenceLocation(srcPos)) { INFO_PRINTF1(_L("Failed test, can't set NetSim's reference location.")); SetTestStepResult(EFail); iNetSim.Close(); return TestStepResult(); } // Set the MaxFix time required by the network. TTimeIntervalMicroSeconds maxFixTime(150*1000000); TLbsNetPosRequestQuality netPosQuality; netPosQuality.SetMaxFixTime(maxFixTime); netPosQuality.SetMinHorizontalAccuracy(srcPos.HorizontalAccuracy()); netPosQuality.SetMinVerticalAccuracy(srcPos.VerticalAccuracy()); if (!iNetSim.SetQuality(netPosQuality)) { INFO_PRINTF1(_L("Failed test, can't set NetSim's quality.")); SetTestStepResult(EFail); iNetSim.Close(); return TestStepResult(); } //Timeout for Transmit Location TLbsTransmitPositionOptions transmitOptions; transmitOptions.SetTimeOut(120*1000000); iTransmitPositioner.SetTransmitOptions(transmitOptions); // Kick off the keep alive timer. TTimeIntervalMicroSeconds32 interval(KLbsKeepAlivePeriod); iKeepAliveTimer->SetTimer(interval); if(iTestCaseId == 3) { const TInt32 time=1000; iNetSim.SetResponseTime(time, ETrue); //TBD } CActiveScheduler::Start(); err = iStatus.Int(); switch(iTestCaseId) { case 1: case 7: break; case 2: case 3: case 10: case 13: { if(KErrCancel != err) { INFO_PRINTF2(_L("<FONT><B>CancelTransmitPosition() should have returned KErrCancel, got %d</B></FONT>"), err); SetTestStepResult(EFail); } } break; case 4: { if(KErrCancel == err && !(iCallbackFlags & KLbsCallback_NetSim_Got_NotifyMeasurementReportControlFailure)) { INFO_PRINTF2(_L("<FONT><B>Should have been completed with KErrCancel, got %d</B></FONT>"), err); SetTestStepResult(EFail); } } //not using break as want to go ahead with below check. case 5: case 6: case 11: case 12: //TBD // In testcases that cancel "late" in the X3P proceudure, cancellation may arrive to NRH before // or after the session has finished. Therefore the error code will sometimes be // KErrCancel (session cancelled) and other times KErrNone (nothing to cancel due to session complete). // { if(!(KErrCancel == err || KErrNone == err)) { INFO_PRINTF2(_L("<FONT><B>CancelTransmitPosition() should have returned KErrCancel or KErrNone, got %d</B></FONT>"), err); SetTestStepResult(EFail); } } break; case 8: case 9: { if(KErrNone != err) { INFO_PRINTF2(_L("<FONT><B>CancelTransmitPosition() should have returned KErrNone, got %d</B></FONT>"), err); SetTestStepResult(EFail); } } break; default: { INFO_PRINTF2(_L("Unrecognised test case id %d"), iTestCaseId); ASSERT(FALSE); } } // Clean up. // Clear A-GPS timeout. //if(iParent.iSharedData->iTestModuleInUse) // { // modDataIn.iRequestType = TModuleDataIn::EModuleRequestTimeOut; // modDataIn.iTimeOut = 0; // utils.NotifyModuleOfConfigChangeL(modDataIn); // } iNetSim.ClearAssistanceDataFilters(); iNetSim.Close(); if(iTestCaseId == 8 || iTestCaseId == 9) { CleanupStack::PopAndDestroy(&iTransmitPositioner2); } //CleanupStack::PopAndDestroy(iKeepAliveTimer); CleanupStack::PopAndDestroy(&iTransmitPositioner); CleanupStack::PopAndDestroy(&server); if(iTestCaseId==13) //Wait while all activities in the PM stop and not interfere with the remaining tests { User::After(5000000); } } INFO_PRINTF1(_L("<<CT_LbsX3PStep_Cancel::doTestStepL()")); return TestStepResult(); }