From af297436e294a9a54bcf9c2c81bdb70d22ab680d Mon Sep 17 00:00:00 2001 From: Keun Soo Yim Date: Thu, 19 Jan 2017 17:07:11 -0800 Subject: [PATCH] Specify username for a target-side driver. Test: make vts -j30 BUILD_GOOGLE_VTS=true && vts-tradefed run commandAndExit vts --skip-all-system-status-check --primary-abi-only --skip-preconditions --module VehicleHidlTest -l INFO Bug: 34360420 Change-Id: Ic9567b588d6d2565014ad145c1d52fadb4082304 --- .../vts/testcases/hal/vehicle/hidl/host/VehicleHidlTest.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 5faf78a2a8..cd52abfc12 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 @@ -20,6 +20,7 @@ import time from vts.runners.host import asserts from vts.runners.host import base_test_with_webdb +from vts.runners.host import const from vts.runners.host import test_runner from vts.utils.python.controllers import android_device from vts.utils.python.profiling import profiling_utils @@ -35,6 +36,10 @@ class VehicleHidlTest(base_test_with_webdb.BaseTestWithWebDbClass): self.dut.shell.InvokeTerminal("one") self.dut.shell.one.Execute("setenforce 0") # SELinux permissive mode + results = self.dut.shell.one.Execute("id -u system") + system_uid = results[const.STDOUT][0].strip() + logging.info("system_uid: %s", system_uid) + self.dut.hal.InitHidlHal( target_type="vehicle", target_basepaths=self.dut.libPaths, @@ -45,6 +50,7 @@ class VehicleHidlTest(base_test_with_webdb.BaseTestWithWebDbClass): bits=64 if self.dut.is64Bit else 32) self.vehicle = self.dut.hal.vehicle # shortcut + self.vehicle.SetCallerUid(system_uid) self.vtypes = self.dut.hal.vehicle.GetHidlTypeInterface("types") logging.info("vehicle types: %s", self.vtypes)