95 RProperty::Define(KUidPSCsyWriteResultCategory, aPortNum, KUidPSCsyWriteResultCategoryKeyType); |
95 RProperty::Define(KUidPSCsyWriteResultCategory, aPortNum, KUidPSCsyWriteResultCategoryKeyType); |
96 } |
96 } |
97 TestL(RProperty::Set(KUidPSCsyWriteResultCategory, aPortNum, aErrorCode), _L("Set PSCsy write result")); |
97 TestL(RProperty::Set(KUidPSCsyWriteResultCategory, aPortNum, aErrorCode), _L("Set PSCsy write result")); |
98 INFO_PRINTF3(_L("Next write on [PKTLOOPBACK::%d] is going to fail with [%d]"), aPortNum, aErrorCode); |
98 INFO_PRINTF3(_L("Next write on [PKTLOOPBACK::%d] is going to fail with [%d]"), aPortNum, aErrorCode); |
99 } |
99 } |
100 |
100 |
|
101 void CSpudNetSideTestBase::ClearNextPktLoopbackCsyWriteL(TInt aPortNum) |
|
102 { |
|
103 TInt dummy(0); |
|
104 TInt ret = RProperty::Get(KUidPSCsyWriteResultCategory, aPortNum, dummy); |
|
105 if(ret != KErrNotFound) |
|
106 { |
|
107 RProperty::Set(KUidPSCsyWriteResultCategory, aPortNum, KErrNone); |
|
108 } |
|
109 INFO_PRINTF2(_L("Reset to KErrNone for the next write on [PKTLOOPBACK::%d] port"), aPortNum); |
|
110 } |
|
111 |
101 /** |
112 /** |
102 Blocks until Nifman progress notification is received. |
113 Blocks until Nifman progress notification is received. |
103 |
114 |
104 |
115 |
105 @param aReqStatus Request status to wait on for the notification |
116 @param aReqStatus Request status to wait on for the notification |
1706 if(!GetIntFromConfig(ConfigSection(), _L("PrimaryLoopbackPort"), loopbackPort)) |
1718 if(!GetIntFromConfig(ConfigSection(), _L("PrimaryLoopbackPort"), loopbackPort)) |
1707 { |
1719 { |
1708 User::Leave(KErrNotFound); |
1720 User::Leave(KErrNotFound); |
1709 } |
1721 } |
1710 FailNextPktLoopbackCsyWriteL(loopbackPort, KErrCompletion); |
1722 FailNextPktLoopbackCsyWriteL(loopbackPort, KErrCompletion); |
1711 |
1723 |
1712 TRequestStatus sendStatus; |
1724 TRequestStatus sendStatus; |
1713 iSocket.Send(KCommWriteData, 0, sendStatus); |
1725 iSocket.Send(KCommWriteData, 0, sendStatus); |
1714 User::WaitForRequest(sendStatus); |
1726 User::WaitForRequest(sendStatus); |
1715 TestL(sendStatus.Int(), 0, _L("Socket send status")); // cause the lower NIF send to fail. |
1727 TestL(sendStatus.Int(), 0, _L("Socket send status")); // cause the lower NIF send to fail. |
1716 // Keep Nifman in Long idle timeout. This is more realistic scenario. |
1728 // Keep Nifman in Long idle timeout. This is more realistic scenario. |
1717 // Now the lower NIF has fired LinkLayerDown, and the primary context is being deleted. |
1729 // Now the lower NIF has fired LinkLayerDown, and the primary context is being deleted. |
1718 // Sim TSY delays the completion of the deletion request. |
1730 // Sim TSY delays the completion of the deletion request. |
1719 // In the meanwhile, we sneak in and stop the interface. |
1731 // In the meanwhile, we sneak in and stop the interface. |
1720 |
1732 |
1721 StopInterfaceL(); |
1733 StopInterfaceL(); |
|
1734 |
|
1735 ClearNextPktLoopbackCsyWriteL(loopbackPort); |
1722 return EPass; |
1736 return EPass; |
1723 }; |
1737 }; |
1724 |
1738 |
1725 /** |
1739 /** |
1726 Test RConnection:Stop on Spud, when only the primary PDP context exists and is active (i.e. no secondaries) |
1740 Test RConnection:Stop on Spud, when only the primary PDP context exists and is active (i.e. no secondaries) |
2136 |
2150 |
2137 // start 2 more PPP instances opposite the SPUD's primary and secondary context PPP instances |
2151 // start 2 more PPP instances opposite the SPUD's primary and secondary context PPP instances |
2138 CConnectionStart *primaryIfStart = CConnectionStart::NewLC(iEsock, *this, primaryIapId); |
2152 CConnectionStart *primaryIfStart = CConnectionStart::NewLC(iEsock, *this, primaryIapId); |
2139 CConnectionStart *secondaryIfStart = CConnectionStart::NewLC(iEsock, *this, secondaryIapId); |
2153 CConnectionStart *secondaryIfStart = CConnectionStart::NewLC(iEsock, *this, secondaryIapId); |
2140 |
2154 |
|
2155 TRequestStatus progressReqSt; |
|
2156 primaryIfStart->iInterface.ProgressNotification(iProgressBuf, progressReqSt, KConnectionUp); |
|
2157 |
|
2158 WaitForProgressNotificationL(progressReqSt, KConnectionUp, 0); // We can wait here forever. Set timeout on test step. |
|
2159 |
|
2160 secondaryIfStart->iInterface.ProgressNotification(iProgressBuf, progressReqSt, KConnectionUp); |
|
2161 WaitForProgressNotificationL(progressReqSt, KConnectionUp, 0); // We can wait here forever. Set timeout on test step. |
|
2162 |
2141 #ifndef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY |
2163 #ifndef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY |
2142 WaitForQoSEventL(_L("SecondaryActivationEvent2"), _L("SecondaryActivationEvent2Reason")); |
2164 WaitForQoSEventL(_L("SecondaryActivationEvent2"), _L("SecondaryActivationEvent2Reason")); |
2143 #else |
2165 #else |
2144 User::After(2*KTimeToStartSecondary); |
|
2145 VerifySubconnectionCountL(_L("SubConnectionCount2"), PDPIAP); |
2166 VerifySubconnectionCountL(_L("SubConnectionCount2"), PDPIAP); |
2146 #endif |
2167 #endif |
2147 |
2168 |
2148 // set up a socket from the second PPP instance (that connects to the SPUD's secondary context) |
2169 // set up a socket from the second PPP instance (that connects to the SPUD's secondary context) |
2149 RSocket secondPppSocket; |
2170 RSocket secondPppSocket; |
2345 iInterface.Stop(); |
2366 iInterface.Stop(); |
2346 iInterface.Close(); |
2367 iInterface.Close(); |
2347 |
2368 |
2348 return EPass; |
2369 return EPass; |
2349 } |
2370 } |
|
2371 |
|
2372 enum TVerdict CRawIpMinMaxMMU::RunTestStepL() |
|
2373 { |
|
2374 //Start 1st context |
|
2375 RConnection* conn1 = new (ELeave) RConnection(); |
|
2376 CleanupClosePushL<RConnection>(*conn1); |
|
2377 |
|
2378 TInt primaryIapId; |
|
2379 if (!GetIntFromConfig(ConfigSection(), _L("PrimaryIapId1"), primaryIapId)) |
|
2380 { |
|
2381 User::Leave(KErrNotFound); |
|
2382 } |
|
2383 |
|
2384 TCommDbConnPref conn1Pref; |
|
2385 conn1Pref.SetIapId(primaryIapId); |
|
2386 |
|
2387 INFO_PRINTF2(_L("Test starting Interface IAP ID == %d"), primaryIapId); |
|
2388 TestL(conn1->Open(iEsock), _L("RConnection::Open the interface")); |
|
2389 TestL(conn1->Start(conn1Pref), _L("RConnection::Start the interface")); |
|
2390 |
|
2391 //Start 2nd context |
|
2392 RConnection* conn2 = new (ELeave) RConnection(); |
|
2393 CleanupClosePushL<RConnection>(*conn2); |
|
2394 |
|
2395 if (!GetIntFromConfig(ConfigSection(), _L("PrimaryIapId2"), primaryIapId)) |
|
2396 { |
|
2397 User::Leave(KErrNotFound); |
|
2398 } |
|
2399 |
|
2400 TCommDbConnPref conn2Pref; |
|
2401 conn2Pref.SetIapId(primaryIapId); |
|
2402 |
|
2403 INFO_PRINTF2(_L("Test starting Interface IAP ID == %d"), primaryIapId); |
|
2404 TestL(conn2->Open(iEsock), _L("RConnection::Open the interface")); |
|
2405 TestL(conn2->Start(conn2Pref), _L("RConnection::Start the interface")); |
|
2406 |
|
2407 //Open & Connect 1st Socket |
|
2408 RSocket sock1; |
|
2409 TestL(sock1.Open(iEsock, KAfInet, KSockDatagram, KProtocolInetUdp, *conn1), _L("RSocket::Open")); |
|
2410 CleanupClosePushL<RSocket>(sock1); |
|
2411 TInetAddr localAddr; |
|
2412 localAddr.SetPort(KConfiguredTftFilter1DestPort); |
|
2413 TestL(sock1.Bind(localAddr), _L("Binding the local Socket")); |
|
2414 |
|
2415 TInetAddr dstAddr; |
|
2416 dstAddr.SetPort(KConfiguredTftFilter1SrcPort); |
|
2417 dstAddr.Input(KConfiguredTftFilter1SrcAddr); |
|
2418 |
|
2419 TRequestStatus status; |
|
2420 sock1.Connect(dstAddr, status); |
|
2421 User::WaitForRequest(status); |
|
2422 TestL(status.Int(), _L("RSocket::Connect status opening 1st socket")); |
|
2423 |
|
2424 //Open & Bind 2nd Socket |
|
2425 RSocket sock2; |
|
2426 TestL(sock2.Open(iEsock, KAfInet, KSockDatagram, KProtocolInetUdp, *conn2), _L("RSocket::Open")); |
|
2427 CleanupClosePushL<RSocket>(sock2); |
|
2428 localAddr.SetPort(KConfiguredTftFilter1SrcPort); |
|
2429 TestL(sock2.Bind(localAddr), _L("Binding the local Socket")); |
|
2430 |
|
2431 //then send & receive data. |
|
2432 const TInt KMaxMMU = 4000; |
|
2433 TBuf8<KMaxMMU> *sendBuf = new(ELeave) TBuf8<KMaxMMU>(); |
|
2434 CleanupStack::PushL(sendBuf); |
|
2435 |
|
2436 TBuf8<KMaxMMU> *recvBuf = new(ELeave) TBuf8<KMaxMMU>(); |
|
2437 CleanupStack::PushL(recvBuf); |
|
2438 |
|
2439 TBuf8<KMaxMMU> *recvBuf2 = new(ELeave) TBuf8<KMaxMMU>(); |
|
2440 CleanupStack::PushL(recvBuf2); |
|
2441 |
|
2442 TInt end; |
|
2443 if (!GetIntFromConfig(ConfigSection(), _L("TestMaxMMU"), end)) |
|
2444 { |
|
2445 User::Leave(KErrNotFound); |
|
2446 } |
|
2447 |
|
2448 TInt begin; |
|
2449 if (!GetIntFromConfig(ConfigSection(), _L("TestMinMMU"), begin)) |
|
2450 { |
|
2451 User::Leave(KErrNotFound); |
|
2452 } |
|
2453 |
|
2454 if (begin > end) |
|
2455 { |
|
2456 User::Leave(KErrArgument); |
|
2457 } |
|
2458 |
|
2459 INFO_PRINTF3(_L("Sending data frame size from (%d) to (%d)"), begin, end); |
|
2460 TRequestStatus readStatus; |
|
2461 |
|
2462 for(TInt j=begin;j<=end;j++) |
|
2463 { |
|
2464 sendBuf->Zero(); |
|
2465 for (TInt i=0;i<j;i++) |
|
2466 { |
|
2467 sendBuf->Append(Math::Random() & 0x7f); |
|
2468 } |
|
2469 |
|
2470 recvBuf->Zero(); |
|
2471 sock2.Read(*recvBuf, readStatus); |
|
2472 sock1.Write(*sendBuf, status); |
|
2473 |
|
2474 User::WaitForRequest(status); |
|
2475 TESTL(status.Int() == 0); |
|
2476 User::WaitForRequest(readStatus); |
|
2477 TESTL(readStatus.Int() == 0); |
|
2478 if (sendBuf->Length() > recvBuf->Length()) |
|
2479 { |
|
2480 recvBuf2->Zero(); |
|
2481 sock2.Read(*recvBuf2, readStatus); |
|
2482 User::WaitForRequest(readStatus); |
|
2483 TESTL(readStatus.Int() == 0); |
|
2484 recvBuf->Append(*recvBuf2); |
|
2485 TESTL(sendBuf->Length() == recvBuf->Length()); |
|
2486 } |
|
2487 TESTL(recvBuf->Compare(*sendBuf) == 0); |
|
2488 } |
|
2489 |
|
2490 CleanupStack::PopAndDestroy(7); //conn1, conn2, sock1, sock2, sendBuf, recvBuf, recvBuf2 |
|
2491 |
|
2492 return EPass; |
|
2493 } |