Move targetSDK-specific tests to SELinux CTS.

SwitchTargetSdkVersionRule is not supported for use with SELinux
target-SDK checks. Moving this specific test into
cts/tests/tests/selinux downstream (Change-Id
I9b9ba084dd1c58d01b97f807d7e0122f059c5121), which will be
cherrypicked into AOSP as soon as SELinux kernel changes trickled
down.

Change-Id: I50b5524c0903b2b72f8de14ba4f321f2f894f397
Bug: 141455849
Fix: 149544376
Test: atest NetworkInterfaceTest
diff --git a/luni/src/test/java/libcore/java/net/NetworkInterfaceTest.java b/luni/src/test/java/libcore/java/net/NetworkInterfaceTest.java
index 0547462..f0f79ad 100644
--- a/luni/src/test/java/libcore/java/net/NetworkInterfaceTest.java
+++ b/luni/src/test/java/libcore/java/net/NetworkInterfaceTest.java
@@ -16,6 +16,7 @@
 
 package libcore.java.net;
 
+import junit.framework.TestCase;
 
 import android.system.StructIfaddrs;
 import java.io.BufferedReader;
@@ -38,11 +39,6 @@
 import java.util.regex.Pattern;
 import libcore.io.IoUtils;
 import libcore.io.Libcore;
-import libcore.junit.junit3.TestCaseWithRules;
-import libcore.junit.util.SwitchTargetSdkVersionRule;
-import libcore.junit.util.SwitchTargetSdkVersionRule.TargetSdkVersion;
-import org.junit.Rule;
-import org.junit.rules.TestRule;
 
 import static android.system.OsConstants.AF_INET;
 import static android.system.OsConstants.IFF_LOOPBACK;
@@ -53,10 +49,7 @@
 import static android.system.OsConstants.SOCK_DGRAM;
 import static java.net.NetworkInterface.getNetworkInterfaces;
 
-public class NetworkInterfaceTest extends TestCaseWithRules {
-    @Rule
-    public TestRule switchTargetSdkVersionRule = SwitchTargetSdkVersionRule.getInstance();
-
+public class NetworkInterfaceTest extends TestCase {
     // http://code.google.com/p/android/issues/detail?id=13784
     private final static int ARPHRD_ETHER = 1; // from if_arp.h
     public void testIPv6() throws Exception {
@@ -118,17 +111,6 @@
         }
     }
 
-    @TargetSdkVersion(29)
-    public void testGetHardwareAddress_compat_returnsHardwareAddress() throws Exception {
-        // Ensure apps with a targetSdk version <= 29 are able to access the MAC address of ethernet
-        // devices.
-        for (NetworkInterface nif : Collections.list(getNetworkInterfaces())) {
-            if (isEthernet(nif.getName())) {
-                assertEquals(6, nif.getHardwareAddress().length);
-            }
-        }
-    }
-
     public void testGetHardwareAddress_returnsNull() throws Exception {
         // Hardware addresses should be unavailable to non-system apps.
         for (NetworkInterface nif : Collections.list(getNetworkInterfaces())) {