NetworkStats: apply464xlatAdjustments - remove useBpfStats parameter.
Test: atest NetworkStatsTest NetworkStatsFactoryTest Bug: 150738490 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I0121a4ac7ee824adc5930bab786d550b2f00b05b Merged-In: I0121a4ac7ee824adc5930bab786d550b2f00b05b
This commit is contained in:
@@ -926,21 +926,14 @@ public class NetworkStatsTest {
|
|||||||
3 /* txPackets */,
|
3 /* txPackets */,
|
||||||
0 /* operations */);
|
0 /* operations */);
|
||||||
|
|
||||||
final NetworkStats statsXt = new NetworkStats(TEST_START, 3)
|
final NetworkStats stats = new NetworkStats(TEST_START, 3)
|
||||||
.insertEntry(appEntry)
|
.insertEntry(appEntry)
|
||||||
.insertEntry(rootUidEntry)
|
.insertEntry(rootUidEntry)
|
||||||
.insertEntry(otherEntry);
|
.insertEntry(otherEntry);
|
||||||
|
|
||||||
final NetworkStats statsEbpf = new NetworkStats(TEST_START, 3)
|
stats.apply464xlatAdjustments(stackedIface);
|
||||||
.insertEntry(appEntry)
|
|
||||||
.insertEntry(rootUidEntry)
|
|
||||||
.insertEntry(otherEntry);
|
|
||||||
|
|
||||||
statsXt.apply464xlatAdjustments(stackedIface, false);
|
assertEquals(3, stats.size());
|
||||||
statsEbpf.apply464xlatAdjustments(stackedIface, true);
|
|
||||||
|
|
||||||
assertEquals(3, statsXt.size());
|
|
||||||
assertEquals(3, statsEbpf.size());
|
|
||||||
final NetworkStats.Entry expectedAppUid = new NetworkStats.Entry(
|
final NetworkStats.Entry expectedAppUid = new NetworkStats.Entry(
|
||||||
v4Iface, appUid, SET_DEFAULT, TAG_NONE,
|
v4Iface, appUid, SET_DEFAULT, TAG_NONE,
|
||||||
30949510,
|
30949510,
|
||||||
@@ -955,12 +948,9 @@ public class NetworkStatsTest {
|
|||||||
17607,
|
17607,
|
||||||
97,
|
97,
|
||||||
0);
|
0);
|
||||||
assertEquals(expectedAppUid, statsXt.getValues(0, null));
|
assertEquals(expectedAppUid, stats.getValues(0, null));
|
||||||
assertEquals(expectedRootUid, statsXt.getValues(1, null));
|
assertEquals(expectedRootUid, stats.getValues(1, null));
|
||||||
assertEquals(otherEntry, statsXt.getValues(2, null));
|
assertEquals(otherEntry, stats.getValues(2, null));
|
||||||
assertEquals(expectedAppUid, statsEbpf.getValues(0, null));
|
|
||||||
assertEquals(expectedRootUid, statsEbpf.getValues(1, null));
|
|
||||||
assertEquals(otherEntry, statsEbpf.getValues(2, null));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -985,7 +975,7 @@ public class NetworkStatsTest {
|
|||||||
.insertEntry(secondEntry);
|
.insertEntry(secondEntry);
|
||||||
|
|
||||||
// Empty map: no adjustment
|
// Empty map: no adjustment
|
||||||
stats.apply464xlatAdjustments(new ArrayMap<>(), false);
|
stats.apply464xlatAdjustments(new ArrayMap<>());
|
||||||
|
|
||||||
assertEquals(2, stats.size());
|
assertEquals(2, stats.size());
|
||||||
assertEquals(firstEntry, stats.getValues(0, null));
|
assertEquals(firstEntry, stats.getValues(0, null));
|
||||||
|
|||||||
Reference in New Issue
Block a user