Merge "Fix testPhysicalEthernet failure for physical ethernet device"

This commit is contained in:
Mark Chien
2023-03-31 04:48:33 +00:00
committed by Gerrit Code Review
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.