summaryrefslogtreecommitdiff
path: root/tests/unit/java/com/android/server/ConnectivityServiceTest.java
diff options
context:
space:
mode:
authorPatrick Rohr <prohr@google.com>2022-03-02 15:14:07 +0100
committerPatrick Rohr <prohr@google.com>2022-03-02 20:41:13 +0100
commitf1fe8ee928f10e15a26059070fb8577fa5cc8c34 (patch)
tree21c6914fadd64e3e4bb26fc0a57688fb704a9b08 /tests/unit/java/com/android/server/ConnectivityServiceTest.java
parent8039c853364b31ae3632fc1a7a504b2f009bc5ae (diff)
Do not enable ingress rate limit until clsact qdisc exists
The tc police filter attaches to the clsact qdisc, so the rate limit cannot be enabled before the qdisc is added to the interface. The clsact qdisc is added as part of INetd#networkAddInterface, which is called from inside updateLinkProperties. Test: atest FrameworksNetTests:ConnectivityServiceTest Change-Id: I0713605ff3684f8271eb3f0e29ab7116561963f1
Diffstat (limited to 'tests/unit/java/com/android/server/ConnectivityServiceTest.java')
-rw-r--r--tests/unit/java/com/android/server/ConnectivityServiceTest.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unit/java/com/android/server/ConnectivityServiceTest.java b/tests/unit/java/com/android/server/ConnectivityServiceTest.java
index 098d48a734..777da1714c 100644
--- a/tests/unit/java/com/android/server/ConnectivityServiceTest.java
+++ b/tests/unit/java/com/android/server/ConnectivityServiceTest.java
@@ -1998,6 +1998,13 @@ public class ConnectivityServiceTest {
// updated. Check that this happened.
assertEquals(-1L, (long) mActiveRateLimit.getOrDefault(iface, -1L));
mActiveRateLimit.put(iface, rateInBytesPerSecond);
+ // verify that clsact qdisc has already been created, otherwise attaching a tc police
+ // filter will fail.
+ try {
+ verify(mMockNetd).networkAddInterface(anyInt(), eq(iface));
+ } catch (RemoteException e) {
+ fail(e.getMessage());
+ }
}
@Override