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>
This commit is contained in:
Mark Chien
2023-03-31 05:18:58 +00:00
committed by Automerger Merge Worker
2 changed files with 8 additions and 1 deletions

View File

@@ -215,6 +215,13 @@ public abstract class EthernetTetheringTestBase {
}
}
protected void stopEthernetTethering(final MyTetheringEventCallback callback) {
runAsShell(TETHER_PRIVILEGED, () -> {
mTm.stopTethering(TETHERING_ETHERNET);
maybeUnregisterTetheringEventCallback(callback);
});
}
protected void cleanUp() throws Exception {
setPreferTestNetworks(false);

View File

@@ -364,7 +364,7 @@ public class EthernetTetheringTest extends EthernetTetheringTestBase {
// 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.