summaryrefslogtreecommitdiffstats
path: root/vehicle
diff options
context:
space:
mode:
authorPavel Maltsev <pavelm@google.com>2017-01-06 13:57:36 -0800
committerKeun Soo Yim <yim@google.com>2017-01-09 19:33:08 +0000
commit9a23ee670c9983574039f098c0def668b05e8465 (patch)
treed258ace9e096ece985c2fa7830cdfc60cb1928a8 /vehicle
parent879cd899986133220a5fa309ca9710bde634b399 (diff)
downloadandroid_hardware_interfaces-9a23ee670c9983574039f098c0def668b05e8465.tar.gz
android_hardware_interfaces-9a23ee670c9983574039f098c0def668b05e8465.tar.bz2
android_hardware_interfaces-9a23ee670c9983574039f098c0def668b05e8465.zip
Add VTS case for mandatory props in Vehicle HAL
Bug: b/33581262 Test: this is VTS test. Change-Id: I71eae5dec0af3dc461698a147870d4c8fc7de7f4
Diffstat (limited to 'vehicle')
-rw-r--r--vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/VehicleHidlTest.py32
1 files changed, 26 insertions, 6 deletions
diff --git a/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/VehicleHidlTest.py b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/VehicleHidlTest.py
index e17c72d70..715cba840 100644
--- a/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/VehicleHidlTest.py
+++ b/vehicle/2.0/vts/functional/vts/testcases/hal/vehicle/hidl/host/VehicleHidlTest.py
@@ -47,9 +47,15 @@ class VehicleHidlTest(base_test_with_webdb.BaseTestWithWebDbClass):
hw_binder_service_name="Vehicle",
bits=64 if self.dut.is64Bit else 32)
+ self.vehicle = self.dut.hal.vehicle # shortcut
+ self.vtypes = self.dut.hal.vehicle.GetHidlTypeInterface("types")
+ logging.info("vehicle types: %s", self.vtypes)
+
def tearDownClass(self):
- """ If profiling is enabled for the test, collect the profiling data
- and disable profiling after the test is done.
+ """Disables the profiling.
+
+ If profiling is enabled for the test, collect the profiling data
+ and disable profiling after the test is done.
"""
if self.enable_profiling:
profiling_trace_path = getattr(
@@ -58,12 +64,26 @@ class VehicleHidlTest(base_test_with_webdb.BaseTestWithWebDbClass):
profiling_utils.DisableVTSProfiling(self.dut.shell.one)
def testListProperties(self):
- logging.info("vehicle_types")
- vehicle_types = self.dut.hal.vehicle.GetHidlTypeInterface("types")
- logging.info("vehicle_types: %s", vehicle_types)
+ """Checks whether some PropConfigs are returned.
- allConfigs = self.dut.hal.vehicle.getAllPropConfigs()
+ Verifies that call to getAllPropConfigs is not failing and
+ it returns at least 1 vehicle property config.
+ """
+ allConfigs = self.vehicle.getAllPropConfigs()
logging.info("all supported properties: %s", allConfigs)
+ asserts.assertLess(0, len(allConfigs))
+
+ def testMandatoryProperties(self):
+ """Verifies that all mandatory properties are supported."""
+ mandatoryProps = set([self.vtypes.DRIVING_STATUS]) # 1 property so far
+ logging.info(self.vtypes.DRIVING_STATUS)
+ allConfigs = self.dut.hal.vehicle.getAllPropConfigs()
+
+ for config in allConfigs:
+ mandatoryProps.discard(config['prop'])
+
+ asserts.assertEqual(0, len(mandatoryProps))
+
if __name__ == "__main__":
test_runner.main()