Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6affb9bb authored by Maciej Żenczykowski's avatar Maciej Żenczykowski
Browse files

fix android.net.NetworkStatsTest#testApply464xlatAdjustments



Test: atest NetworkStatsTest
Bug: 150738490
Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
Change-Id: Ib12ee88295eb502f6da13d212b4fd6298dea380f
Merged-In: Ib12ee88295eb502f6da13d212b4fd6298dea380f
parent d1dd2f9c
Loading
Loading
Loading
Loading
+4 −15
Original line number Original line Diff line number Diff line
@@ -909,8 +909,8 @@ public class NetworkStatsTest {
                13805 /* txPackets */,
                13805 /* txPackets */,
                0 /* operations */);
                0 /* operations */);


        // Traffic measured for the root uid on the base interface if eBPF is in use.
        // Traffic measured for the root uid on the base interface.
        final NetworkStats.Entry ebpfRootUidEntry = new NetworkStats.Entry(
        final NetworkStats.Entry rootUidEntry = new NetworkStats.Entry(
                baseIface, rootUid, SET_DEFAULT, TAG_NONE,
                baseIface, rootUid, SET_DEFAULT, TAG_NONE,
                163577 /* rxBytes */,
                163577 /* rxBytes */,
                187 /* rxPackets */,
                187 /* rxPackets */,
@@ -918,17 +918,6 @@ public class NetworkStatsTest {
                97 /* txPackets */,
                97 /* txPackets */,
                0 /* operations */);
                0 /* operations */);


        // Traffic measured for the root uid on the base interface if xt_qtaguid is in use.
        // Incorrectly includes appEntry's bytes and packets, plus IPv4-IPv6 translation
        // overhead (20 bytes per packet), in rx direction.
        final NetworkStats.Entry xtRootUidEntry = new NetworkStats.Entry(
                baseIface, rootUid, SET_DEFAULT, TAG_NONE,
                31113087 /* rxBytes */,
                22588 /* rxPackets */,
                17607 /* txBytes */,
                97 /* txPackets */,
                0 /* operations */);

        final NetworkStats.Entry otherEntry = new NetworkStats.Entry(
        final NetworkStats.Entry otherEntry = new NetworkStats.Entry(
                otherIface, appUid, SET_DEFAULT, TAG_NONE,
                otherIface, appUid, SET_DEFAULT, TAG_NONE,
                2600  /* rxBytes */,
                2600  /* rxBytes */,
@@ -939,12 +928,12 @@ public class NetworkStatsTest {


        final NetworkStats statsXt = new NetworkStats(TEST_START, 3)
        final NetworkStats statsXt = new NetworkStats(TEST_START, 3)
                .insertEntry(appEntry)
                .insertEntry(appEntry)
                .insertEntry(xtRootUidEntry)
                .insertEntry(rootUidEntry)
                .insertEntry(otherEntry);
                .insertEntry(otherEntry);


        final NetworkStats statsEbpf = new NetworkStats(TEST_START, 3)
        final NetworkStats statsEbpf = new NetworkStats(TEST_START, 3)
                .insertEntry(appEntry)
                .insertEntry(appEntry)
                .insertEntry(ebpfRootUidEntry)
                .insertEntry(rootUidEntry)
                .insertEntry(otherEntry);
                .insertEntry(otherEntry);


        statsXt.apply464xlatAdjustments(stackedIface, false);
        statsXt.apply464xlatAdjustments(stackedIface, false);