summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Maciej Żenczykowski <maze@google.com> 2020-01-04 13:07:51 -0800
committer Maciej Żenczykowski <maze@google.com> 2020-05-28 00:26:18 -0700
commitc1aeb69e590f646a8402723b2a91c8ffdfa37dda (patch)
tree4984ab4f4c0ea6748b9e6beb1f07b2ebb47c48ce
parent3f9933c48d58876389f8e3074cdffdb9eed735aa (diff)
fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting100MBDownload
No clat app uid 0 rx stats on base iface due to ip6tables raw prerouting drop (so just copy over the rx stats from the before file) Test: atest NetworkStatsTest NetworkStatsFactoryTest Bug: 150738490 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Ie73ba0586dafde67bc2726db26e07f7268c18be3
-rw-r--r--tests/net/java/com/android/server/net/NetworkStatsFactoryTest.java8
-rw-r--r--tests/net/res/raw/xt_qtaguid_with_clat_100mb_download_after2
2 files changed, 4 insertions, 6 deletions
diff --git a/tests/net/java/com/android/server/net/NetworkStatsFactoryTest.java b/tests/net/java/com/android/server/net/NetworkStatsFactoryTest.java
index fd51c4ae3f57..e4996d981fac 100644
--- a/tests/net/java/com/android/server/net/NetworkStatsFactoryTest.java
+++ b/tests/net/java/com/android/server/net/NetworkStatsFactoryTest.java
@@ -468,9 +468,7 @@ public class NetworkStatsFactoryTest extends NetworkStatsBaseTest {
long appRxBytesAfter = 439237478L;
assertEquals("App traffic should be ~100MB", 110553449, appRxBytesAfter - appRxBytesBefore);
- long rootRxBytesBefore = 1394011L;
- long rootRxBytesAfter = 1398634L;
- assertEquals("UID 0 traffic should be ~0", 4623, rootRxBytesAfter - rootRxBytesBefore);
+ long rootRxBytes = 330187296L;
mFactory.noteStackedIface("v4-wlan0", "wlan0");
NetworkStats stats;
@@ -478,12 +476,12 @@ public class NetworkStatsFactoryTest extends NetworkStatsBaseTest {
// Stats snapshot before the download
stats = parseDetailedStats(R.raw.xt_qtaguid_with_clat_100mb_download_before);
assertStatsEntry(stats, "v4-wlan0", 10106, SET_FOREGROUND, 0x0, appRxBytesBefore, 5199872L);
- assertStatsEntry(stats, "wlan0", 0, SET_DEFAULT, 0x0, rootRxBytesBefore, 0L);
+ assertStatsEntry(stats, "wlan0", 0, SET_DEFAULT, 0x0, rootRxBytes, 0L);
// Stats snapshot after the download
stats = parseDetailedStats(R.raw.xt_qtaguid_with_clat_100mb_download_after);
assertStatsEntry(stats, "v4-wlan0", 10106, SET_FOREGROUND, 0x0, appRxBytesAfter, 7867488L);
- assertStatsEntry(stats, "wlan0", 0, SET_DEFAULT, 0x0, rootRxBytesAfter, 0L);
+ assertStatsEntry(stats, "wlan0", 0, SET_DEFAULT, 0x0, rootRxBytes, 0L);
}
/**
diff --git a/tests/net/res/raw/xt_qtaguid_with_clat_100mb_download_after b/tests/net/res/raw/xt_qtaguid_with_clat_100mb_download_after
index 9f86153a33cf..12d98ca29f57 100644
--- a/tests/net/res/raw/xt_qtaguid_with_clat_100mb_download_after
+++ b/tests/net/res/raw/xt_qtaguid_with_clat_100mb_download_after
@@ -9,7 +9,7 @@ idx iface acct_tag_hex uid_tag_int cnt_set rx_bytes rx_packets tx_bytes tx_packe
9 v4-wlan0 0x0 10057 1 728 7 392 7 0 0 728 7 0 0 0 0 392 7 0 0
10 v4-wlan0 0x0 10106 0 2232 18 2232 18 0 0 2232 18 0 0 0 0 2232 18 0 0
11 v4-wlan0 0x0 10106 1 432952718 314238 5442288 121260 432950238 314218 2480 20 0 0 5433900 121029 8388 231 0 0
-12 wlan0 0x0 0 0 440746376 329772 0 0 439660007 315369 232001 1276 854368 13127 0 0 0 0 0 0
+12 wlan0 0x0 0 0 330187296 250652 0 0 329106990 236273 226202 1255 854104 13124 0 0 0 0 0 0
13 wlan0 0x0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
14 wlan0 0x0 1000 0 77113 272 56151 575 77113 272 0 0 0 0 19191 190 36960 385 0 0
15 wlan0 0x0 1000 1 20227 80 8356 72 18539 74 1688 6 0 0 7562 66 794 6 0 0