diff options
-rw-r--r-- | api/sysfs/OWNERS | 3 | ||||
-rw-r--r-- | api/sysfs/src/com/android/tests/sysfs/KernelApiSysfsTest.java | 12 | ||||
-rw-r--r-- | linux_kselftest/OWNERS | 3 | ||||
-rw-r--r-- | linux_kselftest/testcases/OWNERS | 3 | ||||
-rw-r--r-- | linux_kselftest/testcases/vts_linux_kselftest_arm_32.xml | 4 | ||||
-rw-r--r-- | linux_kselftest/testcases/vts_linux_kselftest_arm_64.xml | 4 | ||||
-rw-r--r-- | linux_kselftest/testcases/vts_linux_kselftest_x86_32.xml | 4 | ||||
-rw-r--r-- | linux_kselftest/testcases/vts_linux_kselftest_x86_64.xml | 4 | ||||
-rw-r--r-- | loop/Android.bp | 4 | ||||
-rw-r--r-- | loop/vts_kernel_loopconfig_test.cpp | 51 | ||||
-rw-r--r-- | ltp/OWNERS | 3 | ||||
-rw-r--r-- | ltp/testcase/OWNERS | 3 | ||||
-rw-r--r-- | ltp/testcase/tools/configs/stable_tests.py | 2 |
13 files changed, 78 insertions, 22 deletions
diff --git a/api/sysfs/OWNERS b/api/sysfs/OWNERS index e4b9e91a..85b9a12b 100644 --- a/api/sysfs/OWNERS +++ b/api/sysfs/OWNERS @@ -1,2 +1,3 @@ # Bug component: 391836 -smuckle@google.com +vmartensson@google.com +edliaw@google.com diff --git a/api/sysfs/src/com/android/tests/sysfs/KernelApiSysfsTest.java b/api/sysfs/src/com/android/tests/sysfs/KernelApiSysfsTest.java index 105560aa..35de7b30 100644 --- a/api/sysfs/src/com/android/tests/sysfs/KernelApiSysfsTest.java +++ b/api/sysfs/src/com/android/tests/sysfs/KernelApiSysfsTest.java @@ -27,6 +27,7 @@ import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test; import com.android.tradefed.util.FileUtil; import com.android.tradefed.util.TargetFileUtils; import com.android.tradefed.util.TargetFileUtils.FilePermission; +import com.android.tradefed.log.LogUtil.CLog; import com.google.common.base.Strings; import java.util.ArrayList; import java.util.Arrays; @@ -282,6 +283,17 @@ public class KernelApiSysfsTest extends BaseHostJUnit4Test { if ((kernel_major < 5) || ((kernel_major == 5) && (kernel_minor < 10))) return; + String executeShellKernelARM64 = + "cat /proc/config.gz | gzip -d | grep CONFIG_ARM64=y"; + + boolean isKernelARM64 = getDevice().executeShellCommand(executeShellKernelARM64) + .contains("CONFIG_ARM64"); + + if (!isKernelARM64) { + CLog.d("Kernel not 64bit skip"); + return; + } + String filePath = "/sys/module/kfence/parameters/sample_interval"; assertTrue("Failed readwrite check of " + filePath, TargetFileUtils.isReadWriteOnly(filePath, getDevice())); diff --git a/linux_kselftest/OWNERS b/linux_kselftest/OWNERS index e4b9e91a..85b9a12b 100644 --- a/linux_kselftest/OWNERS +++ b/linux_kselftest/OWNERS @@ -1,2 +1,3 @@ # Bug component: 391836 -smuckle@google.com +vmartensson@google.com +edliaw@google.com diff --git a/linux_kselftest/testcases/OWNERS b/linux_kselftest/testcases/OWNERS index f21a0289..1f6a1316 100644 --- a/linux_kselftest/testcases/OWNERS +++ b/linux_kselftest/testcases/OWNERS @@ -1,4 +1,5 @@ # Bug component: 391836 -smuckle@google.com +vmartensson@google.com +edliaw@google.com henneman@google.com diff --git a/linux_kselftest/testcases/vts_linux_kselftest_arm_32.xml b/linux_kselftest/testcases/vts_linux_kselftest_arm_32.xml index 45740541..75426602 100644 --- a/linux_kselftest/testcases/vts_linux_kselftest_arm_32.xml +++ b/linux_kselftest/testcases/vts_linux_kselftest_arm_32.xml @@ -14,8 +14,8 @@ <!ENTITY ktest_dir "/data/local/tmp/vts_kernel_tests/DATA/nativetest/linux-kselftest"> ]> <configuration description="Runs vts_linux_kselftest."> - <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"> - </target_preparer> + <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" /> + <target_preparer class="com.android.tradefed.targetprep.StopServicesSetup" /> <object type="module_controller" class="com.android.tradefed.testtype.suite.module.KernelTestModuleController" > <option name="arch" value="arm"/> diff --git a/linux_kselftest/testcases/vts_linux_kselftest_arm_64.xml b/linux_kselftest/testcases/vts_linux_kselftest_arm_64.xml index fa5237b5..2a33f2c2 100644 --- a/linux_kselftest/testcases/vts_linux_kselftest_arm_64.xml +++ b/linux_kselftest/testcases/vts_linux_kselftest_arm_64.xml @@ -14,8 +14,8 @@ <!ENTITY ktest_dir "/data/local/tmp/vts_kernel_tests/DATA/nativetest64/linux-kselftest"> ]> <configuration description="Runs vts_linux_kselftest."> - <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"> - </target_preparer> + <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" /> + <target_preparer class="com.android.tradefed.targetprep.StopServicesSetup" /> <object type="module_controller" class="com.android.tradefed.testtype.suite.module.KernelTestModuleController" > <option name="arch" value="arm64"/> diff --git a/linux_kselftest/testcases/vts_linux_kselftest_x86_32.xml b/linux_kselftest/testcases/vts_linux_kselftest_x86_32.xml index 65ffc656..01375908 100644 --- a/linux_kselftest/testcases/vts_linux_kselftest_x86_32.xml +++ b/linux_kselftest/testcases/vts_linux_kselftest_x86_32.xml @@ -14,8 +14,8 @@ <!ENTITY ktest_dir "/data/local/tmp/vts_kernel_tests/DATA/nativetest/linux-kselftest"> ]> <configuration description="Runs vts_linux_kselftest."> - <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"> - </target_preparer> + <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" /> + <target_preparer class="com.android.tradefed.targetprep.StopServicesSetup" /> <object type="module_controller" class="com.android.tradefed.testtype.suite.module.KernelTestModuleController" > <option name="arch" value="x86"/> diff --git a/linux_kselftest/testcases/vts_linux_kselftest_x86_64.xml b/linux_kselftest/testcases/vts_linux_kselftest_x86_64.xml index 2cadfbeb..2022e27c 100644 --- a/linux_kselftest/testcases/vts_linux_kselftest_x86_64.xml +++ b/linux_kselftest/testcases/vts_linux_kselftest_x86_64.xml @@ -14,8 +14,8 @@ <!ENTITY ktest_dir "/data/local/tmp/vts_kernel_tests/DATA/nativetest64/linux-kselftest"> ]> <configuration description="Runs vts_linux_kselftest."> - <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"> - </target_preparer> + <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" /> + <target_preparer class="com.android.tradefed.targetprep.StopServicesSetup" /> <object type="module_controller" class="com.android.tradefed.testtype.suite.module.KernelTestModuleController" > <option name="arch" value="x86_64"/> diff --git a/loop/Android.bp b/loop/Android.bp index 48a95ac4..35756f2b 100644 --- a/loop/Android.bp +++ b/loop/Android.bp @@ -18,6 +18,9 @@ package { cc_test { name: "vts_kernel_loopconfig_test", + defaults: [ + "libvintf_static_user_defaults", + ], srcs: ["vts_kernel_loopconfig_test.cpp"], cflags: [ "-Wall", @@ -28,6 +31,7 @@ cc_test { ], static_libs: [ "libgmock", + "libvintf", ], test_suites: [ "general-tests", diff --git a/loop/vts_kernel_loopconfig_test.cpp b/loop/vts_kernel_loopconfig_test.cpp index 8105a83f..1abe17fa 100644 --- a/loop/vts_kernel_loopconfig_test.cpp +++ b/loop/vts_kernel_loopconfig_test.cpp @@ -19,10 +19,16 @@ #include <fstream> #include <string> +#include <android-base/parseint.h> #include <android-base/properties.h> #include <android/api-level.h> #include <gmock/gmock.h> #include <gtest/gtest.h> +#include <vintf/VintfObject.h> + +using android::vintf::KernelVersion; +using android::vintf::VintfObject; +using android::base::ParseInt; namespace android { namespace kernel { @@ -39,7 +45,7 @@ class KernelLoopConfigTest : public ::testing::Test { } }; -TEST_F(KernelLoopConfigTest, ValidLoopConfig) { +TEST_F(KernelLoopConfigTest, ValidLoopCountConfig) { if (!should_run()) return; static constexpr const char* kCmd = @@ -60,25 +66,54 @@ TEST_F(KernelLoopConfigTest, ValidLoopConfig) { int minCountValue = std::stoi(minCountStr.substr(pos + 1)); ASSERT_GE(minCountValue, 16); + + std::ifstream max_loop("/sys/module/loop/parameters/max_loop"); + + std::string max_loop_str; + + std::getline(max_loop, max_loop_str); + + int max_loop_value; + + ParseInt(max_loop_str, &max_loop_value); + + auto runtime_info = VintfObject::GetRuntimeInfo(); + ASSERT_NE(nullptr, runtime_info); + + /* + * Upstream commit 85c50197716c ("loop: Fix the max_loop commandline argument + * treatment when it is set to 0") aligned max_loop to the kernel + * documentation, which states that when it is not set, it should be + * CONFIG_BLK_DEV_LOOP_MIN_COUNT instead of 0. This commit was applied to + * kernels 5.15.86+. + * + * For kernels older than 5.15.86, ensure that max_loop is not set by ensuring + * that it is 0. This ensures that CONFIG_BLK_DEV_LOOP_MIN_COUNT are being + * pre-allocated. + * + * For kernels 5.15.86+ ensure that max_loop is either not set (i.e. it is + * CONFIG_BLK_DEV_LOOP_MIN_COUNT), or if it is set, it s greater than + * CONFIG_BLK_DEV_LOOP_MIN_COUNT to ensure that at least that many loop + * devices are pre-allocated. + */ + if (runtime_info->kernelVersion() < KernelVersion(5, 15, 86)) { + EXPECT_EQ(0, max_loop_value); + } else { + EXPECT_GE(max_loop_value, minCountValue); + } } -TEST_F(KernelLoopConfigTest, ValidLoopParameters) { +TEST_F(KernelLoopConfigTest, ValidLoopPartParameter) { if (!should_run()) return; - std::ifstream max_loop("/sys/module/loop/parameters/max_loop"); std::ifstream max_part("/sys/module/loop/parameters/max_part"); - std::string max_loop_str; std::string max_part_str; - std::getline(max_loop, max_loop_str); std::getline(max_part, max_part_str); int max_part_value = std::stoi(max_part_str); EXPECT_LE(max_part_value, 7); - - int max_loop_value = std::stoi(max_loop_str); - EXPECT_EQ(0, max_loop_value); } } // namespace kernel @@ -1,3 +1,4 @@ # Bug component: 391836 +vmartensson@google.com balsini@google.com -smuckle@google.com +edliaw@google.com diff --git a/ltp/testcase/OWNERS b/ltp/testcase/OWNERS index cce55879..40889183 100644 --- a/ltp/testcase/OWNERS +++ b/ltp/testcase/OWNERS @@ -1,3 +1,4 @@ # Bug component: 391836 -smuckle@google.com +vmartensson@google.com balsini@google.com +edliaw@google.com diff --git a/ltp/testcase/tools/configs/stable_tests.py b/ltp/testcase/tools/configs/stable_tests.py index e652471e..9bc3f2bc 100644 --- a/ltp/testcase/tools/configs/stable_tests.py +++ b/ltp/testcase/tools/configs/stable_tests.py @@ -726,7 +726,7 @@ STABLE_TESTS = [ ('syscalls.clock_gettime02_64bit', True), ('syscalls.clock_gettime03_32bit', True), ('syscalls.clock_gettime03_64bit', True), - ('syscalls.clock_gettime04_32bit', True), + ('syscalls.clock_gettime04_32bit', False), ('syscalls.clock_gettime04_64bit', True), ('syscalls.clock_nanosleep01_32bit', True), ('syscalls.clock_nanosleep01_64bit', True), |