|
1 /* |
|
2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // CLASS HEADER |
|
21 #include "ut_cstunrelaybindingimplementation.h" |
|
22 |
|
23 // EXTERNAL INCLUDES |
|
24 #include <digia/eunit/eunitmacros.h> |
|
25 #include <digia/eunit/EUnitDecorators.h> |
|
26 #include <commdbconnpref.h> |
|
27 #include <e32debug.h> |
|
28 |
|
29 // INTERNAL INCLUDES |
|
30 #include "natfwstunrelaybinding.h" |
|
31 #include "cstunrelaybindingimplementation.h" |
|
32 #include "mstunbindingobserver.h" |
|
33 #include "natfwstunclientdefs.h" |
|
34 #include "natfwunsafunknownattributesattribute.h" |
|
35 #include "natfwunsafbindingrequest.h" |
|
36 #include "natfwunsafbindingresponse.h" |
|
37 #include "natfwunsafbindingerrorresponse.h" |
|
38 #include "natfwunsafallocaterequest.h" |
|
39 #include "natfwunsafallocateerrorresponse.h" |
|
40 #include "natfwunsafallocateresponse.h" |
|
41 #include "natfwunsafconnectresponse.h" |
|
42 #include "natfwunsafconnecterrorresponse.h" |
|
43 #include "natfwunsafconnectrequest.h" |
|
44 #include "natfwunsafsetactivedestinationrequest.h" |
|
45 #include "natfwunsafsetactivedestinationresponse.h" |
|
46 #include "natfwunsafsetactivedestinationerrorresponse.h" |
|
47 #include "cstunbindinggetaddress.h" |
|
48 #include "natfwunsaficecontrolledattribute.h" |
|
49 #include "natfwbindingimplementationbase.h" |
|
50 #include "natfwunsafdataindication.h" |
|
51 #include "natfwunsafdataattribute.h" |
|
52 #include "natfwunsafremoteaddressattribute.h" |
|
53 #include "natfwunsafalternateserverattribute.h" |
|
54 #include "cstunbindinggetsharedsecret.h" |
|
55 #include "cstunbindinggetaddress.h" |
|
56 #include "cstunbindingactive.h" |
|
57 #include "cstunbindingwaittoretry.h" |
|
58 #include "natfwunsafrealmattribute.h" |
|
59 #include "natfwunsafnonceattribute.h" |
|
60 #include "cunsafmessageencoder.h" |
|
61 #include "cstunclientimplementation.h" |
|
62 #include "natfwunsaftcprelaypacket.h" |
|
63 #include "cnatfwunsafencodeditem.h" |
|
64 #include "natfwunittestmacros.h" |
|
65 |
|
66 _LIT8( KServerAddress, "10.32.194.251" ); |
|
67 _LIT8( KUsername, "userAA" ); |
|
68 _LIT8( KPassword,"salasana"); |
|
69 _LIT8(KRealmVal,"\"myrealm\""); |
|
70 _LIT8(KRealmVal2,"\"myREALMI\""); |
|
71 |
|
72 const TDesC8& dataDesc5(KRealmVal); |
|
73 const TDesC8& dataDesc6(KRealmVal2); |
|
74 |
|
75 const TUint KDefaultRtoValue = 0; |
|
76 |
|
77 // CONSTRUCTION |
|
78 ut_cstunrelaybindingimplementation* ut_cstunrelaybindingimplementation::NewL() |
|
79 { |
|
80 ut_cstunrelaybindingimplementation* self = ut_cstunrelaybindingimplementation::NewLC(); |
|
81 CleanupStack::Pop(); |
|
82 |
|
83 return self; |
|
84 } |
|
85 |
|
86 ut_cstunrelaybindingimplementation* ut_cstunrelaybindingimplementation::NewLC() |
|
87 { |
|
88 ut_cstunrelaybindingimplementation* self = new( ELeave ) ut_cstunrelaybindingimplementation(); |
|
89 CleanupStack::PushL( self ); |
|
90 |
|
91 self->ConstructL(); |
|
92 |
|
93 return self; |
|
94 } |
|
95 |
|
96 // Destructor (virtual by CBase) |
|
97 ut_cstunrelaybindingimplementation::~ut_cstunrelaybindingimplementation() |
|
98 { |
|
99 } |
|
100 |
|
101 // Default constructor |
|
102 ut_cstunrelaybindingimplementation::ut_cstunrelaybindingimplementation() |
|
103 { |
|
104 } |
|
105 |
|
106 // Second phase construct |
|
107 void ut_cstunrelaybindingimplementation::ConstructL() |
|
108 { |
|
109 // The ConstructL from the base class CEUnitTestSuiteClass must be called. |
|
110 // It generates the test case table. |
|
111 CEUnitTestSuiteClass::ConstructL(); |
|
112 } |
|
113 |
|
114 // METHODS |
|
115 // from mstunclientbserver |
|
116 void ut_cstunrelaybindingimplementation::STUNClientInitCompleted( const CSTUNClient& /*aClient*/, |
|
117 TInt aCompletionCode ) |
|
118 { |
|
119 RDebug::Print( _L("**NATFW STUNClientInitCompleted, code: %d"), aCompletionCode ); |
|
120 CActiveScheduler::Stop(); |
|
121 } |
|
122 |
|
123 |
|
124 void ut_cstunrelaybindingimplementation::STUNBindingEventOccurredL( TSTUNBindingEvent aEvent, |
|
125 const CBinding& /*aBinding*/ ) |
|
126 { |
|
127 RDebug::Print( _L("**NATFW STUNBindingEventOccurredL, code: %d"), aEvent ); |
|
128 CActiveScheduler::Stop(); |
|
129 } |
|
130 |
|
131 |
|
132 void ut_cstunrelaybindingimplementation::STUNBindingErrorOccurred( const CBinding& /*aBinding*/, |
|
133 TInt aError ) |
|
134 { |
|
135 RDebug::Print( _L("**NATFW STUNBindingErrorOccurred, code: %d"), aError ); |
|
136 CActiveScheduler::Stop(); |
|
137 } |
|
138 |
|
139 void ut_cstunrelaybindingimplementation::Notify( TUint /*aSessionId*/, TUint /*aStreamId*/, |
|
140 TNotifyType /*aType*/, TInt /*aError*/ ) |
|
141 { |
|
142 RDebug::Print( _L("**NATFW Notify") ); |
|
143 } |
|
144 |
|
145 const CSTUNClient& ut_cstunrelaybindingimplementation::STUNClient() const |
|
146 { |
|
147 return *iStunclient; |
|
148 } |
|
149 |
|
150 CDeltaTimer& ut_cstunrelaybindingimplementation::TimerProvider() |
|
151 { |
|
152 return *iDeltatimer; |
|
153 } |
|
154 |
|
155 TInt ut_cstunrelaybindingimplementation::RetransmitInterval() const |
|
156 { |
|
157 TInt dummy(0); |
|
158 return dummy; |
|
159 } |
|
160 |
|
161 TTransportProtocol ut_cstunrelaybindingimplementation::TransportProtocol() const |
|
162 { |
|
163 iStunclient->Implementation().TransportProtocol(); |
|
164 } |
|
165 |
|
166 void ut_cstunrelaybindingimplementation::AddressResolvedL( const CBinding& /*aBinding*/ ) const |
|
167 { |
|
168 } |
|
169 |
|
170 void ut_cstunrelaybindingimplementation::ObtainSharedSecretL( CBinding& /*aBinding*/ ) |
|
171 { |
|
172 TBufC8<16> password( KPassword ); |
|
173 TBufC8<6> usernameA( KUsername ); |
|
174 |
|
175 iImpl->CreateBindingRequestL( usernameA, password ); |
|
176 iImpl->SendBindingRequestL(); |
|
177 } |
|
178 |
|
179 TBool ut_cstunrelaybindingimplementation::SharedSecretRejectedL( |
|
180 const CBinding& /*aBinding*/, const TDesC8& /*aUsername*/, const TDesC8& /*aPassword*/ ) |
|
181 { |
|
182 TBool dummy( EFalse ); |
|
183 return dummy; |
|
184 } |
|
185 |
|
186 TBool ut_cstunrelaybindingimplementation::ObtainServerAddress( TInetAddr& aAddress ) |
|
187 { |
|
188 #ifdef _DEBUG_EUNIT |
|
189 TInetAddr addr; |
|
190 addr.SetAddress( INET_ADDR( 10,32,194,251 ) ); |
|
191 aAddress = addr; |
|
192 return ETrue; |
|
193 #endif |
|
194 |
|
195 return EFalse; |
|
196 } |
|
197 |
|
198 void ut_cstunrelaybindingimplementation::ObtainTransactionIDL( TNATFWUNSAFTransactionID& aTransactionID ) |
|
199 { |
|
200 iStunclient->ObtainTransactionIDL( aTransactionID ); |
|
201 } |
|
202 |
|
203 void ut_cstunrelaybindingimplementation::AttachBindingL( const CBinding& /*aBinding*/ ) |
|
204 { |
|
205 } |
|
206 |
|
207 void ut_cstunrelaybindingimplementation::DetachBinding( const CBinding& /*aBinding*/ ) |
|
208 { |
|
209 } |
|
210 void ut_cstunrelaybindingimplementation::BindingErrorL( const CBinding& /*aBinding*/, TInt aError, TBool /*aIsFatal*/ ) |
|
211 { |
|
212 RDebug::Print( _L("**NATFW BindingErrorL, error: %d"), aError ); |
|
213 } |
|
214 void ut_cstunrelaybindingimplementation::BindingEventOccurred( const CBinding& /*aBinding*/, |
|
215 TSTUNCallbackInfo::TFunction /*aEvent*/ ) |
|
216 { |
|
217 } |
|
218 |
|
219 |
|
220 const TDesC8& ut_cstunrelaybindingimplementation::UsernameForIndication() |
|
221 { |
|
222 TBufC8<16> password( KPassword ); |
|
223 return password; |
|
224 } |
|
225 |
|
226 const TDesC8& ut_cstunrelaybindingimplementation::PasswordForIndication() |
|
227 { |
|
228 TBufC8<16> password( KPassword ); |
|
229 return password; |
|
230 } |
|
231 |
|
232 void ut_cstunrelaybindingimplementation::SetupL( ) |
|
233 { |
|
234 TUint iapID( 6 ); |
|
235 TInt retransmitInterval( 10 ); |
|
236 TBufC8<13> serveraddress( KServerAddress ); |
|
237 TUint serverport( 2000 ); |
|
238 TBufC8<10> service( KStunRelay ); |
|
239 TBool obtainsharedsecret( ETrue ); |
|
240 TBool failifnoSRVrecordfound( EFalse ); |
|
241 iDeltatimer = CDeltaTimer::NewL( 1 ); |
|
242 User::LeaveIfError( iSocketServ.Connect() ); |
|
243 iStreamId = 1; |
|
244 iSubstreamId = 1; |
|
245 TBool icmpUsed( EFalse ); |
|
246 |
|
247 iMux = CNcmConnectionMultiplexer::NewL( *this ); |
|
248 |
|
249 TCommDbConnPref pref; |
|
250 pref.SetDialogPreference( ECommDbDialogPrefDoNotPrompt ); |
|
251 pref.SetIapId( iapID ); |
|
252 |
|
253 User::LeaveIfError( iConnection.Open( iSocketServ ) ); |
|
254 iConnection.Start( pref, iStatus ); |
|
255 User::WaitForRequest( iStatus ); |
|
256 User::LeaveIfError( iStatus.Int() ); |
|
257 |
|
258 iStunclient = CSTUNClient::NewL( retransmitInterval, |
|
259 serveraddress, |
|
260 serverport, |
|
261 service, |
|
262 iSocketServ, |
|
263 iConnection, |
|
264 *iDeltatimer, |
|
265 *this, |
|
266 obtainsharedsecret, |
|
267 failifnoSRVrecordfound, |
|
268 icmpUsed, |
|
269 iMux ); |
|
270 |
|
271 CActiveScheduler::Start(); |
|
272 |
|
273 User::LeaveIfError( iSocket.Open( iSocketServ, KAfInet, KSockDatagram, |
|
274 KProtocolInetUdp )); |
|
275 iSocket.SetLocalPort( 5000 ); |
|
276 iBinding = CSTUNRelayBinding::NewL( *iStunclient, iStreamId, iSubstreamId ); |
|
277 |
|
278 iImpl = CSTUNRelayBindingImplementation::NewL( *iBinding, *this, |
|
279 iStreamId, iSubstreamId, iMux ); |
|
280 } |
|
281 |
|
282 void ut_cstunrelaybindingimplementation::Teardown( ) |
|
283 { |
|
284 delete iImpl; |
|
285 delete iBinding; |
|
286 delete iStunclient; |
|
287 iSocket.Close(); |
|
288 iConnection.Stop(); |
|
289 iConnection.Close(); |
|
290 iSocketServ.Close(); |
|
291 delete iServeraddress; |
|
292 delete iResponse; |
|
293 delete iRespDataIndication; |
|
294 delete iDeltatimer; |
|
295 delete iMux; |
|
296 } |
|
297 |
|
298 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_NewLL( ) |
|
299 { |
|
300 CSTUNRelayBindingImplementation* impl = |
|
301 CSTUNRelayBindingImplementation::NewL( *iBinding, *this, iSocket ); |
|
302 delete impl; |
|
303 } |
|
304 |
|
305 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_NewL_1L( ) |
|
306 { |
|
307 CSTUNRelayBindingImplementation* impl = |
|
308 CSTUNRelayBindingImplementation::NewL( *iBinding, *this, iStreamId, iSubstreamId, iMux ); |
|
309 delete impl; |
|
310 } |
|
311 |
|
312 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_TimerExpiredLL( ) |
|
313 { |
|
314 CSTUNBindingGetAddress* getAddress = new ( ELeave ) CSTUNBindingGetAddress(); |
|
315 CleanupStack::PushL( getAddress ); |
|
316 CSTUNBindingGetSharedSecret* getSharedSecret = |
|
317 new ( ELeave ) CSTUNBindingGetSharedSecret( *getAddress ); |
|
318 CleanupStack::PushL( getSharedSecret ); |
|
319 CSTUNBindingWaitToRetry* waitToRetry = new ( ELeave ) CSTUNBindingWaitToRetry( *getSharedSecret ); |
|
320 CleanupStack::PushL( waitToRetry ); |
|
321 |
|
322 iImpl->ChangeState( *waitToRetry ); |
|
323 |
|
324 TInetAddr addr( KProtocolInetUdp ); |
|
325 _LIT( KServer, "10.32.194.251" ); |
|
326 addr.Input( KServer ); |
|
327 iImpl->iServerAddress = addr; |
|
328 iImpl->iRequestType = iImpl->ESendRequest; |
|
329 iImpl->TimerExpiredL(); |
|
330 |
|
331 CleanupStack::PopAndDestroy( waitToRetry ); |
|
332 CleanupStack::PopAndDestroy( getSharedSecret ); |
|
333 CleanupStack::PopAndDestroy( getAddress ); |
|
334 } |
|
335 |
|
336 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_LeaveFromTimerExpiredL( ) |
|
337 { |
|
338 //EUNIT_ASSERT_PANIC( iImpl->LeaveFromTimerExpired( KErrNone), "", KErrArgument ); |
|
339 iImpl->LeaveFromTimerExpired( KErrNotFound ); |
|
340 } |
|
341 |
|
342 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_PublicAddressObtainedLL( ) |
|
343 { |
|
344 TInetAddr addr; |
|
345 CSTUNBindingGetAddress* getAddress = new ( ELeave ) CSTUNBindingGetAddress(); |
|
346 iImpl->ChangeState( *getAddress ); |
|
347 iImpl->PublicAddressObtainedL( addr ); |
|
348 delete getAddress; |
|
349 } |
|
350 |
|
351 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_PublicAddressObtainedL_1L( ) |
|
352 { |
|
353 TInetAddr reflexsiveAddr; |
|
354 TInetAddr relayAddr; |
|
355 |
|
356 CSTUNBindingGetAddress* getAddress = new ( ELeave ) CSTUNBindingGetAddress(); |
|
357 iImpl->ChangeState( *getAddress ); |
|
358 iImpl->PublicAddressObtainedL( reflexsiveAddr, relayAddr ); |
|
359 delete getAddress; |
|
360 } |
|
361 |
|
362 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_TransactionErrorL( ) |
|
363 { |
|
364 EUNIT_ASSERT_PANIC( iImpl->TransactionError( |
|
365 KErrNone, CNATFWUNSAFUnknownAttributesAttribute::NewLC() ), "", KErrArgument ); |
|
366 } |
|
367 |
|
368 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_TransactionEventOccurredLL( ) |
|
369 { |
|
370 iImpl->TransactionEventOccurredL( TSTUNCallbackInfo::EInitCompleted ); |
|
371 |
|
372 TBufC8<16> password( KPassword ); |
|
373 TBufC8<6> usernameA( KUsername ); |
|
374 iImpl->iRequestType = iImpl->ESendRequest; |
|
375 iImpl->CreateBindingRequestL( usernameA, password ); |
|
376 |
|
377 TInetAddr addr( KProtocolInetUdp ); |
|
378 _LIT( KServer, "10.32.194.251" ); |
|
379 addr.Input( KServer ); |
|
380 iImpl->iServerAddress = addr; |
|
381 iImpl->SendBindingRequestL(); |
|
382 //iImpl->iRequestType = iImpl->ESetActiveDestinationRequest; |
|
383 iImpl->Terminate(401); |
|
384 TUint32 timerValue(10); |
|
385 iImpl->SetActiveDestinationRequestL( addr, timerValue ); |
|
386 iImpl->TransactionEventOccurredL( TSTUNCallbackInfo::EInitCompleted ); |
|
387 |
|
388 //iImpl->iRequestType = iImpl->ESendIndicationToNetwork; |
|
389 iImpl->TransactionEventOccurredL( TSTUNCallbackInfo::EInitCompleted ); |
|
390 } |
|
391 |
|
392 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_AllocateRequestLL( ) |
|
393 { |
|
394 iImpl->AllocateRequestL( KDefaultRtoValue ); |
|
395 } |
|
396 |
|
397 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_CancelRequestL( ) |
|
398 { |
|
399 iImpl->CancelRequest(); |
|
400 } |
|
401 |
|
402 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_SocketL( ) |
|
403 { |
|
404 CSTUNRelayBindingImplementation* impl = |
|
405 CSTUNRelayBindingImplementation::NewL( *iBinding, *this, iSocket ); |
|
406 RSocket socket = impl->Socket(); |
|
407 delete impl; |
|
408 } |
|
409 |
|
410 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_AddressResolvedL( ) |
|
411 { |
|
412 TBool isResolved = iImpl->AddressResolved(); |
|
413 } |
|
414 |
|
415 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_PublicAddrL( ) |
|
416 { |
|
417 TInetAddr addr = iImpl->PublicAddr(); |
|
418 } |
|
419 |
|
420 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_AlternateServerAddrL( ) |
|
421 { |
|
422 TInetAddr addr = iImpl->AlternateServerAddr(); |
|
423 } |
|
424 |
|
425 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_HandleDataLL( ) |
|
426 { |
|
427 EUNIT_DISABLE_ALLOC_DECORATOR; |
|
428 CUnsafMessageEncoder* encoder = CUnsafMessageEncoder::NewLC(); |
|
429 |
|
430 _LIT8( KPassword,"aaaabbbbccccdddd"); |
|
431 TBufC8<16> password( KPassword ); |
|
432 TNATFWUNSAFTransactionID transactionID; |
|
433 iStunclient->ObtainTransactionIDL( transactionID ); |
|
434 |
|
435 CNATFWUNSAFDataIndication* indication = CNATFWUNSAFDataIndication::NewLC( transactionID ); |
|
436 |
|
437 CNATFWUNSAFBindingResponse* response = CNATFWUNSAFBindingResponse::NewLC( transactionID ); |
|
438 HBufC8* respmsg = encoder->EncodeMessageL( *response ); |
|
439 CleanupStack::PopAndDestroy( response ); |
|
440 CleanupStack::PushL( respmsg ); |
|
441 |
|
442 TInetAddr remoteAddr; |
|
443 TBool consumed = EFalse; |
|
444 EUNIT_ENABLE_ALLOC_DECORATOR; |
|
445 HBufC8* ptr = iImpl->HandleDataL( *respmsg, consumed, remoteAddr ); |
|
446 EUNIT_DISABLE_ALLOC_DECORATOR; |
|
447 EUNIT_ASSERT( NULL == ptr ); |
|
448 EUNIT_ASSERT( EFalse == consumed ); |
|
449 |
|
450 CleanupStack::PopAndDestroy( respmsg ); |
|
451 // non-valid stun req inside indication |
|
452 |
|
453 _LIT8( KDummypacket, "oysescatechnologiesabFIN" ); |
|
454 TBufC8<24> buffi( KDummypacket ); |
|
455 indication->AddAttributeL( CNATFWUNSAFDataAttribute::NewLC( buffi ) ); |
|
456 CleanupStack::Pop(); // CNATFWUNSAFDataAttribute |
|
457 indication->AddAttributeL( CNATFWUNSAFRemoteAddressAttribute::NewLC( remoteAddr ) ); |
|
458 CleanupStack::Pop(); // CNATFWUNSAFRemoteAddressAttribute |
|
459 HBufC8* msg = encoder->EncodeMessageL( *indication ); |
|
460 CleanupStack::PushL( msg ); |
|
461 EUNIT_ENABLE_ALLOC_DECORATOR; |
|
462 ptr = iImpl->HandleDataL( *msg, consumed, remoteAddr ); |
|
463 |
|
464 EUNIT_ASSERT( NULL != ptr ); |
|
465 EUNIT_ASSERT( EFalse == consumed ); |
|
466 |
|
467 delete ptr; |
|
468 |
|
469 CleanupStack::PopAndDestroy( msg ); |
|
470 CleanupStack::PopAndDestroy( indication ); // test |
|
471 CleanupStack::PopAndDestroy( encoder ); |
|
472 } |
|
473 |
|
474 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_HandleDataL2L( ) |
|
475 { |
|
476 EUNIT_DISABLE_ALLOC_DECORATOR; |
|
477 CUnsafMessageEncoder* encoder = CUnsafMessageEncoder::NewLC(); |
|
478 |
|
479 TInetAddr remoteAddr; |
|
480 TBool consumed = EFalse; |
|
481 _LIT8( KPassword,"aaaabbbbccccdddd"); |
|
482 TBufC8<16> password( KPassword ); |
|
483 TNATFWUNSAFTransactionID transactionID; |
|
484 iStunclient->ObtainTransactionIDL( transactionID ); |
|
485 |
|
486 CNATFWUNSAFDataIndication* indication = CNATFWUNSAFDataIndication::NewLC( transactionID ); |
|
487 |
|
488 CNATFWUNSAFBindingResponse* response = CNATFWUNSAFBindingResponse::NewLC( transactionID ); |
|
489 HBufC8* respmsg = encoder->EncodeMessageL( *response ); |
|
490 CleanupStack::PopAndDestroy( response ); |
|
491 CleanupStack::PushL( respmsg ); |
|
492 |
|
493 // valid stun request inside indication |
|
494 |
|
495 indication->DeleteAttribute( CNATFWUNSAFAttribute::EData ); |
|
496 indication->AddAttributeL( CNATFWUNSAFDataAttribute::NewLC( *respmsg ) ); |
|
497 CleanupStack::Pop(); // CNATFWUNSAFDataAttribute |
|
498 |
|
499 CleanupStack::PopAndDestroy( respmsg ); |
|
500 |
|
501 HBufC8* msg = encoder->EncodeMessageL( *indication ); |
|
502 CleanupStack::PushL( msg ); |
|
503 EUNIT_ENABLE_ALLOC_DECORATOR; |
|
504 HBufC8* ptr = iImpl->HandleDataL( *msg, consumed, remoteAddr ); |
|
505 EUNIT_DISABLE_ALLOC_DECORATOR; |
|
506 EUNIT_ASSERT( NULL != ptr ); |
|
507 EUNIT_ASSERT( EFalse == consumed ); |
|
508 |
|
509 delete ptr; |
|
510 |
|
511 // Tcp framing not valid |
|
512 |
|
513 iStunclient->Implementation().iTransportProtocol = ETcpProtocol; |
|
514 EUNIT_ENABLE_ALLOC_DECORATOR; |
|
515 ptr = iImpl->HandleDataL( *msg, consumed, remoteAddr ); |
|
516 |
|
517 EUNIT_ASSERT( NULL == ptr ); |
|
518 EUNIT_ASSERT( EFalse == consumed ); |
|
519 |
|
520 CleanupStack::PopAndDestroy( msg ); |
|
521 CleanupStack::PopAndDestroy( indication ); |
|
522 CleanupStack::PopAndDestroy( encoder ); |
|
523 } |
|
524 |
|
525 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_HandleDataL3L( ) |
|
526 { |
|
527 EUNIT_DISABLE_ALLOC_DECORATOR; |
|
528 CUnsafMessageEncoder* encoder = CUnsafMessageEncoder::NewLC(); |
|
529 |
|
530 TBool consumed = EFalse; |
|
531 _LIT8( KPassword,"aaaabbbbccccdddd"); |
|
532 TBufC8<16> password( KPassword ); |
|
533 TNATFWUNSAFTransactionID transactionID; |
|
534 iStunclient->ObtainTransactionIDL( transactionID ); |
|
535 TInetAddr remoteAddr; |
|
536 |
|
537 CNATFWUNSAFDataIndication* indication = CNATFWUNSAFDataIndication::NewLC( transactionID ); |
|
538 |
|
539 CNATFWUNSAFBindingResponse* response = CNATFWUNSAFBindingResponse::NewLC( transactionID ); |
|
540 HBufC8* respmsg = encoder->EncodeMessageL( *response ); |
|
541 CleanupStack::PopAndDestroy( response ); |
|
542 CleanupStack::PushL( respmsg ); |
|
543 |
|
544 indication->AddAttributeL( CNATFWUNSAFRemoteAddressAttribute::NewLC( remoteAddr ) ); |
|
545 CleanupStack::Pop(); // CNATFWUNSAFRemoteAddressAttribute |
|
546 indication->AddAttributeL( CNATFWUNSAFDataAttribute::NewLC( *respmsg ) ); |
|
547 CleanupStack::Pop(); // CNATFWUNSAFDataAttribute |
|
548 |
|
549 CleanupStack::PopAndDestroy( respmsg ); |
|
550 HBufC8* msg = encoder->EncodeMessageL( *indication ); |
|
551 CleanupStack::PushL( msg ); |
|
552 |
|
553 // TCP framing used |
|
554 |
|
555 iStunclient->Implementation().iTransportProtocol = ETcpProtocol; |
|
556 CNATFWUNSAFTcpRelayPacket* packet = CNATFWUNSAFTcpRelayPacket::NewLC( |
|
557 *msg, CNATFWUNSAFTcpRelayPacket::EFrameTypeStun); |
|
558 |
|
559 CBufBase* message = packet->EncodeL(); |
|
560 CleanupStack::PushL( message ); |
|
561 TInt length = message->Size(); |
|
562 HBufC8* readBuf = HBufC8::NewLC( length ); |
|
563 TPtr8 writable( readBuf->Des() ); |
|
564 message->Read( 0, writable, length ); |
|
565 |
|
566 EUNIT_ENABLE_ALLOC_DECORATOR; |
|
567 HBufC8* ptr = iImpl->HandleDataL( *readBuf, consumed, remoteAddr ); |
|
568 EUNIT_ASSERT( NULL != ptr ); |
|
569 EUNIT_ASSERT( EFalse == consumed ); |
|
570 EUNIT_DISABLE_ALLOC_DECORATOR; |
|
571 delete ptr; |
|
572 CleanupStack::PopAndDestroy( readBuf ); |
|
573 CleanupStack::PopAndDestroy( message ); |
|
574 |
|
575 CNATFWUNSAFEncodedItem* encoded = CNATFWUNSAFEncodedItem::NewL( |
|
576 *packet, iStreamId, iSubstreamId ); |
|
577 |
|
578 CleanupStack::PopAndDestroy( packet ); |
|
579 |
|
580 CleanupStack::PushL( encoded ); |
|
581 |
|
582 TBufC8<6> usernameA( KUsername ); |
|
583 iImpl->iRequestType = iImpl->ESendRequest; |
|
584 |
|
585 EUNIT_ENABLE_ALLOC_DECORATOR; |
|
586 |
|
587 NATFW_EUNIT_ASSERT_NO_LEAVE( iImpl->CreateBindingRequestL( usernameA, password ) ); |
|
588 |
|
589 _LIT( KServer, "10.32.194.251" ); |
|
590 TInetAddr addr( KProtocolInetUdp ); |
|
591 addr.Input( KServer ); |
|
592 iImpl->iServerAddress = addr; |
|
593 |
|
594 iImpl->SendBindingRequestL(); |
|
595 |
|
596 TPtr8 data = encoded->Ptr(); |
|
597 |
|
598 ptr = iImpl->HandleDataL( data, consumed, remoteAddr ); |
|
599 EUNIT_ASSERT( NULL == ptr ); |
|
600 EUNIT_ASSERT( ETrue == consumed ); |
|
601 |
|
602 delete ptr; |
|
603 |
|
604 data.Delete( 0, data.Length()); |
|
605 |
|
606 CleanupStack::PopAndDestroy( encoded ); |
|
607 |
|
608 CleanupStack::PopAndDestroy( msg ); |
|
609 CleanupStack::PopAndDestroy( indication ); |
|
610 CleanupStack::PopAndDestroy( encoder ); |
|
611 } |
|
612 |
|
613 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_HandleDataL4L( ) |
|
614 { |
|
615 CUnsafMessageEncoder* encoder = CUnsafMessageEncoder::NewLC(); |
|
616 |
|
617 TBool consumed = EFalse; |
|
618 _LIT8( KPassword,"aaaabbbbccccdddd"); |
|
619 TBufC8<16> password( KPassword ); |
|
620 TNATFWUNSAFTransactionID transactionID; |
|
621 iStunclient->ObtainTransactionIDL( transactionID ); |
|
622 TInetAddr remoteAddr; |
|
623 iStunclient->Implementation().iTransportProtocol = ETcpProtocol; |
|
624 |
|
625 CNATFWUNSAFDataIndication* indication = CNATFWUNSAFDataIndication::NewLC( transactionID ); |
|
626 |
|
627 CNATFWUNSAFBindingResponse* response = CNATFWUNSAFBindingResponse::NewLC( transactionID ); |
|
628 HBufC8* respmsg = encoder->EncodeMessageL( *response ); |
|
629 CleanupStack::PopAndDestroy( response ); |
|
630 CleanupStack::PushL( respmsg ); |
|
631 |
|
632 indication->AddAttributeL( CNATFWUNSAFDataAttribute::NewLC( *respmsg ) ); |
|
633 CleanupStack::Pop(); // CNATFWUNSAFDataAttribute |
|
634 |
|
635 CleanupStack::PopAndDestroy( respmsg ); |
|
636 HBufC8* msg = encoder->EncodeMessageL( *indication ); |
|
637 CleanupStack::PushL( msg ); |
|
638 |
|
639 CNATFWUNSAFTcpRelayPacket* packet = |
|
640 CNATFWUNSAFTcpRelayPacket::NewLC( *msg, CNATFWUNSAFTcpRelayPacket::EFrameTypeData); |
|
641 |
|
642 CNATFWUNSAFEncodedItem* encoded = |
|
643 CNATFWUNSAFEncodedItem::NewLC( *packet, iStreamId, iSubstreamId ); |
|
644 |
|
645 TPtr8 data = encoded->Ptr(); |
|
646 |
|
647 HBufC8* ptr = iImpl->HandleDataL( data, consumed, remoteAddr ); |
|
648 EUNIT_ASSERT( NULL != ptr ); |
|
649 EUNIT_ASSERT( EFalse == consumed ); |
|
650 |
|
651 delete ptr; |
|
652 |
|
653 data.Delete( 0, data.Length()); |
|
654 CleanupStack::PopAndDestroy( encoded ); |
|
655 CleanupStack::PopAndDestroy( packet ); |
|
656 |
|
657 CleanupStack::PopAndDestroy( msg ); |
|
658 CleanupStack::PopAndDestroy( indication ); |
|
659 CleanupStack::PopAndDestroy( encoder ); |
|
660 } |
|
661 |
|
662 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_STUNClientL( ) |
|
663 { |
|
664 const CSTUNClient* client = iImpl->STUNClient(); |
|
665 delete iStunclient; |
|
666 iStunclient = NULL; |
|
667 const CSTUNClient* client2 = iImpl->STUNClient(); |
|
668 } |
|
669 |
|
670 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_GetServerAddressLL( ) |
|
671 { |
|
672 NATFW_EUNIT_ASSERT_NO_LEAVE( iImpl->GetServerAddressL() ); |
|
673 } |
|
674 |
|
675 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_GetSharedSecretLL( ) |
|
676 { |
|
677 TInetAddr addr( KProtocolInetUdp ); |
|
678 _LIT( KServer, "10.32.194.251" ); |
|
679 addr.Input( KServer ); |
|
680 iImpl->iServerAddress = addr; |
|
681 iImpl->iRequestType = iImpl->ESendRequest; |
|
682 iImpl->GetSharedSecretL(); |
|
683 } |
|
684 |
|
685 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_DetachClientL( ) |
|
686 { |
|
687 iImpl->DetachClient(); |
|
688 } |
|
689 |
|
690 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_StoreAddressLL( ) |
|
691 { |
|
692 TInetAddr addr; |
|
693 iImpl->StoreAddressL( addr ); |
|
694 } |
|
695 |
|
696 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_StoreAddressL_1L( ) |
|
697 { |
|
698 TInetAddr reflexiveAddr; |
|
699 TInetAddr relayAddr; |
|
700 iImpl->StoreAddressL( reflexiveAddr, relayAddr ); |
|
701 } |
|
702 |
|
703 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_ChangeStateL( ) |
|
704 { |
|
705 CSTUNBindingGetAddress* getAddress = new ( ELeave ) CSTUNBindingGetAddress(); |
|
706 iImpl->ChangeState( *getAddress ); |
|
707 delete getAddress; |
|
708 } |
|
709 |
|
710 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_TerminateL( ) |
|
711 { |
|
712 _LIT( KServer, "10.32.194.251" ); |
|
713 |
|
714 iImpl->iPublicAddr.SetFamily( KProtocolInetUdp ); |
|
715 iImpl->iPublicAddr.Input( KServer ); |
|
716 iImpl->CancelRequest(); |
|
717 iImpl->Terminate( KErrNotFound ); |
|
718 iImpl->Terminate( 1 ); |
|
719 |
|
720 CSTUNBindingGetAddress* getAddress = new ( ELeave ) CSTUNBindingGetAddress(); |
|
721 CleanupStack::PushL( getAddress ); |
|
722 CSTUNBindingGetSharedSecret* getSharedSecret = |
|
723 new ( ELeave ) CSTUNBindingGetSharedSecret( *getAddress ); |
|
724 CleanupStack::PushL( getSharedSecret ); |
|
725 CSTUNBindingActive* active = new ( ELeave ) CSTUNBindingActive( *getSharedSecret ); |
|
726 CleanupStack::PushL( active ); |
|
727 iImpl->ChangeState( *active ); |
|
728 iImpl->Terminate( 300 ); |
|
729 |
|
730 CleanupStack::PopAndDestroy( active ); |
|
731 CleanupStack::PopAndDestroy( getSharedSecret ); |
|
732 CleanupStack::PopAndDestroy( getAddress ); |
|
733 |
|
734 iImpl->Terminate( 401 ); |
|
735 iImpl->Terminate( 434 ); |
|
736 iImpl->Terminate( 436 ); |
|
737 } |
|
738 |
|
739 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_IsWaitingSharedSecretL( ) |
|
740 { |
|
741 iImpl->IsWaitingSharedSecret(); |
|
742 } |
|
743 |
|
744 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_SharedSecretObtainedLL( ) |
|
745 { |
|
746 TBufC8<16> password( KPassword ); |
|
747 TBufC8<6> usernameA( KUsername ); |
|
748 EUNIT_ASSERT_PANIC( iImpl->SharedSecretObtainedL( usernameA, password ), "", KErrGeneral ); |
|
749 } |
|
750 |
|
751 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_CreateBindingRequestLL( ) |
|
752 { |
|
753 TBufC8<16> password( KPassword ); |
|
754 TBufC8<6> usernameA( KUsername ); |
|
755 TICEAttributes attributes; |
|
756 attributes.iPriority = 36; |
|
757 attributes.iUseCandidate = ETrue; |
|
758 iImpl->SetICESpecificAttributes( attributes ); |
|
759 iImpl->iAddXorOnly = ETrue; |
|
760 |
|
761 iImpl->iRequestType = iImpl->ESendRequest; |
|
762 iImpl->CreateBindingRequestL( usernameA, password ); |
|
763 |
|
764 TBufC8<1> dummy; |
|
765 iImpl->CreateBindingRequestL( dummy, password ); |
|
766 iImpl->iTransactionError = 401; |
|
767 NATFW_EUNIT_ASSERT_SPECIFIC_LEAVE( iImpl->CreateBindingRequestL( dummy, password ), KErrAccessDenied ); |
|
768 NATFW_EUNIT_ASSERT_SPECIFIC_LEAVE( iImpl->CreateBindingRequestL( usernameA, dummy ), KErrAccessDenied ); |
|
769 |
|
770 iImpl->AllocateRequestL( KDefaultRtoValue ); |
|
771 iImpl->iRequestType = iImpl->EAllocateRequest; |
|
772 iImpl->CreateBindingRequestL( usernameA, password ); |
|
773 |
|
774 TInetAddr addr; |
|
775 TUint32 timerValue = 1000000; |
|
776 iImpl->SetActiveDestinationRequestL( addr, timerValue ); |
|
777 iImpl->CreateBindingRequestL( usernameA, password ); |
|
778 |
|
779 iImpl->ConnectRequestL( addr ); |
|
780 iImpl->CreateBindingRequestL( usernameA, password ); |
|
781 } |
|
782 |
|
783 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_SendBindingRequestLL( ) |
|
784 { |
|
785 TBufC8<16> password( KPassword ); |
|
786 TBufC8<6> usernameA( KUsername ); |
|
787 iImpl->iRequestType = iImpl->ESendRequest; |
|
788 iImpl->CreateBindingRequestL( usernameA, password ); |
|
789 |
|
790 TInetAddr addr( KProtocolInetUdp ); |
|
791 _LIT( KServer, "10.32.194.251" ); |
|
792 addr.Input( KServer ); |
|
793 iImpl->iServerAddress = addr; |
|
794 iImpl->SendBindingRequestL(); |
|
795 |
|
796 CSTUNRelayBindingImplementation* impl = |
|
797 CSTUNRelayBindingImplementation::NewL( *iBinding, *this, iSocket ); |
|
798 |
|
799 RSocket socket = impl->Socket(); |
|
800 delete impl; |
|
801 |
|
802 //iImpl->SendBindingRequestL(); |
|
803 |
|
804 delete iImpl->iRequest; |
|
805 iImpl->iRequest = NULL; |
|
806 delete iImpl->iTransaction; |
|
807 iImpl->iTransaction = NULL; |
|
808 EUNIT_ASSERT_PANIC( iImpl->SendBindingRequestL(), "", KErrNotFound ); |
|
809 } |
|
810 |
|
811 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_HandleTransactionErrorL( ) |
|
812 { |
|
813 TBufC8<16> password( KPassword ); |
|
814 TBufC8<6> usernameA( KUsername ); |
|
815 iImpl->iRequestType = iImpl->ESendRequest; |
|
816 iImpl->CreateBindingRequestL( usernameA, password ); |
|
817 iImpl->HandleTransactionError( 2 ); |
|
818 EUNIT_ASSERT( iImpl->HandleTransactionError( KErrTimedOut ) == ETrue ); |
|
819 EUNIT_ASSERT( iImpl->HandleTransactionError( 401 ) == EFalse ); |
|
820 EUNIT_ASSERT( iImpl->HandleTransactionError( 401 ) == EFalse ); // errorcount = 3! |
|
821 |
|
822 iImpl->HandleTransactionError( 432 ); |
|
823 iImpl->HandleTransactionError( 420 ); |
|
824 iImpl->iErrorResponseCount = 0; |
|
825 |
|
826 EUNIT_ASSERT( iImpl->HandleTransactionError( 430 ) == ETrue ); |
|
827 iImpl->HandleTransactionError( 431 ); |
|
828 iImpl->iErrorResponseCount = 0; |
|
829 |
|
830 iImpl->HandleTransactionError( 432 ); |
|
831 EUNIT_ASSERT( iImpl->HandleTransactionError( 433 ) == ETrue ); |
|
832 iImpl->iErrorResponseCount = 0; |
|
833 |
|
834 EUNIT_ASSERT( iImpl->HandleTransactionError( 434 ) == ETrue ); |
|
835 |
|
836 delete iImpl->iRequest; |
|
837 iImpl->iRequest = NULL; |
|
838 TNATFWUNSAFTransactionID transactionID; |
|
839 iImpl->iRequest = CNATFWUNSAFBindingRequest::NewL( transactionID ); |
|
840 iImpl->iRequest->AddAttributeL( CNATFWUNSAFRealmAttribute::NewLC( dataDesc5 ) ); |
|
841 CleanupStack::Pop(); //CNATFWUNSAFRealmAttribute |
|
842 iImpl->iRealmFromResponse = dataDesc5.AllocL(); |
|
843 iImpl->iErrorResponseCount = 0; |
|
844 |
|
845 EUNIT_ASSERT( iImpl->HandleTransactionError( 436 ) == ETrue ); |
|
846 |
|
847 //nonce |
|
848 delete iImpl->iRequest; |
|
849 iImpl->iRequest = NULL; |
|
850 iImpl->iRequestType = iImpl->ESendRequest; |
|
851 iImpl->CreateBindingRequestL( usernameA, password ); |
|
852 NATFW_EUNIT_ASSERT_NO_LEAVE( iImpl->HandleTransactionError( 435 ) ); |
|
853 iImpl->iErrorResponseCount = 0; |
|
854 |
|
855 delete iImpl->iRequest; |
|
856 iImpl->iRequest = NULL; |
|
857 iImpl->iRequestType = iImpl->ESendRequest; |
|
858 iImpl->CreateBindingRequestL( usernameA, password ); |
|
859 EUNIT_ASSERT( iImpl->HandleTransactionError( 435 ) == ETrue ); |
|
860 iImpl->iErrorResponseCount = 0; |
|
861 |
|
862 delete iImpl->iRequest; |
|
863 iImpl->iRequest = NULL; |
|
864 //iImpl->iError436Count = 3; |
|
865 iImpl->iRequestType = iImpl->ESendRequest; |
|
866 iImpl->CreateBindingRequestL( usernameA, password ); |
|
867 iImpl->iRequest->AddAttributeL( CNATFWUNSAFRealmAttribute::NewLC( dataDesc5 ) ); |
|
868 CleanupStack::Pop(); //CNATFWUNSAFRealmAttribute |
|
869 delete iImpl->iRealmFromResponse; |
|
870 iImpl->iRealmFromResponse = NULL; |
|
871 iImpl->iRealmFromResponse = dataDesc5.AllocL(); |
|
872 |
|
873 EUNIT_ASSERT( iImpl->HandleTransactionError( 436 ) == ETrue ); |
|
874 iImpl->iErrorResponseCount = 0; |
|
875 |
|
876 iImpl->HandleTransactionError( 438 ); |
|
877 iImpl->HandleTransactionError( 500 ); |
|
878 iImpl->iErrorResponseCount = 0; |
|
879 iImpl->HandleTransactionError( 600 ); |
|
880 |
|
881 CSTUNBindingGetAddress* getAddress = new ( ELeave ) CSTUNBindingGetAddress(); |
|
882 CleanupStack::PushL( getAddress ); |
|
883 CSTUNBindingGetSharedSecret* getSharedSecret = |
|
884 new ( ELeave ) CSTUNBindingGetSharedSecret( *getAddress ); |
|
885 CleanupStack::PushL( getSharedSecret ); |
|
886 |
|
887 CSTUNBindingActive* active = new ( ELeave ) CSTUNBindingActive( *getSharedSecret ); |
|
888 CleanupStack::PushL( active ); |
|
889 iImpl->ChangeState( *active ); |
|
890 TInetAddr alternativeServer; |
|
891 EUNIT_ASSERT( iImpl->HandleTransactionError( 300 ) == EFalse ); |
|
892 iImpl->iErrorResponseCount = 0; |
|
893 |
|
894 delete iImpl->iRequest; |
|
895 iImpl->iRequest = NULL; |
|
896 iImpl->iRequest = CNATFWUNSAFBindingRequest::NewL( transactionID ); |
|
897 iImpl->iRequest->AddAttributeL( CNATFWUNSAFAlternateServerAttribute::NewLC( alternativeServer ) ); |
|
898 CleanupStack::Pop(); //CNATFWUNSAFAlternateServerAttribute |
|
899 iImpl->iRequest->AddAttributeL( CNATFWUNSAFRealmAttribute::NewLC( dataDesc5 ) ); |
|
900 CleanupStack::Pop(); //CNATFWUNSAFRealmAttribute |
|
901 |
|
902 delete iImpl->iSharedSecret; |
|
903 iImpl->iSharedSecret = NULL; |
|
904 EUNIT_ASSERT( iImpl->HandleTransactionError( 401 ) == ETrue ); |
|
905 |
|
906 delete iImpl->iRequest; |
|
907 iImpl->iRequest = NULL; |
|
908 iImpl->iRequestType = iImpl->ESendRequest; |
|
909 iImpl->CreateBindingRequestL( usernameA, password ); |
|
910 iImpl->iRequest->AddAttributeL( CNATFWUNSAFAlternateServerAttribute::NewLC( alternativeServer ) ); |
|
911 CleanupStack::Pop(); //CNATFWUNSAFAlternateServerAttribute |
|
912 iImpl->iErrorResponseCount = 0; |
|
913 |
|
914 EUNIT_ASSERT( iImpl->HandleTransactionError( 436 ) == ETrue ); |
|
915 |
|
916 delete iImpl->iSharedSecret; |
|
917 iImpl->iSharedSecret = NULL; |
|
918 EUNIT_ASSERT( iImpl->HandleTransactionError( 401 ) == ETrue ); |
|
919 |
|
920 delete iImpl->iRequest; |
|
921 iImpl->iRequest = NULL; |
|
922 iImpl->iRequestType = iImpl->ESendRequest; |
|
923 iImpl->CreateBindingRequestL( usernameA, password ); |
|
924 delete iImpl->iSharedSecret; |
|
925 iImpl->iSharedSecret = NULL; |
|
926 |
|
927 iImpl->iErrorResponseCount = 0; |
|
928 EUNIT_ASSERT( iImpl->HandleTransactionError( 430 ) == EFalse ); |
|
929 EUNIT_ASSERT( iImpl->HandleTransactionError( 433 ) == EFalse ); |
|
930 |
|
931 CleanupStack::PopAndDestroy( active ); |
|
932 CleanupStack::PopAndDestroy( getSharedSecret ); |
|
933 CleanupStack::PopAndDestroy( getAddress ); |
|
934 |
|
935 iImpl->iErrorResponseCount = 0; |
|
936 iImpl->iRequest->AddAttributeL( CNATFWUNSAFAlternateServerAttribute::NewLC( alternativeServer ) ); |
|
937 CleanupStack::Pop(); //CNATFWUNSAFUsernameAttribute |
|
938 EUNIT_ASSERT( iImpl->HandleTransactionError( 1001 ) == ETrue ); |
|
939 EUNIT_ASSERT( iImpl->HandleTransactionError( 300 ) == ETrue ); |
|
940 |
|
941 // TURN SPECIFIC |
|
942 iImpl->iErrorResponseCount = 0; |
|
943 EUNIT_ASSERT( iImpl->HandleTransactionError( 437 ) == EFalse ); |
|
944 EUNIT_ASSERT( iImpl->HandleTransactionError( 439 ) == EFalse ); |
|
945 |
|
946 iImpl->iErrorResponseCount = 0; |
|
947 EUNIT_ASSERT( iImpl->HandleTransactionError( 442 ) == EFalse ); |
|
948 EUNIT_ASSERT( iImpl->HandleTransactionError( 443 ) == EFalse ); |
|
949 |
|
950 iImpl->iErrorResponseCount = 0; |
|
951 EUNIT_ASSERT( iImpl->HandleTransactionError( 444 ) == EFalse ); |
|
952 EUNIT_ASSERT( iImpl->HandleTransactionError( 445 ) == EFalse ); |
|
953 |
|
954 iImpl->iErrorResponseCount = 0; |
|
955 EUNIT_ASSERT( iImpl->HandleTransactionError( 446 ) == EFalse ); |
|
956 EUNIT_ASSERT( iImpl->HandleTransactionError( 486 ) == EFalse ); |
|
957 |
|
958 iImpl->iErrorResponseCount = 0; |
|
959 EUNIT_ASSERT( iImpl->HandleTransactionError( 507 ) == EFalse ); |
|
960 |
|
961 iImpl->iErrorResponseCount = 0; |
|
962 EUNIT_ASSERT( iImpl->HandleTransactionError( 400 ) == EFalse ); |
|
963 } |
|
964 |
|
965 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_HandleTransactionError_AllocL( ) |
|
966 { |
|
967 TBufC8<16> password( KPassword ); |
|
968 TBufC8<6> usernameA( KUsername ); |
|
969 TInetAddr alternativeServer; |
|
970 |
|
971 delete iImpl->iRequest; |
|
972 iImpl->iRequest = NULL; |
|
973 TNATFWUNSAFTransactionID transactionID; |
|
974 iImpl->iRequest = CNATFWUNSAFBindingRequest::NewL( transactionID ); |
|
975 iImpl->iRequest->AddAttributeL( CNATFWUNSAFRealmAttribute::NewLC( dataDesc5 ) ); |
|
976 CleanupStack::Pop(); //CNATFWUNSAFRealmAttribute |
|
977 iImpl->iRealmFromResponse = dataDesc5.AllocL(); |
|
978 EUNIT_ASSERT( iImpl->HandleTransactionError( 434 ) == ETrue ); |
|
979 |
|
980 delete iImpl->iRealmFromResponse; |
|
981 iImpl->iRealmFromResponse = NULL; |
|
982 iImpl->iRealmFromResponse = dataDesc5.AllocL(); |
|
983 iImpl->iErrorResponseCount = 0; |
|
984 EUNIT_ASSERT( iImpl->HandleTransactionError( 434 ) == ETrue ); |
|
985 |
|
986 delete iImpl->iRequest; |
|
987 iImpl->iRequest = NULL; |
|
988 iImpl->iRequestType = iImpl->ESendRequest; |
|
989 iImpl->CreateBindingRequestL( usernameA, password ); |
|
990 iImpl->iRequest->AddAttributeL( CNATFWUNSAFAlternateServerAttribute::NewLC( alternativeServer ) ); |
|
991 CleanupStack::Pop(); //CNATFWUNSAFAlternateServerAttribute |
|
992 EUNIT_ASSERT( iImpl->HandleTransactionError( 401 ) == EFalse ); |
|
993 } |
|
994 |
|
995 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_IcmpErrorL( ) |
|
996 { |
|
997 TInetAddr addr( KProtocolInetUdp ); |
|
998 _LIT( KServer, "10.32.194.251" ); |
|
999 addr.Input( KServer ); |
|
1000 |
|
1001 iImpl->IcmpError( addr ); |
|
1002 |
|
1003 TBufC8<16> password( KPassword ); |
|
1004 TBufC8<6> usernameA( KUsername ); |
|
1005 iImpl->iRequestType = iImpl->ESendRequest; |
|
1006 iImpl->CreateBindingRequestL( usernameA, password ); |
|
1007 |
|
1008 iImpl->iServerAddress = addr; |
|
1009 iImpl->SendBindingRequestL(); |
|
1010 //iImpl->IcmpError( addr ); |
|
1011 EUNIT_ASSERT_PANIC( iImpl->IcmpError( addr ), "", KErrGeneral ); |
|
1012 } |
|
1013 |
|
1014 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_WaitBeforeRetryingL( ) |
|
1015 { |
|
1016 iImpl->WaitBeforeRetrying(); |
|
1017 } |
|
1018 |
|
1019 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_SetICESpecificAttributesL( ) |
|
1020 { |
|
1021 TICEAttributes attributes; |
|
1022 iImpl->SetICESpecificAttributes( attributes ); |
|
1023 } |
|
1024 |
|
1025 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_FetchCandidateLL( ) |
|
1026 { |
|
1027 TInetAddr relayAddr; |
|
1028 |
|
1029 TInetAddr addr( KProtocolInetUdp ); |
|
1030 _LIT( KAddr, "10.32.194.251" ); |
|
1031 addr.Input( KAddr ); |
|
1032 iImpl->iPublicAddr = addr; |
|
1033 relayAddr = addr; |
|
1034 NATFW_EUNIT_ASSERT_NO_LEAVE( relayAddr = iImpl->RelayAddr( ) ); |
|
1035 } |
|
1036 |
|
1037 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_ValidateMsgTypeL() |
|
1038 { |
|
1039 CNATFWUNSAFMessage* msg = NULL; |
|
1040 |
|
1041 TNATFWUNSAFTransactionID transactionID; |
|
1042 msg = CNATFWUNSAFBindingRequest::NewL( transactionID ); |
|
1043 EUNIT_ASSERT_EQUALS( iImpl->ValidateMsgType( msg ), EFalse ); |
|
1044 delete msg; |
|
1045 msg = NULL; |
|
1046 |
|
1047 msg = CNATFWUNSAFBindingResponse::NewL( transactionID ); |
|
1048 EUNIT_ASSERT_EQUALS( iImpl->ValidateMsgType( msg ), ETrue ); |
|
1049 delete msg; |
|
1050 msg = NULL; |
|
1051 |
|
1052 msg = CNATFWUNSAFAllocateResponse::NewL( transactionID ); |
|
1053 EUNIT_ASSERT_EQUALS( iImpl->ValidateMsgType( msg ), ETrue ); |
|
1054 delete msg; |
|
1055 msg = NULL; |
|
1056 |
|
1057 msg = CNATFWUNSAFBindingErrorResponse::NewL( transactionID ); |
|
1058 EUNIT_ASSERT_EQUALS( iImpl->ValidateMsgType( msg ), ETrue ); |
|
1059 delete msg; |
|
1060 msg = NULL; |
|
1061 |
|
1062 msg = CNATFWUNSAFAllocateErrorResponse::NewL( transactionID ); |
|
1063 EUNIT_ASSERT_EQUALS( iImpl->ValidateMsgType( msg ), ETrue ); |
|
1064 delete msg; |
|
1065 msg = NULL; |
|
1066 |
|
1067 msg = CNATFWUNSAFConnectResponse::NewL( transactionID ); |
|
1068 EUNIT_ASSERT_EQUALS( iImpl->ValidateMsgType( msg ), ETrue ); |
|
1069 delete msg; |
|
1070 msg = NULL; |
|
1071 |
|
1072 msg = CNATFWUNSAFConnectErrorResponse::NewL( transactionID ); |
|
1073 EUNIT_ASSERT_EQUALS( iImpl->ValidateMsgType( msg ), ETrue ); |
|
1074 delete msg; |
|
1075 msg = NULL; |
|
1076 |
|
1077 msg = CNATFWUNSAFSetActiveDestinationResponse::NewL( transactionID ); |
|
1078 EUNIT_ASSERT_EQUALS( iImpl->ValidateMsgType( msg ), ETrue ); |
|
1079 delete msg; |
|
1080 msg = NULL; |
|
1081 |
|
1082 msg = CNATFWUNSAFSetActiveDestinationErrorResponse::NewL( transactionID ); |
|
1083 EUNIT_ASSERT_EQUALS( iImpl->ValidateMsgType( msg ), ETrue ); |
|
1084 delete msg; |
|
1085 msg = NULL; |
|
1086 } |
|
1087 |
|
1088 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_SetActiveDestinationRequestLL( ) |
|
1089 { |
|
1090 TInetAddr remoteAddr; |
|
1091 TUint32 timerValue = 1000000; |
|
1092 iImpl->SetActiveDestinationRequestL( remoteAddr, timerValue ); |
|
1093 } |
|
1094 |
|
1095 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_SendIndicationLL( ) |
|
1096 { |
|
1097 TInetAddr addr( KProtocolInetUdp ); |
|
1098 _LIT( KAddr, "10.32.194.251" ); |
|
1099 addr.Input( KAddr ); |
|
1100 _LIT8( KDummypacket, "oysescatechnologiesabFIN" ); |
|
1101 TBufC8<24> buffi( KDummypacket ); |
|
1102 TBufC8<16> password( KPassword ); |
|
1103 TBufC8<6> usernameA( KUsername ); |
|
1104 iImpl->iRequestType = iImpl->ESendRequest; |
|
1105 iImpl->CreateBindingRequestL( usernameA, password ); |
|
1106 |
|
1107 iImpl->iServerAddress = addr; |
|
1108 iImpl->SendIndicationL( addr, buffi, EFalse ); |
|
1109 |
|
1110 iStunclient->Implementation().iTransportProtocol = ETcpProtocol; |
|
1111 iImpl->SendIndicationL( addr, buffi, EFalse ); |
|
1112 } |
|
1113 |
|
1114 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_ConnectRequestLL( ) |
|
1115 { |
|
1116 TInetAddr remoteAddr; |
|
1117 iImpl->ConnectRequestL( remoteAddr ); |
|
1118 } |
|
1119 |
|
1120 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_StreamIdL( ) |
|
1121 { |
|
1122 TUint streamId = iImpl->StreamId(); |
|
1123 } |
|
1124 |
|
1125 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_ConnectionIdL( ) |
|
1126 { |
|
1127 TUint connectionId = iImpl->ConnectionId(); |
|
1128 } |
|
1129 |
|
1130 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_RealmFromResponseL() |
|
1131 { |
|
1132 const HBufC8* response = iImpl->RealmFromResponse(); |
|
1133 delete response; |
|
1134 } |
|
1135 |
|
1136 /* |
|
1137 void ut_cstunrelaybindingimplementation::UT_CSTUNRelayBindingImplementation_ExecuteImmediateRetransmitLL( ) |
|
1138 { |
|
1139 EUNIT_ASSERT_NO_LEAVE( iImpl->ExecuteImmediateRetransmitL() ); |
|
1140 |
|
1141 TBufC8<16> password( KPassword ); |
|
1142 TBufC8<6> usernameA( KUsername ); |
|
1143 iImpl->iRequestType = iImpl->ESendRequest; |
|
1144 iImpl->CreateBindingRequestL( usernameA, password ); |
|
1145 |
|
1146 TInetAddr addr( KProtocolInetUdp ); |
|
1147 _LIT( KServer, "10.32.194.251" ); |
|
1148 addr.Input( KServer ); |
|
1149 iImpl->iServerAddress = addr; |
|
1150 iImpl->SendBindingRequestL(); |
|
1151 iImpl->ExecuteImmediateRetransmitL(); |
|
1152 } |
|
1153 */ |
|
1154 // TEST TABLE |
|
1155 |
|
1156 EUNIT_BEGIN_TEST_TABLE( |
|
1157 ut_cstunrelaybindingimplementation, |
|
1158 "Add test suite description here.", |
|
1159 "UNIT" ) |
|
1160 |
|
1161 EUNIT_TEST( |
|
1162 "NewL - test ", |
|
1163 "CSTUNRelayBindingImplementation", |
|
1164 "NewL", |
|
1165 "FUNCTIONALITY", |
|
1166 SetupL, UT_CSTUNRelayBindingImplementation_NewLL, Teardown) |
|
1167 |
|
1168 EUNIT_TEST( |
|
1169 "NewL - test ", |
|
1170 "CSTUNRelayBindingImplementation", |
|
1171 "NewL", |
|
1172 "FUNCTIONALITY", |
|
1173 SetupL, UT_CSTUNRelayBindingImplementation_NewL_1L, Teardown) |
|
1174 |
|
1175 EUNIT_TEST( |
|
1176 "TimerExpiredL - test ", |
|
1177 "CSTUNRelayBindingImplementation", |
|
1178 "TimerExpiredL", |
|
1179 "FUNCTIONALITY", |
|
1180 SetupL, UT_CSTUNRelayBindingImplementation_TimerExpiredLL, Teardown) |
|
1181 |
|
1182 EUNIT_TEST( |
|
1183 "LeaveFromTimerExpired - test ", |
|
1184 "CSTUNRelayBindingImplementation", |
|
1185 "LeaveFromTimerExpired", |
|
1186 "FUNCTIONALITY", |
|
1187 SetupL, UT_CSTUNRelayBindingImplementation_LeaveFromTimerExpiredL, Teardown) |
|
1188 |
|
1189 EUNIT_TEST( |
|
1190 "PublicAddressObtainedL - test ", |
|
1191 "CSTUNRelayBindingImplementation", |
|
1192 "PublicAddressObtainedL", |
|
1193 "FUNCTIONALITY", |
|
1194 SetupL, UT_CSTUNRelayBindingImplementation_PublicAddressObtainedLL, Teardown) |
|
1195 |
|
1196 EUNIT_TEST( |
|
1197 "PublicAddressObtainedL - test ", |
|
1198 "CSTUNRelayBindingImplementation", |
|
1199 "PublicAddressObtainedL", |
|
1200 "FUNCTIONALITY", |
|
1201 SetupL, UT_CSTUNRelayBindingImplementation_PublicAddressObtainedL_1L, Teardown) |
|
1202 |
|
1203 EUNIT_TEST( |
|
1204 "TransactionError - test ", |
|
1205 "CSTUNRelayBindingImplementation", |
|
1206 "TransactionError", |
|
1207 "FUNCTIONALITY", |
|
1208 SetupL, UT_CSTUNRelayBindingImplementation_TransactionErrorL, Teardown) |
|
1209 |
|
1210 EUNIT_TEST( |
|
1211 "TransactionEventOccurredL - test ", |
|
1212 "CSTUNRelayBindingImplementation", |
|
1213 "TransactionEventOccurredL", |
|
1214 "FUNCTIONALITY", |
|
1215 SetupL, UT_CSTUNRelayBindingImplementation_TransactionEventOccurredLL, Teardown) |
|
1216 |
|
1217 EUNIT_TEST( |
|
1218 "AllocateRequestL - test ", |
|
1219 "CSTUNRelayBindingImplementation", |
|
1220 "AllocateRequestL", |
|
1221 "FUNCTIONALITY", |
|
1222 SetupL, UT_CSTUNRelayBindingImplementation_AllocateRequestLL, Teardown) |
|
1223 |
|
1224 EUNIT_TEST( |
|
1225 "CancelRequest - test ", |
|
1226 "CSTUNRelayBindingImplementation", |
|
1227 "CancelRequest", |
|
1228 "FUNCTIONALITY", |
|
1229 SetupL, UT_CSTUNRelayBindingImplementation_CancelRequestL, Teardown) |
|
1230 |
|
1231 EUNIT_TEST( |
|
1232 "Socket - test ", |
|
1233 "CSTUNRelayBindingImplementation", |
|
1234 "Socket", |
|
1235 "FUNCTIONALITY", |
|
1236 SetupL, UT_CSTUNRelayBindingImplementation_SocketL, Teardown) |
|
1237 |
|
1238 EUNIT_TEST( |
|
1239 "AddressResolved - test ", |
|
1240 "CSTUNRelayBindingImplementation", |
|
1241 "AddressResolved", |
|
1242 "FUNCTIONALITY", |
|
1243 SetupL, UT_CSTUNRelayBindingImplementation_AddressResolvedL, Teardown) |
|
1244 |
|
1245 EUNIT_TEST( |
|
1246 "PublicAddr - test ", |
|
1247 "CSTUNRelayBindingImplementation", |
|
1248 "PublicAddr", |
|
1249 "FUNCTIONALITY", |
|
1250 SetupL, UT_CSTUNRelayBindingImplementation_PublicAddrL, Teardown) |
|
1251 |
|
1252 EUNIT_TEST( |
|
1253 "AlternateServerAddr - test ", |
|
1254 "CSTUNRelayBindingImplementation", |
|
1255 "AlternateServerAddr", |
|
1256 "FUNCTIONALITY", |
|
1257 SetupL, UT_CSTUNRelayBindingImplementation_AlternateServerAddrL, Teardown) |
|
1258 |
|
1259 EUNIT_TEST( |
|
1260 "HandleDataL - test ", |
|
1261 "CSTUNRelayBindingImplementation", |
|
1262 "HandleDataL", |
|
1263 "FUNCTIONALITY", |
|
1264 SetupL, UT_CSTUNRelayBindingImplementation_HandleDataLL, Teardown) |
|
1265 |
|
1266 EUNIT_TEST( |
|
1267 "HandleDataL - test2 ", |
|
1268 "CSTUNRelayBindingImplementation", |
|
1269 "HandleDataL", |
|
1270 "FUNCTIONALITY", |
|
1271 SetupL, UT_CSTUNRelayBindingImplementation_HandleDataL2L, Teardown) |
|
1272 |
|
1273 EUNIT_TEST( |
|
1274 "HandleDataL - test3", |
|
1275 "CSTUNRelayBindingImplementation", |
|
1276 "HandleDataL", |
|
1277 "FUNCTIONALITY", |
|
1278 SetupL, UT_CSTUNRelayBindingImplementation_HandleDataL3L, Teardown) |
|
1279 |
|
1280 EUNIT_TEST( |
|
1281 "HandleDataL - test4", |
|
1282 "CSTUNRelayBindingImplementation", |
|
1283 "HandleDataL", |
|
1284 "FUNCTIONALITY", |
|
1285 SetupL, UT_CSTUNRelayBindingImplementation_HandleDataL4L, Teardown) |
|
1286 |
|
1287 EUNIT_TEST( |
|
1288 "STUNClient - test ", |
|
1289 "CSTUNRelayBindingImplementation", |
|
1290 "STUNClient", |
|
1291 "FUNCTIONALITY", |
|
1292 SetupL, UT_CSTUNRelayBindingImplementation_STUNClientL, Teardown) |
|
1293 |
|
1294 EUNIT_TEST( |
|
1295 "GetServerAddressL - test ", |
|
1296 "CSTUNRelayBindingImplementation", |
|
1297 "GetServerAddressL", |
|
1298 "FUNCTIONALITY", |
|
1299 SetupL, UT_CSTUNRelayBindingImplementation_GetServerAddressLL, Teardown) |
|
1300 |
|
1301 EUNIT_TEST( |
|
1302 "GetSharedSecretL - test ", |
|
1303 "CSTUNRelayBindingImplementation", |
|
1304 "GetSharedSecretL", |
|
1305 "FUNCTIONALITY", |
|
1306 SetupL, UT_CSTUNRelayBindingImplementation_GetSharedSecretLL, Teardown) |
|
1307 |
|
1308 EUNIT_TEST( |
|
1309 "DetachClient - test ", |
|
1310 "CSTUNRelayBindingImplementation", |
|
1311 "DetachClient", |
|
1312 "FUNCTIONALITY", |
|
1313 SetupL, UT_CSTUNRelayBindingImplementation_DetachClientL, Teardown) |
|
1314 |
|
1315 EUNIT_TEST( |
|
1316 "StoreAddressL - test ", |
|
1317 "CSTUNRelayBindingImplementation", |
|
1318 "StoreAddressL", |
|
1319 "FUNCTIONALITY", |
|
1320 SetupL, UT_CSTUNRelayBindingImplementation_StoreAddressLL, Teardown) |
|
1321 |
|
1322 EUNIT_TEST( |
|
1323 "StoreAddressL - test ", |
|
1324 "CSTUNRelayBindingImplementation", |
|
1325 "StoreAddressL", |
|
1326 "FUNCTIONALITY", |
|
1327 SetupL, UT_CSTUNRelayBindingImplementation_StoreAddressL_1L, Teardown) |
|
1328 |
|
1329 EUNIT_TEST( |
|
1330 "ChangeState - test ", |
|
1331 "CSTUNRelayBindingImplementation", |
|
1332 "ChangeState", |
|
1333 "FUNCTIONALITY", |
|
1334 SetupL, UT_CSTUNRelayBindingImplementation_ChangeStateL, Teardown) |
|
1335 |
|
1336 EUNIT_TEST( |
|
1337 "Terminate - test ", |
|
1338 "CSTUNRelayBindingImplementation", |
|
1339 "Terminate", |
|
1340 "FUNCTIONALITY", |
|
1341 SetupL, UT_CSTUNRelayBindingImplementation_TerminateL, Teardown) |
|
1342 |
|
1343 EUNIT_TEST( |
|
1344 "IsWaitingSharedSecret - test ", |
|
1345 "CSTUNRelayBindingImplementation", |
|
1346 "IsWaitingSharedSecret", |
|
1347 "FUNCTIONALITY", |
|
1348 SetupL, UT_CSTUNRelayBindingImplementation_IsWaitingSharedSecretL, Teardown) |
|
1349 |
|
1350 EUNIT_TEST( |
|
1351 "SharedSecretObtainedL - test ", |
|
1352 "CSTUNRelayBindingImplementation", |
|
1353 "SharedSecretObtainedL", |
|
1354 "FUNCTIONALITY", |
|
1355 SetupL, UT_CSTUNRelayBindingImplementation_SharedSecretObtainedLL, Teardown) |
|
1356 |
|
1357 EUNIT_TEST( |
|
1358 "CreateBindingRequestL - test ", |
|
1359 "CSTUNRelayBindingImplementation", |
|
1360 "CreateBindingRequestL", |
|
1361 "FUNCTIONALITY", |
|
1362 SetupL, UT_CSTUNRelayBindingImplementation_CreateBindingRequestLL, Teardown) |
|
1363 |
|
1364 EUNIT_TEST( |
|
1365 "SendBindingRequestL - test ", |
|
1366 "CSTUNRelayBindingImplementation", |
|
1367 "SendBindingRequestL", |
|
1368 "FUNCTIONALITY", |
|
1369 SetupL, UT_CSTUNRelayBindingImplementation_SendBindingRequestLL, Teardown) |
|
1370 |
|
1371 EUNIT_TEST( |
|
1372 "HandleTransactionError - test ", |
|
1373 "CSTUNRelayBindingImplementation", |
|
1374 "HandleTransactionError", |
|
1375 "FUNCTIONALITY", |
|
1376 SetupL, UT_CSTUNRelayBindingImplementation_HandleTransactionErrorL, Teardown) |
|
1377 |
|
1378 EUNIT_TEST( |
|
1379 "IcmpError - test ", |
|
1380 "CSTUNRelayBindingImplementation", |
|
1381 "IcmpError", |
|
1382 "FUNCTIONALITY", |
|
1383 SetupL, UT_CSTUNRelayBindingImplementation_IcmpErrorL, Teardown) |
|
1384 |
|
1385 EUNIT_TEST( |
|
1386 "WaitBeforeRetrying - test ", |
|
1387 "CSTUNRelayBindingImplementation", |
|
1388 "WaitBeforeRetrying", |
|
1389 "FUNCTIONALITY", |
|
1390 SetupL, UT_CSTUNRelayBindingImplementation_WaitBeforeRetryingL, Teardown) |
|
1391 |
|
1392 EUNIT_TEST( |
|
1393 "SetICESpecificAttributes - test ", |
|
1394 "CSTUNRelayBindingImplementation", |
|
1395 "SetICESpecificAttributes", |
|
1396 "FUNCTIONALITY", |
|
1397 SetupL, UT_CSTUNRelayBindingImplementation_SetICESpecificAttributesL, Teardown) |
|
1398 |
|
1399 EUNIT_TEST( |
|
1400 "FetchCandidateL - test ", |
|
1401 "CSTUNRelayBindingImplementation", |
|
1402 "FetchCandidateL", |
|
1403 "FUNCTIONALITY", |
|
1404 SetupL, UT_CSTUNRelayBindingImplementation_FetchCandidateLL, Teardown) |
|
1405 |
|
1406 EUNIT_TEST( |
|
1407 "ValidateMsgType - test ", |
|
1408 "CSTUNRelayBindingImplementation", |
|
1409 "ValidateMsgType", |
|
1410 "FUNCTIONALITY", |
|
1411 SetupL, UT_CSTUNRelayBindingImplementation_ValidateMsgTypeL, Teardown) |
|
1412 |
|
1413 EUNIT_TEST( |
|
1414 "SetActiveDestinationRequestL - test ", |
|
1415 "CSTUNRelayBindingImplementation", |
|
1416 "SetActiveDestinationRequestL", |
|
1417 "FUNCTIONALITY", |
|
1418 SetupL, UT_CSTUNRelayBindingImplementation_SetActiveDestinationRequestLL, Teardown) |
|
1419 |
|
1420 EUNIT_TEST( |
|
1421 "SendIndicationL - test ", |
|
1422 "CSTUNRelayBindingImplementation", |
|
1423 "SendIndicationL", |
|
1424 "FUNCTIONALITY", |
|
1425 SetupL, UT_CSTUNRelayBindingImplementation_SendIndicationLL, Teardown) |
|
1426 |
|
1427 EUNIT_TEST( |
|
1428 "ConnectRequestL - test ", |
|
1429 "CSTUNRelayBindingImplementation", |
|
1430 "ConnectRequestL", |
|
1431 "FUNCTIONALITY", |
|
1432 SetupL, UT_CSTUNRelayBindingImplementation_ConnectRequestLL, Teardown) |
|
1433 |
|
1434 EUNIT_TEST( |
|
1435 "StreamId - test ", |
|
1436 "CSTUNRelayBindingImplementation", |
|
1437 "StreamId", |
|
1438 "FUNCTIONALITY", |
|
1439 SetupL, UT_CSTUNRelayBindingImplementation_StreamIdL, Teardown) |
|
1440 |
|
1441 EUNIT_TEST( |
|
1442 "ConnectionId - test ", |
|
1443 "CSTUNRelayBindingImplementation", |
|
1444 "ConnectionId", |
|
1445 "FUNCTIONALITY", |
|
1446 SetupL, UT_CSTUNRelayBindingImplementation_ConnectionIdL, Teardown) |
|
1447 |
|
1448 EUNIT_TEST( |
|
1449 "RealmFromResponse - test ", |
|
1450 "CSTUNRelayBindingImplementation", |
|
1451 "RealmFromResponse", |
|
1452 "FUNCTIONALITY", |
|
1453 SetupL, UT_CSTUNRelayBindingImplementation_RealmFromResponseL, Teardown) |
|
1454 |
|
1455 /*EUNIT_TEST( |
|
1456 "ExecuteImmediateRetransmitL - test ", |
|
1457 "CSTUNRelayBindingImplementation", |
|
1458 "ExecuteImmediateRetransmitL", |
|
1459 "FUNCTIONALITY", |
|
1460 SetupL, UT_CSTUNRelayBindingImplementation_ExecuteImmediateRetransmitLL, Teardown)*/ |
|
1461 |
|
1462 |
|
1463 EUNIT_END_TEST_TABLE |
|
1464 |
|
1465 // END OF FILE |