[vts-core] Exempt-From-Owner-Approval: Add vts_security_avb_test to vts-core

Add vts_security_avb_test to vts-core suite and test it by using GTest.

Bug: 132702215
Test: $atest vts_security_avb_test
Change-Id: I1138d64610e5d99a2fc24aa44fba983b83a5537b
diff --git a/avb/Android.bp b/avb/Android.bp
index 98d09b5..33b10ed 100644
--- a/avb/Android.bp
+++ b/avb/Android.bp
@@ -14,8 +14,8 @@
 // limitations under the License.
 //
 
-cc_test {
-    name: "VtsSecurityAvbTest",
+cc_defaults {
+    name: "vts_security_avb_defaults",
     srcs: ["VtsSecurityAvbTest.cpp"],
     shared_libs: [
         "libbase",
@@ -29,6 +29,24 @@
     ],
 }
 
+cc_test {
+    name: "vts_security_avb_test",
+    defaults: ["vts_security_avb_defaults"],
+    test_config: "vts_security_avb_test.xml",
+    test_suites: [
+        "device-tests",
+        "vts-core",
+    ],
+    data: [
+        ":q-gsi_avbpubkey",
+    ],
+}
+
+cc_test {
+    name: "VtsSecurityAvbTest",
+    defaults: ["vts_security_avb_defaults"],
+}
+
 vts_config {
     name: "VtsSecurityAvb",
 }
diff --git a/avb/vts_security_avb_test.xml b/avb/vts_security_avb_test.xml
new file mode 100644
index 0000000..5254c1a
--- /dev/null
+++ b/avb/vts_security_avb_test.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 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="Config for vts_security_avb_test">
+    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
+    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+        <option name="cleanup" value="true" />
+        <option name="push" value="vts_security_avb_test->/data/local/tmp/vts_security_avb_test" />
+        <option name="push" value="q-gsi.avbpubkey->/data/local/tmp/gsi.avbpubkey" />
+    </target_preparer>
+    <option name="test-suite-tag" value="vts-core" />
+    <test class="com.android.tradefed.testtype.GTest" >
+        <option name="native-test-device-path" value="/data/local/tmp" />
+        <option name="module-name" value="vts_security_avb_test" />
+    </test>
+    <object type="module_controller" class="com.android.tradefed.testtype.suite.module.MinApiLevelModuleController" >
+        <option name="api-level-prop" value="ro.product.first_api_level"/>
+        <option name="min-api-level" value="29"/>
+    </object>
+</configuration>