Home | History | Annotate | Download | only in shill

Lines Matching refs:TrafficMonitorTest

48 class TrafficMonitorTest : public Test {
63 TrafficMonitorTest()
109 Invoke(this, &TrafficMonitorTest::MockLoadTcpSocketInfo));
117 Invoke(this, &TrafficMonitorTest::MockLoadConnectionInfo));
149 const char TrafficMonitorTest::kLocalIpAddr[] = "127.0.0.1";
150 const uint16_t TrafficMonitorTest::kLocalPort1 = 1234;
151 const uint16_t TrafficMonitorTest::kLocalPort2 = 2345;
152 const uint16_t TrafficMonitorTest::kLocalPort3 = 3456;
153 const uint16_t TrafficMonitorTest::kLocalPort4 = 4567;
154 const uint16_t TrafficMonitorTest::kLocalPort5 = 4567;
155 const char TrafficMonitorTest::kRemoteIpAddr[] = "192.168.1.1";
156 const uint16_t TrafficMonitorTest::kRemotePort = 5678;
157 const uint64_t TrafficMonitorTest::kTxQueueLength1 = 111;
158 const uint64_t TrafficMonitorTest::kTxQueueLength2 = 222;
159 const uint64_t TrafficMonitorTest::kTxQueueLength3 = 333;
160 const uint64_t TrafficMonitorTest::kTxQueueLength4 = 444;
162 TEST_F(TrafficMonitorTest, StartAndStop) {
180 TEST_F(TrafficMonitorTest, BuildIPPortToTxQueueLengthValid) {
185 TrafficMonitorTest::kLocalPort1,
187 TrafficMonitorTest::kRemotePort,
188 TrafficMonitorTest::kTxQueueLength1,
194 string ip_port = FormatIPPort(local_addr_, TrafficMonitorTest::kLocalPort1);
195 EXPECT_EQ(TrafficMonitorTest::kTxQueueLength1, tx_queue_lengths[ip_port]);
198 TEST_F(TrafficMonitorTest, BuildIPPortToTxQueueLengthInvalidDevice) {
205 TrafficMonitorTest::kLocalPort1,
207 TrafficMonitorTest::kRemotePort,
208 TrafficMonitorTest::kTxQueueLength1,
216 TEST_F(TrafficMonitorTest, BuildIPPortToTxQueueLengthZero) {
221 TrafficMonitorTest::kLocalPort1,
223 TrafficMonitorTest::kRemotePort,
232 TEST_F(TrafficMonitorTest, BuildIPPortToTxQueueLengthInvalidConnectionState) {
237 TrafficMonitorTest::kLocalPort1,
239 TrafficMonitorTest::kRemotePort,
240 TrafficMonitorTest::kTxQueueLength1,
248 TEST_F(TrafficMonitorTest, BuildIPPortToTxQueueLengthInvalidTimerState) {
253 TrafficMonitorTest::kLocalPort1,
255 TrafficMonitorTest::kRemotePort,
256 TrafficMonitorTest::kTxQueueLength1,
264 TEST_F(TrafficMonitorTest, BuildIPPortToTxQueueLengthMultipleEntries) {
269 TrafficMonitorTest::kLocalPort1,
271 TrafficMonitorTest::kRemotePort,
272 TrafficMonitorTest::kTxQueueLength1,
278 TrafficMonitorTest::kLocalPort2,
280 TrafficMonitorTest::kRemotePort,
281 TrafficMonitorTest::kTxQueueLength2,
287 TrafficMonitorTest::kLocalPort3,
289 TrafficMonitorTest::kRemotePort,
290 TrafficMonitorTest::kTxQueueLength3,
296 TrafficMonitorTest::kLocalPort4,
298 TrafficMonitorTest::kRemotePort,
299 TrafficMonitorTest::kTxQueueLength4,
305 TrafficMonitorTest::kLocalPort5,
307 TrafficMonitorTest::kRemotePort,
314 string ip_port = FormatIPPort(local_addr_, TrafficMonitorTest::kLocalPort2);
316 ip_port = FormatIPPort(local_addr_, TrafficMonitorTest::kLocalPort3);
320 TEST_F(TrafficMonitorTest, SampleTrafficStuckTxQueueSameQueueLength) {
325 TrafficMonitorTest::kLocalPort1,
327 TrafficMonitorTest::kRemotePort,
328 TrafficMonitorTest::kTxQueueLength1,
333 Bind(&TrafficMonitorTest::OnNoOutgoingPackets, Unretained(this)));
350 TEST_F(TrafficMonitorTest, SampleTrafficStuckTxQueueIncreasingQueueLength) {
355 TrafficMonitorTest::kLocalPort1,
357 TrafficMonitorTest::kRemotePort,
358 TrafficMonitorTest::kTxQueueLength1,
363 Bind(&TrafficMonitorTest::OnNoOutgoingPackets, Unretained(this)));
372 TrafficMonitorTest::kLocalPort1,
374 TrafficMonitorTest::kRemotePort,
375 TrafficMonitorTest::kTxQueueLength1 + 1,
384 TEST_F(TrafficMonitorTest, SampleTrafficStuckTxQueueVariousQueueLengths) {
389 TrafficMonitorTest::kLocalPort1,
391 TrafficMonitorTest::kRemotePort,
392 TrafficMonitorTest::kTxQueueLength2,
397 Bind(&TrafficMonitorTest::OnNoOutgoingPackets, Unretained(this)));
406 TrafficMonitorTest::kLocalPort1,
408 TrafficMonitorTest::kRemotePort,
409 TrafficMonitorTest::kTxQueueLength1,
421 TrafficMonitorTest::kLocalPort1,
423 TrafficMonitorTest::kRemotePort,
424 TrafficMonitorTest::kTxQueueLength2,
433 TEST_F(TrafficMonitorTest, SampleTrafficUnstuckTxQueueZeroQueueLength) {
438 TrafficMonitorTest::kLocalPort1,
440 TrafficMonitorTest::kRemotePort,
441 TrafficMonitorTest::kTxQueueLength1,
446 Bind(&TrafficMonitorTest::OnNoOutgoingPackets, Unretained(this)));
454 TrafficMonitorTest::kLocalPort1,
456 TrafficMonitorTest::kRemotePort,
465 TEST_F(TrafficMonitorTest, SampleTrafficUnstuckTxQueueNoConnection) {
470 TrafficMonitorTest::kLocalPort1,
472 TrafficMonitorTest::kRemotePort,
473 TrafficMonitorTest::kTxQueueLength1,
478 Bind(&TrafficMonitorTest::OnNoOutgoingPackets, Unretained(this)));
488 TEST_F(TrafficMonitorTest, SampleTrafficUnstuckTxQueueStateChanged) {
493 TrafficMonitorTest::kLocalPort1,
495 TrafficMonitorTest::kRemotePort,
496 TrafficMonitorTest::kTxQueueLength1,
501 Bind(&TrafficMonitorTest::OnNoOutgoingPackets, Unretained(this)));
509 TrafficMonitorTest::kLocalPort1,
511 TrafficMonitorTest::kRemotePort,
520 TEST_F(TrafficMonitorTest, SampleTrafficDnsTimedOut) {
525 true, local_addr_, TrafficMonitorTest::kLocalPort1,
528 local_addr_, TrafficMonitorTest::kLocalPort1));
531 Bind(&TrafficMonitorTest::OnNoOutgoingPackets, Unretained(this)));
552 TEST_F(TrafficMonitorTest, SampleTrafficDnsOutstanding) {
557 true, local_addr_, TrafficMonitorTest::kLocalPort1,
560 local_addr_, TrafficMonitorTest::kLocalPort1));
563 Bind(&TrafficMonitorTest::OnNoOutgoingPackets, Unretained(this)));
571 TEST_F(TrafficMonitorTest, SampleTrafficDnsSuccessful) {
576 false, local_addr_, TrafficMonitorTest::kLocalPort1,
579 local_addr_, TrafficMonitorTest::kLocalPort1));
582 Bind(&TrafficMonitorTest::OnNoOutgoingPackets, Unretained(this)));
590 TEST_F(TrafficMonitorTest, SampleTrafficDnsFailureThenSuccess) {
595 true, local_addr_, TrafficMonitorTest::kLocalPort1,
598 local_addr_, TrafficMonitorTest::kLocalPort1));
601 Bind(&TrafficMonitorTest::OnNoOutgoingPackets, Unretained(this)));
613 false, local_addr_, TrafficMonitorTest::kLocalPort1,
616 local_addr_, TrafficMonitorTest::kLocalPort1));
623 TEST_F(TrafficMonitorTest, SampleTrafficDnsTimedOutInvalidProtocol) {
628 true, local_addr_, TrafficMonitorTest::kLocalPort1,
631 local_addr_, TrafficMonitorTest::kLocalPort1));
634 Bind(&TrafficMonitorTest::OnNoOutgoingPackets, Unretained(this)));
642 TEST_F(TrafficMonitorTest, SampleTrafficDnsTimedOutInvalidSourceIp) {
647 true, remote_addr_, TrafficMonitorTest::kLocalPort1,
650 remote_addr_, TrafficMonitorTest::kLocalPort1));
653 Bind(&TrafficMonitorTest::OnNoOutgoingPackets, Unretained(this)));
661 TEST_F(TrafficMonitorTest, SampleTrafficDnsTimedOutOutsideTimeWindow) {
667 true, remote_addr_, TrafficMonitorTest::kLocalPort1,
670 remote_addr_, TrafficMonitorTest::kLocalPort1));
673 Bind(&TrafficMonitorTest::OnNoOutgoingPackets, Unretained(this)));
681 TEST_F(TrafficMonitorTest, SampleTrafficNonDnsTimedOut) {
687 true, local_addr_, TrafficMonitorTest::kLocalPort1,
690 local_addr_, TrafficMonitorTest::kLocalPort1));
693 Bind(&TrafficMonitorTest::OnNoOutgoingPackets, Unretained(this)));
701 TEST_F(TrafficMonitorTest, SampleTrafficDnsStatsReset) {