telephonyserverplugins/simtsy/test/Te_Sim/Te_SimPacketRel5ContextTest.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18 */
       
    19 
       
    20 #include "Te_SimPacketRel5ContextTest.h"
       
    21 
       
    22 CSimPacketRel5ContextTest::CSimPacketRel5ContextTest() 
       
    23 	{ 
       
    24 	SetTestStepName(_L("Rel5ContextTest"));
       
    25 	}
       
    26 
       
    27 TVerdict CSimPacketRel5ContextTest::doTestStepL()
       
    28 	{
       
    29 	INFO_PRINTF1(_L("BeginPacketRel5ContextTest"));
       
    30 
       
    31  	CreateConfigFileL(_L("c:\\config3.txt"));
       
    32  	SetTestNumberL(6);
       
    33 
       
    34 	TInt ret = iPhone.Open(iTelServer,KPhoneName); 
       
    35 	INFO_PRINTF2(_L("Result: %d"),ret); 
       
    36 	TESTL(ret == KErrNone); 
       
    37 	INFO_PRINTF1(_L("Opened phone object"));
       
    38 	TESTL(iRel5PacketService.Open(iPhone)==KErrNone);
       
    39 	INFO_PRINTF1(_L("Opened Packet object"));
       
    40 
       
    41 	TName contextName;	
       
    42 	TESTL(iRel5PacketContext.OpenNewContext(iRel5PacketService, contextName)==KErrNone);
       
    43 	
       
    44 	INFO_PRINTF1(_L("AddMediaAuthorization test"));
       
    45 	// Test valid media authorization with valid return code
       
    46 	INFO_PRINTF1(_L("Test valid media authorization, return valid return code"));
       
    47 	RPacketContext::CTFTMediaAuthorizationV3* test1MediaAuthV3 = RPacketContext::CTFTMediaAuthorizationV3::NewL();
       
    48 	CleanupStack::PushL(test1MediaAuthV3);
       
    49 	RPacketContext::CTFTMediaAuthorizationV3::TFlowIdentifier iFlowIdentifier;
       
    50 	((*test1MediaAuthV3).iAuthorizationToken).Copy(SIMTSY_AUTH_TOKEN_TEST_1);
       
    51 	iFlowIdentifier.iMediaComponentNumber = SIMTSY_COMP_NUMBER1_TEST_1;
       
    52 	iFlowIdentifier.iIPFlowNumber = SIMTSY_IPFLOW_NUMBER1_TEST_1;
       
    53 	(*test1MediaAuthV3).iFlowIds.Append(iFlowIdentifier);
       
    54 	iFlowIdentifier.iMediaComponentNumber = SIMTSY_COMP_NUMBER2_TEST_1;
       
    55 	iFlowIdentifier.iIPFlowNumber = SIMTSY_IPFLOW_NUMBER2_TEST_1;
       
    56 	(*test1MediaAuthV3).iFlowIds.Append(iFlowIdentifier);
       
    57 	
       
    58 	TRequestStatus reqStatus;
       
    59 	iRel5PacketContext.AddMediaAuthorizationL(reqStatus, *test1MediaAuthV3);
       
    60 	User::WaitForRequest(reqStatus);
       
    61 	TESTL(reqStatus.Int()==KErrNone);
       
    62 	INFO_PRINTF1(_L("Valid media authorization Test Passed"));
       
    63 
       
    64 	// Test unmatched media authorization, returning KErrCorrupt
       
    65 	INFO_PRINTF1(_L("Test unmatched media authorization, return invalid return code"));
       
    66 	RPacketContext::CTFTMediaAuthorizationV3* test2MediaAuthV3 = RPacketContext::CTFTMediaAuthorizationV3::NewL();
       
    67 	CleanupStack::PushL(test2MediaAuthV3);
       
    68 
       
    69 	((*test2MediaAuthV3).iAuthorizationToken).Copy(SIMTSY_AUTH_TOKEN_TEST_2);
       
    70 	iFlowIdentifier.iMediaComponentNumber = SIMTSY_COMP_NUMBER1_TEST_2;
       
    71 	iFlowIdentifier.iIPFlowNumber = SIMTSY_IPFLOW_NUMBER1_TEST_2;
       
    72 	(*test2MediaAuthV3).iFlowIds.Append(iFlowIdentifier);
       
    73 	iFlowIdentifier.iMediaComponentNumber = SIMTSY_COMP_NUMBER2_TEST_2;
       
    74 	iFlowIdentifier.iIPFlowNumber = SIMTSY_IPFLOW_NUMBER2_TEST_2;
       
    75 	(*test2MediaAuthV3).iFlowIds.Append(iFlowIdentifier);
       
    76 	
       
    77 	iRel5PacketContext.AddMediaAuthorizationL(reqStatus, *test2MediaAuthV3);
       
    78 	User::WaitForRequest(reqStatus);
       
    79 	TESTL(reqStatus.Int()==KErrCorrupt);
       
    80 	INFO_PRINTF1(_L("Corrupt media authorization Test Passed"));
       
    81 
       
    82 	INFO_PRINTF1(_L("RemoveMediaAuthorization test"));	
       
    83 	// Test removal of media authorization, configured to return not found
       
    84 	INFO_PRINTF1(_L("Test removal media authorization, return not found"));
       
    85 	iRel5PacketContext.RemoveMediaAuthorization(reqStatus, (*test2MediaAuthV3).iAuthorizationToken);
       
    86 	User::WaitForRequest(reqStatus);
       
    87 	TESTL(reqStatus.Int()==KErrNotFound);
       
    88 	INFO_PRINTF1(_L("Not found remove media authorization Test Passed"));
       
    89 
       
    90 	INFO_PRINTF1(_L("AddMediaAuthorization and RemoveMediaAuthorization cancel test"));
       
    91 	// Test cancellation of AddMediaAuthorizationL
       
    92 	INFO_PRINTF1(_L("Test cancellation of AddMediaAuthorizationL"));
       
    93 	iRel5PacketContext.AddMediaAuthorizationL(reqStatus, *test1MediaAuthV3);
       
    94 	iRel5PacketContext.CancelAsyncRequest(EPacketAddMediaAuthorization);
       
    95 	User::WaitForRequest(reqStatus);
       
    96 	TESTL(reqStatus.Int()==KErrNone);
       
    97 	INFO_PRINTF1(_L("Cancellation of add media authorization Test Passed"));
       
    98 
       
    99 	// Test cancellation of RemoveMediaAuthorizationL
       
   100 	INFO_PRINTF1(_L("Test cancellation of RemoveMediaAuthorizationL"));
       
   101 	iRel5PacketContext.RemoveMediaAuthorization(reqStatus, (*test2MediaAuthV3).iAuthorizationToken);
       
   102 	iRel5PacketContext.CancelAsyncRequest(EPacketRemoveMediaAuthorization);
       
   103 	User::WaitForRequest(reqStatus);
       
   104 	TESTL(reqStatus.Int()==KErrNotFound);
       
   105 	INFO_PRINTF1(_L("Cancellation of remove media authorization Test Passed"));
       
   106 
       
   107 	CleanupStack::PopAndDestroy(test2MediaAuthV3);
       
   108 	CleanupStack::PopAndDestroy(test1MediaAuthV3);
       
   109 	
       
   110 
       
   111 
       
   112 	// UMTS Rel5
       
   113 	RPacketContext::TContextConfig_R5* rel5ContextConfig = new(ELeave) RPacketContext::TContextConfig_R5;
       
   114 	CleanupStack::PushL(rel5ContextConfig);
       
   115 	TPckg<RPacketContext::TContextConfig_R5> contextConfigPckgRel5(*rel5ContextConfig);
       
   116 
       
   117 	TRequestStatus notifyStatus;
       
   118 
       
   119 	//Test notification of change in R5 context config params
       
   120 	iRel5PacketContext.NotifyConfigChanged(notifyStatus, contextConfigPckgRel5);
       
   121 
       
   122 	RPacketContext::TContextConfig_R5* rel5ContextConfig_2 = new(ELeave) RPacketContext::TContextConfig_R5;
       
   123 	CleanupStack::PushL(rel5ContextConfig_2);
       
   124 	TPckg<RPacketContext::TContextConfig_R5> contextConfigPckgRel5_2(*rel5ContextConfig_2);
       
   125 
       
   126 	//setup params to test setting R5 context config params
       
   127 	rel5ContextConfig_2->iAccessPointName = R5_CONTEXT_GGSN;
       
   128 	rel5ContextConfig_2->iPdpAddress = R5_CONTEXT_PDP_ADDRESS;
       
   129 	rel5ContextConfig_2->iPdpType = R5_CONTEXT_PROTOCOL;
       
   130 	rel5ContextConfig_2->iUseEdge = R5_CONTEXT_USE_EDGE;
       
   131 	rel5ContextConfig_2->iProtocolConfigOption.iAuthInfo.iProtocol = R5_CONTEXT_AUTH_PROT;
       
   132 	rel5ContextConfig_2->iProtocolConfigOption.iAuthInfo.iUsername = R5_CONTEXT_USERNAME;
       
   133 	rel5ContextConfig_2->iProtocolConfigOption.iAuthInfo.iPassword = R5_CONTEXT_PASSWORD;
       
   134 	rel5ContextConfig_2->iProtocolConfigOption.iChallenge = R5_CONTEXT_CHALLENGE;
       
   135 	rel5ContextConfig_2->iProtocolConfigOption.iResponse = R5_CONTEXT_RESPONSE;
       
   136 	rel5ContextConfig_2->iProtocolConfigOption.iDnsAddresses.iPrimaryDns = R5_CONTEXT_DNS1;
       
   137 	rel5ContextConfig_2->iProtocolConfigOption.iDnsAddresses.iSecondaryDns = R5_CONTEXT_DNS2;
       
   138 	rel5ContextConfig_2->iProtocolConfigOption.iId = R5_CONTEXT_ID;
       
   139 	rel5ContextConfig_2->iPdpHeaderCompression = R5_CONTEXT_HEADER_COMPRESSION;
       
   140 	rel5ContextConfig_2->iPdpDataCompression = R5_CONTEXT_DATA_COMPRESSION;
       
   141 
       
   142 	TBuf8<R5_CONTEXT_ADDITIONAL_PARAM_LEN> additionalParamData(R5_CONTEXT_ADDITIONAL_PARAM);	
       
   143 	additionalParamData.SetLength(R5_CONTEXT_ADDITIONAL_PARAM_LEN);
       
   144 
       
   145 	RPacketContext::TPcoId pcoId(R5_CONTEXT_PCO_ID);
       
   146 
       
   147 	RPacketContext::TMiscProtocolBuffer miscBuffer;
       
   148 	miscBuffer.Zero();
       
   149 
       
   150 	TPtr8 pcoPtr(const_cast<TUint8*>(miscBuffer.Ptr()), RPacketContext::KMiscProtocolBufferLength);
       
   151 
       
   152 	TPtr8 additionalParamDataPtr(const_cast<TUint8*>(additionalParamData.Ptr()),
       
   153 		additionalParamData.Length(), additionalParamData.Length());
       
   154 
       
   155 	// Attach TTlv to the buffer
       
   156 	TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> theTLV(pcoPtr,0);	
       
   157 
       
   158 	theTLV.AppendItemL(pcoId,additionalParamDataPtr);
       
   159 
       
   160 	miscBuffer.SetLength(pcoPtr.Length());
       
   161 
       
   162 	rel5ContextConfig_2->iProtocolConfigOption.iMiscBuffer = miscBuffer;
       
   163 
       
   164 	// Test setting R5 Context Config Params
       
   165 	iRel5PacketContext.SetConfig(reqStatus, contextConfigPckgRel5_2);
       
   166 
       
   167 	User::WaitForRequest(reqStatus);
       
   168 	TESTL(reqStatus.Int()==KErrNone);
       
   169 	CHECKPOINTL(reqStatus.Int(),KErrNone,CHP_IMS_CASE("P.4"));
       
   170 	INFO_PRINTF1(_L("SetConfig Rel5 test passed"));
       
   171 
       
   172 	// Wait for the notification to complete
       
   173 	User::WaitForRequest(notifyStatus);
       
   174 	TESTL(notifyStatus.Int()==KErrNone);
       
   175 	CHECKPOINTL(notifyStatus.Int(),KErrNone,CHP_IMS_CASE("P.3"));
       
   176 
       
   177 	TESTL(rel5ContextConfig->iAccessPointName == R5_CONTEXT_GGSN);
       
   178 	TESTL(rel5ContextConfig->iPdpAddress == R5_CONTEXT_PDP_ADDRESS);
       
   179 	TESTL(rel5ContextConfig->iPdpType == R5_CONTEXT_PROTOCOL);
       
   180 	TESTL(rel5ContextConfig->iUseEdge == R5_CONTEXT_USE_EDGE);
       
   181 	TESTL(rel5ContextConfig->iProtocolConfigOption.iAuthInfo.iProtocol == R5_CONTEXT_AUTH_PROT);
       
   182 	TESTL(rel5ContextConfig->iProtocolConfigOption.iAuthInfo.iUsername == R5_CONTEXT_USERNAME);
       
   183 	TESTL(rel5ContextConfig->iProtocolConfigOption.iAuthInfo.iPassword == R5_CONTEXT_PASSWORD);
       
   184 	TESTL(rel5ContextConfig->iProtocolConfigOption.iChallenge == R5_CONTEXT_CHALLENGE);
       
   185 	TESTL(rel5ContextConfig->iProtocolConfigOption.iResponse == R5_CONTEXT_RESPONSE);
       
   186 	TESTL(rel5ContextConfig->iProtocolConfigOption.iDnsAddresses.iPrimaryDns == R5_CONTEXT_DNS1);
       
   187 	TESTL(rel5ContextConfig->iProtocolConfigOption.iDnsAddresses.iSecondaryDns == R5_CONTEXT_DNS2);
       
   188 	TESTL(rel5ContextConfig->iProtocolConfigOption.iId == R5_CONTEXT_ID);
       
   189 	TESTL(rel5ContextConfig->iPdpHeaderCompression == R5_CONTEXT_HEADER_COMPRESSION);
       
   190 	TESTL(rel5ContextConfig->iPdpDataCompression == R5_CONTEXT_DATA_COMPRESSION);
       
   191 	rel5ContextConfig->iProtocolConfigOption.iMiscBuffer.SetLength(miscBuffer.Length());
       
   192 	TESTL(rel5ContextConfig->iProtocolConfigOption.iMiscBuffer == miscBuffer);
       
   193 	INFO_PRINTF1(_L("NotifyConfigChanged Rel5 Test Passed"));
       
   194 
       
   195 
       
   196 	//Test setting an R5 Config Param and placing GPRS, R4 and R5 Config param change notify requests
       
   197 	//Set R5 Notify
       
   198 	TRequestStatus rel5Status;
       
   199 	RPacketContext::TContextConfig_R5* rel5ContextConfig_3 = new(ELeave) RPacketContext::TContextConfig_R5;
       
   200 	CleanupStack::PushL(rel5ContextConfig_3);
       
   201 	TPckg<RPacketContext::TContextConfig_R5> contextConfigPckgRel5_3(*rel5ContextConfig_3);
       
   202 	iRel5PacketContext.NotifyConfigChanged(rel5Status, contextConfigPckgRel5_3);
       
   203 
       
   204 	//Set GPRS Notify
       
   205 	TRequestStatus gprsStatus;
       
   206 	RPacketContext::TContextConfigGPRS* gprsContextConfig = new(ELeave) RPacketContext::TContextConfigGPRS;
       
   207 	CleanupStack::PushL(gprsContextConfig);
       
   208 	TPckg<RPacketContext::TContextConfigGPRS> contextConfigPckgGPRS(*gprsContextConfig);
       
   209 
       
   210 	RPacketContext iRel5PacketContext2;
       
   211 	TESTL(iRel5PacketContext2.OpenExistingContext(iRel5PacketService, contextName)==KErrNone);
       
   212 	iRel5PacketContext2.NotifyConfigChanged(gprsStatus, contextConfigPckgGPRS);
       
   213 
       
   214 	//Set Rel99/R4 Notify
       
   215 	TRequestStatus rel99Status;	
       
   216 	RPacketContext::TContextConfigR99_R4* rel99ContextConfig = new(ELeave) RPacketContext::TContextConfigR99_R4;
       
   217 	CleanupStack::PushL(rel99ContextConfig);
       
   218 	TPckg<RPacketContext::TContextConfigR99_R4> contextConfigPckgRel99(*rel99ContextConfig);
       
   219 
       
   220 	RPacketContext iRel5PacketContext3;
       
   221 	TESTL(iRel5PacketContext3.OpenExistingContext(iRel5PacketService, contextName)==KErrNone);
       
   222 	iRel5PacketContext3.NotifyConfigChanged(rel99Status, contextConfigPckgRel99);
       
   223 
       
   224 	//setup params to test setting R5 context config params
       
   225 	rel5ContextConfig_2->iAccessPointName = R5_CONTEXT_GGSN2;
       
   226 	rel5ContextConfig_2->iPdpAddress = R5_CONTEXT_PDP_ADDRESS2;
       
   227 	rel5ContextConfig_2->iPdpType = R5_CONTEXT_PROTOCOL2;
       
   228 	rel5ContextConfig_2->iUseEdge = R5_CONTEXT_USE_EDGE2;
       
   229 	rel5ContextConfig_2->iProtocolConfigOption.iAuthInfo.iProtocol = R5_CONTEXT_AUTH_PROT2;
       
   230 	rel5ContextConfig_2->iProtocolConfigOption.iAuthInfo.iUsername = R5_CONTEXT_USERNAME2;
       
   231 	rel5ContextConfig_2->iProtocolConfigOption.iAuthInfo.iPassword = R5_CONTEXT_PASSWORD2;
       
   232 	rel5ContextConfig_2->iProtocolConfigOption.iChallenge = R5_CONTEXT_CHALLENGE2;
       
   233 	rel5ContextConfig_2->iProtocolConfigOption.iResponse = R5_CONTEXT_RESPONSE2;
       
   234 	rel5ContextConfig_2->iProtocolConfigOption.iDnsAddresses.iPrimaryDns = R5_CONTEXT_DNS1_2;
       
   235 	rel5ContextConfig_2->iProtocolConfigOption.iDnsAddresses.iSecondaryDns = R5_CONTEXT_DNS2_2;
       
   236 	rel5ContextConfig_2->iProtocolConfigOption.iId = R5_CONTEXT_ID2;
       
   237 	rel5ContextConfig_2->iPdpHeaderCompression = R5_CONTEXT_HEADER_COMPRESSION2;
       
   238 	rel5ContextConfig_2->iPdpDataCompression = R5_CONTEXT_DATA_COMPRESSION2;
       
   239 
       
   240 	TBuf8<R5_CONTEXT_ADDITIONAL_PARAM_LEN> additionalParamData2(R5_CONTEXT_ADDITIONAL_PARAM2);	
       
   241 	additionalParamData2.SetLength(R5_CONTEXT_ADDITIONAL_PARAM_LEN2);
       
   242 
       
   243 	RPacketContext::TPcoId pcoId2(R5_CONTEXT_PCO_ID2);
       
   244 
       
   245 	RPacketContext::TMiscProtocolBuffer miscBuffer2;
       
   246 
       
   247 	miscBuffer2.Zero();
       
   248 	
       
   249 	TPtr8 pcoPtr2(const_cast<TUint8*>(miscBuffer2.Ptr()), RPacketContext::KMiscProtocolBufferLength);
       
   250 
       
   251 	TPtr8 additionalParamDataPtr2(const_cast<TUint8*>(additionalParamData2.Ptr()),
       
   252 		additionalParamData2.Length(), additionalParamData2.Length());
       
   253 
       
   254 	// Attach TTlv to the buffer
       
   255 	TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> theTLV2(pcoPtr2,0);	
       
   256 
       
   257 	theTLV2.AppendItemL(pcoId2,additionalParamDataPtr2);
       
   258 
       
   259 	miscBuffer2.SetLength(pcoPtr2.Length());
       
   260 
       
   261 	rel5ContextConfig_2->iProtocolConfigOption.iMiscBuffer = miscBuffer2;
       
   262 
       
   263 	//set R5 Context Config Params
       
   264 	iRel5PacketContext.SetConfig(reqStatus, contextConfigPckgRel5_2);
       
   265 	User::WaitForRequest(reqStatus);
       
   266 	TESTL(reqStatus.Int()==KErrNone);
       
   267 
       
   268 	//Wait for the notifications to complete
       
   269 	User::WaitForRequest(gprsStatus);
       
   270 	CHECKPOINTL(gprsStatus.Int(),KErrNone,CHP_IMS_CASE("P.5"));
       
   271 
       
   272 	User::WaitForRequest(rel99Status);
       
   273 	CHECKPOINTL(rel99Status.Int(),KErrNone,CHP_IMS_CASE("P.6"));
       
   274 
       
   275 	User::WaitForRequest(rel5Status);
       
   276 	TESTL(rel5Status.Int()==KErrNone);
       
   277 
       
   278 	//check that the GPRS notify values are correct
       
   279 	TESTL(gprsContextConfig->iAccessPointName == R5_CONTEXT_GGSN2);
       
   280 	TESTL(gprsContextConfig->iAnonymousAccessReqd == RPacketContext::ENotApplicable);
       
   281 	TESTL(gprsContextConfig->iPdpAddress == R5_CONTEXT_PDP_ADDRESS2);
       
   282 	TESTL(gprsContextConfig->iPdpCompression == RPacketContext::KPdpHeaderCompression);
       
   283 	TESTL(gprsContextConfig->iPdpType == R5_CONTEXT_PROTOCOL2);
       
   284 	TESTL(gprsContextConfig->iProtocolConfigOption.iAuthInfo.iProtocol == R5_CONTEXT_AUTH_PROT2);
       
   285 	TESTL(gprsContextConfig->iProtocolConfigOption.iAuthInfo.iUsername == R5_CONTEXT_USERNAME2);
       
   286 	TESTL(gprsContextConfig->iProtocolConfigOption.iAuthInfo.iPassword == R5_CONTEXT_PASSWORD2);
       
   287 	TESTL(gprsContextConfig->iProtocolConfigOption.iChallenge == R5_CONTEXT_CHALLENGE2);
       
   288 	TESTL(gprsContextConfig->iProtocolConfigOption.iResponse == R5_CONTEXT_RESPONSE2);
       
   289 	TESTL(gprsContextConfig->iProtocolConfigOption.iDnsAddresses.iPrimaryDns == R5_CONTEXT_DNS1_2);
       
   290 	TESTL(gprsContextConfig->iProtocolConfigOption.iDnsAddresses.iSecondaryDns == R5_CONTEXT_DNS2_2);
       
   291 	TESTL(gprsContextConfig->iProtocolConfigOption.iId == R5_CONTEXT_ID2);	
       
   292 
       
   293 	//check that the Rel99 notify values are correct
       
   294 	TESTL(rel99ContextConfig->iAccessPointName == R5_CONTEXT_GGSN2);
       
   295 	TESTL(rel99ContextConfig->iPdpAddress == R5_CONTEXT_PDP_ADDRESS2);
       
   296 	TESTL(rel99ContextConfig->iPdpType == R5_CONTEXT_PROTOCOL2);
       
   297 	TESTL(rel99ContextConfig->iProtocolConfigOption.iAuthInfo.iProtocol == R5_CONTEXT_AUTH_PROT2);
       
   298 	TESTL(rel99ContextConfig->iProtocolConfigOption.iAuthInfo.iUsername == R5_CONTEXT_USERNAME2);
       
   299 	TESTL(rel99ContextConfig->iProtocolConfigOption.iAuthInfo.iPassword == R5_CONTEXT_PASSWORD2);
       
   300 	TESTL(rel99ContextConfig->iProtocolConfigOption.iChallenge == R5_CONTEXT_CHALLENGE2);
       
   301 	TESTL(rel99ContextConfig->iProtocolConfigOption.iResponse == R5_CONTEXT_RESPONSE2);
       
   302 	TESTL(rel99ContextConfig->iProtocolConfigOption.iDnsAddresses.iPrimaryDns == R5_CONTEXT_DNS1_2);
       
   303 	TESTL(rel99ContextConfig->iProtocolConfigOption.iDnsAddresses.iSecondaryDns == R5_CONTEXT_DNS2_2);
       
   304 	TESTL(rel99ContextConfig->iProtocolConfigOption.iId == R5_CONTEXT_ID2);
       
   305 
       
   306 
       
   307 	//check that the Rel5 notify values are correct
       
   308 	TESTL(rel5ContextConfig_3->iAccessPointName == R5_CONTEXT_GGSN2);
       
   309 	TESTL(rel5ContextConfig_3->iPdpAddress == R5_CONTEXT_PDP_ADDRESS2);
       
   310 	TESTL(rel5ContextConfig_3->iPdpType == R5_CONTEXT_PROTOCOL2);
       
   311 	TESTL(rel5ContextConfig_3->iUseEdge == R5_CONTEXT_USE_EDGE2);
       
   312 	TESTL(rel5ContextConfig_3->iProtocolConfigOption.iAuthInfo.iProtocol == R5_CONTEXT_AUTH_PROT2);
       
   313 	TESTL(rel5ContextConfig_3->iProtocolConfigOption.iAuthInfo.iUsername == R5_CONTEXT_USERNAME2);
       
   314 	TESTL(rel5ContextConfig_3->iProtocolConfigOption.iAuthInfo.iPassword == R5_CONTEXT_PASSWORD2);
       
   315 	TESTL(rel5ContextConfig_3->iProtocolConfigOption.iChallenge == R5_CONTEXT_CHALLENGE2);
       
   316 	TESTL(rel5ContextConfig_3->iProtocolConfigOption.iResponse == R5_CONTEXT_RESPONSE2);
       
   317 	TESTL(rel5ContextConfig_3->iProtocolConfigOption.iDnsAddresses.iPrimaryDns == R5_CONTEXT_DNS1_2);
       
   318 	TESTL(rel5ContextConfig_3->iProtocolConfigOption.iDnsAddresses.iSecondaryDns == R5_CONTEXT_DNS2_2);
       
   319 	TESTL(rel5ContextConfig_3->iProtocolConfigOption.iId == R5_CONTEXT_ID2);
       
   320 	TESTL(rel5ContextConfig_3->iPdpHeaderCompression == R5_CONTEXT_HEADER_COMPRESSION2);
       
   321 	TESTL(rel5ContextConfig_3->iPdpDataCompression == R5_CONTEXT_DATA_COMPRESSION2);
       
   322 	rel5ContextConfig_3->iProtocolConfigOption.iMiscBuffer.SetLength(miscBuffer2.Length());
       
   323 	TESTL(rel5ContextConfig_3->iProtocolConfigOption.iMiscBuffer == miscBuffer2);
       
   324 	INFO_PRINTF1(_L("NotifyConfigChanged Rel5 Test Passed"));
       
   325 
       
   326 
       
   327 	//Test cancelling the async Setconfig request
       
   328 	iRel5PacketContext.SetConfig(reqStatus, contextConfigPckgRel5_2);
       
   329 	iRel5PacketContext.CancelAsyncRequest(EPacketContextSetConfig);
       
   330 	User::WaitForRequest(reqStatus);
       
   331 	CHECKPOINTL(reqStatus.Int(),KErrNone,CHP_IMS_CASE("P.7")); //not supporting cancel of setconfig umts
       
   332 	INFO_PRINTF1(_L("SetConfig Cancel Rel5 test passed"));
       
   333 
       
   334 
       
   335 	//setup params to test setting R5 context config params
       
   336 	rel5ContextConfig_2->iAccessPointName = R5_CONTEXT_GGSN;
       
   337 	rel5ContextConfig_2->iPdpAddress = R5_CONTEXT_PDP_ADDRESS;
       
   338 	rel5ContextConfig_2->iPdpType = R5_CONTEXT_PROTOCOL;
       
   339 	rel5ContextConfig_2->iUseEdge = R5_CONTEXT_USE_EDGE;
       
   340 	rel5ContextConfig_2->iProtocolConfigOption.iAuthInfo.iProtocol = R5_CONTEXT_AUTH_PROT;
       
   341 	rel5ContextConfig_2->iProtocolConfigOption.iAuthInfo.iUsername = R5_CONTEXT_USERNAME;
       
   342 	rel5ContextConfig_2->iProtocolConfigOption.iAuthInfo.iPassword = R5_CONTEXT_PASSWORD;
       
   343 	rel5ContextConfig_2->iProtocolConfigOption.iChallenge = R5_CONTEXT_CHALLENGE;
       
   344 	rel5ContextConfig_2->iProtocolConfigOption.iResponse = R5_CONTEXT_RESPONSE;
       
   345 	rel5ContextConfig_2->iProtocolConfigOption.iDnsAddresses.iPrimaryDns = R5_CONTEXT_DNS1;
       
   346 	rel5ContextConfig_2->iProtocolConfigOption.iDnsAddresses.iSecondaryDns = R5_CONTEXT_DNS2;
       
   347 	rel5ContextConfig_2->iProtocolConfigOption.iId = R5_CONTEXT_ID;
       
   348 	rel5ContextConfig_2->iPdpHeaderCompression = R5_CONTEXT_HEADER_COMPRESSION;
       
   349 	rel5ContextConfig_2->iPdpDataCompression = R5_CONTEXT_DATA_COMPRESSION;
       
   350 	rel5ContextConfig_2->iProtocolConfigOption.iMiscBuffer = miscBuffer;
       
   351 
       
   352 	//Set R5 Context Config Params
       
   353 	iRel5PacketContext.SetConfig(reqStatus, contextConfigPckgRel5_2);
       
   354 
       
   355 	User::WaitForRequest(reqStatus);
       
   356 	TESTL(reqStatus.Int()==KErrNone);
       
   357 
       
   358 	//Test Getting GPRS Context Config Params when the Params set were R5
       
   359 	iRel5PacketContext2.GetConfig(gprsStatus, contextConfigPckgGPRS);
       
   360 	User::WaitForRequest(gprsStatus);
       
   361 	CHECKPOINTL(gprsStatus.Int(),KErrNone,CHP_IMS_CASE("P.8"));
       
   362 
       
   363 	TESTL(gprsContextConfig->iAccessPointName == R5_CONTEXT_GGSN);
       
   364 	TESTL(gprsContextConfig->iAnonymousAccessReqd == RPacketContext::ENotApplicable);
       
   365 	TESTL(gprsContextConfig->iPdpAddress == R5_CONTEXT_PDP_ADDRESS);
       
   366 	TESTL(gprsContextConfig->iPdpCompression == 
       
   367 			(RPacketContext::KPdpHeaderCompression | RPacketContext::KPdpDataCompression));
       
   368 	TESTL(gprsContextConfig->iPdpType == R5_CONTEXT_PROTOCOL);
       
   369 	TESTL(gprsContextConfig->iProtocolConfigOption.iAuthInfo.iProtocol == R5_CONTEXT_AUTH_PROT);
       
   370 	TESTL(gprsContextConfig->iProtocolConfigOption.iAuthInfo.iUsername == R5_CONTEXT_USERNAME);
       
   371 	TESTL(gprsContextConfig->iProtocolConfigOption.iAuthInfo.iPassword == R5_CONTEXT_PASSWORD);
       
   372 	TESTL(gprsContextConfig->iProtocolConfigOption.iChallenge == R5_CONTEXT_CHALLENGE);
       
   373 	TESTL(gprsContextConfig->iProtocolConfigOption.iResponse == R5_CONTEXT_RESPONSE);
       
   374 	TESTL(gprsContextConfig->iProtocolConfigOption.iDnsAddresses.iPrimaryDns == R5_CONTEXT_DNS1);
       
   375 	TESTL(gprsContextConfig->iProtocolConfigOption.iDnsAddresses.iSecondaryDns == R5_CONTEXT_DNS2);
       
   376 	TESTL(gprsContextConfig->iProtocolConfigOption.iId == R5_CONTEXT_ID);
       
   377 
       
   378 	//Test Getting R99 Context Config Params when the Params set were R5
       
   379 	iRel5PacketContext3.GetConfig(rel99Status, contextConfigPckgRel99);
       
   380 	User::WaitForRequest(rel99Status);
       
   381 	CHECKPOINTL(rel99Status.Int(),KErrNone,CHP_IMS_CASE("P.9"));
       
   382 
       
   383 	TESTL(rel99ContextConfig->iAccessPointName == R5_CONTEXT_GGSN);
       
   384 	TESTL(rel99ContextConfig->iPdpAddress == R5_CONTEXT_PDP_ADDRESS);
       
   385 	TESTL(rel99ContextConfig->iPdpType == R5_CONTEXT_PROTOCOL);
       
   386 	TESTL(rel99ContextConfig->iProtocolConfigOption.iAuthInfo.iProtocol == R5_CONTEXT_AUTH_PROT);
       
   387 	TESTL(rel99ContextConfig->iProtocolConfigOption.iAuthInfo.iUsername == R5_CONTEXT_USERNAME);
       
   388 	TESTL(rel99ContextConfig->iProtocolConfigOption.iAuthInfo.iPassword == R5_CONTEXT_PASSWORD);
       
   389 	TESTL(rel99ContextConfig->iProtocolConfigOption.iChallenge == R5_CONTEXT_CHALLENGE);
       
   390 	TESTL(rel99ContextConfig->iProtocolConfigOption.iResponse == R5_CONTEXT_RESPONSE);
       
   391 	TESTL(rel99ContextConfig->iProtocolConfigOption.iDnsAddresses.iPrimaryDns == R5_CONTEXT_DNS1);
       
   392 	TESTL(rel99ContextConfig->iProtocolConfigOption.iDnsAddresses.iSecondaryDns == R5_CONTEXT_DNS2);
       
   393 	TESTL(rel99ContextConfig->iProtocolConfigOption.iId == R5_CONTEXT_ID);
       
   394 
       
   395 	//Test Getting R5 Conext Config Params when the Params set were R5
       
   396 	iRel5PacketContext.GetConfig(rel5Status, contextConfigPckgRel5_3);
       
   397 	User::WaitForRequest(rel5Status);
       
   398 	CHECKPOINTL(rel5Status.Int(),KErrNone,CHP_IMS_CASE("P.10"));
       
   399 
       
   400 	TESTL(rel5ContextConfig_3->iAccessPointName == R5_CONTEXT_GGSN);
       
   401 	TESTL(rel5ContextConfig_3->iPdpAddress == R5_CONTEXT_PDP_ADDRESS);
       
   402 	TESTL(rel5ContextConfig_3->iPdpType == R5_CONTEXT_PROTOCOL);
       
   403 	TESTL(rel5ContextConfig_3->iUseEdge == R5_CONTEXT_USE_EDGE);
       
   404 	TESTL(rel5ContextConfig_3->iProtocolConfigOption.iAuthInfo.iProtocol == R5_CONTEXT_AUTH_PROT);
       
   405 	TESTL(rel5ContextConfig_3->iProtocolConfigOption.iAuthInfo.iUsername == R5_CONTEXT_USERNAME);
       
   406 	TESTL(rel5ContextConfig_3->iProtocolConfigOption.iAuthInfo.iPassword == R5_CONTEXT_PASSWORD);
       
   407 	TESTL(rel5ContextConfig_3->iProtocolConfigOption.iChallenge == R5_CONTEXT_CHALLENGE);
       
   408 	TESTL(rel5ContextConfig_3->iProtocolConfigOption.iResponse == R5_CONTEXT_RESPONSE);
       
   409 	TESTL(rel5ContextConfig_3->iProtocolConfigOption.iDnsAddresses.iPrimaryDns == R5_CONTEXT_DNS1);
       
   410 	TESTL(rel5ContextConfig_3->iProtocolConfigOption.iDnsAddresses.iSecondaryDns == R5_CONTEXT_DNS2);
       
   411 	TESTL(rel5ContextConfig_3->iProtocolConfigOption.iId == R5_CONTEXT_ID);
       
   412 	TESTL(rel5ContextConfig_3->iPdpHeaderCompression == R5_CONTEXT_HEADER_COMPRESSION);
       
   413 	TESTL(rel5ContextConfig_3->iPdpDataCompression == R5_CONTEXT_DATA_COMPRESSION);
       
   414 	rel5ContextConfig_3->iProtocolConfigOption.iMiscBuffer.SetLength(miscBuffer.Length());
       
   415 	TESTL(rel5ContextConfig_3->iProtocolConfigOption.iMiscBuffer == miscBuffer);
       
   416 
       
   417 	INFO_PRINTF1(_L("GetConfig R5 test passed"));
       
   418 
       
   419 	CleanupStack::PopAndDestroy(rel99ContextConfig);
       
   420 	CleanupStack::PopAndDestroy(gprsContextConfig);
       
   421 	CleanupStack::PopAndDestroy(rel5ContextConfig_3);
       
   422 	CleanupStack::PopAndDestroy(rel5ContextConfig_2);
       
   423 	CleanupStack::PopAndDestroy(rel5ContextConfig);
       
   424 
       
   425 	// Now test the getting of DNS server names
       
   426 	RPacketContext::TDnsInfoV2 dnsInfoV2;
       
   427 	RPacketContext::TTDnsInfoV2Pckg dnsInfoV2pckg(dnsInfoV2);
       
   428 
       
   429 	iRel5PacketContext.GetDnsInfo(reqStatus, dnsInfoV2pckg);
       
   430 	User::WaitForRequest(reqStatus); 
       
   431 	
       
   432 	TESTL(dnsInfoV2.iPrimaryDns==R5_CONTEXT_DNS1);
       
   433 	TESTL(dnsInfoV2.iSecondaryDns==R5_CONTEXT_DNS2);
       
   434 
       
   435 	CHECKPOINTL(reqStatus.Int(),KErrNone,CHP_IMS_CASE("P.11"));
       
   436 	INFO_PRINTF1(_L("GetDnsInfo Test Passed")); 	
       
   437 
       
   438 	iRel5PacketContext.GetDnsInfo(reqStatus, dnsInfoV2pckg);
       
   439 	iRel5PacketContext.CancelAsyncRequest(EPacketContextGetDNSInfo);
       
   440 	User::WaitForRequest(reqStatus); 
       
   441 	TESTL(reqStatus.Int()==KErrNone); 
       
   442 	INFO_PRINTF1(_L("GetDnsInfoCancel Test Passed"));
       
   443 
       
   444 	// End of Rel5PacketContext and Rel5PacketService tests
       
   445 	iRel5PacketContext.Close();
       
   446 	iRel5PacketContext2.Close();
       
   447 	iRel5PacketContext3.Close();
       
   448 	iRel5PacketService.Close();
       
   449 	iPhone.Close();
       
   450 	ASSERT(RThread().RequestCount()==0);
       
   451 
       
   452 	return TestStepResult();
       
   453 	}
       
   454