summaryrefslogtreecommitdiff
path: root/server/TetherControllerTest.cpp
diff options
context:
space:
mode:
authorMaciej Żenczykowski <maze@google.com>2021-03-16 03:00:21 -0700
committerMaciej Żenczykowski <maze@google.com>2021-03-16 04:14:20 -0700
commitc69dea2dba53f856c03f21417d8b6220f2057698 (patch)
tree919f6a86340fc2f3778605bd5c54d4f1f979745c /server/TetherControllerTest.cpp
parente0a71858f13c504c9fe7adbdf57b776fb5eca0b3 (diff)
TetherControllerTest - remove needless fake bpf maps
Since all tethering bpf map related functionality is moving to Tethering mainline module. Test: atest, TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I41832008aa7384516e514211c0d8bf14330f1c7e
Diffstat (limited to 'server/TetherControllerTest.cpp')
-rw-r--r--server/TetherControllerTest.cpp23
1 files changed, 0 insertions, 23 deletions
diff --git a/server/TetherControllerTest.cpp b/server/TetherControllerTest.cpp
index 5c246ac8..71494e9d 100644
--- a/server/TetherControllerTest.cpp
+++ b/server/TetherControllerTest.cpp
@@ -38,7 +38,6 @@
using android::base::Join;
using android::base::StringPrintf;
-using android::bpf::BpfMap;
using android::netdutils::StatusOr;
using TetherStats = android::net::TetherController::TetherStats;
using TetherStatsList = android::net::TetherController::TetherStatsList;
@@ -48,8 +47,6 @@ using TetherOffloadStatsList = android::net::TetherController::TetherOffloadStat
namespace android {
namespace net {
-constexpr int TEST_MAP_SIZE = 10;
-
// Comparison for TetherOffloadStats. Need to override operator== because class TetherOffloadStats
// doesn't have one.
// TODO: once C++20 is used, use default operator== in TetherOffloadStats and remove the overriding
@@ -67,18 +64,6 @@ public:
protected:
TetherController mTetherCtrl;
- BpfMap<TetherStatsKey, TetherStatsValue> mFakeTetherStatsMap{BPF_MAP_TYPE_HASH, TEST_MAP_SIZE};
- BpfMap<TetherLimitKey, TetherLimitValue> mFakeTetherLimitMap{BPF_MAP_TYPE_HASH, TEST_MAP_SIZE};
-
- void SetUp() {
- ASSERT_TRUE(mFakeTetherStatsMap.isValid());
- ASSERT_TRUE(mFakeTetherLimitMap.isValid());
-
- mTetherCtrl.mBpfStatsMap = mFakeTetherStatsMap;
- ASSERT_TRUE(mTetherCtrl.mBpfStatsMap.isValid());
- mTetherCtrl.mBpfLimitMap = mFakeTetherLimitMap;
- ASSERT_TRUE(mTetherCtrl.mBpfLimitMap.isValid());
- }
std::string toString(const TetherOffloadStatsList& statsList) {
std::string result;
@@ -90,14 +75,6 @@ protected:
return result;
}
- void updateMaps(uint32_t ifaceIndex, uint64_t rxBytes, uint64_t rxPackets, uint64_t txBytes,
- uint64_t txPackets) {
- // {rx, tx}Errors in |tetherStats| are set zero because getTetherStats doesn't use them.
- const TetherStatsValue tetherStats = {rxPackets, rxBytes, 0 /*unused*/,
- txPackets, txBytes, 0 /*unused*/};
- ASSERT_RESULT_OK(mFakeTetherStatsMap.writeValue(ifaceIndex, tetherStats, BPF_ANY));
- };
-
int setDefaults() {
return mTetherCtrl.setDefaults();
}