Merge "testTetherBpfOffloadUdpV4: disable on S/Sv2 with old DnsResolver" into main am: 520093b251
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3534159 Change-Id: I35f971dcfbed6185d6846afc5b13e4ad0a856d73 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
3bcb019ca3
1 changed files with 13 additions and 0 deletions
|
|
@ -64,6 +64,7 @@ import androidx.annotation.Nullable;
|
||||||
import androidx.test.filters.LargeTest;
|
import androidx.test.filters.LargeTest;
|
||||||
import androidx.test.runner.AndroidJUnit4;
|
import androidx.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
|
import com.android.modules.utils.build.SdkLevel;
|
||||||
import com.android.net.module.util.BpfDump;
|
import com.android.net.module.util.BpfDump;
|
||||||
import com.android.net.module.util.Ipv6Utils;
|
import com.android.net.module.util.Ipv6Utils;
|
||||||
import com.android.net.module.util.Struct;
|
import com.android.net.module.util.Struct;
|
||||||
|
|
@ -89,6 +90,7 @@ import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.FileDescriptor;
|
import java.io.FileDescriptor;
|
||||||
import java.net.Inet4Address;
|
import java.net.Inet4Address;
|
||||||
import java.net.Inet6Address;
|
import java.net.Inet6Address;
|
||||||
|
|
@ -1051,6 +1053,16 @@ public class EthernetTetheringTest extends EthernetTetheringTestBase {
|
||||||
assertEquals(0, statsValue.txErrors);
|
assertEquals(0, statsValue.txErrors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// on S/Sv2 without a new enough DnsResolver apex, NetBpfLoad does not
|
||||||
|
// get triggered, and thus no mainline programs get loaded.
|
||||||
|
private boolean isNetBpfLoadEnabled() {
|
||||||
|
if (SdkLevel.isAtLeastT()) return true;
|
||||||
|
if (!SdkLevel.isAtLeastS()) return false;
|
||||||
|
|
||||||
|
File f = new File("/apex/com.android.resolv/NetBpfLoad-S.flag");
|
||||||
|
return f.isFile();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BPF offload IPv4 UDP tethering test. Verify that UDP tethered packets are offloaded by BPF.
|
* BPF offload IPv4 UDP tethering test. Verify that UDP tethered packets are offloaded by BPF.
|
||||||
* Minimum test requirement:
|
* Minimum test requirement:
|
||||||
|
|
@ -1065,6 +1077,7 @@ public class EthernetTetheringTest extends EthernetTetheringTestBase {
|
||||||
public void testTetherBpfOffloadUdpV4() throws Exception {
|
public void testTetherBpfOffloadUdpV4() throws Exception {
|
||||||
assumeTrue("Tethering config disabled BPF offload", isTetherConfigBpfOffloadEnabled());
|
assumeTrue("Tethering config disabled BPF offload", isTetherConfigBpfOffloadEnabled());
|
||||||
assumeKernelSupportBpfOffloadUdpV4();
|
assumeKernelSupportBpfOffloadUdpV4();
|
||||||
|
assumeTrue("Mainline NetBpfLoad not available", isNetBpfLoadEnabled());
|
||||||
|
|
||||||
runUdp4Test();
|
runUdp4Test();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue