Convert CtsSecurityBulletinHostTestCases to JUnit4
Bug: 150315725
Test: sts-tradefed run sts-engbuild-no-spl-lock -m CtsSecurityBulletinHostTestCases
Change-Id: Ic1eb7bb5b3adc464835f2ba3bf97906e540849a0
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc16_04.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc16_04.java
index 25c1373..b0f0ddc 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc16_04.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc16_04.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,13 +16,19 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc16_04 extends SecurityTestCase {
/**
* b/26323455
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-04")
public void testPocCVE_2016_2419() throws Exception {
AdbUtils.runCommandLine("logcat -c" , getDevice());
@@ -34,6 +40,7 @@
/**
* b/26324307
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-04")
public void testPocCVE_2016_0844() throws Exception {
AdbUtils.runPoc("CVE-2016-0844", getDevice(), 60);
@@ -42,6 +49,7 @@
/**
* b/26593930
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-04")
public void testPocCVE_2016_2412() throws Exception {
AdbUtils.runPocAssertNoCrashes("CVE-2016-2412", getDevice(), "system_server");
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc16_05.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc16_05.java
index d8df1c6..0895607 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc16_05.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc16_05.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,12 +17,18 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc16_05 extends SecurityTestCase {
/**
* b/27555981
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-05")
public void testPocCVE_2016_2460() throws Exception {
AdbUtils.runCommandLine("logcat -c" , getDevice());
@@ -35,6 +41,7 @@
/**
* b/27275324
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-05")
public void testPocCVE_2015_1805() throws Exception {
AdbUtils.runPoc("CVE-2015-1805", getDevice(), TIMEOUT_NONDETERMINISTIC);
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc16_06.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc16_06.java
index b414a55..58c604e 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc16_06.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc16_06.java
@@ -1,27 +1,34 @@
/**
-* Copyright (C) 2018 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc16_06 extends SecurityTestCase {
/**
* b/27661749
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-06")
public void testPocCVE_2016_2482() throws Exception {
AdbUtils.runPocAssertNoCrashes("CVE-2016-2482", getDevice(), "mediaserver");
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc16_07.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc16_07.java
index b634645..4367a61 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc16_07.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc16_07.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2019 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,15 +13,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc16_07 extends SecurityTestCase {
/**
* b/28740702
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-07")
public void testPocCVE_2016_3818() throws Exception {
AdbUtils.runPoc("CVE-2016-3818", getDevice(), 60);
@@ -30,6 +37,7 @@
/**
* b/27890802
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-07")
public void testPocCVE_2016_3746() throws Exception {
AdbUtils.runPocAssertNoCrashes("CVE-2016-3746", getDevice(), "mediaserver");
@@ -38,6 +46,7 @@
/**
* b/28557020
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-07")
public void testPocCVE_2014_9803() throws Exception {
AdbUtils.runPocAssertExitStatusNotVulnerable("CVE-2014-9803", getDevice(), 60);
@@ -46,6 +55,7 @@
/**
* b/27903498
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-07")
public void testPocCVE_2016_3747() throws Exception {
getOomCatcher().setHighMemoryTest();
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc16_09.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc16_09.java
index 3280a68..a253619 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc16_09.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc16_09.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2017 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,15 +13,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc16_09 extends SecurityTestCase {
/**
* b/27773913
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-09")
public void testPocCVE_2016_2471() throws Exception {
AdbUtils.runPoc("CVE-2016-2471", getDevice(), 60);
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc16_10.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc16_10.java
index 6daa385..d1550d2 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc16_10.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc16_10.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2019 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,13 +17,19 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc16_10 extends SecurityTestCase {
/**
* b/30204103
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-10")
public void testPocCVE_2016_3913() throws Exception {
AdbUtils.runPocAssertNoCrashes("CVE-2016-3913", getDevice(), "mediaserver");
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc16_11.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc16_11.java
index bb18b0d..60a15e6 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc16_11.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc16_11.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,13 +17,19 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc16_11 extends SecurityTestCase {
/**
* b/29149404
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-11")
public void testPocCVE_2012_6702() throws Exception {
AdbUtils.runCommandLine("logcat -c", getDevice());
@@ -35,6 +41,7 @@
/**
* b/30904789
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-11")
public void testPocCVE_2016_6730() throws Exception {
if(containsDriver(getDevice(), "/dev/dri/renderD129")) {
@@ -45,6 +52,7 @@
/**
* b/30906023
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-11")
public void testPocCVE_2016_6731() throws Exception {
if(containsDriver(getDevice(), "/dev/dri/renderD129")) {
@@ -55,6 +63,7 @@
/**
* b/30906599
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-11")
public void testPocCVE_2016_6732() throws Exception {
if(containsDriver(getDevice(), "/dev/dri/renderD129")) {
@@ -65,6 +74,7 @@
/**
* b/30906694
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-11")
public void testPocCVE_2016_6733() throws Exception {
if(containsDriver(getDevice(), "/dev/dri/renderD129")) {
@@ -75,6 +85,7 @@
/**
* b/30907120
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-11")
public void testPocCVE_2016_6734() throws Exception {
if(containsDriver(getDevice(), "/dev/dri/renderD129")) {
@@ -85,6 +96,7 @@
/**
* b/30907701
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-11")
public void testPocCVE_2016_6735() throws Exception {
if(containsDriver(getDevice(), "/dev/dri/renderD129")) {
@@ -95,6 +107,7 @@
/**
* b/30953284
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-11")
public void testPocCVE_2016_6736() throws Exception {
if(containsDriver(getDevice(), "/dev/dri/renderD129")) {
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc16_12.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc16_12.java
index 65a6931..4e2031b 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc16_12.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc16_12.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,14 +17,20 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc16_12 extends SecurityTestCase {
//Criticals
/**
* b/31796940
*/
+ @Test
@SecurityTest(minPatchLevel = "2016-12")
public void testPocCVE_2016_8406() throws Exception {
assertNotKernelPointer(() -> {
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_01.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_01.java
index 107ac45..a7ae370 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_01.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_01.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,14 +17,20 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc17_01 extends SecurityTestCase {
//Criticals
/**
* b/31797770
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-01")
public void testPocCVE_2016_8425() throws Exception {
if(containsDriver(getDevice(), "/dev/nvhost-vic")) {
@@ -35,6 +41,7 @@
/**
* b/31799206
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-01")
public void testPocCVE_2016_8426() throws Exception {
if(containsDriver(getDevice(), "/dev/nvhost-gpu")) {
@@ -45,6 +52,7 @@
/**
* b/31799885
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-01")
public void testPocCVE_2016_8427() throws Exception {
if(containsDriver(getDevice(), "/dev/nvhost-gpu") ||
@@ -56,6 +64,7 @@
/**
* b/31993456
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-01")
public void testPocCVE_2016_8428() throws Exception {
if(containsDriver(getDevice(), "/dev/nvmap")) {
@@ -66,6 +75,7 @@
/**
* b/32160775
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-01")
public void testPocCVE_2016_8429() throws Exception {
if(containsDriver(getDevice(), "/dev/nvmap")) {
@@ -76,6 +86,7 @@
/**
* b/32225180
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-01")
public void testPocCVE_2016_8430() throws Exception {
if(containsDriver(getDevice(), "/dev/nvhost-vic")) {
@@ -86,6 +97,7 @@
/**
* b/32402179
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-01")
public void testPocCVE_2016_8431() throws Exception {
if(containsDriver(getDevice(), "/dev/dri/renderD129")) {
@@ -96,6 +108,7 @@
/**
* b/32447738
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-01")
public void testPocCVE_2016_8432() throws Exception {
if(containsDriver(getDevice(), "/dev/dri/renderD129")) {
@@ -106,6 +119,7 @@
/**
* b/32125137
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-01")
public void testPocCVE_2016_8434() throws Exception {
if(containsDriver(getDevice(), "/dev/kgsl-3d0")) {
@@ -117,6 +131,7 @@
/**
* b/31668540
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-01")
public void testPocCVE_2016_8460() throws Exception {
if(containsDriver(getDevice(), "/dev/nvmap")) {
@@ -128,6 +143,7 @@
/**
* b/32255299
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-01")
public void testPocCVE_2017_0386() throws Exception {
AdbUtils.runPocAssertExitStatusNotVulnerable("CVE-2017-0386", getDevice(), 60);
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_02.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_02.java
index f9d4e1d..3f94a62 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_02.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_02.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,30 +17,39 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc17_02 extends SecurityTestCase {
- /**
- * b/32799236
- */
- @SecurityTest(minPatchLevel = "2017-02")
- public void testPocCVE_2017_0426() throws Exception {
- AdbUtils.runCommandLine("logcat -c", getDevice());
- AdbUtils.runPoc("CVE-2017-0426", getDevice(), 60);
- String logcatOut = AdbUtils.runCommandLine("logcat -d", getDevice());
- assertNotMatchesMultiLine("Bugreports file in wrong path", logcatOut);
- }
+ /**
+ * b/32799236
+ */
+ @Test
+ @SecurityTest(minPatchLevel = "2017-02")
+ public void testPocCVE_2017_0426() throws Exception {
+ AdbUtils.runCommandLine("logcat -c", getDevice());
+ AdbUtils.runPoc("CVE-2017-0426", getDevice(), 60);
+ String logcatOut = AdbUtils.runCommandLine("logcat -d", getDevice());
+ assertNotMatchesMultiLine("Bugreports file in wrong path", logcatOut);
+ }
- /**
- * b/32706020
- */
- @SecurityTest(minPatchLevel = "2017-02")
- public void testPocCVE_2017_0415() throws Exception {
- AdbUtils.runPocAssertNoCrashes("CVE-2017-0415", getDevice(), "mediaserver");
- }
+ /**
+ * b/32706020
+ */
+ @Test
+ @SecurityTest(minPatchLevel = "2017-02")
+ public void testPocCVE_2017_0415() throws Exception {
+ AdbUtils.runPocAssertNoCrashes("CVE-2017-0415", getDevice(), "mediaserver");
+ }
/**
* b/31799863
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-02")
public void testPocCVE_2016_8482() throws Exception {
if(containsDriver(getDevice(), "/dev/nvmap")) {
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_03.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_03.java
index f61e843..3dacc96 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_03.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_03.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2017 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,14 +16,22 @@
package android.security.cts;
-import android.platform.test.annotations.SecurityTest;
import java.util.concurrent.Callable;
+import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
+
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc17_03 extends SecurityTestCase {
/**
* b/31824853
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-03")
public void testPocCVE_2016_8479() throws Exception {
if (containsDriver(getDevice(), "/dev/kgsl-3d0")) {
@@ -37,6 +45,7 @@
/**
* b/33940449
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-03")
public void testPocCVE_2017_0508() throws Exception {
if (containsDriver(getDevice(), "/dev/ion") &&
@@ -51,6 +60,7 @@
/**
* b/33899363
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-03")
public void testPocCVE_2017_0333() throws Exception {
if (containsDriver(getDevice(), "/dev/dri/renderD128")) {
@@ -63,6 +73,7 @@
/**
* b/33245849
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-03")
public void testPocCVE_2017_0334() throws Exception {
if (containsDriver(getDevice(), "/dev/dri/renderD129")) {
@@ -92,6 +103,7 @@
/**
* b/32707507
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-03")
public void testPocCVE_2017_0479() throws Exception {
AdbUtils.runPocAssertNoCrashes("CVE-2017-0479", getDevice(), "audioserver");
@@ -100,6 +112,7 @@
/*
* b/33178389
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-03")
public void testPocCVE_2017_0490() throws Exception {
String bootCountBefore =
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_04.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_04.java
index 248e257..f5c8fe3 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_04.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_04.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,42 +17,51 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc17_04 extends SecurityTestCase {
- /**
- * b/32342065
- */
- @SecurityTest(minPatchLevel = "2017-04")
- public void testPocCVE_2017_0553() throws Exception {
- // Error code of 139 represents segmentation fault
- getDevice().executeShellCommand("chmod +x /data/local/tmp/CVE-2017-0553");
- assertFalse("Segfault found",
- AdbUtils.runCommandGetExitCode("/data/local/tmp/CVE-2017-0553", getDevice())==139);
- }
+ /**
+ * b/32342065
+ */
+ @Test
+ @SecurityTest(minPatchLevel = "2017-04")
+ public void testPocCVE_2017_0553() throws Exception {
+ // Error code of 139 represents segmentation fault
+ getDevice().executeShellCommand("chmod +x /data/local/tmp/CVE-2017-0553");
+ assertFalse("Segfault found",
+ AdbUtils.runCommandGetExitCode("/data/local/tmp/CVE-2017-0553", getDevice())==139);
+ }
- /**
- * b/72460737
- */
- @SecurityTest(minPatchLevel = "2017-04")
- public void testPocCVE_2014_3145() throws Exception {
- assertFalse("VULNERABLE DEVICE DETECTED",
- AdbUtils.runPocCheckExitCode("CVE-2014-3145", getDevice(), 60));
- }
+ /**
+ * b/72460737
+ */
+ @Test
+ @SecurityTest(minPatchLevel = "2017-04")
+ public void testPocCVE_2014_3145() throws Exception {
+ assertFalse("VULNERABLE DEVICE DETECTED",
+ AdbUtils.runPocCheckExitCode("CVE-2014-3145", getDevice(), 60));
+ }
- /**
- * b/32813456
- */
- @SecurityTest(minPatchLevel = "2017-04")
- public void testPocCVE_2016_10229() throws Exception {
- String out = AdbUtils.runPoc("CVE-2016-10229", getDevice());
- assertNotMatchesMultiLine("OVERWRITE", out);
- }
+ /**
+ * b/32813456
+ */
+ @Test
+ @SecurityTest(minPatchLevel = "2017-04")
+ public void testPocCVE_2016_10229() throws Exception {
+ String out = AdbUtils.runPoc("CVE-2016-10229", getDevice());
+ assertNotMatchesMultiLine("OVERWRITE", out);
+ }
/**
* b/33621647
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-04")
public void testPocCVE_2017_0477() throws Exception {
AdbUtils.pushResource("/CVE-2017-0477.gif", "/data/local/tmp/CVE-2017-0477.gif",
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_05.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_05.java
index 70e224a..1ec6d89 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_05.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_05.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,16 +16,23 @@
package android.security.cts;
-import android.platform.test.annotations.SecurityTest;
import java.util.Arrays;
import java.util.concurrent.Callable;
-@SecurityTest
+import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
+
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc17_05 extends SecurityTestCase {
/**
* b/34277115
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-05")
public void testPocCVE_2017_0630() throws Exception {
if (containsDriver(getDevice(), "/sys/kernel/debug/tracing/printk_formats")) {
@@ -54,6 +61,7 @@
/*
* CVE-2016-5862
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-05")
public void testPocCVE_2016_5862() throws Exception {
if (containsDriver(getDevice(), "/dev/snd/controlC0")) {
@@ -64,6 +72,7 @@
/**
* CVE-2016-5867
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-05")
public void testPocCVE_2016_5867() throws Exception {
if (containsDriver(getDevice(), "/dev/snd/controlC0")) {
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_06.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_06.java
index c2c3e29..1f7e5e9 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_06.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_06.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,14 +17,19 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
-import java.util.concurrent.TimeUnit;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc17_06 extends SecurityTestCase {
/**
* b/36392138
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-06")
public void testPocCVE_2017_0647() throws Exception {
AdbUtils.pushResource("/CVE-2017-0647.zip", "/data/local/tmp/CVE-2017-0647.zip",
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_07.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_07.java
index 29b7a39..d3a086a 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_07.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_07.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2017 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,13 +17,19 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc17_07 extends SecurityTestCase {
/**
* b/35443725
**/
+ @Test
@SecurityTest(minPatchLevel = "2017-07")
public void testPocCVE_2016_2109() throws Exception {
assertFalse("Overallocation detected!",
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_09.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_09.java
index 1659397..de7381e 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_09.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_09.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,13 +17,19 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc17_09 extends SecurityTestCase {
/**
* b/63852675
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-09")
public void testPocCve_2017_6983() throws Exception {
// Error code of 139 represents segmentation fault
@@ -53,14 +59,15 @@
)==139);
}
- /**
- * b/38195738
- * b/36590192
- */
- @SecurityTest(minPatchLevel = "2017-09")
- public void testPocBug_38195738() throws Exception {
- if(containsDriver(getDevice(), "/dev/kgsl-3d0")) {
- AdbUtils.runPocNoOutput("Bug-38195738", getDevice(), 60);
+ /**
+ * b/38195738
+ * b/36590192
+ */
+ @Test
+ @SecurityTest(minPatchLevel = "2017-09")
+ public void testPocBug_38195738() throws Exception {
+ if(containsDriver(getDevice(), "/dev/kgsl-3d0")) {
+ AdbUtils.runPocNoOutput("Bug-38195738", getDevice(), 60);
+ }
}
- }
}
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_11.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_11.java
index 3fbf3d2..e592d0f 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_11.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_11.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2017 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,13 +17,19 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc17_11 extends SecurityTestCase {
/**
* b/36075131
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-11")
public void testPocCVE_2017_0859() throws Exception {
AdbUtils.runCommandLine("logcat -c", getDevice());
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_12.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_12.java
index fed0ab5..71607c8 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_12.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_12.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,13 +17,19 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc17_12 extends SecurityTestCase {
/**
* b/38045794
*/
+ @Test
@SecurityTest(minPatchLevel = "2017-12")
public void testPocCVE_2017_6262() throws Exception {
if(containsDriver(getDevice(),"/dev/dri/renderD128")) {
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc18_02.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc18_02.java
index c9f48f9..377e219 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc18_02.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc18_02.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,26 +17,33 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc18_02 extends SecurityTestCase {
/**
* b/68953950
*/
- @SecurityTest(minPatchLevel = "2018-02")
- public void testPocCVE_2017_13232() throws Exception {
- AdbUtils.runCommandLine("logcat -c" , getDevice());
- AdbUtils.runPocNoOutput("CVE-2017-13232", getDevice(), 60);
- String logcatOutput = AdbUtils.runCommandLine("logcat -d", getDevice());
- assertNotMatchesMultiLine("APM_AudioPolicyManager: getOutputForAttr\\(\\) " +
- "invalid attributes: usage=.{1,15} content=.{1,15} " +
- "flags=.{1,15} tags=\\[A{256,}\\]", logcatOutput);
- }
+ @Test
+ @SecurityTest(minPatchLevel = "2018-02")
+ public void testPocCVE_2017_13232() throws Exception {
+ AdbUtils.runCommandLine("logcat -c" , getDevice());
+ AdbUtils.runPocNoOutput("CVE-2017-13232", getDevice(), 60);
+ String logcatOutput = AdbUtils.runCommandLine("logcat -d", getDevice());
+ assertNotMatchesMultiLine("APM_AudioPolicyManager: getOutputForAttr\\(\\) " +
+ "invalid attributes: usage=.{1,15} content=.{1,15} " +
+ "flags=.{1,15} tags=\\[A{256,}\\]", logcatOutput);
+ }
/**
* b/65853158
*/
+ @Test
@SecurityTest(minPatchLevel = "2018-02")
public void testPocCVE_2017_13273() throws Exception {
AdbUtils.runCommandLine("dmesg -c" ,getDevice());
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc18_03.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc18_03.java
index f916d7e..d5e2b90 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc18_03.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc18_03.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2019 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,14 +17,21 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc18_03 extends SecurityTestCase {
- /**
- * CVE-2017-13253
- */
- @SecurityTest(minPatchLevel = "2018-03")
- public void testPocCVE_2017_13253() throws Exception {
- AdbUtils.runPocAssertExitStatusNotVulnerable("CVE-2017-13253", getDevice(), 300);
- }
+ /**
+ * b/71389378
+ */
+ @Test
+ @SecurityTest(minPatchLevel = "2018-03")
+ public void testPocCVE_2017_13253() throws Exception {
+ AdbUtils.runPocAssertExitStatusNotVulnerable("CVE-2017-13253", getDevice(), 300);
+ }
}
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc18_04.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc18_04.java
index 99a4692..44b0d89 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc18_04.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc18_04.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,14 +17,20 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc18_04 extends SecurityTestCase {
/**
* b/69683251
* Does not require root but must be a hostside test to avoid
* a race condition
*/
+ @Test
@SecurityTest(minPatchLevel = "2018-04")
public void testPocCVE_2017_13286() throws Exception {
getOomCatcher().setHighMemoryTest();
@@ -35,6 +41,7 @@
* b/69634768
* Does not require root but must be a hostside test to avoid a race condition
*/
+ @Test
@SecurityTest(minPatchLevel = "2018-04")
public void testPocCVE_2017_13288() throws Exception {
getOomCatcher().setHighMemoryTest();
@@ -45,6 +52,7 @@
* b/70398564
* Does not require root but must be a hostside test to avoid a race condition
*/
+ @Test
@SecurityTest(minPatchLevel = "2018-04")
public void testPocCVE_2017_13289() throws Exception {
getOomCatcher().setHighMemoryTest();
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc18_05.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc18_05.java
index 69a4ed5..6b51f0a 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc18_05.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc18_05.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,14 +17,20 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc18_05 extends SecurityTestCase {
/**
* b/70721937
* Does not require root but must be a hostside test to avoid a race
* condition
*/
+ @Test
@SecurityTest(minPatchLevel = "2018-05")
public void testPocCVE_2017_13315() throws Exception {
getOomCatcher().setHighMemoryTest();
@@ -35,6 +41,7 @@
* b/73085795
* Does not require root but must be a hostside test to avoid a race condition
*/
+ @Test
@SecurityTest(minPatchLevel = "2018-05")
public void testPocCVE_2017_13312() throws Exception {
getOomCatcher().setHighMemoryTest();
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc18_06.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc18_06.java
index b270c69..c0aab3b 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc18_06.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc18_06.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2019 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,31 +17,38 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc18_06 extends SecurityTestCase {
- /**
- * CVE-2018-5884
- */
- @SecurityTest(minPatchLevel = "2018-06")
- public void testPocCVE_2018_5884() throws Exception {
- String wfd_service = AdbUtils.runCommandLine(
- "pm list package com.qualcomm.wfd.service", getDevice());
- if (wfd_service.contains("com.qualcomm.wfd.service")) {
- String result = AdbUtils.runCommandLine(
- "am broadcast -a qualcomm.intent.action.WIFI_DISPLAY_BITRATE --ei format 3 --ei value 32",
- getDevice());
- assertNotMatchesMultiLine("Broadcast completed", result);
+ /**
+ * CVE-2018-5884
+ */
+ @Test
+ @SecurityTest(minPatchLevel = "2018-06")
+ public void testPocCVE_2018_5884() throws Exception {
+ String wfd_service = AdbUtils.runCommandLine(
+ "pm list package com.qualcomm.wfd.service", getDevice());
+ if (wfd_service.contains("com.qualcomm.wfd.service")) {
+ String result = AdbUtils.runCommandLine(
+ "am broadcast -a qualcomm.intent.action.WIFI_DISPLAY_BITRATE --ei format 3 --ei value 32",
+ getDevice());
+ assertNotMatchesMultiLine("Broadcast completed", result);
+ }
}
- }
- /**
- * b/73172817
- */
- @SecurityTest
- public void testPocCVE_2018_9344() throws Exception {
- AdbUtils.runPocAssertNoCrashes(
- "CVE-2018-9344", getDevice(), "android\\.hardware\\.drm@\\d\\.\\d-service");
- }
+ /**
+ * b/73172817
+ */
+ @Test
+ @SecurityTest
+ public void testPocCVE_2018_9344() throws Exception {
+ AdbUtils.runPocAssertNoCrashes("CVE-2018-9344", getDevice(),
+ "android\\.hardware\\.cas@\\d+?\\.\\d+?-service");
+ }
}
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc18_07.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc18_07.java
index 173508c..172f0fc 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc18_07.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc18_07.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,17 +14,22 @@
* limitations under the License.
*/
-
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc18_07 extends SecurityTestCase {
/**
* b/76221123
*/
+ @Test
@SecurityTest(minPatchLevel = "2018-07")
public void testPocCVE_2018_9424() throws Exception {
AdbUtils.runPocAssertNoCrashes(
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc18_10.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc18_10.java
index dfc3de0..ef5b726 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc18_10.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc18_10.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,13 +17,19 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc18_10 extends SecurityTestCase {
/**
* b/111641492
*/
+ @Test
@SecurityTest(minPatchLevel = "2018-10")
public void testPocCVE_2018_9515() throws Exception {
AdbUtils.runCommandLine("rm /sdcard/Android/data/CVE-2018-9515", getDevice());
@@ -40,6 +46,7 @@
/**
* b/111274046
*/
+ @Test
@SecurityTest
public void testPocCVE_2018_9490() throws Exception {
int code = AdbUtils.runProxyAutoConfig("CVE-2018-9490", getDevice());
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc18_11.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc18_11.java
index 81911ed..9699b17 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc18_11.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc18_11.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,15 +17,19 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
import static org.junit.Assert.*;
-@SecurityTest
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc18_11 extends SecurityTestCase {
/**
* b/111330641
*/
+ @Test
@SecurityTest(minPatchLevel = "2018-11")
public void testPocCVE_2018_9525() throws Exception {
assertTrue(AdbUtils.runCommandGetExitCode(
@@ -35,6 +39,7 @@
/**
* b/113027383
*/
+ @Test
@SecurityTest(minPatchLevel = "2018-11")
public void testPocCVE_2018_9539() throws Exception {
AdbUtils.runPocAssertExitStatusNotVulnerable("CVE-2018-9539", getDevice(), 300);
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc19_03.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc19_03.java
index 520c9fc..5977b4a 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc19_03.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc19_03.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,16 +17,18 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
-import static org.junit.Assert.assertFalse;
-import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
import org.junit.Test;
import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc19_03 extends SecurityTestCase {
/**
* b/115739809
*/
+ @Test
@SecurityTest(minPatchLevel = "2019-03")
public void testPocBug_115739809() throws Exception {
assertFalse(AdbUtils.runPocCheckExitCode("Bug-115739809", getDevice(), 30));
@@ -35,6 +37,7 @@
/**
* b/116855682
*/
+ @Test
@SecurityTest(minPatchLevel = "2019-03")
public void testPocCVE_2019_2025() throws Exception {
AdbUtils.runPocNoOutput("CVE-2019-2025", getDevice(), 300);
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc19_05.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc19_05.java
index b9be0af..fd3b638 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc19_05.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc19_05.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2019 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,15 +18,18 @@
import android.platform.test.annotations.SecurityTest;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.*;
-@SecurityTest
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc19_05 extends SecurityTestCase {
/**
* b/129556464
*/
+ @Test
@SecurityTest(minPatchLevel = "2019-05")
public void testPocCVE_2019_2052() throws Exception {
int code = AdbUtils.runProxyAutoConfig("CVE-2019-2052", getDevice());
@@ -36,6 +39,7 @@
/**
* b/129556111
*/
+ @Test
@SecurityTest(minPatchLevel = "2019-05")
public void testPocCVE_2019_2045() throws Exception {
int code = AdbUtils.runProxyAutoConfig("CVE-2019-2045", getDevice());
@@ -45,6 +49,7 @@
/*
* b/129556718
*/
+ @Test
@SecurityTest(minPatchLevel = "2019-05")
public void testPocCVE_2019_2047() throws Exception {
int code = AdbUtils.runProxyAutoConfig("CVE-2019-2047", getDevice());
@@ -54,6 +59,7 @@
/**
* CVE-2019-2257
*/
+ @Test
@SecurityTest(minPatchLevel = "2019-05")
public void testPocCVE_2019_2257() throws Exception {
String result = AdbUtils.runCommandLine(
@@ -65,6 +71,7 @@
/**
* b/117555811
*/
+ @Test
@SecurityTest(minPatchLevel = "2019-05")
public void testPocCVE_2019_2051() throws Exception {
int code = AdbUtils.runProxyAutoConfig("CVE-2019-2051", getDevice());
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc19_06.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc19_06.java
index c3651fb..67986fe 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc19_06.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc19_06.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2019 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,13 +17,19 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc19_06 extends SecurityTestCase {
/**
* b/129556445
*/
+ @Test
@SecurityTest(minPatchLevel = "2019-06")
public void testPocCVE_2019_2097() throws Exception {
int code = AdbUtils.runProxyAutoConfig("CVE-2019-2097", getDevice());
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc19_07.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc19_07.java
index 77400a7..3d729f6 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc19_07.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc19_07.java
@@ -16,15 +16,19 @@
package android.security.cts;
-import static org.junit.Assert.assertTrue;
-
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc19_07 extends SecurityTestCase {
/**
* Bug-137282168
*/
+ @Test
@SecurityTest(minPatchLevel = "2019-07")
public void testPocBug_137282168() throws Exception {
assertFalse("Heap buffer overflow encountered",
@@ -34,6 +38,7 @@
/**
* Bug-137878930
*/
+ @Test
@SecurityTest(minPatchLevel = "2019-07")
public void testPocBug_137878930() throws Exception {
assertFalse("Heap use after free encountered",
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc19_08.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc19_08.java
index b7fd2f2..c2ce29d 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc19_08.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc19_08.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2019 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,13 +17,19 @@
package android.security.cts;
import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-@SecurityTest
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc19_08 extends SecurityTestCase {
/**
* b/129556445
*/
+ @Test
@SecurityTest(minPatchLevel = "2019-08")
public void testPocCVE_2019_2130() throws Exception {
int code = AdbUtils.runProxyAutoConfig("CVE-2019-2130", getDevice());
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc19_11.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc19_11.java
index 07257fa..a79e2b1 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc19_11.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc19_11.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2019 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,15 +18,18 @@
import android.platform.test.annotations.SecurityTest;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.*;
-@SecurityTest
+@RunWith(DeviceJUnit4ClassRunner.class)
public class Poc19_11 extends SecurityTestCase {
/**
* b/138441919
*/
+ @Test
@SecurityTest(minPatchLevel = "2019-11")
public void testPocBug_138441919() throws Exception {
int code = AdbUtils.runProxyAutoConfig("bug_138441919", getDevice());
@@ -36,6 +39,7 @@
/**
* b/139806216
*/
+ @Test
@SecurityTest(minPatchLevel = "2019-11")
public void testPocBug_139806216() throws Exception {
int code = AdbUtils.runProxyAutoConfig("bug_139806216", getDevice());
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/SecurityTestCase.java b/hostsidetests/securitybulletin/src/android/security/cts/SecurityTestCase.java
index ee38deb..a605358 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/SecurityTestCase.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/SecurityTestCase.java
@@ -16,19 +16,27 @@
package android.security.cts;
+import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test;
import com.android.tradefed.device.DeviceNotAvailableException;
import com.android.tradefed.device.ITestDevice;
import com.android.tradefed.device.NativeDevice;
-import com.android.tradefed.testtype.DeviceTestCase;
import com.android.tradefed.log.LogUtil.CLog;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
+import com.android.ddmlib.Log;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.runner.RunWith;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
-import com.android.ddmlib.Log;
import java.util.concurrent.Callable;
import java.math.BigInteger;
-public class SecurityTestCase extends DeviceTestCase {
+import static org.junit.Assert.*;
+import static org.junit.Assume.*;
+
+public class SecurityTestCase extends BaseHostJUnit4Test {
private static final String LOG_TAG = "SecurityTestCase";
private static final int RADIX_HEX = 16;
@@ -45,10 +53,8 @@
/**
* Waits for device to be online, marks the most recent boottime of the device
*/
- @Override
+ @Before
public void setUp() throws Exception {
- super.setUp();
-
getDevice().waitForDeviceAvailable();
getDevice().disableAdbRoot();
updateKernelStartTime();
@@ -62,7 +68,7 @@
* Makes sure the phone is online, and the ensure the current boottime is within 2 seconds
* (due to rounding) of the previous boottime to check if The phone has crashed.
*/
- @Override
+ @After
public void tearDown() throws Exception {
oomCatcher.stop(getDevice().getSerialNumber());
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/TestMedia.java b/hostsidetests/securitybulletin/src/android/security/cts/TestMedia.java
index 4dcb055..03a49b7 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/TestMedia.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/TestMedia.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
@@ -18,10 +18,15 @@
import com.android.tradefed.device.ITestDevice;
import com.android.tradefed.log.LogUtil.CLog;
-import android.platform.test.annotations.SecurityTest;
-import java.util.regex.Pattern;
-@SecurityTest
+import android.platform.test.annotations.SecurityTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
+
+import static org.junit.Assert.*;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
public class TestMedia extends SecurityTestCase {
@@ -30,7 +35,6 @@
* existing test methods
******************************************************************************/
-
/******************************************************************************
* To prevent merge conflicts, add tests for O below this comment, before any
* existing test methods