sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
|
sl@0
|
20 |
#include "tupsclientstep.h"
|
sl@0
|
21 |
#include "tupsintegdefs.h"
|
sl@0
|
22 |
#include "tupsproperty.h"
|
sl@0
|
23 |
#include <e32property.h>
|
sl@0
|
24 |
|
sl@0
|
25 |
|
sl@0
|
26 |
TServiceRequestParameters::TServiceRequestParameters()
|
sl@0
|
27 |
:iServiceUID(0), iServerName(0),iDestination(0), iExpectedError(0),
|
sl@0
|
28 |
iOpaqueData(0), iSelectDialogOption(0), iButtonsDisplayed(0),
|
sl@0
|
29 |
iDialogCreatorInvoked(0), iPolicyEvaluatorInvoked(0), iAccessGranted(0),
|
sl@0
|
30 |
iCloseSession(EFalse), iHoldEvaluatorOpen(EFalse), iHoldPrepareDialogOpen(EFalse), iHoldDisplayDialogOpen(EFalse),
|
sl@0
|
31 |
iRequestDurationThreshold(0), iLeaveDialog(EFalse), iLeaveEvaluator(EFalse), iCancelUpsRequest(EFalse),
|
sl@0
|
32 |
iPlatSecPass(EFalse),iForcePrompt(EFalse),iExpectedEvaluatorInfo(0),iSelectFingerprint(0),
|
sl@0
|
33 |
iWaitUntilFileAppears(0)
|
sl@0
|
34 |
{
|
sl@0
|
35 |
};
|
sl@0
|
36 |
|
sl@0
|
37 |
COpenSession* COpenSession::NewL(const TPtrC& aServerName)
|
sl@0
|
38 |
{
|
sl@0
|
39 |
COpenSession * self = new (ELeave) COpenSession();
|
sl@0
|
40 |
CleanupStack::PushL(self);
|
sl@0
|
41 |
self->ConstructL(aServerName);
|
sl@0
|
42 |
CleanupStack::Pop(self);
|
sl@0
|
43 |
return(self);
|
sl@0
|
44 |
} // End of function
|
sl@0
|
45 |
|
sl@0
|
46 |
void COpenSession::ConstructL(const TPtrC& aServerName)
|
sl@0
|
47 |
{
|
sl@0
|
48 |
iServerName = aServerName;
|
sl@0
|
49 |
iPointerToServer = new RUpsTestServ;
|
sl@0
|
50 |
User::LeaveIfError(iPointerToServer->Connect(iServerName, ETrue));
|
sl@0
|
51 |
iPointerToSession = new RUpsTestSession;
|
sl@0
|
52 |
User::LeaveIfError(iPointerToSession->Open(*iPointerToServer));
|
sl@0
|
53 |
} // End of function
|
sl@0
|
54 |
|
sl@0
|
55 |
COpenSession::~COpenSession()
|
sl@0
|
56 |
{
|
sl@0
|
57 |
if (iPointerToSession)
|
sl@0
|
58 |
iPointerToSession->Close();
|
sl@0
|
59 |
if (iPointerToServer)
|
sl@0
|
60 |
iPointerToServer->Close();
|
sl@0
|
61 |
delete iPointerToSession;
|
sl@0
|
62 |
delete iPointerToServer;
|
sl@0
|
63 |
} // End of function
|
sl@0
|
64 |
|
sl@0
|
65 |
CUpsClientStep::~CUpsClientStep()
|
sl@0
|
66 |
/**
|
sl@0
|
67 |
* Destructor
|
sl@0
|
68 |
*/
|
sl@0
|
69 |
{
|
sl@0
|
70 |
iArraySersToRequest.Close();
|
sl@0
|
71 |
|
sl@0
|
72 |
CloseAllOpenSessions();
|
sl@0
|
73 |
delete iPropertyReader;
|
sl@0
|
74 |
__UHEAP_MARKEND;
|
sl@0
|
75 |
} // End of function
|
sl@0
|
76 |
|
sl@0
|
77 |
|
sl@0
|
78 |
CUpsClientStep::CUpsClientStep()
|
sl@0
|
79 |
/**
|
sl@0
|
80 |
* Constructor
|
sl@0
|
81 |
*/
|
sl@0
|
82 |
{
|
sl@0
|
83 |
SetTestStepName(KUPSClientStep);
|
sl@0
|
84 |
} // End of function
|
sl@0
|
85 |
|
sl@0
|
86 |
|
sl@0
|
87 |
TVerdict CUpsClientStep::doTestStepPreambleL()
|
sl@0
|
88 |
/**
|
sl@0
|
89 |
* @return - TVerdict code
|
sl@0
|
90 |
* Override of base class virtual
|
sl@0
|
91 |
*/
|
sl@0
|
92 |
{
|
sl@0
|
93 |
|
sl@0
|
94 |
__UHEAP_MARK;
|
sl@0
|
95 |
|
sl@0
|
96 |
// Read values to config servers from INI file. (ARRAY of values)
|
sl@0
|
97 |
|
sl@0
|
98 |
// Read how many times the test step needs to be repeated.
|
sl@0
|
99 |
TName fStepRepeat(_L("StepRepeat"));
|
sl@0
|
100 |
TInt repeats;
|
sl@0
|
101 |
|
sl@0
|
102 |
if(GetIntFromConfig(ConfigSection(),fStepRepeat,repeats))
|
sl@0
|
103 |
{
|
sl@0
|
104 |
iStepRepeat=repeats;
|
sl@0
|
105 |
}
|
sl@0
|
106 |
else
|
sl@0
|
107 |
{
|
sl@0
|
108 |
iStepRepeat=1;
|
sl@0
|
109 |
}
|
sl@0
|
110 |
|
sl@0
|
111 |
// Read values for test sequence from INI file. (ARRAY of values)
|
sl@0
|
112 |
TInt index=0;
|
sl@0
|
113 |
TName fUseServiceUID;
|
sl@0
|
114 |
fUseServiceUID.Format(_L("UseServiceUID_%d"),index);
|
sl@0
|
115 |
TName fUseServerName;
|
sl@0
|
116 |
fUseServerName.Format(_L("UseServerName_%d"),index);
|
sl@0
|
117 |
TName fDestination;
|
sl@0
|
118 |
fDestination.Format(_L("Destination_%d"),index);
|
sl@0
|
119 |
TName fExpectedError;
|
sl@0
|
120 |
fExpectedError.Format(_L("ExpectedError_%d"),index);
|
sl@0
|
121 |
TName fUseOpaqueData;
|
sl@0
|
122 |
fUseOpaqueData.Format(_L("UseOpaqueData_%d"),index);
|
sl@0
|
123 |
TName fSelectDialogOption;
|
sl@0
|
124 |
fSelectDialogOption.Format(_L("SelectDialogOption_%d"),index);
|
sl@0
|
125 |
TName fButtonsDisplayed;
|
sl@0
|
126 |
fButtonsDisplayed.Format(_L("ButtonsDisplayed_%d"),index);
|
sl@0
|
127 |
TName fDialogCreatorInvoked;
|
sl@0
|
128 |
fDialogCreatorInvoked.Format(_L("DialogCreatorInvoked_%d"),index);
|
sl@0
|
129 |
TName fPolicyEvaluatorInvoked;
|
sl@0
|
130 |
fPolicyEvaluatorInvoked.Format(_L("PolicyEvaluatorInvoked_%d"),index);
|
sl@0
|
131 |
TName fAccessGranted;
|
sl@0
|
132 |
fAccessGranted.Format(_L("AccessGranted_%d"), index);
|
sl@0
|
133 |
TName fCloseSession;
|
sl@0
|
134 |
fCloseSession.Format(_L("CloseSession_%d"), index);
|
sl@0
|
135 |
TName fHoldEvaluatorOpen;
|
sl@0
|
136 |
fHoldEvaluatorOpen.Format(_L("HoldEvaluatorOpen_%d"), index);
|
sl@0
|
137 |
TName fHoldPrepareDialogOpen;
|
sl@0
|
138 |
fHoldPrepareDialogOpen.Format(_L("HoldPrepareDialogOpen_%d"), index);
|
sl@0
|
139 |
TName fHoldDisplayDialogOpen;
|
sl@0
|
140 |
fHoldDisplayDialogOpen.Format(_L("HoldDisplayDialogOpen_%d"), index);
|
sl@0
|
141 |
TName fRequestDurationThreshold;
|
sl@0
|
142 |
fRequestDurationThreshold.Format(_L("RequestDurationThreshold_%d"), index);
|
sl@0
|
143 |
TName fLeaveDialog;
|
sl@0
|
144 |
fLeaveDialog.Format(_L("LeaveDialog_%d"), index);
|
sl@0
|
145 |
TName fLeaveEvaluator;
|
sl@0
|
146 |
fLeaveEvaluator.Format(_L("LeaveEvaluator_%d"), index);
|
sl@0
|
147 |
TName fCancelUpsRequest;
|
sl@0
|
148 |
fCancelUpsRequest.Format(_L("CancelUpsRequest_%d"), index);
|
sl@0
|
149 |
TName fPlatSecPass;
|
sl@0
|
150 |
fPlatSecPass.Format(_L("PlatSecPass_%d"), index);
|
sl@0
|
151 |
TName fForcePrompt;
|
sl@0
|
152 |
fForcePrompt.Format(_L("ForcePrompt_%d"), index);
|
sl@0
|
153 |
TName fExpectedEvaInfo;
|
sl@0
|
154 |
fExpectedEvaInfo.Format(_L("ExpectedEvaluatorInfo_%d"), index);
|
sl@0
|
155 |
TName fSelectFingerprint;
|
sl@0
|
156 |
fSelectFingerprint.Format(_L("SelectFingerprint_%d"), index);
|
sl@0
|
157 |
TName fWaitUntilFileAppears;
|
sl@0
|
158 |
fWaitUntilFileAppears.Format(_L("WaitUntilFileAppears_%d"), index);
|
sl@0
|
159 |
|
sl@0
|
160 |
TInt useServiceUID;
|
sl@0
|
161 |
TPtrC useServerName;
|
sl@0
|
162 |
TPtrC destination;
|
sl@0
|
163 |
TInt expectedError;
|
sl@0
|
164 |
TPtrC useOpaqueData;
|
sl@0
|
165 |
TPtrC selectDialogOption;
|
sl@0
|
166 |
TInt buttonsDisplayed;
|
sl@0
|
167 |
TInt dialogCreatorInvoked;
|
sl@0
|
168 |
TInt policyEvaluatorInvoked;
|
sl@0
|
169 |
TPtrC accessGranted;
|
sl@0
|
170 |
TBool closeSession;
|
sl@0
|
171 |
TBool holdEvaluatorOpen;
|
sl@0
|
172 |
TBool holdPrepareDialogOpen;
|
sl@0
|
173 |
TBool holdDisplayDialogOpen;
|
sl@0
|
174 |
TInt requestDurationThreshold;
|
sl@0
|
175 |
TBool leaveDialog;
|
sl@0
|
176 |
TBool leaveEvaluator;
|
sl@0
|
177 |
TBool cancelUpsRequest;
|
sl@0
|
178 |
TBool platSecPass;
|
sl@0
|
179 |
TBool forcePrompt;
|
sl@0
|
180 |
TInt expectedEvaInfo;
|
sl@0
|
181 |
TInt selectFingerprint;
|
sl@0
|
182 |
TPtrC waitUntilFileAppears;
|
sl@0
|
183 |
|
sl@0
|
184 |
while (GetHexFromConfig(ConfigSection(), fUseServiceUID,useServiceUID)
|
sl@0
|
185 |
&& GetStringFromConfig(ConfigSection(),fUseServerName,useServerName)
|
sl@0
|
186 |
&& GetStringFromConfig(ConfigSection(),fDestination,destination)
|
sl@0
|
187 |
&& GetStringFromConfig(ConfigSection(),fAccessGranted,accessGranted))
|
sl@0
|
188 |
{
|
sl@0
|
189 |
TServiceRequestParameters newSerReq;
|
sl@0
|
190 |
newSerReq.iServiceUID = useServiceUID;
|
sl@0
|
191 |
newSerReq.iServerName = useServerName;
|
sl@0
|
192 |
newSerReq.iDestination = destination;
|
sl@0
|
193 |
newSerReq.iAccessGranted = accessGranted;
|
sl@0
|
194 |
|
sl@0
|
195 |
// Close session is optional.
|
sl@0
|
196 |
if(GetBoolFromConfig(ConfigSection(),fCloseSession,closeSession))
|
sl@0
|
197 |
{
|
sl@0
|
198 |
newSerReq.iCloseSession = closeSession;
|
sl@0
|
199 |
}
|
sl@0
|
200 |
|
sl@0
|
201 |
// use of dialog creator is optional.
|
sl@0
|
202 |
if(GetStringFromConfig(ConfigSection(),fSelectDialogOption,selectDialogOption)
|
sl@0
|
203 |
&& GetIntFromConfig(ConfigSection(),fButtonsDisplayed,buttonsDisplayed)
|
sl@0
|
204 |
&& GetIntFromConfig(ConfigSection(),fDialogCreatorInvoked,dialogCreatorInvoked))
|
sl@0
|
205 |
{
|
sl@0
|
206 |
newSerReq.iSelectDialogOption = selectDialogOption;
|
sl@0
|
207 |
newSerReq.iButtonsDisplayed = buttonsDisplayed;
|
sl@0
|
208 |
newSerReq.iDialogCreatorInvoked = dialogCreatorInvoked;
|
sl@0
|
209 |
}
|
sl@0
|
210 |
|
sl@0
|
211 |
// use of policy evaluator is optional.
|
sl@0
|
212 |
if(GetIntFromConfig(ConfigSection(),fPolicyEvaluatorInvoked,policyEvaluatorInvoked))
|
sl@0
|
213 |
{
|
sl@0
|
214 |
newSerReq.iPolicyEvaluatorInvoked = policyEvaluatorInvoked;
|
sl@0
|
215 |
}
|
sl@0
|
216 |
|
sl@0
|
217 |
// Opaque data is optional
|
sl@0
|
218 |
if(GetStringFromConfig(ConfigSection(),fUseOpaqueData,useOpaqueData))
|
sl@0
|
219 |
{
|
sl@0
|
220 |
HBufC8* converter = HBufC8::NewLC(useOpaqueData.Length());
|
sl@0
|
221 |
converter->Des().Copy(useOpaqueData);
|
sl@0
|
222 |
|
sl@0
|
223 |
newSerReq.iOpaqueData = converter->Ptr() ;
|
sl@0
|
224 |
CleanupStack::PopAndDestroy(); //converter
|
sl@0
|
225 |
}
|
sl@0
|
226 |
|
sl@0
|
227 |
// Expected error is optional.
|
sl@0
|
228 |
if(GetIntFromConfig(ConfigSection(),fExpectedError,expectedError))
|
sl@0
|
229 |
{
|
sl@0
|
230 |
newSerReq.iExpectedError = expectedError;
|
sl@0
|
231 |
}
|
sl@0
|
232 |
|
sl@0
|
233 |
// hold policy evaluator open is optional.
|
sl@0
|
234 |
if(GetBoolFromConfig(ConfigSection(),fHoldEvaluatorOpen, holdEvaluatorOpen))
|
sl@0
|
235 |
{
|
sl@0
|
236 |
newSerReq.iHoldEvaluatorOpen = holdEvaluatorOpen;
|
sl@0
|
237 |
}
|
sl@0
|
238 |
|
sl@0
|
239 |
// hold prepare dialog open is optional.
|
sl@0
|
240 |
if(GetBoolFromConfig(ConfigSection(),fHoldPrepareDialogOpen, holdPrepareDialogOpen))
|
sl@0
|
241 |
{
|
sl@0
|
242 |
newSerReq.iHoldPrepareDialogOpen = holdPrepareDialogOpen;
|
sl@0
|
243 |
}
|
sl@0
|
244 |
|
sl@0
|
245 |
// hold display dialog open is optional.
|
sl@0
|
246 |
if(GetBoolFromConfig(ConfigSection(),fHoldDisplayDialogOpen, holdDisplayDialogOpen))
|
sl@0
|
247 |
{
|
sl@0
|
248 |
newSerReq.iHoldDisplayDialogOpen = holdDisplayDialogOpen;
|
sl@0
|
249 |
}
|
sl@0
|
250 |
|
sl@0
|
251 |
// request duration threshold - if a request takes
|
sl@0
|
252 |
// longer than this threshold it will fail the test
|
sl@0
|
253 |
if(GetIntFromConfig(ConfigSection(),fRequestDurationThreshold, requestDurationThreshold))
|
sl@0
|
254 |
{
|
sl@0
|
255 |
newSerReq.iRequestDurationThreshold = requestDurationThreshold;
|
sl@0
|
256 |
}
|
sl@0
|
257 |
|
sl@0
|
258 |
// leave dialog is optional.
|
sl@0
|
259 |
if(GetBoolFromConfig(ConfigSection(),fLeaveDialog,leaveDialog))
|
sl@0
|
260 |
{
|
sl@0
|
261 |
newSerReq.iLeaveDialog = leaveDialog;
|
sl@0
|
262 |
}
|
sl@0
|
263 |
|
sl@0
|
264 |
// leave Evaluator is optional.
|
sl@0
|
265 |
if(GetBoolFromConfig(ConfigSection(),fLeaveEvaluator,leaveEvaluator))
|
sl@0
|
266 |
{
|
sl@0
|
267 |
newSerReq.iLeaveEvaluator = leaveEvaluator;
|
sl@0
|
268 |
}
|
sl@0
|
269 |
|
sl@0
|
270 |
// Cancel ups request is optional.
|
sl@0
|
271 |
if(GetBoolFromConfig(ConfigSection(),fCancelUpsRequest,cancelUpsRequest))
|
sl@0
|
272 |
{
|
sl@0
|
273 |
newSerReq.iCancelUpsRequest = cancelUpsRequest;
|
sl@0
|
274 |
}
|
sl@0
|
275 |
|
sl@0
|
276 |
// plat sec pass is optional.
|
sl@0
|
277 |
if(GetBoolFromConfig(ConfigSection(),fPlatSecPass,platSecPass))
|
sl@0
|
278 |
{
|
sl@0
|
279 |
newSerReq.iPlatSecPass = platSecPass;
|
sl@0
|
280 |
}
|
sl@0
|
281 |
|
sl@0
|
282 |
// Force prompt is optional.
|
sl@0
|
283 |
if(GetBoolFromConfig(ConfigSection(),fForcePrompt,forcePrompt))
|
sl@0
|
284 |
{
|
sl@0
|
285 |
newSerReq.iForcePrompt = forcePrompt;
|
sl@0
|
286 |
}
|
sl@0
|
287 |
|
sl@0
|
288 |
// use of policy evaluator is optional.
|
sl@0
|
289 |
if(GetIntFromConfig(ConfigSection(),fExpectedEvaInfo,expectedEvaInfo))
|
sl@0
|
290 |
{
|
sl@0
|
291 |
newSerReq.iExpectedEvaluatorInfo = expectedEvaInfo;
|
sl@0
|
292 |
}
|
sl@0
|
293 |
|
sl@0
|
294 |
// Fingerprint selection is optional.
|
sl@0
|
295 |
if(GetIntFromConfig(ConfigSection(),fSelectFingerprint,selectFingerprint))
|
sl@0
|
296 |
{
|
sl@0
|
297 |
newSerReq.iSelectFingerprint = selectFingerprint;
|
sl@0
|
298 |
}
|
sl@0
|
299 |
|
sl@0
|
300 |
// iRepeatUntilFileAppears is optional.
|
sl@0
|
301 |
if(GetStringFromConfig(ConfigSection(),fWaitUntilFileAppears,waitUntilFileAppears))
|
sl@0
|
302 |
{
|
sl@0
|
303 |
newSerReq.iWaitUntilFileAppears = waitUntilFileAppears;
|
sl@0
|
304 |
}
|
sl@0
|
305 |
|
sl@0
|
306 |
// Add the new service to be requested to array.
|
sl@0
|
307 |
iArraySersToRequest.Append(newSerReq);
|
sl@0
|
308 |
|
sl@0
|
309 |
index++;
|
sl@0
|
310 |
fUseServiceUID.Format(_L("UseServiceUID_%d"),index);
|
sl@0
|
311 |
fUseServerName.Format(_L("UseServerName_%d"),index);
|
sl@0
|
312 |
fDestination.Format(_L("Destination_%d"),index);
|
sl@0
|
313 |
fExpectedError.Format(_L("ExpectedError_%d"),index);
|
sl@0
|
314 |
fUseOpaqueData.Format(_L("UseOpaqueData_%d"),index);
|
sl@0
|
315 |
fSelectDialogOption.Format(_L("SelectDialogOption_%d"),index);
|
sl@0
|
316 |
fButtonsDisplayed.Format(_L("ButtonsDisplayed_%d"),index);
|
sl@0
|
317 |
fDialogCreatorInvoked.Format(_L("DialogCreatorInvoked_%d"),index);
|
sl@0
|
318 |
fPolicyEvaluatorInvoked.Format(_L("PolicyEvaluatorInvoked_%d"),index);
|
sl@0
|
319 |
fAccessGranted.Format(_L("AccessGranted_%d"), index);
|
sl@0
|
320 |
fCloseSession.Format(_L("CloseSession_%d"), index);
|
sl@0
|
321 |
fHoldEvaluatorOpen.Format(_L("HoldEvaluatorOpen_%d"), index);
|
sl@0
|
322 |
fHoldPrepareDialogOpen.Format(_L("HoldPrepareDialogOpen_%d"), index);
|
sl@0
|
323 |
fHoldDisplayDialogOpen.Format(_L("HoldDisplayDialogOpen_%d"), index);
|
sl@0
|
324 |
fRequestDurationThreshold.Format(_L("RequestDurationThreshold_%d"), index);
|
sl@0
|
325 |
fLeaveDialog.Format(_L("LeaveDialog_%d"), index);
|
sl@0
|
326 |
fLeaveEvaluator.Format(_L("LeaveEvaluator_%d"), index);
|
sl@0
|
327 |
fCancelUpsRequest.Format(_L("CancelUpsRequest_%d"), index);
|
sl@0
|
328 |
fPlatSecPass.Format(_L("PlatSecPass_%d"), index);
|
sl@0
|
329 |
fForcePrompt.Format(_L("ForcePrompt_%d"), index);
|
sl@0
|
330 |
fExpectedEvaInfo.Format(_L("ExpectedEvaluatorInfo_%d"), index);
|
sl@0
|
331 |
fSelectFingerprint.Format(_L("SelectFingerprint_%d"), index);
|
sl@0
|
332 |
fWaitUntilFileAppears.Format(_L("WaitUntilFileAppears_%d"), index);
|
sl@0
|
333 |
}
|
sl@0
|
334 |
|
sl@0
|
335 |
// now try for some clientStep specific stuff
|
sl@0
|
336 |
// this ini file entry specifies the property key value for the hold flag
|
sl@0
|
337 |
// If the hold flag property is true then monitor it until it becomes false
|
sl@0
|
338 |
// then continue
|
sl@0
|
339 |
TInt holdKey;
|
sl@0
|
340 |
if(GetIntFromConfig(ConfigSection(),_L("HoldClientStepKey"), holdKey))
|
sl@0
|
341 |
{
|
sl@0
|
342 |
iHoldClientStepKey = holdKey;
|
sl@0
|
343 |
|
sl@0
|
344 |
// as this property is present then set it to true using a direct call to p&s api because
|
sl@0
|
345 |
// the ups p&s api only handles policy evaluators and dialog creators and not test steps
|
sl@0
|
346 |
User::LeaveIfError(RProperty::Set(KPropertyCreatorUid, iHoldClientStepKey, 2));
|
sl@0
|
347 |
}
|
sl@0
|
348 |
|
sl@0
|
349 |
// Instantiates property reader and seter
|
sl@0
|
350 |
iPropertyReader= CUpsProperty::NewL(KPropertyCreatorUid);
|
sl@0
|
351 |
|
sl@0
|
352 |
// reads client name and SID
|
sl@0
|
353 |
TParse clientFullName;
|
sl@0
|
354 |
RThread client;
|
sl@0
|
355 |
clientFullName.Set(client.FullName(),NULL, NULL);
|
sl@0
|
356 |
iTEFServerName=clientFullName.Name();
|
sl@0
|
357 |
iExpectedClientSid = client.SecureId() ;
|
sl@0
|
358 |
client.Close();
|
sl@0
|
359 |
|
sl@0
|
360 |
SetTestStepResult(EPass);
|
sl@0
|
361 |
return TestStepResult();
|
sl@0
|
362 |
}
|
sl@0
|
363 |
|
sl@0
|
364 |
|
sl@0
|
365 |
TVerdict CUpsClientStep::doTestStepL()
|
sl@0
|
366 |
{
|
sl@0
|
367 |
// loop to request for different test services.
|
sl@0
|
368 |
TVerdict testResult= EPass;
|
sl@0
|
369 |
TInt numServicesToRequest = iArraySersToRequest.Count();
|
sl@0
|
370 |
|
sl@0
|
371 |
if(numServicesToRequest > 0)
|
sl@0
|
372 |
{
|
sl@0
|
373 |
// check if the test step needs to hold until another step allows it to continue
|
sl@0
|
374 |
if (iHoldClientStepKey)
|
sl@0
|
375 |
{
|
sl@0
|
376 |
HoldClientL();
|
sl@0
|
377 |
}
|
sl@0
|
378 |
|
sl@0
|
379 |
// repeats the sequence of test services request as many times as specified in iStepRepeat
|
sl@0
|
380 |
for(TInt repeatTimes = 0;repeatTimes<iStepRepeat;++repeatTimes)
|
sl@0
|
381 |
{
|
sl@0
|
382 |
INFO_PRINTF3(_L("%S: Repeat number: %d"),&iTEFServerName,repeatTimes);
|
sl@0
|
383 |
|
sl@0
|
384 |
for(TInt index=0;index < numServicesToRequest; ++index )
|
sl@0
|
385 |
{
|
sl@0
|
386 |
INFO_PRINTF6(_L("%S: Service request: %d. SysServer: %S Destination: %S ServiceUID: %X "),&iTEFServerName, index, &iArraySersToRequest[index].iServerName ,&iArraySersToRequest[index].iDestination, iArraySersToRequest[index].iServiceUID);
|
sl@0
|
387 |
RUpsTestSession * sessionToBeUsed;
|
sl@0
|
388 |
|
sl@0
|
389 |
sessionToBeUsed = GetSessionToServerL(iArraySersToRequest[index].iServerName);
|
sl@0
|
390 |
|
sl@0
|
391 |
SetTestDataL(index);
|
sl@0
|
392 |
|
sl@0
|
393 |
sessionToBeUsed->UseTestService(iRequestData,iReturnData);
|
sl@0
|
394 |
|
sl@0
|
395 |
iServerId=sessionToBeUsed->GetServerSid();
|
sl@0
|
396 |
// Check results.
|
sl@0
|
397 |
if(CheckResultsL(index) == EFalse)
|
sl@0
|
398 |
{
|
sl@0
|
399 |
ERR_PRINTF2(_L("%S: Incorrect results"),&iTEFServerName);
|
sl@0
|
400 |
User::Leave(KErrGeneral);
|
sl@0
|
401 |
}
|
sl@0
|
402 |
|
sl@0
|
403 |
// Checks from config value if session need to be closed.
|
sl@0
|
404 |
if(iArraySersToRequest[index].iCloseSession)
|
sl@0
|
405 |
{
|
sl@0
|
406 |
INFO_PRINTF3(_L("%S :Closing session to server: %S"),&iTEFServerName, &iArraySersToRequest[index].iServerName );
|
sl@0
|
407 |
CloseSessionL(iArraySersToRequest[index].iServerName);
|
sl@0
|
408 |
}
|
sl@0
|
409 |
} // End of second loop
|
sl@0
|
410 |
}// End of first loop
|
sl@0
|
411 |
|
sl@0
|
412 |
// Sets the status of the first instance of policy evaluator and dialog creator to
|
sl@0
|
413 |
// completed so that the coordinator step can progress in concurrent mode
|
sl@0
|
414 |
SetClientStatusCompleteL();
|
sl@0
|
415 |
}
|
sl@0
|
416 |
else
|
sl@0
|
417 |
{
|
sl@0
|
418 |
testResult= EFail;
|
sl@0
|
419 |
ERR_PRINTF2(_L("%S :Problem reading ini file"),&iTEFServerName);
|
sl@0
|
420 |
User::Leave(KErrGeneral);
|
sl@0
|
421 |
}
|
sl@0
|
422 |
|
sl@0
|
423 |
return testResult;
|
sl@0
|
424 |
} // End of function
|
sl@0
|
425 |
|
sl@0
|
426 |
|
sl@0
|
427 |
TVerdict CUpsClientStep::doTestStepPostambleL()
|
sl@0
|
428 |
{
|
sl@0
|
429 |
return TestStepResult();
|
sl@0
|
430 |
}
|
sl@0
|
431 |
|
sl@0
|
432 |
|
sl@0
|
433 |
void CUpsClientStep::HoldClientL(void)
|
sl@0
|
434 |
{
|
sl@0
|
435 |
RProperty checkIfStillNeedtoHold;
|
sl@0
|
436 |
User::LeaveIfError(checkIfStillNeedtoHold.Attach(KPropertyCreatorUid, iHoldClientStepKey));
|
sl@0
|
437 |
CleanupClosePushL(checkIfStillNeedtoHold);
|
sl@0
|
438 |
checkIfStillNeedtoHold.Set(KPropertyCreatorUid, iHoldClientStepKey, 1);
|
sl@0
|
439 |
TRequestStatus holdStatus;
|
sl@0
|
440 |
checkIfStillNeedtoHold.Subscribe(holdStatus);
|
sl@0
|
441 |
|
sl@0
|
442 |
TInt holdState;
|
sl@0
|
443 |
|
sl@0
|
444 |
checkIfStillNeedtoHold.Get(KPropertyCreatorUid, iHoldClientStepKey, holdState);
|
sl@0
|
445 |
if(!holdState)
|
sl@0
|
446 |
{
|
sl@0
|
447 |
checkIfStillNeedtoHold.Cancel();
|
sl@0
|
448 |
}
|
sl@0
|
449 |
else
|
sl@0
|
450 |
{
|
sl@0
|
451 |
User::WaitForRequest(holdStatus);
|
sl@0
|
452 |
}
|
sl@0
|
453 |
|
sl@0
|
454 |
RDebug::Printf("[UPS ClientStep 0x%x] HoldClient() stopped holding\n", this);
|
sl@0
|
455 |
|
sl@0
|
456 |
// set the hold state back to 1 for future holds
|
sl@0
|
457 |
checkIfStillNeedtoHold.Set(KPropertyCreatorUid, iHoldClientStepKey, 2);
|
sl@0
|
458 |
CleanupStack::PopAndDestroy(&checkIfStillNeedtoHold);
|
sl@0
|
459 |
}
|
sl@0
|
460 |
|
sl@0
|
461 |
|
sl@0
|
462 |
TBool CUpsClientStep::FindOpenSession(const TDesC& aServerName,TInt &position)
|
sl@0
|
463 |
{
|
sl@0
|
464 |
TBool sessionFound = EFalse;
|
sl@0
|
465 |
TInt sessionsCount = iArraySessionsInUse.Count();
|
sl@0
|
466 |
for(TInt index = 0;index < sessionsCount; ++index)
|
sl@0
|
467 |
{
|
sl@0
|
468 |
if(!aServerName.CompareF(iArraySessionsInUse[index]->iServerName))
|
sl@0
|
469 |
{
|
sl@0
|
470 |
position = index;
|
sl@0
|
471 |
sessionFound = ETrue;
|
sl@0
|
472 |
break;
|
sl@0
|
473 |
}
|
sl@0
|
474 |
}
|
sl@0
|
475 |
return sessionFound;
|
sl@0
|
476 |
} // End of function
|
sl@0
|
477 |
|
sl@0
|
478 |
|
sl@0
|
479 |
RUpsTestSession* CUpsClientStep::GetSessionToServerL(const TDesC& aServerName)
|
sl@0
|
480 |
{
|
sl@0
|
481 |
// Finds out if a session is already open for server requested
|
sl@0
|
482 |
TInt foundPos;
|
sl@0
|
483 |
RUpsTestSession* sessionToReturn;
|
sl@0
|
484 |
if(!FindOpenSession(aServerName,foundPos))
|
sl@0
|
485 |
{
|
sl@0
|
486 |
// if open session for intended server not found it creates a new one
|
sl@0
|
487 |
COpenSession* sessionToAppend=COpenSession::NewL(aServerName);
|
sl@0
|
488 |
iArraySessionsInUse.AppendL(sessionToAppend);
|
sl@0
|
489 |
foundPos = iArraySessionsInUse.Count()-1; // position of new session is last one in array.
|
sl@0
|
490 |
}
|
sl@0
|
491 |
sessionToReturn = iArraySessionsInUse[foundPos]->iPointerToSession;
|
sl@0
|
492 |
|
sl@0
|
493 |
return sessionToReturn;
|
sl@0
|
494 |
} // End of function
|
sl@0
|
495 |
|
sl@0
|
496 |
|
sl@0
|
497 |
void CUpsClientStep::CloseSessionL(const TDesC& aServerName)
|
sl@0
|
498 |
{
|
sl@0
|
499 |
// Finds out if a session is already open for server requested
|
sl@0
|
500 |
TInt foundPos;
|
sl@0
|
501 |
|
sl@0
|
502 |
if(!FindOpenSession(aServerName,foundPos))
|
sl@0
|
503 |
{
|
sl@0
|
504 |
// if a session for this server was not found it leaves.
|
sl@0
|
505 |
ERR_PRINTF2(_L("%S: The server to be closed was not found"),&iTEFServerName);
|
sl@0
|
506 |
User::Leave(KErrGeneral);
|
sl@0
|
507 |
}
|
sl@0
|
508 |
delete iArraySessionsInUse[foundPos]; // deletes instance.
|
sl@0
|
509 |
iArraySessionsInUse.Remove(foundPos); // removes empty slot
|
sl@0
|
510 |
|
sl@0
|
511 |
} // End of function
|
sl@0
|
512 |
|
sl@0
|
513 |
|
sl@0
|
514 |
void CUpsClientStep::CloseAllOpenSessions()
|
sl@0
|
515 |
{
|
sl@0
|
516 |
while(iArraySessionsInUse.Count()>0)
|
sl@0
|
517 |
{ // delete and remove first session of array.
|
sl@0
|
518 |
delete iArraySessionsInUse[0];
|
sl@0
|
519 |
iArraySessionsInUse.Remove(0);
|
sl@0
|
520 |
}
|
sl@0
|
521 |
iArraySessionsInUse.Close();
|
sl@0
|
522 |
} // End of function
|
sl@0
|
523 |
|
sl@0
|
524 |
|
sl@0
|
525 |
void CUpsClientStep::SetTestDataL(TInt aIndex)
|
sl@0
|
526 |
{
|
sl@0
|
527 |
// Set data for request.
|
sl@0
|
528 |
iReturnData.iError=KErrNone;
|
sl@0
|
529 |
iServerId=0;
|
sl@0
|
530 |
iRequestData.iMeasureResponceTime = EFalse;
|
sl@0
|
531 |
iRequestData.iServiceUid = TUid::Uid(iArraySersToRequest[aIndex].iServiceUID);
|
sl@0
|
532 |
|
sl@0
|
533 |
if(iArraySersToRequest[aIndex].iOpaqueData.CompareF(_L8(""))==0)
|
sl@0
|
534 |
{
|
sl@0
|
535 |
iRequestData.iOpaquePresent = EFalse;
|
sl@0
|
536 |
}
|
sl@0
|
537 |
else
|
sl@0
|
538 |
{
|
sl@0
|
539 |
iRequestData.iOpaquePresent = ETrue;
|
sl@0
|
540 |
iRequestData.iOpaqueData =iArraySersToRequest[aIndex].iOpaqueData;
|
sl@0
|
541 |
}
|
sl@0
|
542 |
|
sl@0
|
543 |
iRequestData.iDestination = iArraySersToRequest[aIndex].iDestination;
|
sl@0
|
544 |
iRequestData.iCancelRequest = iArraySersToRequest[aIndex].iCancelUpsRequest;
|
sl@0
|
545 |
iRequestData.iPlatSecPass = iArraySersToRequest[aIndex].iPlatSecPass;
|
sl@0
|
546 |
|
sl@0
|
547 |
// set properties for policy evaluator.
|
sl@0
|
548 |
if (iArraySersToRequest[aIndex].iPolicyEvaluatorInvoked != 0)
|
sl@0
|
549 |
{
|
sl@0
|
550 |
//Reset various publisher and suscribe properties for policy evaluator.
|
sl@0
|
551 |
TInt instance = iArraySersToRequest[aIndex].iPolicyEvaluatorInvoked;
|
sl@0
|
552 |
iPropertyReader->SetL(instance,KPe_Status,CUpsProperty::EPolicyEvaluator, KUpsPeStatusReset);
|
sl@0
|
553 |
iPropertyReader->SetL(instance,KPe_ClientSid,CUpsProperty::EPolicyEvaluator, 0);
|
sl@0
|
554 |
iPropertyReader->SetL(instance,KPe_ServerSid,CUpsProperty::EPolicyEvaluator, 0);
|
sl@0
|
555 |
TBool leaveEvaluator = iArraySersToRequest[aIndex].iLeaveEvaluator;
|
sl@0
|
556 |
iPropertyReader->SetL(instance,KPe_Leave,CUpsProperty::EPolicyEvaluator, leaveEvaluator);
|
sl@0
|
557 |
iPropertyReader->SetL(instance,KPe_Error,CUpsProperty::EPolicyEvaluator, KErrNone);
|
sl@0
|
558 |
TBool holdEvaluatorOpen = iArraySersToRequest[aIndex].iHoldEvaluatorOpen;
|
sl@0
|
559 |
iPropertyReader->SetL(instance,KPe_HoldEvaluatorOpen,CUpsProperty::EPolicyEvaluator, holdEvaluatorOpen);
|
sl@0
|
560 |
TBool forcePrompt = iArraySersToRequest[aIndex].iForcePrompt;
|
sl@0
|
561 |
iPropertyReader->SetL(instance,KPe_ForcePrompt,CUpsProperty::EPolicyEvaluator, forcePrompt);
|
sl@0
|
562 |
iPropertyReader->SetL(instance,KPe_EvaluatorInfo,CUpsProperty::EPolicyEvaluator, 0);
|
sl@0
|
563 |
}
|
sl@0
|
564 |
|
sl@0
|
565 |
// set properties for dialog creator.
|
sl@0
|
566 |
if (iArraySersToRequest[aIndex].iDialogCreatorInvoked != 0)
|
sl@0
|
567 |
{
|
sl@0
|
568 |
//Reset various publisher and suscribe properties for dialog creator.
|
sl@0
|
569 |
TInt instance = iArraySersToRequest[aIndex].iDialogCreatorInvoked;
|
sl@0
|
570 |
iPropertyReader->SetL(instance,KDc_Status,CUpsProperty::EDialogCreator, KUpsDcStatusReset);
|
sl@0
|
571 |
iPropertyReader->SetL(instance,KDc_ClientSid,CUpsProperty::EDialogCreator, 0);
|
sl@0
|
572 |
iPropertyReader->SetL(instance,KDc_ServerSid,CUpsProperty::EDialogCreator, 0);
|
sl@0
|
573 |
TBool dialogLeave = iArraySersToRequest[aIndex].iLeaveDialog ;
|
sl@0
|
574 |
iPropertyReader->SetL(instance,KDc_Leave,CUpsProperty::EDialogCreator, dialogLeave);
|
sl@0
|
575 |
iPropertyReader->SetL(instance,KDc_Error,CUpsProperty::EDialogCreator, KErrNone);
|
sl@0
|
576 |
iPropertyReader->SetL(instance,KDc_UpsRequestedButtons,CUpsProperty::EDialogCreator, 0);
|
sl@0
|
577 |
TInt buttonToPress = ButtonToInt(iArraySersToRequest[aIndex].iSelectDialogOption);
|
sl@0
|
578 |
iPropertyReader->SetL(instance,KDc_WhichButtonToPress,CUpsProperty::EDialogCreator, buttonToPress);
|
sl@0
|
579 |
TBool holdPrepareDialogOpen = iArraySersToRequest[aIndex].iHoldPrepareDialogOpen;
|
sl@0
|
580 |
iPropertyReader->SetL(instance,KDc_HoldPrepareDialogOpen,CUpsProperty::EDialogCreator, holdPrepareDialogOpen);
|
sl@0
|
581 |
TBool holdDisplayDialogOpen = iArraySersToRequest[aIndex].iHoldDisplayDialogOpen;
|
sl@0
|
582 |
iPropertyReader->SetL(instance,KDc_HoldDisplayDialogOpen,CUpsProperty::EDialogCreator, holdDisplayDialogOpen);
|
sl@0
|
583 |
TBool selectFingerprint = iArraySersToRequest[aIndex].iSelectFingerprint ;
|
sl@0
|
584 |
iPropertyReader->SetL(instance,KDc_SelectFingerprint,CUpsProperty::EDialogCreator, selectFingerprint);
|
sl@0
|
585 |
}
|
sl@0
|
586 |
|
sl@0
|
587 |
} // End of function.
|
sl@0
|
588 |
|
sl@0
|
589 |
|
sl@0
|
590 |
void CUpsClientStep::SetClientStatusCompleteL()
|
sl@0
|
591 |
/**
|
sl@0
|
592 |
* Sets the status of the first policy evaluator invoked by the client to "KUpsClientCompleted" so that
|
sl@0
|
593 |
* the coordinator step can determine when the step has completely finish and progress in Concurrent mode
|
sl@0
|
594 |
*
|
sl@0
|
595 |
* NOTE: When using the Coordinator in this manner, ALL requests made to UPS must invoke the same instance
|
sl@0
|
596 |
* of the Policy Evaluator and Dialog Creator! e.g. Policy Evalutor 1 and Dialog Creator 1
|
sl@0
|
597 |
*/
|
sl@0
|
598 |
{
|
sl@0
|
599 |
TInt requestCount = iArraySersToRequest.Count();
|
sl@0
|
600 |
|
sl@0
|
601 |
for(TInt i=0; i<requestCount; ++i)
|
sl@0
|
602 |
{
|
sl@0
|
603 |
if (iArraySersToRequest[i].iPolicyEvaluatorInvoked != 0)
|
sl@0
|
604 |
{
|
sl@0
|
605 |
TInt instance = iArraySersToRequest[i].iPolicyEvaluatorInvoked;
|
sl@0
|
606 |
iPropertyReader->SetL(instance,KPe_Status,CUpsProperty::EPolicyEvaluator, KUpsClientCompleted);
|
sl@0
|
607 |
iPropertyReader->SetL(instance,KDc_Status,CUpsProperty::EDialogCreator, KUpsClientCompleted);
|
sl@0
|
608 |
break;
|
sl@0
|
609 |
}
|
sl@0
|
610 |
}
|
sl@0
|
611 |
}
|
sl@0
|
612 |
|
sl@0
|
613 |
|
sl@0
|
614 |
TUpsDecision CUpsClientStep::StringToTUpsDecision(const TPtrC& aString)
|
sl@0
|
615 |
{
|
sl@0
|
616 |
if(aString.CompareF(_L("Yes"))==0)
|
sl@0
|
617 |
{
|
sl@0
|
618 |
return TUpsDecision(EUpsDecYes);
|
sl@0
|
619 |
}
|
sl@0
|
620 |
else if(aString.CompareF(_L("No"))==0)
|
sl@0
|
621 |
{
|
sl@0
|
622 |
return TUpsDecision(EUpsDecNo);
|
sl@0
|
623 |
}
|
sl@0
|
624 |
else if(aString.CompareF(_L("SessionYes"))==0)
|
sl@0
|
625 |
{
|
sl@0
|
626 |
return TUpsDecision(EUpsDecSessionYes);
|
sl@0
|
627 |
}
|
sl@0
|
628 |
else
|
sl@0
|
629 |
{
|
sl@0
|
630 |
return TUpsDecision(EUpsDecSessionNo);
|
sl@0
|
631 |
}
|
sl@0
|
632 |
} // End of function.
|
sl@0
|
633 |
|
sl@0
|
634 |
|
sl@0
|
635 |
TPtrC CUpsClientStep::TUpsDecisionToString(TUpsDecision aDecision)
|
sl@0
|
636 |
{
|
sl@0
|
637 |
if(aDecision == EUpsDecYes)
|
sl@0
|
638 |
{
|
sl@0
|
639 |
return _L("Yes");
|
sl@0
|
640 |
}
|
sl@0
|
641 |
else if(aDecision == EUpsDecNo)
|
sl@0
|
642 |
{
|
sl@0
|
643 |
return _L("No");
|
sl@0
|
644 |
}
|
sl@0
|
645 |
else if(aDecision == EUpsDecSessionYes)
|
sl@0
|
646 |
{
|
sl@0
|
647 |
return _L("SessionYes");
|
sl@0
|
648 |
}
|
sl@0
|
649 |
else if(aDecision == EUpsDecSessionNo)
|
sl@0
|
650 |
{
|
sl@0
|
651 |
return _L("SessionNo");
|
sl@0
|
652 |
}
|
sl@0
|
653 |
else
|
sl@0
|
654 |
{
|
sl@0
|
655 |
return _L("Undefined");
|
sl@0
|
656 |
}
|
sl@0
|
657 |
} // End of function.
|
sl@0
|
658 |
|
sl@0
|
659 |
|
sl@0
|
660 |
TInt CUpsClientStep::ButtonToInt(const TPtrC& aButton)
|
sl@0
|
661 |
{
|
sl@0
|
662 |
if(aButton.CompareF(_L("Yes"))==0)
|
sl@0
|
663 |
{
|
sl@0
|
664 |
return KYes;
|
sl@0
|
665 |
}
|
sl@0
|
666 |
else if(aButton.CompareF(_L("No"))==0)
|
sl@0
|
667 |
{
|
sl@0
|
668 |
return KNo;
|
sl@0
|
669 |
}
|
sl@0
|
670 |
else if(aButton.CompareF(_L("Always"))==0)
|
sl@0
|
671 |
{
|
sl@0
|
672 |
return KAlways;
|
sl@0
|
673 |
}
|
sl@0
|
674 |
else if(aButton.CompareF(_L("SessionYes"))==0)
|
sl@0
|
675 |
{
|
sl@0
|
676 |
return KSessionYes;
|
sl@0
|
677 |
}
|
sl@0
|
678 |
else if(aButton.CompareF(_L("SessionNo"))==0)
|
sl@0
|
679 |
{
|
sl@0
|
680 |
return KSessionNo;
|
sl@0
|
681 |
}
|
sl@0
|
682 |
else if(aButton.CompareF(_L("Never"))==0)
|
sl@0
|
683 |
{
|
sl@0
|
684 |
return KNever;
|
sl@0
|
685 |
}
|
sl@0
|
686 |
else return KNone;
|
sl@0
|
687 |
|
sl@0
|
688 |
} // End of function.
|
sl@0
|
689 |
|
sl@0
|
690 |
|
sl@0
|
691 |
TBool CUpsClientStep::CheckResultsL(TInt aIndex)
|
sl@0
|
692 |
{
|
sl@0
|
693 |
TBool theReturn = ETrue;
|
sl@0
|
694 |
|
sl@0
|
695 |
if(iArraySersToRequest[aIndex].iExpectedError == KErrNone)
|
sl@0
|
696 |
{
|
sl@0
|
697 |
TUpsDecision expectedDecision = StringToTUpsDecision(iArraySersToRequest[aIndex].iAccessGranted);
|
sl@0
|
698 |
if(expectedDecision != iReturnData.iDecision)
|
sl@0
|
699 |
{
|
sl@0
|
700 |
TPtrC decisionReceived(TUpsDecisionToString(iReturnData.iDecision));
|
sl@0
|
701 |
ERR_PRINTF4(_L("%S: Decision expected: %S ,Decision received: %S"),&iTEFServerName, &iArraySersToRequest[aIndex].iAccessGranted, &decisionReceived);
|
sl@0
|
702 |
theReturn=EFalse;
|
sl@0
|
703 |
}
|
sl@0
|
704 |
}
|
sl@0
|
705 |
|
sl@0
|
706 |
if(iArraySersToRequest[aIndex].iExpectedError != iReturnData.iError)
|
sl@0
|
707 |
{
|
sl@0
|
708 |
// Incorrect error code returned.
|
sl@0
|
709 |
theReturn=EFalse;
|
sl@0
|
710 |
ERR_PRINTF3(_L("%S: Error code expected: %d"),&iTEFServerName,iArraySersToRequest[aIndex].iExpectedError);
|
sl@0
|
711 |
ERR_PRINTF3(_L("%S: Error code Received: %d"),&iTEFServerName,iReturnData.iError);
|
sl@0
|
712 |
}
|
sl@0
|
713 |
|
sl@0
|
714 |
// checks returned properties from dialog creator & policy evaluator.
|
sl@0
|
715 |
if ( CheckDialogCreatorResultsL(aIndex) == EFalse || CheckPolicyEvaluatorResultsL(aIndex) == EFalse)
|
sl@0
|
716 |
{
|
sl@0
|
717 |
theReturn = EFalse;
|
sl@0
|
718 |
}
|
sl@0
|
719 |
|
sl@0
|
720 |
// display the request duration and check against the ini file value, if supplied
|
sl@0
|
721 |
INFO_PRINTF3(_L("%S: UPS decision request duration: %u milliseconds"),&iTEFServerName, iReturnData.iRequestDuration);
|
sl@0
|
722 |
if (iArraySersToRequest[aIndex].iRequestDurationThreshold > 0)
|
sl@0
|
723 |
{
|
sl@0
|
724 |
// check whether the request duration was too long
|
sl@0
|
725 |
if (static_cast<TInt>(iReturnData.iRequestDuration) > iArraySersToRequest[aIndex].iRequestDurationThreshold)
|
sl@0
|
726 |
{
|
sl@0
|
727 |
ERR_PRINTF3(_L("%S: UPS decision request took too long: %u"), &iTEFServerName, iArraySersToRequest[aIndex].iRequestDurationThreshold);
|
sl@0
|
728 |
theReturn = EFalse;
|
sl@0
|
729 |
}
|
sl@0
|
730 |
}
|
sl@0
|
731 |
|
sl@0
|
732 |
return theReturn;
|
sl@0
|
733 |
} // End of function.
|
sl@0
|
734 |
|
sl@0
|
735 |
|
sl@0
|
736 |
TBool CUpsClientStep::CheckDialogCreatorResultsL(TInt aIndex)
|
sl@0
|
737 |
{
|
sl@0
|
738 |
TBool checkPassed = ETrue;
|
sl@0
|
739 |
|
sl@0
|
740 |
// checks return properties from dialog creator.
|
sl@0
|
741 |
if (iArraySersToRequest[aIndex].iDialogCreatorInvoked != 0)
|
sl@0
|
742 |
{
|
sl@0
|
743 |
TInt instanceDia = iArraySersToRequest[aIndex].iDialogCreatorInvoked;
|
sl@0
|
744 |
TInt dialogError = 0;
|
sl@0
|
745 |
iPropertyReader->GetL(instanceDia,KDc_Error,CUpsProperty::EDialogCreator, dialogError);
|
sl@0
|
746 |
|
sl@0
|
747 |
// Checks that any error encountered by dialog creator is transmited by UPS to system server
|
sl@0
|
748 |
if(dialogError != iReturnData.iError && dialogError!=KErrNone)
|
sl@0
|
749 |
{
|
sl@0
|
750 |
ERR_PRINTF3(_L("%S: Dialog creator found an error: %d"),&iTEFServerName,dialogError);
|
sl@0
|
751 |
checkPassed = EFalse;
|
sl@0
|
752 |
}
|
sl@0
|
753 |
|
sl@0
|
754 |
TInt clientSidDia=0;
|
sl@0
|
755 |
iPropertyReader->GetL(instanceDia,KDc_ClientSid,CUpsProperty::EDialogCreator, clientSidDia);
|
sl@0
|
756 |
|
sl@0
|
757 |
if(iExpectedClientSid != clientSidDia)
|
sl@0
|
758 |
{
|
sl@0
|
759 |
ERR_PRINTF2(_L("%S: Client SID returned by dialog creator is not what is expected"),&iTEFServerName);
|
sl@0
|
760 |
checkPassed = EFalse;
|
sl@0
|
761 |
}
|
sl@0
|
762 |
|
sl@0
|
763 |
TInt buttonsDisplayed=0;
|
sl@0
|
764 |
iPropertyReader->GetL(instanceDia,KDc_UpsRequestedButtons,CUpsProperty::EDialogCreator, buttonsDisplayed);
|
sl@0
|
765 |
TInt32 expectedButtonsDisplayed=iArraySersToRequest[aIndex].iButtonsDisplayed;
|
sl@0
|
766 |
if(expectedButtonsDisplayed != buttonsDisplayed)
|
sl@0
|
767 |
{
|
sl@0
|
768 |
ERR_PRINTF2(_L("%S: Incorrect buttons displayed."),&iTEFServerName);
|
sl@0
|
769 |
ERR_PRINTF3(_L("%S: Buttons displayed expected: %d"),&iTEFServerName,expectedButtonsDisplayed);
|
sl@0
|
770 |
ERR_PRINTF3(_L("%S: Buttons displayed received: %d"),&iTEFServerName,buttonsDisplayed);
|
sl@0
|
771 |
checkPassed = EFalse;
|
sl@0
|
772 |
}
|
sl@0
|
773 |
|
sl@0
|
774 |
TInt serverSidDia=0;
|
sl@0
|
775 |
iPropertyReader->GetL(instanceDia,KDc_ServerSid,CUpsProperty::EDialogCreator, serverSidDia);
|
sl@0
|
776 |
|
sl@0
|
777 |
if(iServerId != serverSidDia)
|
sl@0
|
778 |
{
|
sl@0
|
779 |
ERR_PRINTF2(_L("%S: Server SID returned by dialog creator is not what is expected"),&iTEFServerName);
|
sl@0
|
780 |
checkPassed = EFalse;
|
sl@0
|
781 |
}
|
sl@0
|
782 |
|
sl@0
|
783 |
TInt serviceSidDia=0;
|
sl@0
|
784 |
iPropertyReader->GetL(instanceDia,KDc_ServiceId,CUpsProperty::EDialogCreator, serviceSidDia);
|
sl@0
|
785 |
if(serviceSidDia != iArraySersToRequest[aIndex].iServiceUID)
|
sl@0
|
786 |
{
|
sl@0
|
787 |
ERR_PRINTF3(_L("%S: Service ID reported by dialog creator is not what is expected: %d"),&iTEFServerName,serviceSidDia);
|
sl@0
|
788 |
checkPassed = EFalse;
|
sl@0
|
789 |
}
|
sl@0
|
790 |
}
|
sl@0
|
791 |
|
sl@0
|
792 |
return checkPassed;
|
sl@0
|
793 |
} // End of function.
|
sl@0
|
794 |
|
sl@0
|
795 |
|
sl@0
|
796 |
TBool CUpsClientStep::CheckPolicyEvaluatorResultsL(TInt aIndex)
|
sl@0
|
797 |
{
|
sl@0
|
798 |
TBool checkPassed = ETrue;
|
sl@0
|
799 |
|
sl@0
|
800 |
if (iArraySersToRequest[aIndex].iPolicyEvaluatorInvoked != 0)
|
sl@0
|
801 |
{
|
sl@0
|
802 |
TInt instanceEva = iArraySersToRequest[aIndex].iPolicyEvaluatorInvoked;
|
sl@0
|
803 |
TInt evaluatorError = 0;
|
sl@0
|
804 |
|
sl@0
|
805 |
// Checks that any error encountered by policy evaluator is transmited by UPS to system server
|
sl@0
|
806 |
iPropertyReader->GetL(instanceEva,KPe_Error,CUpsProperty::EPolicyEvaluator, evaluatorError);
|
sl@0
|
807 |
if(evaluatorError != iReturnData.iError && evaluatorError!=KErrNone)
|
sl@0
|
808 |
{
|
sl@0
|
809 |
ERR_PRINTF3(_L("%S: Policy evaluator found an error: %d"),&iTEFServerName,evaluatorError);
|
sl@0
|
810 |
checkPassed = EFalse;
|
sl@0
|
811 |
}
|
sl@0
|
812 |
|
sl@0
|
813 |
TInt clientSidEva=0;
|
sl@0
|
814 |
iPropertyReader->GetL(instanceEva,KPe_ClientSid,CUpsProperty::EPolicyEvaluator, clientSidEva);
|
sl@0
|
815 |
|
sl@0
|
816 |
if(iExpectedClientSid != clientSidEva)
|
sl@0
|
817 |
{
|
sl@0
|
818 |
ERR_PRINTF2(_L("%S: Client SID returned by policy evaluator is not what is expected"),&iTEFServerName);
|
sl@0
|
819 |
checkPassed = EFalse;
|
sl@0
|
820 |
}
|
sl@0
|
821 |
|
sl@0
|
822 |
TInt serverSidEva=0;
|
sl@0
|
823 |
iPropertyReader->GetL(instanceEva,KPe_ServerSid,CUpsProperty::EPolicyEvaluator, serverSidEva);
|
sl@0
|
824 |
|
sl@0
|
825 |
if(iServerId != serverSidEva)
|
sl@0
|
826 |
{
|
sl@0
|
827 |
ERR_PRINTF2(_L("%S: Server SID returned by policy evaluator is not what is expected"),&iTEFServerName);
|
sl@0
|
828 |
checkPassed = EFalse;
|
sl@0
|
829 |
}
|
sl@0
|
830 |
|
sl@0
|
831 |
TInt serviceSidEva = 0;
|
sl@0
|
832 |
iPropertyReader->GetL(instanceEva,KPe_ServiceId,CUpsProperty::EPolicyEvaluator, serviceSidEva);
|
sl@0
|
833 |
if(serviceSidEva != iArraySersToRequest[aIndex].iServiceUID)
|
sl@0
|
834 |
{
|
sl@0
|
835 |
ERR_PRINTF3(_L("%S: Service ID reported by policy evaluator is not what is expected: %d"),&iTEFServerName,serviceSidEva);
|
sl@0
|
836 |
checkPassed = EFalse;
|
sl@0
|
837 |
}
|
sl@0
|
838 |
if( iArraySersToRequest[aIndex].iForcePrompt)
|
sl@0
|
839 |
{
|
sl@0
|
840 |
// Read evaluator info
|
sl@0
|
841 |
TInt evaluatorInfo = 0;
|
sl@0
|
842 |
iPropertyReader->GetL(instanceEva,KPe_EvaluatorInfo,CUpsProperty::EPolicyEvaluator, evaluatorInfo);
|
sl@0
|
843 |
if(evaluatorInfo != iArraySersToRequest[aIndex].iExpectedEvaluatorInfo)
|
sl@0
|
844 |
{
|
sl@0
|
845 |
ERR_PRINTF4(_L("%S: incorrect evaluator info:Expected: %d Received: %d"),&iTEFServerName,iArraySersToRequest[aIndex].iExpectedEvaluatorInfo,evaluatorInfo);
|
sl@0
|
846 |
checkPassed = EFalse;
|
sl@0
|
847 |
}
|
sl@0
|
848 |
}
|
sl@0
|
849 |
}
|
sl@0
|
850 |
|
sl@0
|
851 |
return checkPassed;
|
sl@0
|
852 |
} // End of function.
|