24
|
1 |
// Copyright (c) 2005-2010 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 |
// Defines the Network-side events & error conditions tests for SPUD.
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
@internalComponent
|
|
21 |
*/
|
|
22 |
|
|
23 |
#ifndef TE_SPUD_NETWORK_SIDE_STEPS_H
|
|
24 |
#define TE_SPUD_NETWORK_SIDE_STEPS_H
|
|
25 |
|
|
26 |
|
|
27 |
#include <test/testexecutestepbase.h>
|
|
28 |
#include <c32comm.h>
|
|
29 |
#include <es_sock.h>
|
|
30 |
#ifndef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
|
|
31 |
#include <qoslib.h>
|
|
32 |
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
|
|
33 |
#include <networking/qoslib_internal.h>
|
|
34 |
#endif
|
|
35 |
#endif
|
|
36 |
|
|
37 |
/** Encapsulates all Spud Network Side tests */
|
|
38 |
namespace te_spudNetworkSide
|
|
39 |
{
|
|
40 |
|
|
41 |
const TUint KConfiguredTftFilter1DestPort = 1031;
|
|
42 |
const TUint KConfiguredTftFilter1SrcPort = 3461;
|
|
43 |
const TUint KConfiguredTftFilter2DestPort = 1032;
|
|
44 |
|
|
45 |
_LIT(KConfiguredTftFilter2DestAddr, "192.168.1.2");
|
|
46 |
_LIT(KConfiguredTftFilter1SrcAddr, "192.168.1.1");
|
|
47 |
|
|
48 |
|
|
49 |
/** Identifiers for each of the simtsy parameters that can be changed using publish and subscribe */
|
|
50 |
enum TEtelRequestType
|
|
51 |
{
|
|
52 |
/** Change QoS parameters */
|
|
53 |
ENetworkQoSChange,
|
|
54 |
/** Change network status */
|
|
55 |
ENetworkChangeRegStatus,
|
|
56 |
/** Change context status */
|
|
57 |
EContextStatusChange,
|
|
58 |
/** Change context config parameters */
|
|
59 |
EContextConfigChange,
|
|
60 |
/**Invalid Request */
|
|
61 |
EInvalidRequest,
|
|
62 |
};
|
|
63 |
|
|
64 |
enum TContextType
|
|
65 |
{
|
|
66 |
EPrimaryContext,
|
|
67 |
ESecondaryContext
|
|
68 |
};
|
|
69 |
|
|
70 |
/**
|
|
71 |
Base class for all Spud Network Side Tests.
|
|
72 |
|
|
73 |
@internalComponent
|
|
74 |
*/
|
|
75 |
#ifndef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
|
|
76 |
class CSpudNetSideTestBase : public CTestStep, public MQoSObserver
|
|
77 |
#else
|
|
78 |
class CSpudNetSideTestBase : public CTestStep
|
|
79 |
#endif
|
|
80 |
{
|
|
81 |
public:
|
|
82 |
|
|
83 |
TVerdict doTestStepPreambleL();
|
|
84 |
#ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
|
|
85 |
TVerdict doTestStepPostambleL();
|
|
86 |
#endif
|
|
87 |
|
|
88 |
enum TVerdict doTestStepL();
|
|
89 |
|
|
90 |
#ifndef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
|
|
91 |
// MQoSObserver
|
|
92 |
void Event(const CQoSEventBase& aEvent);
|
|
93 |
#endif
|
|
94 |
|
|
95 |
// Utility
|
|
96 |
void TestBooleanTrueL(TBool aBool, const TDesC& aMsg);
|
|
97 |
void TestL(TInt aErrCode, const TDesC& aMsg);
|
|
98 |
void TestL(TInt aErrCode, TInt aExpErrCode, const TDesC& aMsg);
|
|
99 |
|
|
100 |
|
|
101 |
|
|
102 |
protected:
|
|
103 |
|
|
104 |
/**
|
|
105 |
Executes the Test Step
|
|
106 |
|
|
107 |
@return Verdict of the test step: EPass / EFail;
|
|
108 |
EAborted if the test case could not be executed properly;
|
|
109 |
EInconclusive if it could not be determined with certainty that the test case has succeeded.
|
|
110 |
@leave if the test fails
|
|
111 |
*/
|
|
112 |
virtual TVerdict RunTestStepL() = 0;
|
|
113 |
|
|
114 |
// utility
|
|
115 |
#ifndef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
|
|
116 |
void WaitForQoSEventL(TQoSEvent aQosEvent, TInt aReasonCode);
|
|
117 |
void WaitForOptionalQoSEventL(TQoSEvent aQosEvent, TInt aReasonCode, TQoSEvent aOptionalQosEvent, TInt aOptionalReasonCode);
|
|
118 |
void WaitForOptionalQoSEventL(const TDesC& aQosEventString, const TDesC& aReasonCodeString, TQoSEvent aOptionalQosEvent, const TDesC& aOptionalReasonCodeString);
|
|
119 |
|
|
120 |
void WaitForQoSEventL(const TDesC& aQosEventString, TInt aReasonCode);
|
|
121 |
void WaitForQoSEventL(const TDesC& aQosEventString, const TDesC& aReasonCodeString);
|
|
122 |
void WaitForOptionalQoSEventL(const TDesC& aQosEventString, const TDesC& aReasonCodeString, const TDesC& aOptionalQosEventString, const TDesC& aOptionalReasonCodeString);
|
|
123 |
|
|
124 |
void SetQoSParameters(CQoSParameters& aParameters);
|
|
125 |
void SetQoSParameters1(CQoSParameters& aParameters);
|
|
126 |
#endif
|
|
127 |
void SetSimTsyTestNumberL(TInt aTestNumber);
|
|
128 |
|
|
129 |
void StartPrimaryOnlyL();
|
|
130 |
void OpenPrimarySocketL();
|
|
131 |
void SendUntilTimeoutL();
|
|
132 |
void SendSinglePacketL();
|
|
133 |
void StopPrimary();
|
|
134 |
|
|
135 |
TBool SpudDeletePrimaryPdpL();
|
|
136 |
|
|
137 |
void StartSecondaryL();
|
|
138 |
void StopSecondaryL();
|
|
139 |
void RetrieveMandatorySettingsFromConfigL();
|
|
140 |
#ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
|
|
141 |
void ReadQosParameterSettingsFromConfigL();
|
|
142 |
|
|
143 |
void VerifySubconnectionCountL(const TDesC& aSubConnDesc, TUint aIap);
|
|
144 |
void VerifySubconnectionCountL(TUint aSubConnectionCount, TUint aIap);
|
|
145 |
void UpdatePolicySelector2QosParametersTableL(TUint aPolicySelector, TUint aQosParameter);
|
|
146 |
void ClearPolicySelector2QosParametersTableL();
|
|
147 |
#endif
|
|
148 |
|
|
149 |
void FailNextPktLoopbackCsyWriteL(TInt aPortNum, TInt aErrorCode);
|
|
150 |
TEtelRequestType RetrieveNetSideEventRequestFromConfigL(const TDesC& aEventName);
|
|
151 |
void EtelRequestL(TEtelRequestType aEtelCommand, TInt aNewValue);
|
|
152 |
TInt RetrieveNetSideEventValFromConfigL(const TDesC& aEventValName);
|
|
153 |
#ifndef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
|
|
154 |
enum TQoSEvent RetrieveQosEventFromConfigL(const TDesC& aQosEventName);
|
|
155 |
#endif
|
|
156 |
TContextType RetrieveContextTypeFromConfigL(const TDesC& aContextTypeName);
|
|
157 |
TCommRole RetrieveCommRoleFromConfigL(const TDesC& aCommRoleName);
|
|
158 |
void WaitForProgressNotificationL(TRequestStatus& aStatus, TInt aProgress, TInt aErrCode);
|
|
159 |
void StopInterfaceL();
|
|
160 |
|
|
161 |
void InitLoopbackL(const TDesC& aLoopbackPortName);
|
|
162 |
|
|
163 |
virtual void InitiateSecondaryStartL();
|
|
164 |
#ifndef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
|
|
165 |
virtual void ChangeQoSL();
|
|
166 |
#endif
|
|
167 |
|
|
168 |
// Data
|
|
169 |
TInt iSimTsyTestNum;
|
|
170 |
#ifndef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
|
|
171 |
TQoSEvent iReceivedQosEvent;
|
|
172 |
#else
|
|
173 |
TInt iPolicySelector;
|
|
174 |
TUint iQosParametersRecord;
|
|
175 |
#endif
|
|
176 |
TInt iQosReason;
|
|
177 |
|
|
178 |
RSocketServ iEsock;
|
|
179 |
RSocket iSocket;
|
|
180 |
/** Socket used in RQoSChannel Join*/
|
|
181 |
RSocket iSocketJoin;
|
|
182 |
#ifndef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
|
|
183 |
RQoSPolicy iQoSPolicy_1;
|
|
184 |
#endif
|
|
185 |
TNifProgressBuf iProgressBuf;
|
|
186 |
TRequestStatus iQosEventReq;
|
|
187 |
|
|
188 |
RConnection iInterface;
|
|
189 |
|
|
190 |
RCommServ iCommServer;
|
|
191 |
RComm iLoopbackPort;
|
|
192 |
|
|
193 |
};
|
|
194 |
|
|
195 |
|
|
196 |
/** Used to define a literal variable. */
|
|
197 |
#define SYMBIAN_TEST_LIT(name) _LIT(K##name, #name)
|
|
198 |
|
|
199 |
/** Define a literal from a classname and can be as the keyword class. */
|
|
200 |
#define SYMBIAN_TEST_CLASS(className) SYMBIAN_TEST_LIT(className); class className
|
|
201 |
|
|
202 |
/** Define a basic declaration for testClass as a subclass of CSpudNetSideTestBase
|
|
203 |
and define a literal from testClass */
|
|
204 |
#define SYMBIAN_SPUD_TEST_CLASS(testClass) SYMBIAN_TEST_CLASS(testClass) : public CSpudNetSideTestBase \
|
|
205 |
{ \
|
|
206 |
public: \
|
|
207 |
inline testClass() {SetTestStepName(K##testClass);}; \
|
|
208 |
virtual TVerdict RunTestStepL(); \
|
|
209 |
};
|
|
210 |
|
|
211 |
|
|
212 |
// Test Steps
|
|
213 |
SYMBIAN_SPUD_TEST_CLASS(CESockCheck)
|
|
214 |
SYMBIAN_SPUD_TEST_CLASS(CSpudPrimary)
|
|
215 |
SYMBIAN_SPUD_TEST_CLASS(CSpudPrimaryEvent)
|
|
216 |
SYMBIAN_SPUD_TEST_CLASS(CSpudPrimaryContextEventProgress)
|
|
217 |
SYMBIAN_SPUD_TEST_CLASS(CSpudDeletePrimary)
|
|
218 |
SYMBIAN_SPUD_TEST_CLASS(CSpudPrimaryEventOnLowerNifStarting)
|
|
219 |
SYMBIAN_SPUD_TEST_CLASS(CSpudSecondary)
|
|
220 |
SYMBIAN_SPUD_TEST_CLASS(CSpudSuspendContext)
|
|
221 |
|
|
222 |
#ifndef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
|
|
223 |
SYMBIAN_SPUD_TEST_CLASS(CSpudSecondaryChangeQoS)
|
|
224 |
SYMBIAN_SPUD_TEST_CLASS(CSpudSecondaryEvent)
|
|
225 |
SYMBIAN_SPUD_TEST_CLASS(CSpudTwoSecondaryEvents)
|
|
226 |
SYMBIAN_SPUD_TEST_CLASS(CSpudSecondaryEvent2)
|
|
227 |
#endif
|
|
228 |
|
|
229 |
// Nifman side testing
|
|
230 |
SYMBIAN_SPUD_TEST_CLASS(CSpudPrimaryInterfaceStop)
|
|
231 |
SYMBIAN_SPUD_TEST_CLASS(CSpudPrimaryInterfaceEventStop)
|
|
232 |
SYMBIAN_SPUD_TEST_CLASS(CSpudPrimaryDeletionInterfaceStop)
|
|
233 |
|
|
234 |
SYMBIAN_SPUD_TEST_CLASS(CSpudSecondaryInterfaceStop)
|
|
235 |
SYMBIAN_SPUD_TEST_CLASS(CSpudSecondaryInterfaceEventStop)
|
|
236 |
SYMBIAN_SPUD_TEST_CLASS(CSpudPrimayStartingStop)
|
|
237 |
SYMBIAN_SPUD_TEST_CLASS(CSpudSecondaryStartingStop)
|
|
238 |
SYMBIAN_SPUD_TEST_CLASS(CSpudSecondaryLowerNifDownStop)
|
|
239 |
SYMBIAN_SPUD_TEST_CLASS(CSpudPppPrimary)
|
|
240 |
SYMBIAN_SPUD_TEST_CLASS(CSpudPppSecondarySend)
|
|
241 |
SYMBIAN_SPUD_TEST_CLASS(CSpudMultiPrimary)
|
|
242 |
|
|
243 |
//SIP server address retrieve
|
|
244 |
SYMBIAN_SPUD_TEST_CLASS(CIoctlAddressRetrieve)
|
|
245 |
}
|
|
246 |
|
|
247 |
#endif
|