Split Conscrypt MTS into user and eng-only test lists.

[Moved from AOSP due to merge conflicts]

Bug: 235453983
Test: m mts && mts-tradefed run mts-conscrypt
Change-Id: Idc819c089a6746fab3dc0c7bf5a099549262c638
diff --git a/tools/mts-tradefed/res/config/mts-conscrypt-tests-list-eng-only.xml b/tools/mts-tradefed/res/config/mts-conscrypt-tests-list-eng-only.xml
new file mode 100644
index 0000000..575a123
--- /dev/null
+++ b/tools/mts-tradefed/res/config/mts-conscrypt-tests-list-eng-only.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<configuration description="List of MTS Conscrypt tests requiring eng build.">
+    <option name="compatibility:include-filter" value="boringssl_crypto_test" />
+    <option name="compatibility:include-filter" value="boringssl_ssl_test" />
+</configuration>
+
diff --git a/tools/mts-tradefed/res/config/mts-conscrypt-tests-list.xml b/tools/mts-tradefed/res/config/mts-conscrypt-tests-list-user.xml
similarity index 85%
rename from tools/mts-tradefed/res/config/mts-conscrypt-tests-list.xml
rename to tools/mts-tradefed/res/config/mts-conscrypt-tests-list-user.xml
index d61c506..4d79397 100644
--- a/tools/mts-tradefed/res/config/mts-conscrypt-tests-list.xml
+++ b/tools/mts-tradefed/res/config/mts-conscrypt-tests-list-user.xml
@@ -13,9 +13,7 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="List MTS conscrypt tests.">
-    <option name="compatibility:include-filter" value="boringssl_crypto_test" />
-    <option name="compatibility:include-filter" value="boringssl_ssl_test" />
+<configuration description="List of MTS Conscrypt tests that can run on user builds.">
     <option name="compatibility:include-filter" value="CtsLibcoreOkHttpTestCases" />
     <option name="compatibility:include-filter" value="MtsConscryptTestCases" />
     <option name="compatibility:include-filter" value="MtsConscryptFdSocketTestCases" />
diff --git a/tools/mts-tradefed/res/config/mts-conscrypt.xml b/tools/mts-tradefed/res/config/mts-conscrypt.xml
index a91837e..40e1452 100644
--- a/tools/mts-tradefed/res/config/mts-conscrypt.xml
+++ b/tools/mts-tradefed/res/config/mts-conscrypt.xml
@@ -17,8 +17,14 @@
 
     <include name="mts" />
 
-    <include name="mts-conscrypt-tests-list" />
+    <include name="mts-conscrypt-tests-list-eng-only" />
+    <include name="mts-conscrypt-tests-list-user" />
 
     <option name="plan" value="mts-conscrypt" />
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.PropertyCheck">
+        <option name="property-name" value="ro.build.type" />
+        <option name="expected-value" value="userdebug"/> <!-- Device should have userdebug/eng build -->
+        <option name="throw-error" value="false"/> <!-- Only print warning if not user build -->
+    </target_preparer>
 </configuration>
 
diff --git a/tools/mts-tradefed/res/config/mts-tests-list-eng-only.xml b/tools/mts-tradefed/res/config/mts-tests-list-eng-only.xml
index 02d0723..4243bb2 100644
--- a/tools/mts-tradefed/res/config/mts-tests-list-eng-only.xml
+++ b/tools/mts-tradefed/res/config/mts-tests-list-eng-only.xml
@@ -16,6 +16,7 @@
 <configuration description="List tests that need root access.">
     <include name="mts-adbd-tests-list-eng-only" />
     <include name="mts-art-tests-list-eng-only" />
+    <include name="mts-conscrypt-tests-list-eng-only" />
     <include name="mts-core-tests-list-eng-only" />
     <include name="mts-dnsresolver-tests-list-eng-only" />
     <include name="mts-documentsUI-usedapi-tests-list-eng-only" />
diff --git a/tools/mts-tradefed/res/config/mts-tests-list-user.xml b/tools/mts-tradefed/res/config/mts-tests-list-user.xml
index 46d25a5..15a08ff 100644
--- a/tools/mts-tradefed/res/config/mts-tests-list-user.xml
+++ b/tools/mts-tradefed/res/config/mts-tests-list-user.xml
@@ -18,7 +18,7 @@
     <include name="mts-art-tests-list-user" />
     <include name="mts-bluetooth-tests-list" />
     <include name="mts-cellbroadcast-oem-tests-list" />
-    <include name="mts-conscrypt-tests-list" />
+    <include name="mts-conscrypt-tests-list-user" />
     <include name="mts-core-tests-list-user" />
     <include name="mts-dnsresolver-tests-list-user" />
     <include name="mts-documentsUI-oem-tests-list" />