From 462bd7efe9c2aed421d9412d9c0855e5f2befff9 Mon Sep 17 00:00:00 2001 From: Patrick Rohr Date: Fri, 7 Jun 2024 11:05:50 -0700 Subject: [PATCH] Inline runUdp4Test runUdp4Test is only used from testTetherUdpV4, so it should be inlined. Test: TH Change-Id: I54451c4a707f576d3c5266d7ea8149a831c7cb07 --- .../android/net/EthernetTetheringTest.java | 43 +++++++++---------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java b/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java index b332b1f802..5c258b2939 100644 --- a/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java +++ b/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java @@ -486,17 +486,23 @@ public class EthernetTetheringTest extends EthernetTetheringTestBase { // TODO: test BPF offload maps {rule, stats}. } - // Test network topology: - // - // public network (rawip) private network - // | UE | - // +------------+ V +------------+------------+ V +------------+ - // | Sever +---------+ Upstream | Downstream +---------+ Client | - // +------------+ +------------+------------+ +------------+ - // remote ip public ip private ip - // 8.8.8.8:443 :9876 :9876 - // - private void runUdp4Test() throws Exception { + + /** + * Basic IPv4 UDP tethering test. Verify that UDP tethered packets are transferred no matter + * using which data path. + */ + @Test + public void testTetherUdpV4() throws Exception { + // Test network topology: + // + // public network (rawip) private network + // | UE | + // +------------+ V +------------+------------+ V +------------+ + // | Sever +---------+ Upstream | Downstream +---------+ Client | + // +------------+ +------------+------------+ +------------+ + // remote ip public ip private ip + // 8.8.8.8:443 :9876 :9876 + // final TetheringTester tester = initTetheringTester(toList(TEST_IP4_ADDR), toList(TEST_IP4_DNS)); final TetheredDevice tethered = tester.createTetheredDevice(TEST_MAC, false /* hasIpv6 */); @@ -518,15 +524,6 @@ public class EthernetTetheringTest extends EthernetTetheringTestBase { sendDownloadPacketUdp(remoteIp, tetheringUpstreamIp, tester, false /* is6To4 */); } - /** - * Basic IPv4 UDP tethering test. Verify that UDP tethered packets are transferred no matter - * using which data path. - */ - @Test - public void testTetherUdpV4() throws Exception { - runUdp4Test(); - } - // Test network topology: // // public network (rawip) private network @@ -576,7 +573,7 @@ public class EthernetTetheringTest extends EthernetTetheringTestBase { final TetheredDevice tethered = tester.createTetheredDevice(TEST_MAC, false /* hasIpv6 */); // TODO: remove the connectivity verification for upstream connected notification race. - // See the same reason in runUdp4Test(). + // See the same reason in testTetherUdp4(). probeV4TetheringConnectivity(tester, tethered, false /* is4To6 */); final ByteBuffer request = buildIcmpEchoPacketV4(tethered.macAddr /* srcMac */, @@ -684,7 +681,7 @@ public class EthernetTetheringTest extends EthernetTetheringTestBase { final TetheredDevice tethered = tester.createTetheredDevice(TEST_MAC, false /* hasIpv6 */); // TODO: remove the connectivity verification for upstream connected notification race. - // See the same reason in runUdp4Test(). + // See the same reason in testTetherUdp4(). probeV4TetheringConnectivity(tester, tethered, false /* is4To6 */); // [1] Send DNS query. @@ -728,7 +725,7 @@ public class EthernetTetheringTest extends EthernetTetheringTestBase { final TetheredDevice tethered = tester.createTetheredDevice(TEST_MAC, false /* hasIpv6 */); // TODO: remove the connectivity verification for upstream connected notification race. - // See the same reason in runUdp4Test(). + // See the same reason in testTetherUdp4(). probeV4TetheringConnectivity(tester, tethered, false /* is4To6 */); runTcpTest(tethered.macAddr /* uploadSrcMac */, tethered.routerMacAddr /* uploadDstMac */,