DO NOT MERGE IP connectivity metrics: fix tests.

This patch fixes mismatch between current proto compiler and what is
expected in several IP connectivity metrics unit tests.

Test: built, flashed, $ runtest frameworks-net
Bug: 37126521
Change-Id: I1476c923d61f748ecac1146423127f54ba117502
This commit is contained in:
Hugo Benichi
2017-04-10 13:12:49 +09:00
parent 499541673f
commit 98607d3f20
3 changed files with 40 additions and 36 deletions

View File

@@ -58,8 +58,6 @@ public class IpConnectivityEventBuilderTest extends TestCase {
String want = joinLines(
"dropped_events: 0",
"events <",
" time_ms: 1",
" transport: 0",
" default_network_event <",
" network_id <",
" network_id: 102",
@@ -72,6 +70,8 @@ public class IpConnectivityEventBuilderTest extends TestCase {
" transport_types: 2",
" transport_types: 3",
" >",
" time_ms: 1",
" transport: 0",
">",
"version: 2");
@@ -89,13 +89,14 @@ public class IpConnectivityEventBuilderTest extends TestCase {
String want = joinLines(
"dropped_events: 0",
"events <",
" time_ms: 1",
" transport: 0",
" dhcp_event <",
" duration_ms: 192",
" error_code: 0",
" if_name: \"wlan0\"",
" state_transition: \"SomeState\"",
" >",
" time_ms: 1",
" transport: 0",
">",
"version: 2");
@@ -112,13 +113,14 @@ public class IpConnectivityEventBuilderTest extends TestCase {
String want = joinLines(
"dropped_events: 0",
"events <",
" time_ms: 1",
" transport: 0",
" dhcp_event <",
" duration_ms: 0",
" if_name: \"wlan0\"",
" error_code: 50397184",
" if_name: \"wlan0\"",
" state_transition: \"\"",
" >",
" time_ms: 1",
" transport: 0",
">",
"version: 2");
@@ -137,8 +139,6 @@ public class IpConnectivityEventBuilderTest extends TestCase {
String want = joinLines(
"dropped_events: 0",
"events <",
" time_ms: 1",
" transport: 0",
" dns_lookup_batch <",
" event_types: 1",
" event_types: 1",
@@ -168,6 +168,8 @@ public class IpConnectivityEventBuilderTest extends TestCase {
" return_codes: 200",
" return_codes: 178",
" >",
" time_ms: 1",
" transport: 0",
">",
"version: 2");
@@ -185,13 +187,13 @@ public class IpConnectivityEventBuilderTest extends TestCase {
String want = joinLines(
"dropped_events: 0",
"events <",
" time_ms: 1",
" transport: 0",
" ip_provisioning_event <",
" event_type: 1",
" if_name: \"wlan0\"",
" latency_ms: 5678",
" >",
" time_ms: 1",
" transport: 0",
">",
"version: 2");
@@ -208,12 +210,12 @@ public class IpConnectivityEventBuilderTest extends TestCase {
String want = joinLines(
"dropped_events: 0",
"events <",
" time_ms: 1",
" transport: 0",
" ip_reachability_event <",
" event_type: 512",
" if_name: \"wlan0\"",
" >",
" time_ms: 1",
" transport: 0",
">",
"version: 2");
@@ -231,8 +233,6 @@ public class IpConnectivityEventBuilderTest extends TestCase {
String want = joinLines(
"dropped_events: 0",
"events <",
" time_ms: 1",
" transport: 0",
" network_event <",
" event_type: 5",
" latency_ms: 20410",
@@ -240,6 +240,8 @@ public class IpConnectivityEventBuilderTest extends TestCase {
" network_id: 100",
" >",
" >",
" time_ms: 1",
" transport: 0",
">",
"version: 2");
@@ -287,8 +289,6 @@ public class IpConnectivityEventBuilderTest extends TestCase {
String want = joinLines(
"dropped_events: 0",
"events <",
" time_ms: 1",
" transport: 0",
" apf_program_event <",
" current_ras: 9",
" drop_multicast: true",
@@ -297,6 +297,8 @@ public class IpConnectivityEventBuilderTest extends TestCase {
" lifetime: 200",
" program_length: 2048",
" >",
" time_ms: 1",
" transport: 0",
">",
"version: 2");
@@ -319,8 +321,6 @@ public class IpConnectivityEventBuilderTest extends TestCase {
String want = joinLines(
"dropped_events: 0",
"events <",
" time_ms: 1",
" transport: 0",
" apf_statistics <",
" dropped_ras: 2",
" duration_ms: 45000",
@@ -331,6 +331,8 @@ public class IpConnectivityEventBuilderTest extends TestCase {
" received_ras: 10",
" zero_lifetime_ras: 1",
" >",
" time_ms: 1",
" transport: 0",
">",
"version: 2");
@@ -351,8 +353,6 @@ public class IpConnectivityEventBuilderTest extends TestCase {
String want = joinLines(
"dropped_events: 0",
"events <",
" time_ms: 1",
" transport: 0",
" ra_event <",
" dnssl_lifetime: -1",
" prefix_preferred_lifetime: 300",
@@ -361,6 +361,8 @@ public class IpConnectivityEventBuilderTest extends TestCase {
" route_info_lifetime: -1",
" router_lifetime: 2000",
" >",
" time_ms: 1",
" transport: 0",
">",
"version: 2");

View File

@@ -158,25 +158,24 @@ public class IpConnectivityMetricsTest extends TestCase {
String want = joinLines(
"dropped_events: 0",
"events <",
" time_ms: 100",
" transport: 0",
" ip_reachability_event <",
" event_type: 512",
" if_name: \"wlan0\"",
" >",
" time_ms: 100",
" transport: 0",
">",
"events <",
" time_ms: 200",
" transport: 0",
" dhcp_event <",
" duration_ms: 192",
" error_code: 0",
" if_name: \"wlan0\"",
" state_transition: \"SomeState\"",
" >",
" time_ms: 200",
" transport: 0",
">",
"events <",
" time_ms: 300",
" transport: 0",
" default_network_event <",
" network_id <",
" network_id: 102",
@@ -189,15 +188,17 @@ public class IpConnectivityMetricsTest extends TestCase {
" transport_types: 2",
" transport_types: 3",
" >",
" time_ms: 300",
" transport: 0",
">",
"events <",
" time_ms: 400",
" transport: 0",
" ip_provisioning_event <",
" event_type: 1",
" if_name: \"wlan0\"",
" latency_ms: 5678",
" >",
" time_ms: 400",
" transport: 0",
">",
"events <",
" time_ms: 500",
@@ -212,8 +213,6 @@ public class IpConnectivityMetricsTest extends TestCase {
" >",
">",
"events <",
" time_ms: 600",
" transport: 0",
" apf_statistics <",
" dropped_ras: 2",
" duration_ms: 45000",
@@ -224,10 +223,10 @@ public class IpConnectivityMetricsTest extends TestCase {
" received_ras: 10",
" zero_lifetime_ras: 1",
" >",
" time_ms: 600",
" transport: 0",
">",
"events <",
" time_ms: 700",
" transport: 0",
" ra_event <",
" dnssl_lifetime: -1",
" prefix_preferred_lifetime: 300",
@@ -236,6 +235,8 @@ public class IpConnectivityMetricsTest extends TestCase {
" route_info_lifetime: -1",
" router_lifetime: 2000",
" >",
" time_ms: 700",
" transport: 0",
">",
"version: 2");

View File

@@ -212,8 +212,6 @@ public class NetdEventListenerServiceTest extends TestCase {
IpConnectivityEvent got = events.get(0);
String want = joinLines(
"time_ms: 0",
"transport: 0",
"connect_statistics <",
" connect_count: 12",
" errnos_counters <",
@@ -247,7 +245,10 @@ public class NetdEventListenerServiceTest extends TestCase {
" latencies_ms: 67",
" latencies_ms: 110",
" latencies_ms: 214",
" latencies_ms: 523");
" latencies_ms: 523",
">",
"time_ms: 0",
"transport: 0");
verifyConnectEvent(want, got);
}