|
1 // Copyright (c) 2002-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 // This defines the CTS_MultiHomingStep class which is the base class for all |
|
15 // the MultiHoming test step classes |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 */ |
|
22 |
|
23 #if (!defined __TS_MULTIHOMINGSTEP_H__) |
|
24 #define __TS_MULTIHOMINGSTEP_H__ |
|
25 |
|
26 #include <e32std.h> |
|
27 #include <networking/teststep.h> |
|
28 #include <cdbstore.h> |
|
29 #include <es_sock.h> |
|
30 #include <in_sock.h> |
|
31 |
|
32 #include "TS_MultiHomingSuite.h" |
|
33 |
|
34 |
|
35 |
|
36 #include "CEchoSocket.h" |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 // Connection Configuration Lits |
|
42 _LIT(KNameDefault, "default"); |
|
43 _LIT(KNumOfConns, "NumberOfConns"); |
|
44 _LIT(KNumOfResolvers, "NumberOfResolvers"); |
|
45 _LIT(KConnName, "ConnName"); |
|
46 _LIT(KConnBearer, "ConnBearer"); |
|
47 _LIT(KConnIap, "ConnIAP"); |
|
48 _LIT(KConnNet, "ConnNET"); |
|
49 _LIT(KConnType, "ConnType"); |
|
50 _LIT(KExpectSameAddress, "ExpectSameAddress"); |
|
51 |
|
52 |
|
53 //_LIT(KConnType, "ConnType"); |
|
54 _LIT(KConnExplicit, "EXPLICIT"); |
|
55 _LIT(KConnImplicit, "IMPLICIT"); |
|
56 _LIT(KConnDefault, "DEFAULT"); |
|
57 |
|
58 // Socket Configuration Lits |
|
59 _LIT(KNumOfSocks, "NumberOfSockets"); |
|
60 _LIT(KSocket, "Socket"); |
|
61 _LIT(KSrcAddr, "SrcAddr"); |
|
62 _LIT(KSrcPort, "SrcPort"); |
|
63 _LIT(KDestAddr, "DestAddr"); |
|
64 _LIT(KDestPort, "DestPort"); |
|
65 _LIT(KProtocol, "Protocol"); |
|
66 _LIT(KTcp, "TCP"); |
|
67 _LIT(KUdp, "UDP"); |
|
68 _LIT(KPacketSize, "PacketSize"); |
|
69 _LIT(KNumOfPackets, "NumOfPackets"); |
|
70 _LIT(KUdpTol, "UDPTolerance"); |
|
71 _LIT(KSocketName, "SocketName"); |
|
72 _LIT(KIsListener, "IsListener"); |
|
73 _LIT(KIsSenderOnly, "IsSenderOnly"); |
|
74 |
|
75 |
|
76 // DNS Lits |
|
77 _LIT(KDestName, "DestName"); |
|
78 _LIT(KResolver, "Resolver"); |
|
79 _LIT(KExpectSuccess, "ExpectSuccess"); |
|
80 _LIT(KExpectTimeout, "ExpectTimeout"); |
|
81 _LIT(KExplicitResolve, "ExplicitResolve"); |
|
82 _LIT(KExpectNoDnsServer, "ExpectNoDnsServer"); |
|
83 |
|
84 |
|
85 // Error / Reporting |
|
86 _LIT(KEConnNotFound, "Connection not found"); |
|
87 _LIT(KDoingDefault, "No details found; doing the default (see documentation)"); |
|
88 _LIT(KConnXOpen, "Connection [%S] open"); |
|
89 _LIT(KConnXInsert, "Connection [%S] added to list"); |
|
90 _LIT(KConnXFail, "Connection [%S] failed to start with error [%S]."); |
|
91 _LIT(KEConfigFile, "There is a problem with the .ini file. Please create/check it."); |
|
92 _LIT(KELogger, "Error [%S] occurred."); //< General Error logger |
|
93 _LIT(KSockRun, "Socket [%i] running."); |
|
94 _LIT(KSockPassed, "Socket %i passed, sent %i packet loss was %i%%."); |
|
95 _LIT(KSockFailed, "Socket %i failed, error %S, sent %i packet loss was %i%%."); |
|
96 _LIT(KConnXClose, "Closing connection [%S]."); |
|
97 _LIT(KConnXStop, "Stoping connection [%S]."); |
|
98 |
|
99 _LIT(KOomTest, "OOMTest"); |
|
100 _LIT(KConnectionInfo, "ConnectionInfo"); |
|
101 _LIT(KRConnectionStart, "RConnectionStart"); |
|
102 _LIT(KRConnectionClose, "RConnectionClose"); |
|
103 _LIT(KRConnectionStop, "RConnectionStop"); |
|
104 _LIT(KTestConnection, "TestConnections"); |
|
105 _LIT(KTestIncomming, "TestIncomming"); |
|
106 _LIT(KShowConnections, "ShowConnections"); |
|
107 _LIT(KExpectedNumberOfIfs, "ExpectedNumOfIfs"); |
|
108 _LIT(KGetConnectionInfo, "GetConnectionInfo"); |
|
109 _LIT(KResolveName, "ResolveName"); |
|
110 _LIT(KResolveAddress, "ResolveAddress"); |
|
111 _LIT(KCopyComDbFile, "CopyComDbFile"); |
|
112 _LIT(KSourceFileName, "SourceFileName"); |
|
113 _LIT(KCheckLinkLocalSame,"CheckLinkLocalSame"); |
|
114 _LIT(KDelay, "Delay"); |
|
115 _LIT(KDelayInMs, "DelayInMs"); |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 class CTS_MultiHomingSuite; |
|
122 |
|
123 /* CTS_MultiHomingStep class declaration |
|
124 * Provides the base class for all multihoming test steps |
|
125 * |
|
126 */ |
|
127 class CTS_MultiHomingStep : public CTestStep |
|
128 { |
|
129 // Test Step Defaults - not #defines |
|
130 public: |
|
131 |
|
132 enum { ECHO_PORT = 7 }; |
|
133 enum { PACKET_SIZE = 512 }; |
|
134 enum { MAX_PACKET_SIZE = 1024 }; |
|
135 enum { NUM_OF_PACKETS = 20 }; |
|
136 enum { UDP_TOLERANCE = 5 }; |
|
137 |
|
138 public: |
|
139 CTS_MultiHomingStep(); |
|
140 |
|
141 void ExpLogExtra(const TText8* aFile, TInt aLine, TInt aSeverity, |
|
142 TRefByValue<const TDesC> aFmt,...); |
|
143 virtual ~CTS_MultiHomingStep(); |
|
144 |
|
145 CTS_MultiHomingSuite* iOwnerSuite; //< Pointer to suite which owns this test step |
|
146 void StepLog(TRefByValue<const TDesC16> aText, ...); //< Log function for CEchoSocket class |
|
147 private: |
|
148 enum TVerdict doTestStepPreambleL()=0; //< Used for OOMTest flag |
|
149 |
|
150 |
|
151 protected: |
|
152 TBool iIsOOMTest; |
|
153 TInt SetConnPrefs(TCommDbConnPref& aPrefs, TDesC& aName); |
|
154 TInt GetConnectionType(TConnDetails *conn, TDesC& aName); |
|
155 TInt GetSockConfig(const TInt aIndex, TInt& aProtocol, |
|
156 TInt& aPackSize, TInt& aNumPackets, |
|
157 TInt& aUdp, TInetAddr& aDstAddr, TInetAddr& aSrcAddr, |
|
158 TBool& aExpectPass, TBool& isListener, TConnDetails **aConnDetails); |
|
159 TInt GetResolverConfig(const TInt aIndex, TName &aHostName,TInt& aProtocol, |
|
160 TBool& aExpectSuccess, TBool& aExpectTimeout, TBool& aExpectNotReady, |
|
161 TBool& aExplicitResolve, TConnDetails **aConnDetails); |
|
162 |
|
163 }; |
|
164 |
|
165 #endif /* __TS_MULTIHOMINGSTEP_H__ */ |
|
166 |