commit | 52fee67b996216dc51076f2ce7fcca2abc1e02b3 | [log] [tgz] |
---|---|---|
author | Mark Chien <markchien@google.com> | Fri Mar 31 05:18:58 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Fri Mar 31 05:18:58 2023 +0000 |
tree | 8c11e66a7f01500f82d5648475f562aa09cf8c59 | |
parent | 815cedfcbb8a481330198b785236cae73b6cb79d [diff] | |
parent | 1a978c03003a72077d4520657723d056c6b1265e [diff] |
Merge "Fix testPhysicalEthernet failure for physical ethernet device" am: 1a978c0300 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2514919 Change-Id: I3e105e53564e1c933d70ea6688029b12ecc84bdf Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/Tethering/tests/integration/base/android/net/EthernetTetheringTestBase.java b/Tethering/tests/integration/base/android/net/EthernetTetheringTestBase.java index 69eb58f..007bf23 100644 --- a/Tethering/tests/integration/base/android/net/EthernetTetheringTestBase.java +++ b/Tethering/tests/integration/base/android/net/EthernetTetheringTestBase.java
@@ -215,6 +215,13 @@ } } + protected void stopEthernetTethering(final MyTetheringEventCallback callback) { + runAsShell(TETHER_PRIVILEGED, () -> { + mTm.stopTethering(TETHERING_ETHERNET); + maybeUnregisterTetheringEventCallback(callback); + }); + } + protected void cleanUp() throws Exception { setPreferTestNetworks(false);
diff --git a/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java b/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java index 12ac454..55854e2 100644 --- a/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java +++ b/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java
@@ -364,7 +364,7 @@ // Enable Ethernet tethering and check that it starts. tetheringEventCallback = enableEthernetTethering(iface, null /* any upstream */); } finally { - maybeUnregisterTetheringEventCallback(tetheringEventCallback); + stopEthernetTethering(tetheringEventCallback); } // There is nothing more we can do on a physical interface without connecting an actual // client, which is not possible in this test.