24
|
1 |
// Copyright (c) 2006-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_SimPacketAdditionalParamsTest.h"
|
|
21 |
|
|
22 |
CSimPacketAdditionalParamsTest::CSimPacketAdditionalParamsTest()
|
|
23 |
/**
|
|
24 |
Default constructor. Initialises the test step name.
|
|
25 |
*/
|
|
26 |
{
|
|
27 |
SetTestStepName(_L("AdditionalParamsContextTest"));
|
|
28 |
}
|
|
29 |
|
|
30 |
TVerdict CSimPacketAdditionalParamsTest::doTestStepL()
|
|
31 |
/**
|
|
32 |
The test step containing test cases for DEF082819 and DEF082817.
|
|
33 |
*/
|
|
34 |
{
|
|
35 |
INFO_PRINTF1(_L("BeginAdditionalParamsContextTest"));
|
|
36 |
|
|
37 |
CreateConfigFileL(_L("c:\\config3.txt"));
|
|
38 |
SetTestNumberL(16);
|
|
39 |
|
|
40 |
INFO_PRINTF1(_L("RPacketService Functionality"));
|
|
41 |
|
|
42 |
// Test RPacketService::Open
|
|
43 |
TInt ret = iPhone.Open(iTelServer,KPhoneName);
|
|
44 |
INFO_PRINTF2(_L("Result: %d"),ret);
|
|
45 |
TESTL(ret == KErrNone);
|
|
46 |
INFO_PRINTF1(_L("Opened phone object"));
|
|
47 |
|
|
48 |
TESTL(iPacketService.Open(iPhone)==KErrNone);
|
|
49 |
INFO_PRINTF1(_L("Opened packet object"));
|
|
50 |
|
|
51 |
// Test RPacketContext::OpenNewContext
|
|
52 |
TName gprsContextName;
|
|
53 |
TName gprsContextNameCompare;
|
|
54 |
TESTL(iPacketContext.OpenNewContext(iPacketService, gprsContextName)==KErrNone);
|
|
55 |
gprsContextNameCompare.Append(KSimPrimaryPacketContextName);
|
|
56 |
gprsContextNameCompare.AppendNum(1);
|
|
57 |
TESTL(gprsContextName.Compare(gprsContextNameCompare)==KErrNone);
|
|
58 |
INFO_PRINTF1(_L("Opened GPRS Context object"));
|
|
59 |
|
|
60 |
TRequestStatus reqStatus, notifyStatus;
|
|
61 |
|
|
62 |
// GPRS RPacketContext::SetConfig and
|
|
63 |
// RPacketContext::NotifyConfigChanged
|
|
64 |
// when there is an additional parameter specified
|
|
65 |
RPacketContext::TContextConfigGPRS gprsContextConfig;
|
|
66 |
TESTL(gprsContextConfig.ExtensionId()==TPacketDataConfigBase::KConfigGPRS);
|
|
67 |
TPckg<RPacketContext::TContextConfigGPRS> contextConfigPckgGPRS(gprsContextConfig);
|
|
68 |
|
|
69 |
RPacketContext::TContextConfigGPRS gprsContextNotify;
|
|
70 |
TESTL(gprsContextNotify.ExtensionId()==TPacketDataConfigBase::KConfigGPRS);
|
|
71 |
TPckg<RPacketContext::TContextConfigGPRS> contextNotifyPckgGPRS(gprsContextNotify);
|
|
72 |
|
|
73 |
gprsContextConfig.iAccessPointName = DPCKTTSY_ACCESS_POINT1;
|
|
74 |
gprsContextConfig.iAnonymousAccessReqd = DPCKTTSY_ANONYMOUS_ACCESS1;
|
|
75 |
gprsContextConfig.iPdpAddress = DPCKTTSY_PDP_ADDRESS1;
|
|
76 |
gprsContextConfig.iPdpCompression = DPCKTTSY_COMPRESSION1;
|
|
77 |
gprsContextConfig.iPdpType = DPCKTTSY_PDP_TYPE1;
|
|
78 |
gprsContextConfig.iUseEdge = DPCKTTSY_EGPRS_REQUIRED;
|
|
79 |
gprsContextConfig.iProtocolConfigOption.iAuthInfo.iProtocol = SIM_PACKET_CONTEXT_PROTOCOL1;
|
|
80 |
gprsContextConfig.iProtocolConfigOption.iAuthInfo.iUsername = SIM_PACKET_CONTEXT_USERNAME1;
|
|
81 |
gprsContextConfig.iProtocolConfigOption.iAuthInfo.iPassword = SIM_PACKET_CONTEXT_PASSWORD1;
|
|
82 |
gprsContextConfig.iProtocolConfigOption.iChallenge = SIM_PACKET_CONTEXT_CHALLENGE1;
|
|
83 |
gprsContextConfig.iProtocolConfigOption.iResponse = SIM_PACKET_CONTEXT_RESPONSE1;
|
|
84 |
gprsContextConfig.iProtocolConfigOption.iDnsAddresses.iPrimaryDns = SIM_PACKET_CONTEXT_PRIMARYSERVER1;
|
|
85 |
gprsContextConfig.iProtocolConfigOption.iDnsAddresses.iSecondaryDns = SIM_PACKET_CONTEXT_SECONDARYSERVER1;
|
|
86 |
gprsContextConfig.iProtocolConfigOption.iId = SIM_PACKET_CONTEXT_ID1;
|
|
87 |
|
|
88 |
TBuf8<GPRS_CONTEXT_ADDITIONAL_PARAM_LEN> additionalParamDataGprs_2(GPRS_PACKET_CONTEXT_ADDITIONAL_PARAM);
|
|
89 |
additionalParamDataGprs_2.SetLength(GPRS_CONTEXT_ADDITIONAL_PARAM_LEN);
|
|
90 |
|
|
91 |
RPacketContext::TPcoId pcoIdGprs_2(GPRS_PACKET_CONTEXT_PCO_ID);
|
|
92 |
|
|
93 |
RPacketContext::TMiscProtocolBuffer miscBufferGprs_2;
|
|
94 |
miscBufferGprs_2.Zero();
|
|
95 |
|
|
96 |
TPtr8 pcoPtrGprs_2(const_cast<TUint8*>(miscBufferGprs_2.Ptr()),
|
|
97 |
RPacketContext::KMiscProtocolBufferLength);
|
|
98 |
|
|
99 |
TPtr8 additionalParamDataPtrGprs_2(const_cast<TUint8*>(additionalParamDataGprs_2.Ptr()),
|
|
100 |
additionalParamDataGprs_2.Length(), additionalParamDataGprs_2.Length());
|
|
101 |
|
|
102 |
// Attach TTlv to the buffer
|
|
103 |
TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> theTLVGprs_2(pcoPtrGprs_2,0);
|
|
104 |
|
|
105 |
theTLVGprs_2.AppendItemL(pcoIdGprs_2,additionalParamDataPtrGprs_2);
|
|
106 |
|
|
107 |
miscBufferGprs_2.SetLength(pcoPtrGprs_2.Length());
|
|
108 |
|
|
109 |
gprsContextConfig.iProtocolConfigOption.iMiscBuffer = miscBufferGprs_2;
|
|
110 |
|
|
111 |
iPacketContext.NotifyConfigChanged(notifyStatus, contextNotifyPckgGPRS);
|
|
112 |
iPacketContext.SetConfig(reqStatus, contextConfigPckgGPRS);
|
|
113 |
|
|
114 |
User::WaitForRequest(notifyStatus);
|
|
115 |
User::WaitForRequest(reqStatus);
|
|
116 |
TESTL(reqStatus.Int()==KErrNone);
|
|
117 |
TESTL(notifyStatus.Int()==KErrNone);
|
|
118 |
|
|
119 |
INFO_PRINTF1(_L("SetConfig GPRS with Additional Parameter Test Passed"));
|
|
120 |
|
|
121 |
TESTL(gprsContextNotify.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
122 |
TESTL(gprsContextNotify.iAnonymousAccessReqd==DPCKTTSY_ANONYMOUS_ACCESS1);
|
|
123 |
TESTL(gprsContextNotify.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
124 |
TESTL(gprsContextNotify.iPdpCompression==DPCKTTSY_COMPRESSION1);
|
|
125 |
TESTL(gprsContextNotify.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
126 |
TESTL(gprsContextNotify.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL1);
|
|
127 |
TESTL(gprsContextNotify.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME1);
|
|
128 |
TESTL(gprsContextNotify.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD1);
|
|
129 |
TESTL(gprsContextNotify.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE1);
|
|
130 |
TESTL(gprsContextNotify.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE1);
|
|
131 |
TESTL(gprsContextNotify.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER1);
|
|
132 |
TESTL(gprsContextNotify.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER1);
|
|
133 |
TESTL(gprsContextNotify.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID1);
|
|
134 |
gprsContextNotify.iProtocolConfigOption.iMiscBuffer.SetLength(miscBufferGprs_2.Length());
|
|
135 |
TESTL(gprsContextNotify.iProtocolConfigOption.iMiscBuffer == miscBufferGprs_2);
|
|
136 |
|
|
137 |
INFO_PRINTF1(_L("NotifyConfigChanged GPRS with Additional Parameter Test Passed"));
|
|
138 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.52"));
|
|
139 |
|
|
140 |
// Test GPRS RPacketContext::GetConfig with additional parameter
|
|
141 |
RPacketContext::TContextConfigGPRS gprsContextConfig_2;
|
|
142 |
TESTL(gprsContextConfig_2.ExtensionId()==TPacketDataConfigBase::KConfigGPRS);
|
|
143 |
TPckg<RPacketContext::TContextConfigGPRS> contextConfigPckgGPRS_2(gprsContextConfig_2);
|
|
144 |
|
|
145 |
iPacketContext.GetConfig(reqStatus, contextConfigPckgGPRS_2);
|
|
146 |
User::WaitForRequest(reqStatus);
|
|
147 |
TESTL(reqStatus.Int()==KErrNone);
|
|
148 |
TESTL(gprsContextConfig_2.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
149 |
TESTL(gprsContextConfig_2.iAnonymousAccessReqd==DPCKTTSY_ANONYMOUS_ACCESS1);
|
|
150 |
TESTL(gprsContextConfig_2.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
151 |
TESTL(gprsContextConfig_2.iPdpCompression==DPCKTTSY_COMPRESSION1);
|
|
152 |
TESTL(gprsContextConfig_2.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
153 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL1);
|
|
154 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME1);
|
|
155 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD1);
|
|
156 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE1);
|
|
157 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE1);
|
|
158 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER1);
|
|
159 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER1);
|
|
160 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID1);
|
|
161 |
gprsContextConfig_2.iProtocolConfigOption.iMiscBuffer.SetLength(miscBufferGprs_2.Length());
|
|
162 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iMiscBuffer == miscBufferGprs_2);
|
|
163 |
|
|
164 |
INFO_PRINTF1(_L("GetConfig GPRS with Additional Parameter Test Passed"));
|
|
165 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.53"));
|
|
166 |
|
|
167 |
|
|
168 |
// Clean up for next set of tests
|
|
169 |
iPacketContext.Close();
|
|
170 |
iPacketService.Close();
|
|
171 |
iPhone.Close();
|
|
172 |
|
|
173 |
// Test RPacketService::Open
|
|
174 |
ret = iPhone.Open(iTelServer,KPhoneName);
|
|
175 |
INFO_PRINTF2(_L("Result: %d"),ret);
|
|
176 |
TESTL(ret == KErrNone);
|
|
177 |
INFO_PRINTF1(_L("Opened phone object"));
|
|
178 |
|
|
179 |
TESTL(iPacketService.Open(iPhone)==KErrNone);
|
|
180 |
INFO_PRINTF1(_L("Opened packet object"));
|
|
181 |
|
|
182 |
// Test RPacketContext::OpenNewContext
|
|
183 |
TName rel4ContextName;
|
|
184 |
TName rel4ContextNameCompare;
|
|
185 |
|
|
186 |
TESTL(iPacketContext.OpenNewContext(iPacketService, rel4ContextName)==KErrNone);
|
|
187 |
rel4ContextNameCompare.Append(KSimPrimaryPacketContextName);
|
|
188 |
rel4ContextNameCompare.AppendNum(1);
|
|
189 |
TESTL(rel4ContextName.Compare(rel4ContextNameCompare)==KErrNone);
|
|
190 |
INFO_PRINTF1(_L("Opened R99_R4 context object"));
|
|
191 |
|
|
192 |
// Rel4_R99 RPacketContext::SetConfig and
|
|
193 |
// RPacketContext::NotifyConfigChanged
|
|
194 |
// when there is an additional parameter specified
|
|
195 |
RPacketContext::TContextConfigR99_R4 contextConfigRel4;
|
|
196 |
TESTL(contextConfigRel4.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4);
|
|
197 |
TPckg<RPacketContext::TContextConfigR99_R4> contextConfigRel4Pckg(contextConfigRel4);
|
|
198 |
|
|
199 |
RPacketContext::TContextConfigR99_R4 rel4ContextNotify;
|
|
200 |
TESTL(rel4ContextNotify.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4);
|
|
201 |
TPckg<RPacketContext::TContextConfigR99_R4> rel4ContextNotifyPckg(rel4ContextNotify);
|
|
202 |
|
|
203 |
contextConfigRel4.iAccessPointName = DPCKTTSY_ACCESS_POINT1;
|
|
204 |
contextConfigRel4.iPdpAddress = DPCKTTSY_PDP_ADDRESS1;
|
|
205 |
contextConfigRel4.iPdpType = DPCKTTSY_PDP_TYPE1;
|
|
206 |
contextConfigRel4.iUseEdge = DPCKTTSY_EGPRS_REQUIRED;
|
|
207 |
contextConfigRel4.iProtocolConfigOption.iAuthInfo.iProtocol = SIM_PACKET_CONTEXT_PROTOCOL2;
|
|
208 |
contextConfigRel4.iProtocolConfigOption.iAuthInfo.iUsername = SIM_PACKET_CONTEXT_USERNAME2;
|
|
209 |
contextConfigRel4.iProtocolConfigOption.iAuthInfo.iPassword = SIM_PACKET_CONTEXT_PASSWORD2;
|
|
210 |
contextConfigRel4.iProtocolConfigOption.iChallenge = SIM_PACKET_CONTEXT_CHALLENGE2;
|
|
211 |
contextConfigRel4.iProtocolConfigOption.iResponse = SIM_PACKET_CONTEXT_RESPONSE2;
|
|
212 |
contextConfigRel4.iProtocolConfigOption.iDnsAddresses.iPrimaryDns = SIM_PACKET_CONTEXT_PRIMARYSERVER2;
|
|
213 |
contextConfigRel4.iProtocolConfigOption.iDnsAddresses.iSecondaryDns = SIM_PACKET_CONTEXT_SECONDARYSERVER2;
|
|
214 |
contextConfigRel4.iProtocolConfigOption.iId = SIM_PACKET_CONTEXT_ID2;
|
|
215 |
|
|
216 |
TBuf8<R99_R4_CONTEXT_ADDITIONAL_PARAM_LEN> additionalParamDataR4_2(R99_R4_PACKET_CONTEXT_ADDITIONAL_PARAM);
|
|
217 |
additionalParamDataR4_2.SetLength(R99_R4_CONTEXT_ADDITIONAL_PARAM_LEN);
|
|
218 |
|
|
219 |
RPacketContext::TPcoId pcoIdR4_2(R99_R4_PACKET_CONTEXT_PCO_ID);
|
|
220 |
|
|
221 |
RPacketContext::TMiscProtocolBuffer miscBufferR4_2;
|
|
222 |
miscBufferR4_2.Zero();
|
|
223 |
|
|
224 |
TPtr8 pcoPtrR4_2(const_cast<TUint8*>(miscBufferR4_2.Ptr()),
|
|
225 |
RPacketContext::KMiscProtocolBufferLength);
|
|
226 |
|
|
227 |
TPtr8 additionalParamDataPtrR4_2(const_cast<TUint8*>(additionalParamDataR4_2.Ptr()),
|
|
228 |
additionalParamDataR4_2.Length(), additionalParamDataR4_2.Length());
|
|
229 |
|
|
230 |
// Attach TTlv to the buffer
|
|
231 |
TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> theTLVR4_2(pcoPtrR4_2,0);
|
|
232 |
|
|
233 |
theTLVR4_2.AppendItemL(pcoIdR4_2,additionalParamDataPtrR4_2);
|
|
234 |
|
|
235 |
miscBufferR4_2.SetLength(pcoPtrR4_2.Length());
|
|
236 |
|
|
237 |
contextConfigRel4.iProtocolConfigOption.iMiscBuffer = miscBufferR4_2;
|
|
238 |
|
|
239 |
iPacketContext.NotifyConfigChanged(notifyStatus, rel4ContextNotifyPckg);
|
|
240 |
iPacketContext.SetConfig(reqStatus, contextConfigRel4Pckg);
|
|
241 |
|
|
242 |
User::WaitForRequest(reqStatus);
|
|
243 |
User::WaitForRequest(notifyStatus);
|
|
244 |
|
|
245 |
TESTL(reqStatus.Int()==KErrNone);
|
|
246 |
TESTL(notifyStatus.Int()==KErrNone);
|
|
247 |
|
|
248 |
INFO_PRINTF1(_L("SetConfig Rel99_R4 with Additional Parameter Test Passed"));
|
|
249 |
|
|
250 |
TESTL(rel4ContextNotify.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
251 |
TESTL(rel4ContextNotify.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
252 |
TESTL(rel4ContextNotify.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
253 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL2);
|
|
254 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME2);
|
|
255 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD2);
|
|
256 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE2);
|
|
257 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE2);
|
|
258 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER2);
|
|
259 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER2);
|
|
260 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID2);
|
|
261 |
rel4ContextNotify.iProtocolConfigOption.iMiscBuffer.SetLength(miscBufferR4_2.Length());
|
|
262 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iMiscBuffer == miscBufferR4_2);
|
|
263 |
|
|
264 |
INFO_PRINTF1(_L("NotifyConfigChanged Rel99_R4 with Additional Parameter Test Passed"));
|
|
265 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.64"));
|
|
266 |
|
|
267 |
// Test R99_R4 RPacketContext::GetConfig with additional parameter
|
|
268 |
RPacketContext::TContextConfigR99_R4 contextConfigR99_R4;
|
|
269 |
TESTL(contextConfigR99_R4.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4);
|
|
270 |
TPckg<RPacketContext::TContextConfigR99_R4> contextConfigR99_R4Pckg(contextConfigR99_R4);
|
|
271 |
|
|
272 |
iPacketContext.GetConfig(reqStatus, contextConfigR99_R4Pckg);
|
|
273 |
User::WaitForRequest(reqStatus);
|
|
274 |
TESTL(reqStatus.Int()==KErrNone);
|
|
275 |
TESTL(contextConfigR99_R4.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
276 |
TESTL(contextConfigR99_R4.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
277 |
TESTL(contextConfigR99_R4.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
278 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL2);
|
|
279 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME2);
|
|
280 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD2);
|
|
281 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE2);
|
|
282 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE2);
|
|
283 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER2);
|
|
284 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER2);
|
|
285 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID2);
|
|
286 |
contextConfigR99_R4.iProtocolConfigOption.iMiscBuffer.SetLength(miscBufferR4_2.Length());
|
|
287 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iMiscBuffer == miscBufferR4_2);
|
|
288 |
INFO_PRINTF1(_L("GetConfig Rel99_R4 with Additional Parameter Test Passed"));
|
|
289 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.65"));
|
|
290 |
|
|
291 |
// Clear up
|
|
292 |
iPacketContext.Close();
|
|
293 |
iPacketService.Close();
|
|
294 |
iPhone.Close();
|
|
295 |
|
|
296 |
ASSERT(RThread().RequestCount()==0);
|
|
297 |
|
|
298 |
return TestStepResult();
|
|
299 |
}
|
|
300 |
|
|
301 |
CSimPacketAdditionalParamsTest2::CSimPacketAdditionalParamsTest2()
|
|
302 |
/**
|
|
303 |
Default constructor. Initialises the test step name.
|
|
304 |
*/
|
|
305 |
{
|
|
306 |
SetTestStepName(_L("AdditionalParamsContextTest2"));
|
|
307 |
}
|
|
308 |
|
|
309 |
TVerdict CSimPacketAdditionalParamsTest2::doTestStepL()
|
|
310 |
/**
|
|
311 |
The test step containing test cases for DEF082819 and DEF082817.
|
|
312 |
*/
|
|
313 |
{
|
|
314 |
INFO_PRINTF1(_L("BeginAdditionalParamsContextTest2"));
|
|
315 |
|
|
316 |
CreateConfigFileL(_L("c:\\config3.txt"));
|
|
317 |
SetTestNumberL(17);
|
|
318 |
|
|
319 |
INFO_PRINTF1(_L("RPacketService Functionality"));
|
|
320 |
|
|
321 |
// Test RPacketService::Open
|
|
322 |
TInt ret = iPhone.Open(iTelServer,KPhoneName);
|
|
323 |
INFO_PRINTF2(_L("Result: %d"),ret);
|
|
324 |
TESTL(ret == KErrNone);
|
|
325 |
INFO_PRINTF1(_L("Opened phone object"));
|
|
326 |
|
|
327 |
TESTL(iPacketService.Open(iPhone)==KErrNone);
|
|
328 |
INFO_PRINTF1(_L("Opened packet object"));
|
|
329 |
|
|
330 |
// Test RPacketContext::OpenNewContext
|
|
331 |
TName gprsContextName;
|
|
332 |
TName gprsContextNameCompare;
|
|
333 |
TESTL(iPacketContext.OpenNewContext(iPacketService, gprsContextName)==KErrNone);
|
|
334 |
gprsContextNameCompare.Append(KSimPrimaryPacketContextName);
|
|
335 |
gprsContextNameCompare.AppendNum(1);
|
|
336 |
TESTL(gprsContextName.Compare(gprsContextNameCompare)==KErrNone);
|
|
337 |
INFO_PRINTF1(_L("Opened GPRS Context object"));
|
|
338 |
|
|
339 |
TRequestStatus reqStatus, notifyStatus;
|
|
340 |
|
|
341 |
// Test GPRS RPacketService::SetDefaultContextParams
|
|
342 |
// When no additional params are specified
|
|
343 |
RPacketContext::TContextConfigGPRS defaultConfigGPRS_3;
|
|
344 |
TPckg<RPacketContext::TContextConfigGPRS> defaultConfigPckgGPRS_3(defaultConfigGPRS_3);
|
|
345 |
|
|
346 |
defaultConfigGPRS_3.iAccessPointName = DPCKTTSY_ACCESS_POINT1;
|
|
347 |
defaultConfigGPRS_3.iAnonymousAccessReqd = DPCKTTSY_ANONYMOUS_ACCESS1;
|
|
348 |
defaultConfigGPRS_3.iPdpAddress = DPCKTTSY_PDP_ADDRESS1;
|
|
349 |
defaultConfigGPRS_3.iPdpCompression = DPCKTTSY_COMPRESSION1;
|
|
350 |
defaultConfigGPRS_3.iPdpType = DPCKTTSY_PDP_TYPE1;
|
|
351 |
defaultConfigGPRS_3.iUseEdge = DPCKTTSY_EGPRS_REQUIRED;
|
|
352 |
defaultConfigGPRS_3.iProtocolConfigOption.iAuthInfo.iProtocol = SIM_PACKET_CONTEXT_PROTOCOL1;
|
|
353 |
defaultConfigGPRS_3.iProtocolConfigOption.iAuthInfo.iUsername = SIM_PACKET_CONTEXT_USERNAME1;
|
|
354 |
defaultConfigGPRS_3.iProtocolConfigOption.iAuthInfo.iPassword = SIM_PACKET_CONTEXT_PASSWORD1;
|
|
355 |
defaultConfigGPRS_3.iProtocolConfigOption.iChallenge = SIM_PACKET_CONTEXT_CHALLENGE1;
|
|
356 |
defaultConfigGPRS_3.iProtocolConfigOption.iResponse = SIM_PACKET_CONTEXT_RESPONSE1;
|
|
357 |
defaultConfigGPRS_3.iProtocolConfigOption.iDnsAddresses.iPrimaryDns = SIM_PACKET_CONTEXT_PRIMARYSERVER1;
|
|
358 |
defaultConfigGPRS_3.iProtocolConfigOption.iDnsAddresses.iSecondaryDns = SIM_PACKET_CONTEXT_SECONDARYSERVER1;
|
|
359 |
defaultConfigGPRS_3.iProtocolConfigOption.iId = SIM_PACKET_CONTEXT_ID1;
|
|
360 |
|
|
361 |
TESTL(iPacketService.SetDefaultContextParams(defaultConfigPckgGPRS_3) == KErrNone);
|
|
362 |
INFO_PRINTF1(_L("SetDefault Params GPRS when no additional params specified test Passed"));
|
|
363 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.54"));
|
|
364 |
|
|
365 |
// Test GPRS RPacketService::GetDefaultContextParams
|
|
366 |
// when there are no additional parameters
|
|
367 |
RPacketContext::TContextConfigGPRS defaultConfigGPRS_4;
|
|
368 |
TPckg<RPacketContext::TContextConfigGPRS> defaultConfigPckgGPRS_4(defaultConfigGPRS_4);
|
|
369 |
TESTL(iPacketService.GetDefaultContextParams(defaultConfigPckgGPRS_4) == KErrNone);
|
|
370 |
TESTL(defaultConfigGPRS_4.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
371 |
TESTL(defaultConfigGPRS_4.iAnonymousAccessReqd==DPCKTTSY_ANONYMOUS_ACCESS1);
|
|
372 |
TESTL(defaultConfigGPRS_4.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
373 |
TESTL(defaultConfigGPRS_4.iPdpCompression==DPCKTTSY_COMPRESSION1);
|
|
374 |
TESTL(defaultConfigGPRS_4.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
375 |
TESTL(defaultConfigGPRS_4.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL1);
|
|
376 |
TESTL(defaultConfigGPRS_4.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME1);
|
|
377 |
TESTL(defaultConfigGPRS_4.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD1);
|
|
378 |
TESTL(defaultConfigGPRS_4.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE1);
|
|
379 |
TESTL(defaultConfigGPRS_4.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE1);
|
|
380 |
TESTL(defaultConfigGPRS_4.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER1);
|
|
381 |
TESTL(defaultConfigGPRS_4.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER1);
|
|
382 |
TESTL(defaultConfigGPRS_4.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID1);
|
|
383 |
INFO_PRINTF1(_L("GetDefault Params GPRS where there are no additional params test Passed"));
|
|
384 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.55"));
|
|
385 |
|
|
386 |
// Test R5 RPacketService::SetDefaultContextParams
|
|
387 |
// When no additional params are specified
|
|
388 |
RPacketContext::TContextConfig_R5 defaultConfigR5_3;
|
|
389 |
TPckg<RPacketContext::TContextConfig_R5> defaultConfigPckgR5_3(defaultConfigR5_3);
|
|
390 |
|
|
391 |
defaultConfigR5_3.iAccessPointName = R5_CONTEXT_GGSN;
|
|
392 |
defaultConfigR5_3.iPdpAddress = R5_CONTEXT_PDP_ADDRESS;
|
|
393 |
defaultConfigR5_3.iPdpType = R5_CONTEXT_PROTOCOL;
|
|
394 |
defaultConfigR5_3.iUseEdge = R5_CONTEXT_USE_EDGE;
|
|
395 |
defaultConfigR5_3.iProtocolConfigOption.iAuthInfo.iProtocol = R5_CONTEXT_AUTH_PROT;
|
|
396 |
defaultConfigR5_3.iProtocolConfigOption.iAuthInfo.iUsername = R5_CONTEXT_USERNAME;
|
|
397 |
defaultConfigR5_3.iProtocolConfigOption.iAuthInfo.iPassword = R5_CONTEXT_PASSWORD;
|
|
398 |
defaultConfigR5_3.iProtocolConfigOption.iChallenge = R5_CONTEXT_CHALLENGE;
|
|
399 |
defaultConfigR5_3.iProtocolConfigOption.iResponse = R5_CONTEXT_RESPONSE;
|
|
400 |
defaultConfigR5_3.iProtocolConfigOption.iDnsAddresses.iPrimaryDns = R5_CONTEXT_DNS1;
|
|
401 |
defaultConfigR5_3.iProtocolConfigOption.iDnsAddresses.iSecondaryDns = R5_CONTEXT_DNS2;
|
|
402 |
defaultConfigR5_3.iProtocolConfigOption.iId = R5_CONTEXT_ID;
|
|
403 |
defaultConfigR5_3.iPdpHeaderCompression = R5_CONTEXT_HEADER_COMPRESSION;
|
|
404 |
defaultConfigR5_3.iPdpDataCompression = R5_CONTEXT_DATA_COMPRESSION;
|
|
405 |
|
|
406 |
ret = iPacketService.SetDefaultContextParams(defaultConfigPckgR5_3);
|
|
407 |
|
|
408 |
INFO_PRINTF1(_L("SetDefault Params R5 when there are no additional params test Passed"));
|
|
409 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.56"));
|
|
410 |
|
|
411 |
// Test R5 RPacketService::GetDefaultContextParams
|
|
412 |
// when there are no additional params
|
|
413 |
RPacketContext::TContextConfig_R5 defaultConfigR5_4;
|
|
414 |
TPckg<RPacketContext::TContextConfig_R5> defaultConfigPckgR5_4(defaultConfigR5_4);
|
|
415 |
|
|
416 |
ret = iPacketService.GetDefaultContextParams(defaultConfigPckgR5_4);
|
|
417 |
|
|
418 |
TESTL(defaultConfigR5_4.iAccessPointName == R5_CONTEXT_GGSN);
|
|
419 |
TESTL(defaultConfigR5_4.iPdpAddress == R5_CONTEXT_PDP_ADDRESS);
|
|
420 |
TESTL(defaultConfigR5_4.iPdpType == R5_CONTEXT_PROTOCOL);
|
|
421 |
TESTL(defaultConfigR5_4.iUseEdge == R5_CONTEXT_USE_EDGE);
|
|
422 |
TESTL(defaultConfigR5_4.iProtocolConfigOption.iAuthInfo.iProtocol == R5_CONTEXT_AUTH_PROT);
|
|
423 |
TESTL(defaultConfigR5_4.iProtocolConfigOption.iAuthInfo.iUsername == R5_CONTEXT_USERNAME);
|
|
424 |
TESTL(defaultConfigR5_4.iProtocolConfigOption.iAuthInfo.iPassword == R5_CONTEXT_PASSWORD);
|
|
425 |
TESTL(defaultConfigR5_4.iProtocolConfigOption.iChallenge == R5_CONTEXT_CHALLENGE);
|
|
426 |
TESTL(defaultConfigR5_4.iProtocolConfigOption.iResponse == R5_CONTEXT_RESPONSE);
|
|
427 |
TESTL(defaultConfigR5_4.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == R5_CONTEXT_DNS1);
|
|
428 |
TESTL(defaultConfigR5_4.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == R5_CONTEXT_DNS2);
|
|
429 |
TESTL(defaultConfigR5_4.iProtocolConfigOption.iId == R5_CONTEXT_ID);
|
|
430 |
TESTL(defaultConfigR5_4.iPdpHeaderCompression == R5_CONTEXT_HEADER_COMPRESSION);
|
|
431 |
TESTL(defaultConfigR5_4.iPdpDataCompression == R5_CONTEXT_DATA_COMPRESSION);
|
|
432 |
INFO_PRINTF1(_L("GetDefault Params R5 with no additional params test Passed"));
|
|
433 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.57"));
|
|
434 |
|
|
435 |
// Test UMTS RPacketService::GetDefaultContextParams
|
|
436 |
// when no additional parameters are specified.
|
|
437 |
|
|
438 |
RPacketContext::TContextConfigR99_R4 defaultConfigR99_R4_3;
|
|
439 |
TPckg<RPacketContext::TContextConfigR99_R4> defaultConfigPckgR99_R4_3(defaultConfigR99_R4_3);
|
|
440 |
|
|
441 |
defaultConfigR99_R4_3.iAccessPointName = DPCKTTSY_ACCESS_POINT1;
|
|
442 |
defaultConfigR99_R4_3.iPdpAddress = DPCKTTSY_PDP_ADDRESS1;
|
|
443 |
defaultConfigR99_R4_3.iPdpType = DPCKTTSY_PDP_TYPE1;
|
|
444 |
defaultConfigR99_R4_3.iUseEdge = DPCKTTSY_EGPRS_REQUIRED;
|
|
445 |
defaultConfigR99_R4_3.iProtocolConfigOption.iAuthInfo.iProtocol = SIM_PACKET_CONTEXT_PROTOCOL2;
|
|
446 |
defaultConfigR99_R4_3.iProtocolConfigOption.iAuthInfo.iUsername = SIM_PACKET_CONTEXT_USERNAME2;
|
|
447 |
defaultConfigR99_R4_3.iProtocolConfigOption.iAuthInfo.iPassword = SIM_PACKET_CONTEXT_PASSWORD2;
|
|
448 |
defaultConfigR99_R4_3.iProtocolConfigOption.iChallenge = SIM_PACKET_CONTEXT_CHALLENGE2;
|
|
449 |
defaultConfigR99_R4_3.iProtocolConfigOption.iResponse = SIM_PACKET_CONTEXT_RESPONSE2;
|
|
450 |
defaultConfigR99_R4_3.iProtocolConfigOption.iDnsAddresses.iPrimaryDns = SIM_PACKET_CONTEXT_PRIMARYSERVER2;
|
|
451 |
defaultConfigR99_R4_3.iProtocolConfigOption.iDnsAddresses.iSecondaryDns = SIM_PACKET_CONTEXT_SECONDARYSERVER2;
|
|
452 |
defaultConfigR99_R4_3.iProtocolConfigOption.iId = SIM_PACKET_CONTEXT_ID2;
|
|
453 |
|
|
454 |
TESTL(iPacketService.SetDefaultContextParams(defaultConfigPckgR99_R4_3) == KErrNone);
|
|
455 |
INFO_PRINTF1(_L("SetDefault Params R99_R4 with no additional params test Passed"));
|
|
456 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.58"));
|
|
457 |
|
|
458 |
// Test RPacketService::GetDefaultContextParams
|
|
459 |
RPacketContext::TContextConfigR99_R4 defaultConfigR99_R4_4;
|
|
460 |
TPckg<RPacketContext::TContextConfigR99_R4> defaultConfigPckgR99_R4_4(defaultConfigR99_R4_4);
|
|
461 |
|
|
462 |
TESTL(iPacketService.GetDefaultContextParams(defaultConfigPckgR99_R4_4) == KErrNone);
|
|
463 |
TESTL(defaultConfigR99_R4_4.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
464 |
TESTL(defaultConfigR99_R4_4.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
465 |
TESTL(defaultConfigR99_R4_4.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
466 |
TESTL(defaultConfigR99_R4_4.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL2);
|
|
467 |
TESTL(defaultConfigR99_R4_4.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME2);
|
|
468 |
TESTL(defaultConfigR99_R4_4.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD2);
|
|
469 |
TESTL(defaultConfigR99_R4_4.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE2);
|
|
470 |
TESTL(defaultConfigR99_R4_4.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE2);
|
|
471 |
TESTL(defaultConfigR99_R4_4.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER2);
|
|
472 |
TESTL(defaultConfigR99_R4_4.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER2);
|
|
473 |
TESTL(defaultConfigR99_R4_4.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID2);
|
|
474 |
|
|
475 |
INFO_PRINTF1(_L("GetDefault Params R99_R4 with no additional params test Passed"));
|
|
476 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.59"));
|
|
477 |
|
|
478 |
// Clear up
|
|
479 |
iPacketContext.Close();
|
|
480 |
iPacketService.Close();
|
|
481 |
iPhone.Close();
|
|
482 |
|
|
483 |
ASSERT(RThread().RequestCount()==0);
|
|
484 |
|
|
485 |
return TestStepResult();
|
|
486 |
}
|
|
487 |
|
|
488 |
CSimPacketAdditionalParamsTest3::CSimPacketAdditionalParamsTest3()
|
|
489 |
/**
|
|
490 |
Default constructor. Initialises the test step name.
|
|
491 |
*/
|
|
492 |
{
|
|
493 |
SetTestStepName(_L("AdditionalParamsContextTest3"));
|
|
494 |
}
|
|
495 |
|
|
496 |
TVerdict CSimPacketAdditionalParamsTest3::doTestStepL()
|
|
497 |
/**
|
|
498 |
The test step containing test cases for DEF082819 and DEF082817.
|
|
499 |
*/
|
|
500 |
{
|
|
501 |
INFO_PRINTF1(_L("BeginAdditionalParamsContextTest3"));
|
|
502 |
|
|
503 |
CreateConfigFileL(_L("c:\\config3.txt"));
|
|
504 |
SetTestNumberL(17);
|
|
505 |
|
|
506 |
INFO_PRINTF1(_L("RPacketService Functionality"));
|
|
507 |
|
|
508 |
// Test RPacketService::Open
|
|
509 |
TInt ret = iPhone.Open(iTelServer,KPhoneName);
|
|
510 |
INFO_PRINTF2(_L("Result: %d"),ret);
|
|
511 |
TESTL(ret == KErrNone);
|
|
512 |
INFO_PRINTF1(_L("Opened phone object"));
|
|
513 |
|
|
514 |
TESTL(iPacketService.Open(iPhone)==KErrNone);
|
|
515 |
INFO_PRINTF1(_L("Opened packet object"));
|
|
516 |
|
|
517 |
// Test RPacketContext::OpenNewContext
|
|
518 |
TName gprsContextName;
|
|
519 |
TName gprsContextNameCompare;
|
|
520 |
TESTL(iPacketContext.OpenNewContext(iPacketService, gprsContextName)==KErrNone);
|
|
521 |
gprsContextNameCompare.Append(KSimPrimaryPacketContextName);
|
|
522 |
gprsContextNameCompare.AppendNum(1);
|
|
523 |
TESTL(gprsContextName.Compare(gprsContextNameCompare)==KErrNone);
|
|
524 |
INFO_PRINTF1(_L("Opened GPRS Context object"));
|
|
525 |
|
|
526 |
TRequestStatus reqStatus, notifyStatus;
|
|
527 |
|
|
528 |
// GPRS RPacketContext::SetConfig and
|
|
529 |
// RPacketContext::NotifyConfigChanged
|
|
530 |
// when there are no additional parameters specified
|
|
531 |
RPacketContext::TContextConfigGPRS gprsContextConfig_3;
|
|
532 |
TESTL(gprsContextConfig_3.ExtensionId()==TPacketDataConfigBase::KConfigGPRS);
|
|
533 |
TPckg<RPacketContext::TContextConfigGPRS> contextConfigPckgGPRS_3(gprsContextConfig_3);
|
|
534 |
|
|
535 |
RPacketContext::TContextConfigGPRS gprsContextNotify_3;
|
|
536 |
TESTL(gprsContextNotify_3.ExtensionId()==TPacketDataConfigBase::KConfigGPRS);
|
|
537 |
TPckg<RPacketContext::TContextConfigGPRS> contextNotifyPckgGPRS_3(gprsContextNotify_3);
|
|
538 |
|
|
539 |
gprsContextConfig_3.iAccessPointName = DPCKTTSY_ACCESS_POINT1;
|
|
540 |
gprsContextConfig_3.iAnonymousAccessReqd = DPCKTTSY_ANONYMOUS_ACCESS1;
|
|
541 |
gprsContextConfig_3.iPdpAddress = DPCKTTSY_PDP_ADDRESS1;
|
|
542 |
gprsContextConfig_3.iPdpCompression = DPCKTTSY_COMPRESSION1;
|
|
543 |
gprsContextConfig_3.iPdpType = DPCKTTSY_PDP_TYPE1;
|
|
544 |
gprsContextConfig_3.iUseEdge = DPCKTTSY_EGPRS_REQUIRED;
|
|
545 |
gprsContextConfig_3.iProtocolConfigOption.iAuthInfo.iProtocol = SIM_PACKET_CONTEXT_PROTOCOL1;
|
|
546 |
gprsContextConfig_3.iProtocolConfigOption.iAuthInfo.iUsername = SIM_PACKET_CONTEXT_USERNAME1;
|
|
547 |
gprsContextConfig_3.iProtocolConfigOption.iAuthInfo.iPassword = SIM_PACKET_CONTEXT_PASSWORD1;
|
|
548 |
gprsContextConfig_3.iProtocolConfigOption.iChallenge = SIM_PACKET_CONTEXT_CHALLENGE1;
|
|
549 |
gprsContextConfig_3.iProtocolConfigOption.iResponse = SIM_PACKET_CONTEXT_RESPONSE1;
|
|
550 |
gprsContextConfig_3.iProtocolConfigOption.iDnsAddresses.iPrimaryDns = SIM_PACKET_CONTEXT_PRIMARYSERVER1;
|
|
551 |
gprsContextConfig_3.iProtocolConfigOption.iDnsAddresses.iSecondaryDns = SIM_PACKET_CONTEXT_SECONDARYSERVER1;
|
|
552 |
gprsContextConfig_3.iProtocolConfigOption.iId = SIM_PACKET_CONTEXT_ID1;
|
|
553 |
|
|
554 |
iPacketContext.NotifyConfigChanged(notifyStatus, contextNotifyPckgGPRS_3);
|
|
555 |
iPacketContext.SetConfig(reqStatus, contextConfigPckgGPRS_3);
|
|
556 |
|
|
557 |
User::WaitForRequest(notifyStatus);
|
|
558 |
User::WaitForRequest(reqStatus);
|
|
559 |
TESTL(reqStatus.Int()==KErrNone);
|
|
560 |
TESTL(notifyStatus.Int()==KErrNone);
|
|
561 |
|
|
562 |
INFO_PRINTF1(_L("SetConfig GPRS with no Additional Parameter Test Passed"));
|
|
563 |
|
|
564 |
TESTL(gprsContextNotify_3.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
565 |
TESTL(gprsContextNotify_3.iAnonymousAccessReqd==DPCKTTSY_ANONYMOUS_ACCESS1);
|
|
566 |
TESTL(gprsContextNotify_3.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
567 |
TESTL(gprsContextNotify_3.iPdpCompression==DPCKTTSY_COMPRESSION1);
|
|
568 |
TESTL(gprsContextNotify_3.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
569 |
TESTL(gprsContextNotify_3.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL1);
|
|
570 |
TESTL(gprsContextNotify_3.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME1);
|
|
571 |
TESTL(gprsContextNotify_3.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD1);
|
|
572 |
TESTL(gprsContextNotify_3.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE1);
|
|
573 |
TESTL(gprsContextNotify_3.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE1);
|
|
574 |
TESTL(gprsContextNotify_3.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER1);
|
|
575 |
TESTL(gprsContextNotify_3.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER1);
|
|
576 |
TESTL(gprsContextNotify_3.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID1);
|
|
577 |
|
|
578 |
INFO_PRINTF1(_L("NotifyConfigChanged GPRS with no Additional Parameter Test Passed"));
|
|
579 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.60"));
|
|
580 |
|
|
581 |
// Test GPRS RPacketContext::GetConfig with no additional parameter
|
|
582 |
RPacketContext::TContextConfigGPRS gprsContextConfig_4;
|
|
583 |
TESTL(gprsContextConfig_4.ExtensionId()==TPacketDataConfigBase::KConfigGPRS);
|
|
584 |
TPckg<RPacketContext::TContextConfigGPRS> contextConfigPckgGPRS_4(gprsContextConfig_4);
|
|
585 |
|
|
586 |
iPacketContext.GetConfig(reqStatus, contextConfigPckgGPRS_4);
|
|
587 |
User::WaitForRequest(reqStatus);
|
|
588 |
TESTL(reqStatus.Int()==KErrNone);
|
|
589 |
TESTL(gprsContextConfig_4.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
590 |
TESTL(gprsContextConfig_4.iAnonymousAccessReqd==DPCKTTSY_ANONYMOUS_ACCESS1);
|
|
591 |
TESTL(gprsContextConfig_4.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
592 |
TESTL(gprsContextConfig_4.iPdpCompression==DPCKTTSY_COMPRESSION1);
|
|
593 |
TESTL(gprsContextConfig_4.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
594 |
TESTL(gprsContextConfig_4.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL1);
|
|
595 |
TESTL(gprsContextConfig_4.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME1);
|
|
596 |
TESTL(gprsContextConfig_4.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD1);
|
|
597 |
TESTL(gprsContextConfig_4.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE1);
|
|
598 |
TESTL(gprsContextConfig_4.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE1);
|
|
599 |
TESTL(gprsContextConfig_4.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER1);
|
|
600 |
TESTL(gprsContextConfig_4.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER1);
|
|
601 |
TESTL(gprsContextConfig_4.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID1);
|
|
602 |
|
|
603 |
INFO_PRINTF1(_L("GetConfig GPRS with no Additional Parameter Test Passed"));
|
|
604 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.61"));
|
|
605 |
|
|
606 |
// Clear up
|
|
607 |
iPacketContext.Close();
|
|
608 |
iPacketService.Close();
|
|
609 |
iPhone.Close();
|
|
610 |
|
|
611 |
// Test RPacketService::Open
|
|
612 |
ret = iPhone.Open(iTelServer,KPhoneName);
|
|
613 |
INFO_PRINTF2(_L("Result: %d"),ret);
|
|
614 |
TESTL(ret == KErrNone);
|
|
615 |
INFO_PRINTF1(_L("Opened phone object"));
|
|
616 |
|
|
617 |
TESTL(iPacketService.Open(iPhone)==KErrNone);
|
|
618 |
INFO_PRINTF1(_L("Opened packet object"));
|
|
619 |
|
|
620 |
// Test RPacketContext::OpenNewContext
|
|
621 |
TName rel4ContextName;
|
|
622 |
TName rel4ContextNameCompare;
|
|
623 |
|
|
624 |
TESTL(iPacketContext.OpenNewContext(iPacketService, rel4ContextName)==KErrNone);
|
|
625 |
rel4ContextNameCompare.Append(KSimPrimaryPacketContextName);
|
|
626 |
rel4ContextNameCompare.AppendNum(1);
|
|
627 |
TESTL(rel4ContextName.Compare(rel4ContextNameCompare)==KErrNone);
|
|
628 |
INFO_PRINTF1(_L("Opened R99_R4 context object"));
|
|
629 |
|
|
630 |
// R99_R4 RPacketContext::SetConfig and
|
|
631 |
// RPacketContext::NotifyConfigChanged
|
|
632 |
// when there is an additional parameter specified
|
|
633 |
RPacketContext::TContextConfigR99_R4 contextConfigR99_R4_2;
|
|
634 |
TPckg<RPacketContext::TContextConfigR99_R4> contextConfigPckgR99_R4_2(contextConfigR99_R4_2);
|
|
635 |
|
|
636 |
RPacketContext::TContextConfigR99_R4 contextConfigNotifyR99_R4_2;
|
|
637 |
TESTL(contextConfigNotifyR99_R4_2.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4);
|
|
638 |
TPckg<RPacketContext::TContextConfigR99_R4> contextConfigNotifyPckgR99_R4_2(contextConfigNotifyR99_R4_2);
|
|
639 |
|
|
640 |
contextConfigR99_R4_2.iAccessPointName = DPCKTTSY_ACCESS_POINT1;
|
|
641 |
contextConfigR99_R4_2.iPdpAddress = DPCKTTSY_PDP_ADDRESS1;
|
|
642 |
contextConfigR99_R4_2.iPdpType = DPCKTTSY_PDP_TYPE1;
|
|
643 |
contextConfigR99_R4_2.iUseEdge = DPCKTTSY_EGPRS_REQUIRED;
|
|
644 |
contextConfigR99_R4_2.iProtocolConfigOption.iAuthInfo.iProtocol = SIM_PACKET_CONTEXT_PROTOCOL2;
|
|
645 |
contextConfigR99_R4_2.iProtocolConfigOption.iAuthInfo.iUsername = SIM_PACKET_CONTEXT_USERNAME2;
|
|
646 |
contextConfigR99_R4_2.iProtocolConfigOption.iAuthInfo.iPassword = SIM_PACKET_CONTEXT_PASSWORD2;
|
|
647 |
contextConfigR99_R4_2.iProtocolConfigOption.iChallenge = SIM_PACKET_CONTEXT_CHALLENGE2;
|
|
648 |
contextConfigR99_R4_2.iProtocolConfigOption.iResponse = SIM_PACKET_CONTEXT_RESPONSE2;
|
|
649 |
contextConfigR99_R4_2.iProtocolConfigOption.iDnsAddresses.iPrimaryDns = SIM_PACKET_CONTEXT_PRIMARYSERVER2;
|
|
650 |
contextConfigR99_R4_2.iProtocolConfigOption.iDnsAddresses.iSecondaryDns = SIM_PACKET_CONTEXT_SECONDARYSERVER2;
|
|
651 |
contextConfigR99_R4_2.iProtocolConfigOption.iId = SIM_PACKET_CONTEXT_ID2;
|
|
652 |
|
|
653 |
iPacketContext.NotifyConfigChanged(notifyStatus, contextConfigNotifyPckgR99_R4_2);
|
|
654 |
iPacketContext.SetConfig(reqStatus, contextConfigPckgR99_R4_2);
|
|
655 |
|
|
656 |
User::WaitForRequest(notifyStatus);
|
|
657 |
User::WaitForRequest(reqStatus);
|
|
658 |
TESTL(reqStatus.Int()==KErrNone);
|
|
659 |
TESTL(notifyStatus.Int()==KErrNone);
|
|
660 |
|
|
661 |
INFO_PRINTF1(_L("SetConfig Rel99_R4 with no Additional Parameter Test Passed"));
|
|
662 |
|
|
663 |
TESTL(contextConfigNotifyR99_R4_2.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
664 |
TESTL(contextConfigNotifyR99_R4_2.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
665 |
TESTL(contextConfigNotifyR99_R4_2.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
666 |
TESTL(contextConfigNotifyR99_R4_2.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL2);
|
|
667 |
TESTL(contextConfigNotifyR99_R4_2.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME2);
|
|
668 |
TESTL(contextConfigNotifyR99_R4_2.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD2);
|
|
669 |
TESTL(contextConfigNotifyR99_R4_2.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE2);
|
|
670 |
TESTL(contextConfigNotifyR99_R4_2.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE2);
|
|
671 |
TESTL(contextConfigNotifyR99_R4_2.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER2);
|
|
672 |
TESTL(contextConfigNotifyR99_R4_2.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER2);
|
|
673 |
TESTL(contextConfigNotifyR99_R4_2.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID2);
|
|
674 |
INFO_PRINTF1(_L("NotifyConfigChanged Rel99_R4 with no Additional Parameter Test Passed"));
|
|
675 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.62"));
|
|
676 |
|
|
677 |
// Test R99_R4 RPacketContext::GetConfig with no additional parameter
|
|
678 |
RPacketContext::TContextConfigR99_R4 contextConfigR99_R4_3;
|
|
679 |
TESTL(contextConfigR99_R4_2.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4);
|
|
680 |
TPckg<RPacketContext::TContextConfigR99_R4> contextConfigR99_R4Pckg_2(contextConfigR99_R4_3);
|
|
681 |
|
|
682 |
iPacketContext.GetConfig(reqStatus, contextConfigR99_R4Pckg_2);
|
|
683 |
User::WaitForRequest(reqStatus);
|
|
684 |
TESTL(reqStatus.Int()==KErrNone);
|
|
685 |
TESTL(contextConfigR99_R4_3.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
686 |
TESTL(contextConfigR99_R4_3.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
687 |
TESTL(contextConfigR99_R4_3.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
688 |
TESTL(contextConfigR99_R4_3.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL2);
|
|
689 |
TESTL(contextConfigR99_R4_3.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME2);
|
|
690 |
TESTL(contextConfigR99_R4_3.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD2);
|
|
691 |
TESTL(contextConfigR99_R4_3.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE2);
|
|
692 |
TESTL(contextConfigR99_R4_3.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE2);
|
|
693 |
TESTL(contextConfigR99_R4_3.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER2);
|
|
694 |
TESTL(contextConfigR99_R4_3.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER2);
|
|
695 |
TESTL(contextConfigR99_R4_3.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID2);
|
|
696 |
INFO_PRINTF1(_L("GetConfig Rel99_R4 with no Additional Parameter Test Passed"));
|
|
697 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.63"));
|
|
698 |
|
|
699 |
// Clear up
|
|
700 |
iPacketContext.Close();
|
|
701 |
iPacketService.Close();
|
|
702 |
iPhone.Close();
|
|
703 |
|
|
704 |
ASSERT(RThread().RequestCount()==0);
|
|
705 |
|
|
706 |
return TestStepResult();
|
|
707 |
}
|
|
708 |
|
|
709 |
CSimPacketDefaultAdditionalParamsTest::CSimPacketDefaultAdditionalParamsTest()
|
|
710 |
/**
|
|
711 |
Default constructor. Initialises the test step name.
|
|
712 |
*/
|
|
713 |
{
|
|
714 |
SetTestStepName(_L("DefaultAdditionalParamsContextTest"));
|
|
715 |
}
|
|
716 |
|
|
717 |
TVerdict CSimPacketDefaultAdditionalParamsTest::doTestStepL()
|
|
718 |
/**
|
|
719 |
The test step containing test cases for DEF082819 and DEF082817.
|
|
720 |
*/
|
|
721 |
{
|
|
722 |
INFO_PRINTF1(_L("BeginDefaultAdditionalParamsContextTest"));
|
|
723 |
|
|
724 |
CreateConfigFileL(_L("c:\\config3.txt"));
|
|
725 |
SetTestNumberL(16);
|
|
726 |
|
|
727 |
INFO_PRINTF1(_L("RPacketService Functionality"));
|
|
728 |
|
|
729 |
// Test RPacketService::Open
|
|
730 |
TInt ret = iPhone.Open(iTelServer,KPhoneName);
|
|
731 |
INFO_PRINTF2(_L("Result: %d"),ret);
|
|
732 |
TESTL(ret == KErrNone);
|
|
733 |
INFO_PRINTF1(_L("Opened phone object"));
|
|
734 |
|
|
735 |
TESTL(iPacketService.Open(iPhone)==KErrNone);
|
|
736 |
INFO_PRINTF1(_L("Opened packet object"));
|
|
737 |
|
|
738 |
// Test RPacketContext::OpenNewContext
|
|
739 |
TName gprsContextName;
|
|
740 |
TName gprsContextNameCompare;
|
|
741 |
TESTL(iPacketContext.OpenNewContext(iPacketService, gprsContextName)==KErrNone);
|
|
742 |
gprsContextNameCompare.Append(KSimPrimaryPacketContextName);
|
|
743 |
gprsContextNameCompare.AppendNum(1);
|
|
744 |
TESTL(gprsContextName.Compare(gprsContextNameCompare)==KErrNone);
|
|
745 |
INFO_PRINTF1(_L("Opened GPRS Context object"));
|
|
746 |
|
|
747 |
TRequestStatus reqStatus, notifyStatus;
|
|
748 |
|
|
749 |
// Test GPRS RPacketService::SetDefaultContextParams
|
|
750 |
// When additional params are specified
|
|
751 |
RPacketContext::TContextConfigGPRS defaultConfigGPRS;
|
|
752 |
TPckg<RPacketContext::TContextConfigGPRS> defaultConfigPckgGPRS(defaultConfigGPRS);
|
|
753 |
|
|
754 |
defaultConfigGPRS.iAccessPointName = DPCKTTSY_ACCESS_POINT1;
|
|
755 |
defaultConfigGPRS.iAnonymousAccessReqd = DPCKTTSY_ANONYMOUS_ACCESS1;
|
|
756 |
defaultConfigGPRS.iPdpAddress = DPCKTTSY_PDP_ADDRESS1;
|
|
757 |
defaultConfigGPRS.iPdpCompression = DPCKTTSY_COMPRESSION1;
|
|
758 |
defaultConfigGPRS.iPdpType = DPCKTTSY_PDP_TYPE1;
|
|
759 |
defaultConfigGPRS.iUseEdge = DPCKTTSY_EGPRS_REQUIRED;
|
|
760 |
defaultConfigGPRS.iProtocolConfigOption.iAuthInfo.iProtocol = SIM_PACKET_CONTEXT_PROTOCOL1;
|
|
761 |
defaultConfigGPRS.iProtocolConfigOption.iAuthInfo.iUsername = SIM_PACKET_CONTEXT_USERNAME1;
|
|
762 |
defaultConfigGPRS.iProtocolConfigOption.iAuthInfo.iPassword = SIM_PACKET_CONTEXT_PASSWORD1;
|
|
763 |
defaultConfigGPRS.iProtocolConfigOption.iChallenge = SIM_PACKET_CONTEXT_CHALLENGE1;
|
|
764 |
defaultConfigGPRS.iProtocolConfigOption.iResponse = SIM_PACKET_CONTEXT_RESPONSE1;
|
|
765 |
defaultConfigGPRS.iProtocolConfigOption.iDnsAddresses.iPrimaryDns = SIM_PACKET_CONTEXT_PRIMARYSERVER1;
|
|
766 |
defaultConfigGPRS.iProtocolConfigOption.iDnsAddresses.iSecondaryDns = SIM_PACKET_CONTEXT_SECONDARYSERVER1;
|
|
767 |
defaultConfigGPRS.iProtocolConfigOption.iId = SIM_PACKET_CONTEXT_ID1;
|
|
768 |
|
|
769 |
TBuf8<GPRS_CONTEXT_ADDITIONAL_PARAM_LEN> additionalParamDataGprs(GPRS_PACKET_CONTEXT_ADDITIONAL_PARAM);
|
|
770 |
additionalParamDataGprs.SetLength(GPRS_CONTEXT_ADDITIONAL_PARAM_LEN);
|
|
771 |
|
|
772 |
RPacketContext::TPcoId pcoId(GPRS_PACKET_CONTEXT_PCO_ID);
|
|
773 |
|
|
774 |
RPacketContext::TMiscProtocolBuffer miscBufferGprs;
|
|
775 |
miscBufferGprs.Zero();
|
|
776 |
|
|
777 |
TPtr8 pcoPtrGprs(const_cast<TUint8*>(miscBufferGprs.Ptr()),
|
|
778 |
RPacketContext::KMiscProtocolBufferLength);
|
|
779 |
|
|
780 |
TPtr8 additionalParamDataPtrGprs(const_cast<TUint8*>(additionalParamDataGprs.Ptr()),
|
|
781 |
additionalParamDataGprs.Length(), additionalParamDataGprs.Length());
|
|
782 |
|
|
783 |
// Attach TTlv to the buffer
|
|
784 |
TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> theTLVGprs(pcoPtrGprs,0);
|
|
785 |
|
|
786 |
theTLVGprs.AppendItemL(pcoId,additionalParamDataPtrGprs);
|
|
787 |
|
|
788 |
miscBufferGprs.SetLength(pcoPtrGprs.Length());
|
|
789 |
|
|
790 |
defaultConfigGPRS.iProtocolConfigOption.iMiscBuffer = miscBufferGprs;
|
|
791 |
|
|
792 |
TESTL(iPacketService.SetDefaultContextParams(defaultConfigPckgGPRS) == KErrNone);
|
|
793 |
INFO_PRINTF1(_L("SetDefault Params GPRS when additional params specified test Passed"));
|
|
794 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.46"));
|
|
795 |
|
|
796 |
// Test GPRS RPacketService::GetDefaultContextParams
|
|
797 |
// when there are additional parameters
|
|
798 |
RPacketContext::TContextConfigGPRS defaultConfigGPRS_2;
|
|
799 |
TPckg<RPacketContext::TContextConfigGPRS> defaultConfigPckgGPRS_2(defaultConfigGPRS_2);
|
|
800 |
TESTL(iPacketService.GetDefaultContextParams(defaultConfigPckgGPRS_2) == KErrNone);
|
|
801 |
TESTL(defaultConfigGPRS_2.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
802 |
TESTL(defaultConfigGPRS_2.iAnonymousAccessReqd==DPCKTTSY_ANONYMOUS_ACCESS1);
|
|
803 |
TESTL(defaultConfigGPRS_2.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
804 |
TESTL(defaultConfigGPRS_2.iPdpCompression==DPCKTTSY_COMPRESSION1);
|
|
805 |
TESTL(defaultConfigGPRS_2.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
806 |
TESTL(defaultConfigGPRS_2.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL1);
|
|
807 |
TESTL(defaultConfigGPRS_2.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME1);
|
|
808 |
TESTL(defaultConfigGPRS_2.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD1);
|
|
809 |
TESTL(defaultConfigGPRS_2.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE1);
|
|
810 |
TESTL(defaultConfigGPRS_2.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE1);
|
|
811 |
TESTL(defaultConfigGPRS_2.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER1);
|
|
812 |
TESTL(defaultConfigGPRS_2.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER1);
|
|
813 |
TESTL(defaultConfigGPRS_2.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID1);
|
|
814 |
defaultConfigGPRS_2.iProtocolConfigOption.iMiscBuffer.SetLength(miscBufferGprs.Length());
|
|
815 |
TESTL(defaultConfigGPRS_2.iProtocolConfigOption.iMiscBuffer == miscBufferGprs);
|
|
816 |
INFO_PRINTF1(_L("GetDefault Params GPRS where there are additional params test Passed"));
|
|
817 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.47"));
|
|
818 |
|
|
819 |
// Test R5 RPacketService::SetDefaultContextParams
|
|
820 |
// When additional params are specified
|
|
821 |
RPacketContext::TContextConfig_R5 defaultConfigR5;
|
|
822 |
TPckg<RPacketContext::TContextConfig_R5> defaultConfigPckgR5(defaultConfigR5);
|
|
823 |
|
|
824 |
defaultConfigR5.iAccessPointName = R5_CONTEXT_GGSN;
|
|
825 |
defaultConfigR5.iPdpAddress = R5_CONTEXT_PDP_ADDRESS;
|
|
826 |
defaultConfigR5.iPdpType = R5_CONTEXT_PROTOCOL;
|
|
827 |
defaultConfigR5.iUseEdge = R5_CONTEXT_USE_EDGE;
|
|
828 |
defaultConfigR5.iProtocolConfigOption.iAuthInfo.iProtocol = R5_CONTEXT_AUTH_PROT;
|
|
829 |
defaultConfigR5.iProtocolConfigOption.iAuthInfo.iUsername = R5_CONTEXT_USERNAME;
|
|
830 |
defaultConfigR5.iProtocolConfigOption.iAuthInfo.iPassword = R5_CONTEXT_PASSWORD;
|
|
831 |
defaultConfigR5.iProtocolConfigOption.iChallenge = R5_CONTEXT_CHALLENGE;
|
|
832 |
defaultConfigR5.iProtocolConfigOption.iResponse = R5_CONTEXT_RESPONSE;
|
|
833 |
defaultConfigR5.iProtocolConfigOption.iDnsAddresses.iPrimaryDns = R5_CONTEXT_DNS1;
|
|
834 |
defaultConfigR5.iProtocolConfigOption.iDnsAddresses.iSecondaryDns = R5_CONTEXT_DNS2;
|
|
835 |
defaultConfigR5.iProtocolConfigOption.iId = R5_CONTEXT_ID;
|
|
836 |
defaultConfigR5.iPdpHeaderCompression = R5_CONTEXT_HEADER_COMPRESSION;
|
|
837 |
defaultConfigR5.iPdpDataCompression = R5_CONTEXT_DATA_COMPRESSION;
|
|
838 |
|
|
839 |
TBuf8<R5_CONTEXT_ADDITIONAL_PARAM_LEN> additionalParamDataR5(R5_CONTEXT_ADDITIONAL_PARAM);
|
|
840 |
additionalParamDataR5.SetLength(R5_CONTEXT_ADDITIONAL_PARAM_LEN);
|
|
841 |
|
|
842 |
RPacketContext::TPcoId pcoIdR5(R5_CONTEXT_PCO_ID);
|
|
843 |
|
|
844 |
RPacketContext::TMiscProtocolBuffer miscBufferR5;
|
|
845 |
|
|
846 |
miscBufferR5.Zero();
|
|
847 |
|
|
848 |
TPtr8 pcoPtrR5(const_cast<TUint8*>(miscBufferR5.Ptr()),
|
|
849 |
RPacketContext::KMiscProtocolBufferLength);
|
|
850 |
|
|
851 |
TPtr8 additionalParamDataPtrR5(const_cast<TUint8*>(additionalParamDataR5.Ptr()),
|
|
852 |
additionalParamDataR5.Length(), additionalParamDataR5.Length());
|
|
853 |
|
|
854 |
// Attach TTlv to the buffer
|
|
855 |
TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> theTLVR5(pcoPtrR5,0);
|
|
856 |
|
|
857 |
theTLVR5.AppendItemL(pcoIdR5,additionalParamDataPtrR5);
|
|
858 |
|
|
859 |
miscBufferR5.SetLength(pcoPtrR5.Length());
|
|
860 |
|
|
861 |
defaultConfigR5.iProtocolConfigOption.iMiscBuffer = miscBufferR5;
|
|
862 |
ret = iPacketService.SetDefaultContextParams(defaultConfigPckgR5);
|
|
863 |
|
|
864 |
INFO_PRINTF1(_L("SetDefault Params R5 when there are additional params test Passed"));
|
|
865 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.48"));
|
|
866 |
|
|
867 |
// Test R5 RPacketService::GetDefaultContextParams
|
|
868 |
// when there are additional params
|
|
869 |
RPacketContext::TContextConfig_R5 defaultConfigR5_2;
|
|
870 |
TPckg<RPacketContext::TContextConfig_R5> defaultConfigPckgR5_2(defaultConfigR5_2);
|
|
871 |
|
|
872 |
ret = iPacketService.GetDefaultContextParams(defaultConfigPckgR5_2);
|
|
873 |
|
|
874 |
TESTL(defaultConfigR5_2.iAccessPointName == R5_CONTEXT_GGSN);
|
|
875 |
TESTL(defaultConfigR5_2.iPdpAddress == R5_CONTEXT_PDP_ADDRESS);
|
|
876 |
TESTL(defaultConfigR5_2.iPdpType == R5_CONTEXT_PROTOCOL);
|
|
877 |
TESTL(defaultConfigR5_2.iUseEdge == R5_CONTEXT_USE_EDGE);
|
|
878 |
TESTL(defaultConfigR5_2.iProtocolConfigOption.iAuthInfo.iProtocol == R5_CONTEXT_AUTH_PROT);
|
|
879 |
TESTL(defaultConfigR5_2.iProtocolConfigOption.iAuthInfo.iUsername == R5_CONTEXT_USERNAME);
|
|
880 |
TESTL(defaultConfigR5_2.iProtocolConfigOption.iAuthInfo.iPassword == R5_CONTEXT_PASSWORD);
|
|
881 |
TESTL(defaultConfigR5_2.iProtocolConfigOption.iChallenge == R5_CONTEXT_CHALLENGE);
|
|
882 |
TESTL(defaultConfigR5_2.iProtocolConfigOption.iResponse == R5_CONTEXT_RESPONSE);
|
|
883 |
TESTL(defaultConfigR5_2.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == R5_CONTEXT_DNS1);
|
|
884 |
TESTL(defaultConfigR5_2.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == R5_CONTEXT_DNS2);
|
|
885 |
TESTL(defaultConfigR5_2.iProtocolConfigOption.iId == R5_CONTEXT_ID);
|
|
886 |
TESTL(defaultConfigR5_2.iPdpHeaderCompression == R5_CONTEXT_HEADER_COMPRESSION);
|
|
887 |
TESTL(defaultConfigR5_2.iPdpDataCompression == R5_CONTEXT_DATA_COMPRESSION);
|
|
888 |
defaultConfigR5_2.iProtocolConfigOption.iMiscBuffer.SetLength(miscBufferR5.Length());
|
|
889 |
TESTL(defaultConfigR5_2.iProtocolConfigOption.iMiscBuffer == miscBufferR5);
|
|
890 |
INFO_PRINTF1(_L("GetDefault Params R5 with additional params test Passed"));
|
|
891 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.49"));
|
|
892 |
|
|
893 |
// Test UMTS RPacketService::GetDefaultContextParams
|
|
894 |
// when an additional parameter is specified.
|
|
895 |
|
|
896 |
RPacketContext::TContextConfigR99_R4 defaultConfigR99_R4;
|
|
897 |
TPckg<RPacketContext::TContextConfigR99_R4> defaultConfigPckgR99_R4(defaultConfigR99_R4);
|
|
898 |
|
|
899 |
defaultConfigR99_R4.iAccessPointName = DPCKTTSY_ACCESS_POINT1;
|
|
900 |
defaultConfigR99_R4.iPdpAddress = DPCKTTSY_PDP_ADDRESS1;
|
|
901 |
defaultConfigR99_R4.iPdpType = DPCKTTSY_PDP_TYPE1;
|
|
902 |
defaultConfigR99_R4.iUseEdge = DPCKTTSY_EGPRS_REQUIRED;
|
|
903 |
defaultConfigR99_R4.iProtocolConfigOption.iAuthInfo.iProtocol = SIM_PACKET_CONTEXT_PROTOCOL2;
|
|
904 |
defaultConfigR99_R4.iProtocolConfigOption.iAuthInfo.iUsername = SIM_PACKET_CONTEXT_USERNAME2;
|
|
905 |
defaultConfigR99_R4.iProtocolConfigOption.iAuthInfo.iPassword = SIM_PACKET_CONTEXT_PASSWORD2;
|
|
906 |
defaultConfigR99_R4.iProtocolConfigOption.iChallenge = SIM_PACKET_CONTEXT_CHALLENGE2;
|
|
907 |
defaultConfigR99_R4.iProtocolConfigOption.iResponse = SIM_PACKET_CONTEXT_RESPONSE2;
|
|
908 |
defaultConfigR99_R4.iProtocolConfigOption.iDnsAddresses.iPrimaryDns = SIM_PACKET_CONTEXT_PRIMARYSERVER2;
|
|
909 |
defaultConfigR99_R4.iProtocolConfigOption.iDnsAddresses.iSecondaryDns = SIM_PACKET_CONTEXT_SECONDARYSERVER2;
|
|
910 |
defaultConfigR99_R4.iProtocolConfigOption.iId = SIM_PACKET_CONTEXT_ID2;
|
|
911 |
|
|
912 |
TBuf8<R99_R4_CONTEXT_ADDITIONAL_PARAM_LEN> additionalParamDataR4(R99_R4_PACKET_CONTEXT_ADDITIONAL_PARAM);
|
|
913 |
additionalParamDataR4.SetLength(R99_R4_CONTEXT_ADDITIONAL_PARAM_LEN);
|
|
914 |
|
|
915 |
RPacketContext::TPcoId pcoIdR4(R99_R4_PACKET_CONTEXT_PCO_ID);
|
|
916 |
|
|
917 |
RPacketContext::TMiscProtocolBuffer miscBufferR4;
|
|
918 |
miscBufferR4.Zero();
|
|
919 |
|
|
920 |
TPtr8 pcoPtrR4(const_cast<TUint8*>(miscBufferR4.Ptr()),
|
|
921 |
RPacketContext::KMiscProtocolBufferLength);
|
|
922 |
|
|
923 |
TPtr8 additionalParamDataPtrR4(const_cast<TUint8*>(additionalParamDataR4.Ptr()),
|
|
924 |
additionalParamDataR4.Length(), additionalParamDataR4.Length());
|
|
925 |
|
|
926 |
// Attach TTlv to the buffer
|
|
927 |
TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> theTLVR4(pcoPtrR4,0);
|
|
928 |
|
|
929 |
theTLVR4.AppendItemL(pcoIdR4,additionalParamDataPtrR4);
|
|
930 |
|
|
931 |
miscBufferR4.SetLength(pcoPtrR4.Length());
|
|
932 |
|
|
933 |
defaultConfigR99_R4.iProtocolConfigOption.iMiscBuffer = miscBufferR4;
|
|
934 |
|
|
935 |
TESTL(iPacketService.SetDefaultContextParams(defaultConfigPckgR99_R4) == KErrNone);
|
|
936 |
INFO_PRINTF1(_L("SetDefault Params R99_R4 test Passed"));
|
|
937 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.50"));
|
|
938 |
|
|
939 |
// Test RPacketService::GetDefaultContextParams
|
|
940 |
RPacketContext::TContextConfigR99_R4 defaultConfigR99_R4_2;
|
|
941 |
TPckg<RPacketContext::TContextConfigR99_R4> defaultConfigPckgR99_R4_2(defaultConfigR99_R4_2);
|
|
942 |
|
|
943 |
TESTL(iPacketService.GetDefaultContextParams(defaultConfigPckgR99_R4_2) == KErrNone);
|
|
944 |
TESTL(defaultConfigR99_R4_2.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
945 |
TESTL(defaultConfigR99_R4_2.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
946 |
TESTL(defaultConfigR99_R4_2.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
947 |
TESTL(defaultConfigR99_R4_2.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL2);
|
|
948 |
TESTL(defaultConfigR99_R4_2.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME2);
|
|
949 |
TESTL(defaultConfigR99_R4_2.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD2);
|
|
950 |
TESTL(defaultConfigR99_R4_2.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE2);
|
|
951 |
TESTL(defaultConfigR99_R4_2.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE2);
|
|
952 |
TESTL(defaultConfigR99_R4_2.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER2);
|
|
953 |
TESTL(defaultConfigR99_R4_2.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER2);
|
|
954 |
TESTL(defaultConfigR99_R4_2.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID2);
|
|
955 |
defaultConfigR99_R4_2.iProtocolConfigOption.iMiscBuffer.SetLength(miscBufferR4.Length());
|
|
956 |
TESTL(defaultConfigR99_R4_2.iProtocolConfigOption.iMiscBuffer == miscBufferR4);
|
|
957 |
|
|
958 |
INFO_PRINTF1(_L("GetDefault Params R99_R4 test Passed"));
|
|
959 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.51"));
|
|
960 |
|
|
961 |
// Clear up
|
|
962 |
iPacketContext.Close();
|
|
963 |
iPacketService.Close();
|
|
964 |
iPhone.Close();
|
|
965 |
|
|
966 |
ASSERT(RThread().RequestCount()==0);
|
|
967 |
|
|
968 |
return TestStepResult();
|
|
969 |
}
|
|
970 |
|
|
971 |
CSimPacketBinaryAdditionalParamsTest1::CSimPacketBinaryAdditionalParamsTest1()
|
|
972 |
/**
|
|
973 |
Default constructor. Initialises the test step name.
|
|
974 |
*/
|
|
975 |
{
|
|
976 |
SetTestStepName(_L("BinaryAdditionalParamsContextTest1"));
|
|
977 |
}
|
|
978 |
|
|
979 |
TVerdict CSimPacketBinaryAdditionalParamsTest1::doTestStepL()
|
|
980 |
/**
|
|
981 |
The test step containing test cases for DEF082820
|
|
982 |
*/
|
|
983 |
{
|
|
984 |
INFO_PRINTF1(_L("BeginBinaryAdditionalParamsContextTest1"));
|
|
985 |
|
|
986 |
CreateConfigFileL(_L("c:\\config3.txt"));
|
|
987 |
SetTestNumberL(18);
|
|
988 |
|
|
989 |
INFO_PRINTF1(_L("RPacketService Functionality"));
|
|
990 |
|
|
991 |
// Test RPacketService::Open
|
|
992 |
TInt ret = iPhone.Open(iTelServer,KPhoneName);
|
|
993 |
INFO_PRINTF2(_L("Result: %d"),ret);
|
|
994 |
TESTL(ret == KErrNone);
|
|
995 |
INFO_PRINTF1(_L("Opened phone object"));
|
|
996 |
|
|
997 |
TESTL(iPacketService.Open(iPhone)==KErrNone);
|
|
998 |
INFO_PRINTF1(_L("Opened packet object"));
|
|
999 |
|
|
1000 |
// Test RPacketContext::OpenNewContext
|
|
1001 |
TName gprsContextName;
|
|
1002 |
TName gprsContextNameCompare;
|
|
1003 |
TESTL(iPacketContext.OpenNewContext(iPacketService, gprsContextName)==KErrNone);
|
|
1004 |
gprsContextNameCompare.Append(KSimPrimaryPacketContextName);
|
|
1005 |
gprsContextNameCompare.AppendNum(1);
|
|
1006 |
TESTL(gprsContextName.Compare(gprsContextNameCompare)==KErrNone);
|
|
1007 |
INFO_PRINTF1(_L("Opened GPRS Context object"));
|
|
1008 |
|
|
1009 |
TRequestStatus reqStatus, notifyStatus;
|
|
1010 |
|
|
1011 |
// GPRS RPacketContext::SetConfig and
|
|
1012 |
// RPacketContext::NotifyConfigChanged
|
|
1013 |
// when there is a mix binary and ASCII additional parameter
|
|
1014 |
// specified
|
|
1015 |
RPacketContext::TContextConfigGPRS gprsContextConfig;
|
|
1016 |
TESTL(gprsContextConfig.ExtensionId()==TPacketDataConfigBase::KConfigGPRS);
|
|
1017 |
TPckg<RPacketContext::TContextConfigGPRS> contextConfigPckgGPRS(gprsContextConfig);
|
|
1018 |
|
|
1019 |
RPacketContext::TContextConfigGPRS gprsContextNotify;
|
|
1020 |
TESTL(gprsContextNotify.ExtensionId()==TPacketDataConfigBase::KConfigGPRS);
|
|
1021 |
TPckg<RPacketContext::TContextConfigGPRS> contextNotifyPckgGPRS(gprsContextNotify);
|
|
1022 |
|
|
1023 |
gprsContextConfig.iAccessPointName = DPCKTTSY_ACCESS_POINT1;
|
|
1024 |
gprsContextConfig.iAnonymousAccessReqd = DPCKTTSY_ANONYMOUS_ACCESS1;
|
|
1025 |
gprsContextConfig.iPdpAddress = DPCKTTSY_PDP_ADDRESS1;
|
|
1026 |
gprsContextConfig.iPdpCompression = DPCKTTSY_COMPRESSION1;
|
|
1027 |
gprsContextConfig.iPdpType = DPCKTTSY_PDP_TYPE1;
|
|
1028 |
gprsContextConfig.iUseEdge = DPCKTTSY_EGPRS_REQUIRED;
|
|
1029 |
gprsContextConfig.iProtocolConfigOption.iAuthInfo.iProtocol = SIM_PACKET_CONTEXT_PROTOCOL1;
|
|
1030 |
gprsContextConfig.iProtocolConfigOption.iAuthInfo.iUsername = SIM_PACKET_CONTEXT_USERNAME1;
|
|
1031 |
gprsContextConfig.iProtocolConfigOption.iAuthInfo.iPassword = SIM_PACKET_CONTEXT_PASSWORD1;
|
|
1032 |
gprsContextConfig.iProtocolConfigOption.iChallenge = SIM_PACKET_CONTEXT_CHALLENGE1;
|
|
1033 |
gprsContextConfig.iProtocolConfigOption.iResponse = SIM_PACKET_CONTEXT_RESPONSE1;
|
|
1034 |
gprsContextConfig.iProtocolConfigOption.iDnsAddresses.iPrimaryDns = SIM_PACKET_CONTEXT_PRIMARYSERVER1;
|
|
1035 |
gprsContextConfig.iProtocolConfigOption.iDnsAddresses.iSecondaryDns = SIM_PACKET_CONTEXT_SECONDARYSERVER1;
|
|
1036 |
gprsContextConfig.iProtocolConfigOption.iId = SIM_PACKET_CONTEXT_ID1;
|
|
1037 |
|
|
1038 |
_LIT8(KBinaryAdditionalParam1,"abc\\def\\\\");
|
|
1039 |
TBuf8<9> additionalParamDataGprs(KBinaryAdditionalParam1);
|
|
1040 |
|
|
1041 |
RPacketContext::TPcoId pcoIdGprs(GPRS_PACKET_CONTEXT_PCO_ID);
|
|
1042 |
|
|
1043 |
RPacketContext::TMiscProtocolBuffer miscBufferGprs;
|
|
1044 |
miscBufferGprs.Zero();
|
|
1045 |
|
|
1046 |
TPtr8 pcoPtrGprs(const_cast<TUint8*>(miscBufferGprs.Ptr()),
|
|
1047 |
RPacketContext::KMiscProtocolBufferLength);
|
|
1048 |
|
|
1049 |
TPtr8 additionalParamDataPtrGprs(const_cast<TUint8*>(additionalParamDataGprs.Ptr()),
|
|
1050 |
additionalParamDataGprs.Length(), additionalParamDataGprs.Length());
|
|
1051 |
|
|
1052 |
// Attach TTlv to the buffer
|
|
1053 |
TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> theTLVGprs(pcoPtrGprs,0);
|
|
1054 |
|
|
1055 |
theTLVGprs.AppendItemL(pcoIdGprs,additionalParamDataPtrGprs);
|
|
1056 |
|
|
1057 |
miscBufferGprs.SetLength(pcoPtrGprs.Length());
|
|
1058 |
|
|
1059 |
gprsContextConfig.iProtocolConfigOption.iMiscBuffer = miscBufferGprs;
|
|
1060 |
|
|
1061 |
iPacketContext.NotifyConfigChanged(notifyStatus, contextNotifyPckgGPRS);
|
|
1062 |
iPacketContext.SetConfig(reqStatus, contextConfigPckgGPRS);
|
|
1063 |
|
|
1064 |
User::WaitForRequest(notifyStatus);
|
|
1065 |
User::WaitForRequest(reqStatus);
|
|
1066 |
TESTL(reqStatus.Int()==KErrNone);
|
|
1067 |
TESTL(notifyStatus.Int()==KErrNone);
|
|
1068 |
|
|
1069 |
INFO_PRINTF1(_L("SetConfig GPRS with Additional Parameter Test Passed"));
|
|
1070 |
|
|
1071 |
TESTL(gprsContextNotify.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
1072 |
TESTL(gprsContextNotify.iAnonymousAccessReqd==DPCKTTSY_ANONYMOUS_ACCESS1);
|
|
1073 |
TESTL(gprsContextNotify.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
1074 |
TESTL(gprsContextNotify.iPdpCompression==DPCKTTSY_COMPRESSION1);
|
|
1075 |
TESTL(gprsContextNotify.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
1076 |
TESTL(gprsContextNotify.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL1);
|
|
1077 |
TESTL(gprsContextNotify.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME1);
|
|
1078 |
TESTL(gprsContextNotify.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD1);
|
|
1079 |
TESTL(gprsContextNotify.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE1);
|
|
1080 |
TESTL(gprsContextNotify.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE1);
|
|
1081 |
TESTL(gprsContextNotify.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER1);
|
|
1082 |
TESTL(gprsContextNotify.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER1);
|
|
1083 |
TESTL(gprsContextNotify.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID1);
|
|
1084 |
gprsContextNotify.iProtocolConfigOption.iMiscBuffer.SetLength(miscBufferGprs.Length());
|
|
1085 |
TESTL(gprsContextNotify.iProtocolConfigOption.iMiscBuffer == miscBufferGprs);
|
|
1086 |
|
|
1087 |
INFO_PRINTF1(_L("NotifyConfigChanged GPRS with Additional Parameter Test Passed"));
|
|
1088 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.66"));
|
|
1089 |
|
|
1090 |
// Test GPRS RPacketContext::GetConfig with additional parameter
|
|
1091 |
RPacketContext::TContextConfigGPRS gprsContextConfig_2;
|
|
1092 |
TESTL(gprsContextConfig_2.ExtensionId()==TPacketDataConfigBase::KConfigGPRS);
|
|
1093 |
TPckg<RPacketContext::TContextConfigGPRS> contextConfigPckgGPRS_2(gprsContextConfig_2);
|
|
1094 |
|
|
1095 |
iPacketContext.GetConfig(reqStatus, contextConfigPckgGPRS_2);
|
|
1096 |
User::WaitForRequest(reqStatus);
|
|
1097 |
TESTL(reqStatus.Int()==KErrNone);
|
|
1098 |
TESTL(gprsContextConfig_2.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
1099 |
TESTL(gprsContextConfig_2.iAnonymousAccessReqd==DPCKTTSY_ANONYMOUS_ACCESS1);
|
|
1100 |
TESTL(gprsContextConfig_2.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
1101 |
TESTL(gprsContextConfig_2.iPdpCompression==DPCKTTSY_COMPRESSION1);
|
|
1102 |
TESTL(gprsContextConfig_2.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
1103 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL1);
|
|
1104 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME1);
|
|
1105 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD1);
|
|
1106 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE1);
|
|
1107 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE1);
|
|
1108 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER1);
|
|
1109 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER1);
|
|
1110 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID1);
|
|
1111 |
gprsContextConfig_2.iProtocolConfigOption.iMiscBuffer.SetLength(miscBufferGprs.Length());
|
|
1112 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iMiscBuffer == miscBufferGprs);
|
|
1113 |
|
|
1114 |
INFO_PRINTF1(_L("GetConfig GPRS with Additional Parameter Test Passed"));
|
|
1115 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.67"));
|
|
1116 |
|
|
1117 |
// Clean up for next test case
|
|
1118 |
iPacketContext.Close();
|
|
1119 |
iPacketService.Close();
|
|
1120 |
iPhone.Close();
|
|
1121 |
|
|
1122 |
// Test RPacketService::Open
|
|
1123 |
ret = iPhone.Open(iTelServer,KPhoneName);
|
|
1124 |
INFO_PRINTF2(_L("Result: %d"),ret);
|
|
1125 |
TESTL(ret == KErrNone);
|
|
1126 |
INFO_PRINTF1(_L("Opened phone object"));
|
|
1127 |
|
|
1128 |
TESTL(iPacketService.Open(iPhone)==KErrNone);
|
|
1129 |
INFO_PRINTF1(_L("Opened packet object"));
|
|
1130 |
|
|
1131 |
// Test RPacketContext::OpenNewContext
|
|
1132 |
TName rel4ContextName;
|
|
1133 |
TName rel4ContextNameCompare;
|
|
1134 |
|
|
1135 |
TESTL(iPacketContext.OpenNewContext(iPacketService, rel4ContextName)==KErrNone);
|
|
1136 |
rel4ContextNameCompare.Append(KSimPrimaryPacketContextName);
|
|
1137 |
rel4ContextNameCompare.AppendNum(1);
|
|
1138 |
TESTL(rel4ContextName.Compare(rel4ContextNameCompare)==KErrNone);
|
|
1139 |
INFO_PRINTF1(_L("Opened R99_R4 context object"));
|
|
1140 |
|
|
1141 |
// Rel4_R99 RPacketContext::SetConfig and
|
|
1142 |
// RPacketContext::NotifyConfigChanged
|
|
1143 |
// when there is an additional mixed binary and ASCII parameter
|
|
1144 |
// specified
|
|
1145 |
RPacketContext::TContextConfigR99_R4 contextConfigRel4;
|
|
1146 |
TESTL(contextConfigRel4.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4);
|
|
1147 |
TPckg<RPacketContext::TContextConfigR99_R4> contextConfigRel4Pckg(contextConfigRel4);
|
|
1148 |
|
|
1149 |
RPacketContext::TContextConfigR99_R4 rel4ContextNotify;
|
|
1150 |
TESTL(rel4ContextNotify.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4);
|
|
1151 |
TPckg<RPacketContext::TContextConfigR99_R4> rel4ContextNotifyPckg(rel4ContextNotify);
|
|
1152 |
|
|
1153 |
contextConfigRel4.iAccessPointName = DPCKTTSY_ACCESS_POINT1;
|
|
1154 |
contextConfigRel4.iPdpAddress = DPCKTTSY_PDP_ADDRESS1;
|
|
1155 |
contextConfigRel4.iPdpType = DPCKTTSY_PDP_TYPE1;
|
|
1156 |
contextConfigRel4.iUseEdge = DPCKTTSY_EGPRS_REQUIRED;
|
|
1157 |
contextConfigRel4.iProtocolConfigOption.iAuthInfo.iProtocol = SIM_PACKET_CONTEXT_PROTOCOL2;
|
|
1158 |
contextConfigRel4.iProtocolConfigOption.iAuthInfo.iUsername = SIM_PACKET_CONTEXT_USERNAME2;
|
|
1159 |
contextConfigRel4.iProtocolConfigOption.iAuthInfo.iPassword = SIM_PACKET_CONTEXT_PASSWORD2;
|
|
1160 |
contextConfigRel4.iProtocolConfigOption.iChallenge = SIM_PACKET_CONTEXT_CHALLENGE2;
|
|
1161 |
contextConfigRel4.iProtocolConfigOption.iResponse = SIM_PACKET_CONTEXT_RESPONSE2;
|
|
1162 |
contextConfigRel4.iProtocolConfigOption.iDnsAddresses.iPrimaryDns = SIM_PACKET_CONTEXT_PRIMARYSERVER2;
|
|
1163 |
contextConfigRel4.iProtocolConfigOption.iDnsAddresses.iSecondaryDns = SIM_PACKET_CONTEXT_SECONDARYSERVER2;
|
|
1164 |
contextConfigRel4.iProtocolConfigOption.iId = SIM_PACKET_CONTEXT_ID2;
|
|
1165 |
|
|
1166 |
const TUint8 binaryAdditionalParam2[10] =
|
|
1167 |
{'a','b','c',0x0A,'d','e','f',0xFF,'\\',0x00};
|
|
1168 |
|
|
1169 |
TBuf8<9> additionalParamDataR4_2(binaryAdditionalParam2);
|
|
1170 |
|
|
1171 |
RPacketContext::TPcoId pcoIdR4_2(R99_R4_PACKET_CONTEXT_PCO_ID);
|
|
1172 |
|
|
1173 |
RPacketContext::TMiscProtocolBuffer miscBufferR4_2;
|
|
1174 |
miscBufferR4_2.Zero();
|
|
1175 |
|
|
1176 |
TPtr8 pcoPtrR4_2(const_cast<TUint8*>(miscBufferR4_2.Ptr()),
|
|
1177 |
RPacketContext::KMiscProtocolBufferLength);
|
|
1178 |
|
|
1179 |
TPtr8 additionalParamDataPtrR4_2(const_cast<TUint8*>(additionalParamDataR4_2.Ptr()),
|
|
1180 |
additionalParamDataR4_2.Length(), additionalParamDataR4_2.Length());
|
|
1181 |
|
|
1182 |
// Attach TTlv to the buffer
|
|
1183 |
TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> theTLVR4_2(pcoPtrR4_2,0);
|
|
1184 |
|
|
1185 |
theTLVR4_2.AppendItemL(pcoIdR4_2,additionalParamDataPtrR4_2);
|
|
1186 |
|
|
1187 |
miscBufferR4_2.SetLength(pcoPtrR4_2.Length());
|
|
1188 |
|
|
1189 |
contextConfigRel4.iProtocolConfigOption.iMiscBuffer = miscBufferR4_2;
|
|
1190 |
|
|
1191 |
iPacketContext.NotifyConfigChanged(notifyStatus, rel4ContextNotifyPckg);
|
|
1192 |
iPacketContext.SetConfig(reqStatus, contextConfigRel4Pckg);
|
|
1193 |
|
|
1194 |
User::WaitForRequest(reqStatus);
|
|
1195 |
User::WaitForRequest(notifyStatus);
|
|
1196 |
|
|
1197 |
TESTL(reqStatus.Int()==KErrNone);
|
|
1198 |
TESTL(notifyStatus.Int()==KErrNone);
|
|
1199 |
|
|
1200 |
INFO_PRINTF1(_L("SetConfig Rel99_R4 with Additional Parameter Test Passed"));
|
|
1201 |
|
|
1202 |
TESTL(rel4ContextNotify.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
1203 |
TESTL(rel4ContextNotify.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
1204 |
TESTL(rel4ContextNotify.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
1205 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL2);
|
|
1206 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME2);
|
|
1207 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD2);
|
|
1208 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE2);
|
|
1209 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE2);
|
|
1210 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER2);
|
|
1211 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER2);
|
|
1212 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID2);
|
|
1213 |
rel4ContextNotify.iProtocolConfigOption.iMiscBuffer.SetLength(miscBufferR4_2.Length());
|
|
1214 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iMiscBuffer == miscBufferR4_2);
|
|
1215 |
|
|
1216 |
INFO_PRINTF1(_L("NotifyConfigChanged Rel99_R4 with Additional Parameter Test Passed"));
|
|
1217 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.68"));
|
|
1218 |
|
|
1219 |
// Test R99_R4 RPacketContext::GetConfig with additional parameter
|
|
1220 |
RPacketContext::TContextConfigR99_R4 contextConfigR99_R4;
|
|
1221 |
TESTL(contextConfigR99_R4.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4);
|
|
1222 |
TPckg<RPacketContext::TContextConfigR99_R4> contextConfigR99_R4Pckg(contextConfigR99_R4);
|
|
1223 |
|
|
1224 |
iPacketContext.GetConfig(reqStatus, contextConfigR99_R4Pckg);
|
|
1225 |
User::WaitForRequest(reqStatus);
|
|
1226 |
TESTL(reqStatus.Int()==KErrNone);
|
|
1227 |
TESTL(contextConfigR99_R4.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
1228 |
TESTL(contextConfigR99_R4.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
1229 |
TESTL(contextConfigR99_R4.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
1230 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL2);
|
|
1231 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME2);
|
|
1232 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD2);
|
|
1233 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE2);
|
|
1234 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE2);
|
|
1235 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER2);
|
|
1236 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER2);
|
|
1237 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID2);
|
|
1238 |
contextConfigR99_R4.iProtocolConfigOption.iMiscBuffer.SetLength(miscBufferR4_2.Length());
|
|
1239 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iMiscBuffer == miscBufferR4_2);
|
|
1240 |
INFO_PRINTF1(_L("GetConfig Rel99_R4 with Additional Parameter Test Passed"));
|
|
1241 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.69"));
|
|
1242 |
|
|
1243 |
|
|
1244 |
// Clear up
|
|
1245 |
iPacketContext.Close();
|
|
1246 |
iPacketService.Close();
|
|
1247 |
iPhone.Close();
|
|
1248 |
|
|
1249 |
ASSERT(RThread().RequestCount()==0);
|
|
1250 |
|
|
1251 |
return TestStepResult();
|
|
1252 |
}
|
|
1253 |
|
|
1254 |
|
|
1255 |
CSimPacketBinaryAdditionalParamsTest2::CSimPacketBinaryAdditionalParamsTest2()
|
|
1256 |
/**
|
|
1257 |
Default constructor. Initialises the test step name.
|
|
1258 |
*/
|
|
1259 |
{
|
|
1260 |
SetTestStepName(_L("BinaryAdditionalParamsContextTest2"));
|
|
1261 |
}
|
|
1262 |
|
|
1263 |
TVerdict CSimPacketBinaryAdditionalParamsTest2::doTestStepL()
|
|
1264 |
/**
|
|
1265 |
The test step containing test cases for DEF082820
|
|
1266 |
*/
|
|
1267 |
{
|
|
1268 |
INFO_PRINTF1(_L("BeginBinaryAdditionalParamsContextTest2"));
|
|
1269 |
|
|
1270 |
CreateConfigFileL(_L("c:\\config3.txt"));
|
|
1271 |
SetTestNumberL(19);
|
|
1272 |
|
|
1273 |
INFO_PRINTF1(_L("RPacketService Functionality"));
|
|
1274 |
|
|
1275 |
TInt ret = iPhone.Open(iTelServer,KPhoneName);
|
|
1276 |
INFO_PRINTF2(_L("Result: %d"),ret);
|
|
1277 |
TESTL(ret == KErrNone);
|
|
1278 |
INFO_PRINTF1(_L("Opened phone object"));
|
|
1279 |
TESTL(iPacketService.Open(iPhone)==KErrNone);
|
|
1280 |
INFO_PRINTF1(_L("Opened Packet object"));
|
|
1281 |
|
|
1282 |
// Test RPacketContext::OpenNewContext
|
|
1283 |
TName gprsContextName;
|
|
1284 |
TName gprsContextNameCompare;
|
|
1285 |
TESTL(iPacketContext.OpenNewContext(iPacketService, gprsContextName)==KErrNone);
|
|
1286 |
gprsContextNameCompare.Append(KSimPrimaryPacketContextName);
|
|
1287 |
gprsContextNameCompare.AppendNum(1);
|
|
1288 |
TESTL(gprsContextName.Compare(gprsContextNameCompare)==KErrNone);
|
|
1289 |
INFO_PRINTF1(_L("Opened GPRS Context object"));
|
|
1290 |
|
|
1291 |
TRequestStatus reqStatus, notifyStatus;
|
|
1292 |
|
|
1293 |
// RPacketContext::SetConfig and
|
|
1294 |
// RPacketContext::NotifyConfigChanged
|
|
1295 |
// when there is a completely binary additional parameter
|
|
1296 |
// specified
|
|
1297 |
RPacketContext::TContextConfigGPRS gprsContextConfig;
|
|
1298 |
TESTL(gprsContextConfig.ExtensionId()==TPacketDataConfigBase::KConfigGPRS);
|
|
1299 |
TPckg<RPacketContext::TContextConfigGPRS> contextConfigPckgGPRS(gprsContextConfig);
|
|
1300 |
|
|
1301 |
RPacketContext::TContextConfigGPRS gprsContextNotify;
|
|
1302 |
TESTL(gprsContextNotify.ExtensionId()==TPacketDataConfigBase::KConfigGPRS);
|
|
1303 |
TPckg<RPacketContext::TContextConfigGPRS> contextNotifyPckgGPRS(gprsContextNotify);
|
|
1304 |
|
|
1305 |
gprsContextConfig.iAccessPointName = DPCKTTSY_ACCESS_POINT1;
|
|
1306 |
gprsContextConfig.iAnonymousAccessReqd = DPCKTTSY_ANONYMOUS_ACCESS1;
|
|
1307 |
gprsContextConfig.iPdpAddress = DPCKTTSY_PDP_ADDRESS1;
|
|
1308 |
gprsContextConfig.iPdpCompression = DPCKTTSY_COMPRESSION1;
|
|
1309 |
gprsContextConfig.iPdpType = DPCKTTSY_PDP_TYPE1;
|
|
1310 |
gprsContextConfig.iUseEdge = DPCKTTSY_EGPRS_REQUIRED;
|
|
1311 |
gprsContextConfig.iProtocolConfigOption.iAuthInfo.iProtocol = SIM_PACKET_CONTEXT_PROTOCOL1;
|
|
1312 |
gprsContextConfig.iProtocolConfigOption.iAuthInfo.iUsername = SIM_PACKET_CONTEXT_USERNAME1;
|
|
1313 |
gprsContextConfig.iProtocolConfigOption.iAuthInfo.iPassword = SIM_PACKET_CONTEXT_PASSWORD1;
|
|
1314 |
gprsContextConfig.iProtocolConfigOption.iChallenge = SIM_PACKET_CONTEXT_CHALLENGE1;
|
|
1315 |
gprsContextConfig.iProtocolConfigOption.iResponse = SIM_PACKET_CONTEXT_RESPONSE1;
|
|
1316 |
gprsContextConfig.iProtocolConfigOption.iDnsAddresses.iPrimaryDns = SIM_PACKET_CONTEXT_PRIMARYSERVER1;
|
|
1317 |
gprsContextConfig.iProtocolConfigOption.iDnsAddresses.iSecondaryDns = SIM_PACKET_CONTEXT_SECONDARYSERVER1;
|
|
1318 |
gprsContextConfig.iProtocolConfigOption.iId = SIM_PACKET_CONTEXT_ID1;
|
|
1319 |
|
|
1320 |
const TUint8 binaryAdditionalParam3[7] =
|
|
1321 |
{0xAB,0x01,0xCD,0x02,0xEF,0x03,0x00};
|
|
1322 |
|
|
1323 |
TBuf8<6> additionalParamDataGprs(binaryAdditionalParam3);
|
|
1324 |
|
|
1325 |
RPacketContext::TPcoId pcoIdGprs(GPRS_PACKET_CONTEXT_PCO_ID);
|
|
1326 |
|
|
1327 |
RPacketContext::TMiscProtocolBuffer miscBufferGprs;
|
|
1328 |
miscBufferGprs.Zero();
|
|
1329 |
|
|
1330 |
TPtr8 pcoPtrGprs(const_cast<TUint8*>(miscBufferGprs.Ptr()),
|
|
1331 |
RPacketContext::KMiscProtocolBufferLength);
|
|
1332 |
|
|
1333 |
TPtr8 additionalParamDataPtrGprs(const_cast<TUint8*>(additionalParamDataGprs.Ptr()),
|
|
1334 |
additionalParamDataGprs.Length(), additionalParamDataGprs.Length());
|
|
1335 |
|
|
1336 |
// Attach TTlv to the buffer
|
|
1337 |
TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> theTLVGprs(pcoPtrGprs,0);
|
|
1338 |
|
|
1339 |
theTLVGprs.AppendItemL(pcoIdGprs,additionalParamDataPtrGprs);
|
|
1340 |
|
|
1341 |
miscBufferGprs.SetLength(pcoPtrGprs.Length());
|
|
1342 |
|
|
1343 |
gprsContextConfig.iProtocolConfigOption.iMiscBuffer = miscBufferGprs;
|
|
1344 |
|
|
1345 |
iPacketContext.NotifyConfigChanged(notifyStatus, contextNotifyPckgGPRS);
|
|
1346 |
iPacketContext.SetConfig(reqStatus, contextConfigPckgGPRS);
|
|
1347 |
|
|
1348 |
User::WaitForRequest(notifyStatus);
|
|
1349 |
User::WaitForRequest(reqStatus);
|
|
1350 |
TESTL(reqStatus.Int()==KErrNone);
|
|
1351 |
TESTL(notifyStatus.Int()==KErrNone);
|
|
1352 |
|
|
1353 |
INFO_PRINTF1(_L("SetConfig GPRS with Additional Parameter Test Passed"));
|
|
1354 |
|
|
1355 |
TESTL(gprsContextNotify.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
1356 |
TESTL(gprsContextNotify.iAnonymousAccessReqd==DPCKTTSY_ANONYMOUS_ACCESS1);
|
|
1357 |
TESTL(gprsContextNotify.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
1358 |
TESTL(gprsContextNotify.iPdpCompression==DPCKTTSY_COMPRESSION1);
|
|
1359 |
TESTL(gprsContextNotify.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
1360 |
TESTL(gprsContextNotify.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL1);
|
|
1361 |
TESTL(gprsContextNotify.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME1);
|
|
1362 |
TESTL(gprsContextNotify.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD1);
|
|
1363 |
TESTL(gprsContextNotify.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE1);
|
|
1364 |
TESTL(gprsContextNotify.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE1);
|
|
1365 |
TESTL(gprsContextNotify.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER1);
|
|
1366 |
TESTL(gprsContextNotify.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER1);
|
|
1367 |
TESTL(gprsContextNotify.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID1);
|
|
1368 |
gprsContextNotify.iProtocolConfigOption.iMiscBuffer.SetLength(miscBufferGprs.Length());
|
|
1369 |
TESTL(gprsContextNotify.iProtocolConfigOption.iMiscBuffer == miscBufferGprs);
|
|
1370 |
|
|
1371 |
INFO_PRINTF1(_L("NotifyConfigChanged GPRS with Additional Parameter Test Passed"));
|
|
1372 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.70"));
|
|
1373 |
|
|
1374 |
// Test GPRS RPacketContext::GetConfig with additional parameter
|
|
1375 |
RPacketContext::TContextConfigGPRS gprsContextConfig_2;
|
|
1376 |
TESTL(gprsContextConfig_2.ExtensionId()==TPacketDataConfigBase::KConfigGPRS);
|
|
1377 |
TPckg<RPacketContext::TContextConfigGPRS> contextConfigPckgGPRS_2(gprsContextConfig_2);
|
|
1378 |
|
|
1379 |
iPacketContext.GetConfig(reqStatus, contextConfigPckgGPRS_2);
|
|
1380 |
User::WaitForRequest(reqStatus);
|
|
1381 |
TESTL(reqStatus.Int()==KErrNone);
|
|
1382 |
TESTL(gprsContextConfig_2.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
1383 |
TESTL(gprsContextConfig_2.iAnonymousAccessReqd==DPCKTTSY_ANONYMOUS_ACCESS1);
|
|
1384 |
TESTL(gprsContextConfig_2.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
1385 |
TESTL(gprsContextConfig_2.iPdpCompression==DPCKTTSY_COMPRESSION1);
|
|
1386 |
TESTL(gprsContextConfig_2.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
1387 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL1);
|
|
1388 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME1);
|
|
1389 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD1);
|
|
1390 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE1);
|
|
1391 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE1);
|
|
1392 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER1);
|
|
1393 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER1);
|
|
1394 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID1);
|
|
1395 |
gprsContextConfig_2.iProtocolConfigOption.iMiscBuffer.SetLength(miscBufferGprs.Length());
|
|
1396 |
TESTL(gprsContextConfig_2.iProtocolConfigOption.iMiscBuffer == miscBufferGprs);
|
|
1397 |
|
|
1398 |
INFO_PRINTF1(_L("GetConfig GPRS with Additional Parameter Test Passed"));
|
|
1399 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.71"));
|
|
1400 |
|
|
1401 |
// Clean up for next test case
|
|
1402 |
iPacketContext.Close();
|
|
1403 |
iPacketService.Close();
|
|
1404 |
iPhone.Close();
|
|
1405 |
|
|
1406 |
// Test RPacketService::Open
|
|
1407 |
ret = iPhone.Open(iTelServer,KPhoneName);
|
|
1408 |
INFO_PRINTF2(_L("Result: %d"),ret);
|
|
1409 |
TESTL(ret == KErrNone);
|
|
1410 |
INFO_PRINTF1(_L("Opened phone object"));
|
|
1411 |
|
|
1412 |
TESTL(iPacketService.Open(iPhone)==KErrNone);
|
|
1413 |
INFO_PRINTF1(_L("Opened packet object"));
|
|
1414 |
|
|
1415 |
// Test RPacketContext::OpenNewContext
|
|
1416 |
TName rel4ContextName;
|
|
1417 |
TName rel4ContextNameCompare;
|
|
1418 |
|
|
1419 |
TESTL(iPacketContext.OpenNewContext(iPacketService, rel4ContextName)==KErrNone);
|
|
1420 |
rel4ContextNameCompare.Append(KSimPrimaryPacketContextName);
|
|
1421 |
rel4ContextNameCompare.AppendNum(1);
|
|
1422 |
TESTL(rel4ContextName.Compare(rel4ContextNameCompare)==KErrNone);
|
|
1423 |
INFO_PRINTF1(_L("Opened R99_R4 context object"));
|
|
1424 |
|
|
1425 |
// Rel4_R99 RPacketContext::SetConfig and
|
|
1426 |
// RPacketContext::NotifyConfigChanged
|
|
1427 |
// when there is an additional mix binary and ASCII parameter
|
|
1428 |
// specified which only actually contains ASCII chars.
|
|
1429 |
RPacketContext::TContextConfigR99_R4 contextConfigRel4;
|
|
1430 |
TESTL(contextConfigRel4.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4);
|
|
1431 |
TPckg<RPacketContext::TContextConfigR99_R4> contextConfigRel4Pckg(contextConfigRel4);
|
|
1432 |
|
|
1433 |
RPacketContext::TContextConfigR99_R4 rel4ContextNotify;
|
|
1434 |
TESTL(rel4ContextNotify.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4);
|
|
1435 |
TPckg<RPacketContext::TContextConfigR99_R4> rel4ContextNotifyPckg(rel4ContextNotify);
|
|
1436 |
|
|
1437 |
contextConfigRel4.iAccessPointName = DPCKTTSY_ACCESS_POINT1;
|
|
1438 |
contextConfigRel4.iPdpAddress = DPCKTTSY_PDP_ADDRESS1;
|
|
1439 |
contextConfigRel4.iPdpType = DPCKTTSY_PDP_TYPE1;
|
|
1440 |
contextConfigRel4.iUseEdge = DPCKTTSY_EGPRS_REQUIRED;
|
|
1441 |
contextConfigRel4.iProtocolConfigOption.iAuthInfo.iProtocol = SIM_PACKET_CONTEXT_PROTOCOL2;
|
|
1442 |
contextConfigRel4.iProtocolConfigOption.iAuthInfo.iUsername = SIM_PACKET_CONTEXT_USERNAME2;
|
|
1443 |
contextConfigRel4.iProtocolConfigOption.iAuthInfo.iPassword = SIM_PACKET_CONTEXT_PASSWORD2;
|
|
1444 |
contextConfigRel4.iProtocolConfigOption.iChallenge = SIM_PACKET_CONTEXT_CHALLENGE2;
|
|
1445 |
contextConfigRel4.iProtocolConfigOption.iResponse = SIM_PACKET_CONTEXT_RESPONSE2;
|
|
1446 |
contextConfigRel4.iProtocolConfigOption.iDnsAddresses.iPrimaryDns = SIM_PACKET_CONTEXT_PRIMARYSERVER2;
|
|
1447 |
contextConfigRel4.iProtocolConfigOption.iDnsAddresses.iSecondaryDns = SIM_PACKET_CONTEXT_SECONDARYSERVER2;
|
|
1448 |
contextConfigRel4.iProtocolConfigOption.iId = SIM_PACKET_CONTEXT_ID2;
|
|
1449 |
|
|
1450 |
_LIT8(KBinaryAdditionalParam4,"abcDEFghi012345");
|
|
1451 |
|
|
1452 |
TBuf8<15> additionalParamDataR4_2(KBinaryAdditionalParam4);
|
|
1453 |
|
|
1454 |
RPacketContext::TPcoId pcoIdR4_2(R99_R4_PACKET_CONTEXT_PCO_ID);
|
|
1455 |
|
|
1456 |
RPacketContext::TMiscProtocolBuffer miscBufferR4_2;
|
|
1457 |
miscBufferR4_2.Zero();
|
|
1458 |
|
|
1459 |
TPtr8 pcoPtrR4_2(const_cast<TUint8*>(miscBufferR4_2.Ptr()),
|
|
1460 |
RPacketContext::KMiscProtocolBufferLength);
|
|
1461 |
|
|
1462 |
TPtr8 additionalParamDataPtrR4_2(const_cast<TUint8*>(additionalParamDataR4_2.Ptr()),
|
|
1463 |
additionalParamDataR4_2.Length(), additionalParamDataR4_2.Length());
|
|
1464 |
|
|
1465 |
// Attach TTlv to the buffer
|
|
1466 |
TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> theTLVR4_2(pcoPtrR4_2,0);
|
|
1467 |
|
|
1468 |
theTLVR4_2.AppendItemL(pcoIdR4_2,additionalParamDataPtrR4_2);
|
|
1469 |
|
|
1470 |
miscBufferR4_2.SetLength(pcoPtrR4_2.Length());
|
|
1471 |
|
|
1472 |
contextConfigRel4.iProtocolConfigOption.iMiscBuffer = miscBufferR4_2;
|
|
1473 |
|
|
1474 |
iPacketContext.NotifyConfigChanged(notifyStatus, rel4ContextNotifyPckg);
|
|
1475 |
iPacketContext.SetConfig(reqStatus, contextConfigRel4Pckg);
|
|
1476 |
|
|
1477 |
User::WaitForRequest(reqStatus);
|
|
1478 |
User::WaitForRequest(notifyStatus);
|
|
1479 |
|
|
1480 |
TESTL(reqStatus.Int()==KErrNone);
|
|
1481 |
TESTL(notifyStatus.Int()==KErrNone);
|
|
1482 |
|
|
1483 |
INFO_PRINTF1(_L("SetConfig Rel99_R4 with Additional Parameter Test Passed"));
|
|
1484 |
|
|
1485 |
TESTL(rel4ContextNotify.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
1486 |
TESTL(rel4ContextNotify.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
1487 |
TESTL(rel4ContextNotify.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
1488 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL2);
|
|
1489 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME2);
|
|
1490 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD2);
|
|
1491 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE2);
|
|
1492 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE2);
|
|
1493 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER2);
|
|
1494 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER2);
|
|
1495 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID2);
|
|
1496 |
rel4ContextNotify.iProtocolConfigOption.iMiscBuffer.SetLength(miscBufferR4_2.Length());
|
|
1497 |
TESTL(rel4ContextNotify.iProtocolConfigOption.iMiscBuffer == miscBufferR4_2);
|
|
1498 |
|
|
1499 |
INFO_PRINTF1(_L("NotifyConfigChanged Rel99_R4 with Additional Parameter Test Passed"));
|
|
1500 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.72"));
|
|
1501 |
|
|
1502 |
// Test R99_R4 RPacketContext::GetConfig with additional parameter
|
|
1503 |
RPacketContext::TContextConfigR99_R4 contextConfigR99_R4;
|
|
1504 |
TESTL(contextConfigR99_R4.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4);
|
|
1505 |
TPckg<RPacketContext::TContextConfigR99_R4> contextConfigR99_R4Pckg(contextConfigR99_R4);
|
|
1506 |
|
|
1507 |
iPacketContext.GetConfig(reqStatus, contextConfigR99_R4Pckg);
|
|
1508 |
User::WaitForRequest(reqStatus);
|
|
1509 |
TESTL(reqStatus.Int()==KErrNone);
|
|
1510 |
TESTL(contextConfigR99_R4.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
1511 |
TESTL(contextConfigR99_R4.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
1512 |
TESTL(contextConfigR99_R4.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
1513 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL2);
|
|
1514 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME2);
|
|
1515 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD2);
|
|
1516 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE2);
|
|
1517 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE2);
|
|
1518 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER2);
|
|
1519 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER2);
|
|
1520 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID2);
|
|
1521 |
contextConfigR99_R4.iProtocolConfigOption.iMiscBuffer.SetLength(miscBufferR4_2.Length());
|
|
1522 |
TESTL(contextConfigR99_R4.iProtocolConfigOption.iMiscBuffer == miscBufferR4_2);
|
|
1523 |
INFO_PRINTF1(_L("GetConfig Rel99_R4 with Additional Parameter Test Passed"));
|
|
1524 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.73"));
|
|
1525 |
|
|
1526 |
// Clear up
|
|
1527 |
iPacketContext.Close();
|
|
1528 |
iPacketService.Close();
|
|
1529 |
iPhone.Close();
|
|
1530 |
|
|
1531 |
ASSERT(RThread().RequestCount()==0);
|
|
1532 |
|
|
1533 |
return TestStepResult();
|
|
1534 |
}
|
|
1535 |
|
|
1536 |
CSimPacketDefaultBinaryAdditionalParamsTest::CSimPacketDefaultBinaryAdditionalParamsTest()
|
|
1537 |
/**
|
|
1538 |
Default constructor. Initialises the test step name.
|
|
1539 |
*/
|
|
1540 |
{
|
|
1541 |
SetTestStepName(_L("DefaultBinaryAdditionalParamsContextTest"));
|
|
1542 |
}
|
|
1543 |
|
|
1544 |
TVerdict CSimPacketDefaultBinaryAdditionalParamsTest::doTestStepL()
|
|
1545 |
/**
|
|
1546 |
The test step containing test cases for DEF082820
|
|
1547 |
*/
|
|
1548 |
{
|
|
1549 |
INFO_PRINTF1(_L("BeginDefaultBinaryAdditionalParamsContextTest"));
|
|
1550 |
|
|
1551 |
CreateConfigFileL(_L("c:\\config3.txt"));
|
|
1552 |
SetTestNumberL(18);
|
|
1553 |
|
|
1554 |
INFO_PRINTF1(_L("RPacketService Functionality"));
|
|
1555 |
|
|
1556 |
// Test RPacketService::Open
|
|
1557 |
TInt ret = iPhone.Open(iTelServer,KPhoneName);
|
|
1558 |
INFO_PRINTF2(_L("Result: %d"),ret);
|
|
1559 |
TESTL(ret == KErrNone);
|
|
1560 |
INFO_PRINTF1(_L("Opened phone object"));
|
|
1561 |
|
|
1562 |
TESTL(iPacketService.Open(iPhone)==KErrNone);
|
|
1563 |
INFO_PRINTF1(_L("Opened packet object"));
|
|
1564 |
|
|
1565 |
// Test RPacketContext::OpenNewContext
|
|
1566 |
TName gprsContextName;
|
|
1567 |
TName gprsContextNameCompare;
|
|
1568 |
TESTL(iPacketContext.OpenNewContext(iPacketService, gprsContextName)==KErrNone);
|
|
1569 |
gprsContextNameCompare.Append(KSimPrimaryPacketContextName);
|
|
1570 |
gprsContextNameCompare.AppendNum(1);
|
|
1571 |
TESTL(gprsContextName.Compare(gprsContextNameCompare)==KErrNone);
|
|
1572 |
INFO_PRINTF1(_L("Opened GPRS Context object"));
|
|
1573 |
|
|
1574 |
TRequestStatus reqStatus, notifyStatus;
|
|
1575 |
|
|
1576 |
// Test GPRS RPacketService::SetDefaultContextParams
|
|
1577 |
// When additional mixed binary and ASCII param is specified
|
|
1578 |
// which contains backslashes at beginning and end of
|
|
1579 |
// the data item.
|
|
1580 |
RPacketContext::TContextConfigGPRS defaultConfigGPRS;
|
|
1581 |
TPckg<RPacketContext::TContextConfigGPRS> defaultConfigPckgGPRS(defaultConfigGPRS);
|
|
1582 |
|
|
1583 |
defaultConfigGPRS.iAccessPointName = DPCKTTSY_ACCESS_POINT1;
|
|
1584 |
defaultConfigGPRS.iAnonymousAccessReqd = DPCKTTSY_ANONYMOUS_ACCESS1;
|
|
1585 |
defaultConfigGPRS.iPdpAddress = DPCKTTSY_PDP_ADDRESS1;
|
|
1586 |
defaultConfigGPRS.iPdpCompression = DPCKTTSY_COMPRESSION1;
|
|
1587 |
defaultConfigGPRS.iPdpType = DPCKTTSY_PDP_TYPE1;
|
|
1588 |
defaultConfigGPRS.iUseEdge = DPCKTTSY_EGPRS_REQUIRED;
|
|
1589 |
defaultConfigGPRS.iProtocolConfigOption.iAuthInfo.iProtocol = SIM_PACKET_CONTEXT_PROTOCOL1;
|
|
1590 |
defaultConfigGPRS.iProtocolConfigOption.iAuthInfo.iUsername = SIM_PACKET_CONTEXT_USERNAME1;
|
|
1591 |
defaultConfigGPRS.iProtocolConfigOption.iAuthInfo.iPassword = SIM_PACKET_CONTEXT_PASSWORD1;
|
|
1592 |
defaultConfigGPRS.iProtocolConfigOption.iChallenge = SIM_PACKET_CONTEXT_CHALLENGE1;
|
|
1593 |
defaultConfigGPRS.iProtocolConfigOption.iResponse = SIM_PACKET_CONTEXT_RESPONSE1;
|
|
1594 |
defaultConfigGPRS.iProtocolConfigOption.iDnsAddresses.iPrimaryDns = SIM_PACKET_CONTEXT_PRIMARYSERVER1;
|
|
1595 |
defaultConfigGPRS.iProtocolConfigOption.iDnsAddresses.iSecondaryDns = SIM_PACKET_CONTEXT_SECONDARYSERVER1;
|
|
1596 |
defaultConfigGPRS.iProtocolConfigOption.iId = SIM_PACKET_CONTEXT_ID1;
|
|
1597 |
|
|
1598 |
_LIT8(KBinaryAdditionalParam1,"\\\\PQR\\\\\\");
|
|
1599 |
TBuf8<8> additionalParamDataGprs(KBinaryAdditionalParam1);
|
|
1600 |
|
|
1601 |
RPacketContext::TPcoId pcoId(GPRS_PACKET_CONTEXT_PCO_ID);
|
|
1602 |
|
|
1603 |
RPacketContext::TMiscProtocolBuffer miscBufferGprs;
|
|
1604 |
miscBufferGprs.Zero();
|
|
1605 |
|
|
1606 |
TPtr8 pcoPtrGprs(const_cast<TUint8*>(miscBufferGprs.Ptr()),
|
|
1607 |
RPacketContext::KMiscProtocolBufferLength);
|
|
1608 |
|
|
1609 |
TPtr8 additionalParamDataPtrGprs(const_cast<TUint8*>(additionalParamDataGprs.Ptr()),
|
|
1610 |
additionalParamDataGprs.Length(), additionalParamDataGprs.Length());
|
|
1611 |
|
|
1612 |
// Attach TTlv to the buffer
|
|
1613 |
TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> theTLVGprs(pcoPtrGprs,0);
|
|
1614 |
|
|
1615 |
theTLVGprs.AppendItemL(pcoId,additionalParamDataPtrGprs);
|
|
1616 |
|
|
1617 |
miscBufferGprs.SetLength(pcoPtrGprs.Length());
|
|
1618 |
|
|
1619 |
defaultConfigGPRS.iProtocolConfigOption.iMiscBuffer = miscBufferGprs;
|
|
1620 |
|
|
1621 |
TESTL(iPacketService.SetDefaultContextParams(defaultConfigPckgGPRS) == KErrNone);
|
|
1622 |
INFO_PRINTF1(_L("SetDefault Params GPRS when additional params specified test Passed"));
|
|
1623 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.73"));
|
|
1624 |
|
|
1625 |
// Test GPRS RPacketService::GetDefaultContextParams
|
|
1626 |
// when there are additional parameters
|
|
1627 |
RPacketContext::TContextConfigGPRS defaultConfigGPRS_2;
|
|
1628 |
TPckg<RPacketContext::TContextConfigGPRS> defaultConfigPckgGPRS_2(defaultConfigGPRS_2);
|
|
1629 |
TESTL(iPacketService.GetDefaultContextParams(defaultConfigPckgGPRS_2) == KErrNone);
|
|
1630 |
TESTL(defaultConfigGPRS_2.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
1631 |
TESTL(defaultConfigGPRS_2.iAnonymousAccessReqd==DPCKTTSY_ANONYMOUS_ACCESS1);
|
|
1632 |
TESTL(defaultConfigGPRS_2.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
1633 |
TESTL(defaultConfigGPRS_2.iPdpCompression==DPCKTTSY_COMPRESSION1);
|
|
1634 |
TESTL(defaultConfigGPRS_2.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
1635 |
TESTL(defaultConfigGPRS_2.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL1);
|
|
1636 |
TESTL(defaultConfigGPRS_2.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME1);
|
|
1637 |
TESTL(defaultConfigGPRS_2.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD1);
|
|
1638 |
TESTL(defaultConfigGPRS_2.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE1);
|
|
1639 |
TESTL(defaultConfigGPRS_2.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE1);
|
|
1640 |
TESTL(defaultConfigGPRS_2.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER1);
|
|
1641 |
TESTL(defaultConfigGPRS_2.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER1);
|
|
1642 |
TESTL(defaultConfigGPRS_2.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID1);
|
|
1643 |
defaultConfigGPRS_2.iProtocolConfigOption.iMiscBuffer.SetLength(miscBufferGprs.Length());
|
|
1644 |
TESTL(defaultConfigGPRS_2.iProtocolConfigOption.iMiscBuffer == miscBufferGprs);
|
|
1645 |
INFO_PRINTF1(_L("GetDefault Params GPRS where there are additional params test Passed"));
|
|
1646 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.74"));
|
|
1647 |
|
|
1648 |
// Test R5 RPacketService::SetDefaultContextParams
|
|
1649 |
// When a mixed additional param item is specified
|
|
1650 |
// which contains 128 bits of binary data.
|
|
1651 |
RPacketContext::TContextConfig_R5 defaultConfigR5;
|
|
1652 |
TPckg<RPacketContext::TContextConfig_R5> defaultConfigPckgR5(defaultConfigR5);
|
|
1653 |
|
|
1654 |
defaultConfigR5.iAccessPointName = R5_CONTEXT_GGSN;
|
|
1655 |
defaultConfigR5.iPdpAddress = R5_CONTEXT_PDP_ADDRESS;
|
|
1656 |
defaultConfigR5.iPdpType = R5_CONTEXT_PROTOCOL;
|
|
1657 |
defaultConfigR5.iUseEdge = R5_CONTEXT_USE_EDGE;
|
|
1658 |
defaultConfigR5.iProtocolConfigOption.iAuthInfo.iProtocol = R5_CONTEXT_AUTH_PROT;
|
|
1659 |
defaultConfigR5.iProtocolConfigOption.iAuthInfo.iUsername = R5_CONTEXT_USERNAME;
|
|
1660 |
defaultConfigR5.iProtocolConfigOption.iAuthInfo.iPassword = R5_CONTEXT_PASSWORD;
|
|
1661 |
defaultConfigR5.iProtocolConfigOption.iChallenge = R5_CONTEXT_CHALLENGE;
|
|
1662 |
defaultConfigR5.iProtocolConfigOption.iResponse = R5_CONTEXT_RESPONSE;
|
|
1663 |
defaultConfigR5.iProtocolConfigOption.iDnsAddresses.iPrimaryDns = R5_CONTEXT_DNS1;
|
|
1664 |
defaultConfigR5.iProtocolConfigOption.iDnsAddresses.iSecondaryDns = R5_CONTEXT_DNS2;
|
|
1665 |
defaultConfigR5.iProtocolConfigOption.iId = R5_CONTEXT_ID;
|
|
1666 |
defaultConfigR5.iPdpHeaderCompression = R5_CONTEXT_HEADER_COMPRESSION;
|
|
1667 |
defaultConfigR5.iPdpDataCompression = R5_CONTEXT_DATA_COMPRESSION;
|
|
1668 |
|
|
1669 |
const TUint8 binaryDefaultAdditionalParamR5[17] =
|
|
1670 |
{0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0x10,0x00};
|
|
1671 |
|
|
1672 |
TBuf8<16> additionalParamDataR5(binaryDefaultAdditionalParamR5);
|
|
1673 |
|
|
1674 |
RPacketContext::TPcoId pcoIdR5(R5_CONTEXT_PCO_ID);
|
|
1675 |
|
|
1676 |
RPacketContext::TMiscProtocolBuffer miscBufferR5;
|
|
1677 |
|
|
1678 |
miscBufferR5.Zero();
|
|
1679 |
|
|
1680 |
TPtr8 pcoPtrR5(const_cast<TUint8*>(miscBufferR5.Ptr()),
|
|
1681 |
RPacketContext::KMiscProtocolBufferLength);
|
|
1682 |
|
|
1683 |
TPtr8 additionalParamDataPtrR5(const_cast<TUint8*>(additionalParamDataR5.Ptr()),
|
|
1684 |
additionalParamDataR5.Length(), additionalParamDataR5.Length());
|
|
1685 |
|
|
1686 |
// Attach TTlv to the buffer
|
|
1687 |
TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> theTLVR5(pcoPtrR5,0);
|
|
1688 |
|
|
1689 |
theTLVR5.AppendItemL(pcoIdR5,additionalParamDataPtrR5);
|
|
1690 |
|
|
1691 |
miscBufferR5.SetLength(pcoPtrR5.Length());
|
|
1692 |
|
|
1693 |
defaultConfigR5.iProtocolConfigOption.iMiscBuffer = miscBufferR5;
|
|
1694 |
ret = iPacketService.SetDefaultContextParams(defaultConfigPckgR5);
|
|
1695 |
|
|
1696 |
INFO_PRINTF1(_L("SetDefault Params R5 when there are additional params test Passed"));
|
|
1697 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.75"));
|
|
1698 |
|
|
1699 |
// Test R5 RPacketService::GetDefaultContextParams
|
|
1700 |
// when there are additional params
|
|
1701 |
RPacketContext::TContextConfig_R5 defaultConfigR5_2;
|
|
1702 |
TPckg<RPacketContext::TContextConfig_R5> defaultConfigPckgR5_2(defaultConfigR5_2);
|
|
1703 |
|
|
1704 |
ret = iPacketService.GetDefaultContextParams(defaultConfigPckgR5_2);
|
|
1705 |
|
|
1706 |
TESTL(defaultConfigR5_2.iAccessPointName == R5_CONTEXT_GGSN);
|
|
1707 |
TESTL(defaultConfigR5_2.iPdpAddress == R5_CONTEXT_PDP_ADDRESS);
|
|
1708 |
TESTL(defaultConfigR5_2.iPdpType == R5_CONTEXT_PROTOCOL);
|
|
1709 |
TESTL(defaultConfigR5_2.iUseEdge == R5_CONTEXT_USE_EDGE);
|
|
1710 |
TESTL(defaultConfigR5_2.iProtocolConfigOption.iAuthInfo.iProtocol == R5_CONTEXT_AUTH_PROT);
|
|
1711 |
TESTL(defaultConfigR5_2.iProtocolConfigOption.iAuthInfo.iUsername == R5_CONTEXT_USERNAME);
|
|
1712 |
TESTL(defaultConfigR5_2.iProtocolConfigOption.iAuthInfo.iPassword == R5_CONTEXT_PASSWORD);
|
|
1713 |
TESTL(defaultConfigR5_2.iProtocolConfigOption.iChallenge == R5_CONTEXT_CHALLENGE);
|
|
1714 |
TESTL(defaultConfigR5_2.iProtocolConfigOption.iResponse == R5_CONTEXT_RESPONSE);
|
|
1715 |
TESTL(defaultConfigR5_2.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == R5_CONTEXT_DNS1);
|
|
1716 |
TESTL(defaultConfigR5_2.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == R5_CONTEXT_DNS2);
|
|
1717 |
TESTL(defaultConfigR5_2.iProtocolConfigOption.iId == R5_CONTEXT_ID);
|
|
1718 |
TESTL(defaultConfigR5_2.iPdpHeaderCompression == R5_CONTEXT_HEADER_COMPRESSION);
|
|
1719 |
TESTL(defaultConfigR5_2.iPdpDataCompression == R5_CONTEXT_DATA_COMPRESSION);
|
|
1720 |
defaultConfigR5_2.iProtocolConfigOption.iMiscBuffer.SetLength(miscBufferR5.Length());
|
|
1721 |
TESTL(defaultConfigR5_2.iProtocolConfigOption.iMiscBuffer == miscBufferR5);
|
|
1722 |
INFO_PRINTF1(_L("GetDefault Params R5 with additional params test Passed"));
|
|
1723 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.76"));
|
|
1724 |
|
|
1725 |
// Test UMTS RPacketService::GetDefaultContextParams
|
|
1726 |
// when an additional mixed binary and ASCII parameter is
|
|
1727 |
// specified which contains a both binary non-printable chars
|
|
1728 |
// and back slashes
|
|
1729 |
|
|
1730 |
RPacketContext::TContextConfigR99_R4 defaultConfigR99_R4;
|
|
1731 |
TPckg<RPacketContext::TContextConfigR99_R4> defaultConfigPckgR99_R4(defaultConfigR99_R4);
|
|
1732 |
|
|
1733 |
defaultConfigR99_R4.iAccessPointName = DPCKTTSY_ACCESS_POINT1;
|
|
1734 |
defaultConfigR99_R4.iPdpAddress = DPCKTTSY_PDP_ADDRESS1;
|
|
1735 |
defaultConfigR99_R4.iPdpType = DPCKTTSY_PDP_TYPE1;
|
|
1736 |
defaultConfigR99_R4.iUseEdge = DPCKTTSY_EGPRS_REQUIRED;
|
|
1737 |
defaultConfigR99_R4.iProtocolConfigOption.iAuthInfo.iProtocol = SIM_PACKET_CONTEXT_PROTOCOL2;
|
|
1738 |
defaultConfigR99_R4.iProtocolConfigOption.iAuthInfo.iUsername = SIM_PACKET_CONTEXT_USERNAME2;
|
|
1739 |
defaultConfigR99_R4.iProtocolConfigOption.iAuthInfo.iPassword = SIM_PACKET_CONTEXT_PASSWORD2;
|
|
1740 |
defaultConfigR99_R4.iProtocolConfigOption.iChallenge = SIM_PACKET_CONTEXT_CHALLENGE2;
|
|
1741 |
defaultConfigR99_R4.iProtocolConfigOption.iResponse = SIM_PACKET_CONTEXT_RESPONSE2;
|
|
1742 |
defaultConfigR99_R4.iProtocolConfigOption.iDnsAddresses.iPrimaryDns = SIM_PACKET_CONTEXT_PRIMARYSERVER2;
|
|
1743 |
defaultConfigR99_R4.iProtocolConfigOption.iDnsAddresses.iSecondaryDns = SIM_PACKET_CONTEXT_SECONDARYSERVER2;
|
|
1744 |
defaultConfigR99_R4.iProtocolConfigOption.iId = SIM_PACKET_CONTEXT_ID2;
|
|
1745 |
|
|
1746 |
const TUint8 binaryDefaultAdditionalParam[12] =
|
|
1747 |
{'\\',0x0A,'\\',0x0B,'\\',0x0C,'\\',0x0D,'\\',0x0E,'\\',0x00};
|
|
1748 |
|
|
1749 |
TBuf8<11> additionalParamDataR4(binaryDefaultAdditionalParam);
|
|
1750 |
|
|
1751 |
RPacketContext::TPcoId pcoIdR4(R99_R4_PACKET_CONTEXT_PCO_ID);
|
|
1752 |
|
|
1753 |
RPacketContext::TMiscProtocolBuffer miscBufferR4;
|
|
1754 |
miscBufferR4.Zero();
|
|
1755 |
|
|
1756 |
TPtr8 pcoPtrR4(const_cast<TUint8*>(miscBufferR4.Ptr()),
|
|
1757 |
RPacketContext::KMiscProtocolBufferLength);
|
|
1758 |
|
|
1759 |
TPtr8 additionalParamDataPtrR4(const_cast<TUint8*>(additionalParamDataR4.Ptr()),
|
|
1760 |
additionalParamDataR4.Length(), additionalParamDataR4.Length());
|
|
1761 |
|
|
1762 |
// Attach TTlv to the buffer
|
|
1763 |
TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> theTLVR4(pcoPtrR4,0);
|
|
1764 |
|
|
1765 |
theTLVR4.AppendItemL(pcoIdR4,additionalParamDataPtrR4);
|
|
1766 |
|
|
1767 |
miscBufferR4.SetLength(pcoPtrR4.Length());
|
|
1768 |
|
|
1769 |
defaultConfigR99_R4.iProtocolConfigOption.iMiscBuffer = miscBufferR4;
|
|
1770 |
|
|
1771 |
TESTL(iPacketService.SetDefaultContextParams(defaultConfigPckgR99_R4) == KErrNone);
|
|
1772 |
INFO_PRINTF1(_L("SetDefault Params R99_R4 test Passed"));
|
|
1773 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.77"));
|
|
1774 |
|
|
1775 |
// Test RPacketService::GetDefaultContextParams
|
|
1776 |
RPacketContext::TContextConfigR99_R4 defaultConfigR99_R4_2;
|
|
1777 |
TPckg<RPacketContext::TContextConfigR99_R4> defaultConfigPckgR99_R4_2(defaultConfigR99_R4_2);
|
|
1778 |
|
|
1779 |
TESTL(iPacketService.GetDefaultContextParams(defaultConfigPckgR99_R4_2) == KErrNone);
|
|
1780 |
TESTL(defaultConfigR99_R4_2.iAccessPointName==DPCKTTSY_ACCESS_POINT1);
|
|
1781 |
TESTL(defaultConfigR99_R4_2.iPdpAddress==DPCKTTSY_PDP_ADDRESS1);
|
|
1782 |
TESTL(defaultConfigR99_R4_2.iPdpType==DPCKTTSY_PDP_TYPE1);
|
|
1783 |
TESTL(defaultConfigR99_R4_2.iProtocolConfigOption.iAuthInfo.iProtocol == SIM_PACKET_CONTEXT_PROTOCOL2);
|
|
1784 |
TESTL(defaultConfigR99_R4_2.iProtocolConfigOption.iAuthInfo.iUsername == SIM_PACKET_CONTEXT_USERNAME2);
|
|
1785 |
TESTL(defaultConfigR99_R4_2.iProtocolConfigOption.iAuthInfo.iPassword == SIM_PACKET_CONTEXT_PASSWORD2);
|
|
1786 |
TESTL(defaultConfigR99_R4_2.iProtocolConfigOption.iChallenge == SIM_PACKET_CONTEXT_CHALLENGE2);
|
|
1787 |
TESTL(defaultConfigR99_R4_2.iProtocolConfigOption.iResponse == SIM_PACKET_CONTEXT_RESPONSE2);
|
|
1788 |
TESTL(defaultConfigR99_R4_2.iProtocolConfigOption.iDnsAddresses.iPrimaryDns == SIM_PACKET_CONTEXT_PRIMARYSERVER2);
|
|
1789 |
TESTL(defaultConfigR99_R4_2.iProtocolConfigOption.iDnsAddresses.iSecondaryDns == SIM_PACKET_CONTEXT_SECONDARYSERVER2);
|
|
1790 |
TESTL(defaultConfigR99_R4_2.iProtocolConfigOption.iId == SIM_PACKET_CONTEXT_ID2);
|
|
1791 |
defaultConfigR99_R4_2.iProtocolConfigOption.iMiscBuffer.SetLength(miscBufferR4.Length());
|
|
1792 |
TESTL(defaultConfigR99_R4_2.iProtocolConfigOption.iMiscBuffer == miscBufferR4);
|
|
1793 |
|
|
1794 |
INFO_PRINTF1(_L("GetDefault Params R99_R4 test Passed"));
|
|
1795 |
CHECKPOINTL(ret,KErrNone,CHP_CNTXT_CASE("E.78"));
|
|
1796 |
|
|
1797 |
// Clear up
|
|
1798 |
iPacketContext.Close();
|
|
1799 |
iPacketService.Close();
|
|
1800 |
iPhone.Close();
|
|
1801 |
|
|
1802 |
ASSERT(RThread().RequestCount()==0);
|
|
1803 |
|
|
1804 |
return TestStepResult();
|
|
1805 |
}
|