Merge "vts test project init for radio hal"
diff --git a/radio/1.0/vts/Android.mk b/radio/1.0/vts/Android.mk
index df5dac8..4e1fb84 100644
--- a/radio/1.0/vts/Android.mk
+++ b/radio/1.0/vts/Android.mk
@@ -16,4 +16,4 @@
LOCAL_PATH := $(call my-dir)
-include $(call all-subdir-makefiles)
\ No newline at end of file
+include $(LOCAL_PATH)/functional/vts/testcases/hal/radio/hidl/Android.mk
\ No newline at end of file
diff --git a/radio/1.0/vts/functional/vts/testcases/hal/radio/__init__.py b/radio/1.0/vts/functional/vts/testcases/hal/radio/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/radio/1.0/vts/functional/vts/testcases/hal/radio/__init__.py
diff --git a/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/Android.mk b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/Android.mk
new file mode 100644
index 0000000..f9e3276
--- /dev/null
+++ b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/Android.mk
@@ -0,0 +1,19 @@
+#
+# Copyright (C) 2016 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 $(call all-subdir-makefiles)
diff --git a/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/__init__.py b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/__init__.py
diff --git a/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/Android.mk b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/Android.mk
new file mode 100644
index 0000000..59f7c85
--- /dev/null
+++ b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/Android.mk
@@ -0,0 +1,23 @@
+#
+# Copyright (C) 2016 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 := RadioHidlTest
+VTS_CONFIG_SRC_DIR := testcases/hal/radio/hidl/host
+include test/vts/tools/build/Android.host_config.mk
\ No newline at end of file
diff --git a/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/AndroidTest.xml b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/AndroidTest.xml
new file mode 100644
index 0000000..a826d20
--- /dev/null
+++ b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/AndroidTest.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2017 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 HAL Radio test cases">
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="push-group" value="HidlHalTest.push" />
+ <option name="cleanup" value="true" />
+ <option name="push" value="spec/hardware/interfaces/radio/1.0/vts/Radio.vts->/data/local/tmp/spec/Radio.vts" />
+ <option name="push" value="spec/hardware/interfaces/radio/1.0/vts/RadioIndication.vts->/data/local/tmp/spec/RadioIndication.vts" />
+ <option name="push" value="spec/hardware/interfaces/radio/1.0/vts/RadioResponse.vts->/data/local/tmp/spec/RadioResponse.vts" />
+ <option name="push" value="spec/hardware/interfaces/radio/1.0/vts/Sap.vts->/data/local/tmp/spec/Sap.vts" />
+ <option name="push" value="spec/hardware/interfaces/radio/1.0/vts/SapCallback.vts->/data/local/tmp/spec/SapCallback.vts" />
+ <option name="push" value="spec/hardware/interfaces/radio/1.0/vts/types.vts->/data/local/tmp/spec/types.vts" />
+ </target_preparer>
+ <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+ <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+ <option name="test-module-name" value="RadioHidlTest" />
+ <option name="test-case-path" value="vts/testcases/hal/radio/hidl/host/RadioHidlTest" />
+ </test>
+</configuration>
diff --git a/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/RadioHidlTest.py b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/RadioHidlTest.py
new file mode 100644
index 0000000..33dac35
--- /dev/null
+++ b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/RadioHidlTest.py
@@ -0,0 +1,71 @@
+#!/usr/bin/env python3.4
+#
+# Copyright (C) 2016 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.
+#
+
+import logging
+import time
+
+from vts.runners.host import asserts
+from vts.runners.host import base_test_with_webdb
+from vts.runners.host import test_runner
+from vts.utils.python.controllers import android_device
+from vts.utils.python.profiling import profiling_utils
+
+
+class VehicleHidlTest(base_test_with_webdb.BaseTestWithWebDbClass):
+ """A simple testcase for the VEHICLE HIDL HAL."""
+
+ def setUpClass(self):
+ """Creates a mirror and init vehicle hal."""
+ self.dut = self.registerController(android_device)[0]
+
+ self.dut.shell.InvokeTerminal("one")
+ self.dut.shell.one.Execute("setenforce 0") # SELinux permissive mode
+
+ if self.enable_profiling:
+ profiling_utils.EnableVTSProfiling(self.dut.shell.one)
+
+ self.dut.hal.InitHidlHal(
+ target_type="radio",
+ target_basepaths=self.dut.libPaths,
+ target_version=1.0,
+ target_package="android.hardware.radio",
+ target_component_name="IRadio",
+ hw_binder_service_name="Radio",
+ bits=64 if self.dut.is64Bit else 32)
+
+ self.radio = self.dut.hal.radio # shortcut
+ self.radio_types = self.dut.hal.radio.GetHidlTypeInterface("types")
+ logging.info("Radio types: %s", self.radio_types)
+
+ def tearDownClass(self):
+ """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(
+ self, self.VTS_PROFILING_TRACING_PATH, "")
+ self.ProcessAndUploadTraceData(self.dut, profiling_trace_path)
+ profiling_utils.DisableVTSProfiling(self.dut.shell.one)
+
+ def testHelloWorld(self):
+ logging.info('hello world')
+
+
+if __name__ == "__main__":
+ test_runner.main()
diff --git a/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/__init__.py b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/radio/1.0/vts/functional/vts/testcases/hal/radio/hidl/host/__init__.py
diff --git a/radio/1.0/vts/types.vts b/radio/1.0/vts/types.vts
index cec9b6d..c11db63 100644
--- a/radio/1.0/vts/types.vts
+++ b/radio/1.0/vts/types.vts
@@ -2730,23 +2730,23 @@
enumerator: "GSM"
scalar_value: {
- int32_t: 0
+ int32_t: 1
}
enumerator: "CDMA"
scalar_value: {
- int32_t: 1
+ int32_t: 2
}
enumerator: "LTE"
scalar_value: {
- int32_t: 2
+ int32_t: 3
}
enumerator: "WCDMA"
scalar_value: {
- int32_t: 3
+ int32_t: 4
}
enumerator: "TD_SCDMA"
scalar_value: {
- int32_t: 4
+ int32_t: 5
}
}
}