Merge "[vts-core] add VtsKernelKheaders and VtsKernelLoopConfigTest to vts-core"
diff --git a/api/bpf_native_test/BpfTest.cpp b/api/bpf_native_test/BpfTest.cpp
index 64b0c7f..8427e4a 100644
--- a/api/bpf_native_test/BpfTest.cpp
+++ b/api/bpf_native_test/BpfTest.cpp
@@ -137,9 +137,9 @@
     ASSERT_EQ(0, access(progSrcPath.c_str(), R_OK) ? errno : 0);
     ASSERT_EQ(0, android::bpf::loadProg(progSrcPath.c_str()));
 
-    EXPECT_TRUE(cookieStatsMap[0].init(TEST_STATS_MAP_A_PATH));
-    EXPECT_TRUE(cookieStatsMap[1].init(TEST_STATS_MAP_B_PATH));
-    EXPECT_TRUE(configurationMap.init(TEST_CONFIGURATION_MAP_PATH));
+    EXPECT_RESULT_OK(cookieStatsMap[0].init(TEST_STATS_MAP_A_PATH));
+    EXPECT_RESULT_OK(cookieStatsMap[1].init(TEST_STATS_MAP_B_PATH));
+    EXPECT_RESULT_OK(configurationMap.init(TEST_CONFIGURATION_MAP_PATH));
     EXPECT_TRUE(cookieStatsMap[0].isValid());
     EXPECT_TRUE(cookieStatsMap[1].isValid());
     EXPECT_TRUE(configurationMap.isValid());
@@ -147,7 +147,7 @@
     // attached to the socket.
     stop = false;
     int prog_fd = bpfFdGet(TEST_PROG_PATH, 0);
-    EXPECT_TRUE(configurationMap.writeValue(ACTIVE_MAP_KEY, 0, BPF_ANY));
+    EXPECT_RESULT_OK(configurationMap.writeValue(ACTIVE_MAP_KEY, 0, BPF_ANY));
 
     for (int i = 0; i < NUM_SOCKETS; i++) {
       tds[i] = std::thread(workerThread, prog_fd, &stop);
@@ -177,7 +177,7 @@
             1000) < seconds) {
       // Check if the vacant map is empty based on the current configuration.
       auto isEmpty = cookieStatsMap[i].isEmpty();
-      ASSERT_TRUE(isEmpty);
+      ASSERT_RESULT_OK(isEmpty);
       if (expectSynchronized) {
         // The map should always be empty because synchronizeKernelRCU should
         // ensure that the BPF programs running on all cores have seen the write
@@ -193,13 +193,13 @@
 
       // Change the configuration and wait for rcu grace period.
       i ^= 1;
-      ASSERT_TRUE(configurationMap.writeValue(ACTIVE_MAP_KEY, i, BPF_ANY));
+      ASSERT_RESULT_OK(configurationMap.writeValue(ACTIVE_MAP_KEY, i, BPF_ANY));
       if (expectSynchronized) {
         EXPECT_EQ(0, synchronizeKernelRCU());
       }
 
       // Clean up the previous map after map swap.
-      EXPECT_TRUE(cookieStatsMap[i].clear());
+      EXPECT_RESULT_OK(cookieStatsMap[i].clear());
     }
     if (!expectSynchronized) {
       auto test_end = std::chrono::system_clock::now();
diff --git a/toolchain/Android.bp b/toolchain/Android.bp
index cd0bc1e..f892308 100644
--- a/toolchain/Android.bp
+++ b/toolchain/Android.bp
@@ -25,6 +25,12 @@
     static_libs: [
         "libgmock",
     ],
+    test_suites: [
+        "device-tests",
+        "vts-core"
+    ],
+    require_root: true,
+    auto_gen_config: true,
 }
 
 vts_config {