summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHridya Valsaraju <hridya@google.com>2019-03-25 15:48:38 -0700
committerHridya Valsaraju <hridya@google.com>2019-03-25 23:02:11 +0000
commit5469c04666df1864f5abac05a1d64cdd410ddf89 (patch)
tree8d1f4b782f30fac0c980c0fe3ac5788e2080bfc0
parent1675e20e5e216f3a253b710de10dc37c75ad2847 (diff)
downloadplatform_test_vts-testcase_kernel-5469c04666df1864f5abac05a1d64cdd410ddf89.tar.gz
platform_test_vts-testcase_kernel-5469c04666df1864f5abac05a1d64cdd410ddf89.tar.bz2
platform_test_vts-testcase_kernel-5469c04666df1864f5abac05a1d64cdd410ddf89.zip
Add a test to verify if dynamic partitions are enabled.
This test checks the sysprop ro.boot.dynamic_partitions to ensure that dynamic partitions are enabled for Q-launched devices. Test: vts-tradefed run commandAndExit vts-kernel --primary-abi-only --module VtsKernelDynamicPartitionsTest Bug: 129294743 Change-Id: I07a794a994ed2036f84698c97e251c9719ff5a2f
-rw-r--r--dynamic_partitions/Android.mk23
-rw-r--r--dynamic_partitions/AndroidTest.xml26
-rw-r--r--dynamic_partitions/VtsKernelDynamicPartitionsTest.py42
-rw-r--r--dynamic_partitions/__init__.py0
4 files changed, 91 insertions, 0 deletions
diff --git a/dynamic_partitions/Android.mk b/dynamic_partitions/Android.mk
new file mode 100644
index 00000000..e491b0ca
--- /dev/null
+++ b/dynamic_partitions/Android.mk
@@ -0,0 +1,23 @@
+#
+# 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.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := VtsKernelDynamicPartitionsTest
+VTS_CONFIG_SRC_DIR := testcases/kernel/dynamic_partitions
+-include test/vts/tools/build/Android.host_config.mk
diff --git a/dynamic_partitions/AndroidTest.xml b/dynamic_partitions/AndroidTest.xml
new file mode 100644
index 00000000..ebe4d235
--- /dev/null
+++ b/dynamic_partitions/AndroidTest.xml
@@ -0,0 +1,26 @@
+<?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 KernelApiTest test cases">
+ <option name="config-descriptor:metadata" key="plan" value="vts-kernel" />
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="push-group" value="HostDrivenTest.push" />
+ </target_preparer>
+ <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+ <option name="test-module-name" value="VtsKernelDynamicPartitionsTest" />
+ <option name="test-case-path" value="vts/testcases/kernel/dynamic_partitions/VtsKernelDynamicPartitionsTest" />
+ <option name="precondition-first-api-level" value="29" />
+ </test>
+</configuration>
diff --git a/dynamic_partitions/VtsKernelDynamicPartitionsTest.py b/dynamic_partitions/VtsKernelDynamicPartitionsTest.py
new file mode 100644
index 00000000..e61e06fd
--- /dev/null
+++ b/dynamic_partitions/VtsKernelDynamicPartitionsTest.py
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+#
+# 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.
+#
+
+"""A test to check if dynamic partitions is enabled for new devices in Q."""
+
+from vts.runners.host import asserts
+from vts.runners.host import base_test
+from vts.runners.host import test_runner
+
+# The property to indicate dynamic partitions are enabled.
+_DYNAMIC_PARTITIONS_PROP = "ro.boot.dynamic_partitions"
+
+
+class VtsKernelDynamicPartitionsTest(base_test.BaseTestClass):
+ """A test class to verify dynamic partitions are enabled."""
+
+ def setUpClass(self):
+ """Initializes device and shell."""
+ self._dut = self.android_devices[0]
+
+ def testDynamicPartitionsSysProp(self):
+ """Checks ro.build.dynamic_partitions is 'true'."""
+ asserts.assertEqual("true",
+ self._dut.getProp(_DYNAMIC_PARTITIONS_PROP),
+ "%s is not true" % _DYNAMIC_PARTITIONS_PROP)
+
+if __name__ == "__main__":
+ test_runner.main()
diff --git a/dynamic_partitions/__init__.py b/dynamic_partitions/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/dynamic_partitions/__init__.py