Merge "Revert "Temporailly disable Bionic Test""
diff --git a/Android.mk b/Android.mk
index 29f83d6..02b62d0 100644
--- a/Android.mk
+++ b/Android.mk
@@ -32,12 +32,73 @@
$(VTS_PYTHON_ZIP): $(SOONG_ZIP)
@echo "build vts python package: $(VTS_PYTHON_ZIP)"
$(hide) mkdir -p $(dir $@)
- @rm -f $@.list
- $(hide) find test -name '*.py' -or -name '*.config' -or -name '*.push' | sort > $@.list
+ $(hide) rm -rf $(VTS_TESTCASES_OUT)/vts
+ $(hide) find test/vts -name '*.py' -or -name '*.config' -or -name '*.push' | sort > $@.list
$(hide) $(SOONG_ZIP) -d -o $@ -C test -l $@.list
@rm -f $@.list
- $(hide) rm -rf $(VTS_TESTCASES_OUT)/vts
$(hide) unzip $@ -d $(VTS_TESTCASES_OUT)
+ #
+ @echo "build vts python testcases"
+ $(hide) find test/vts-testcase -name '*.py' -or -name '*.config' -or -name '*.push' | sort > $@.list
+ $(hide) $(SOONG_ZIP) -d -o $@ -C test/vts-testcase -l $@.list
+ @rm -f $@.list
+ $(hide)unzip -o $@ -d $(VTS_TESTCASES_OUT)/vts/testcases/
+ #
+ @echo "build vts python package for audio effect HAL"
+ $(hide) find hardware/interfaces/audio/effect/2.0/vts/functional -name '*.py' -or -name '*.config' -or -name '*.push' | sort > $@.list
+ # uncomment when audio effect HAL test has some py, config, or push files
+ # $(hide) $(SOONG_ZIP) -d -o $@ -C hardware/interfaces/audio/effect/2.0/vts/functional -l $@.list
+ @rm -f $@.list
+ # $(hide) unzip $@ -d $(VTS_TESTCASES_OUT)
+ #
+ @echo "build vts python package for boot HAL"
+ $(hide) find hardware/interfaces/boot/1.0/vts/functional -name '*.py' -or -name '*.config' -or -name '*.push' | sort > $@.list
+ $(hide) $(SOONG_ZIP) -d -o $@ -C hardware/interfaces/boot/1.0/vts/functional -l $@.list
+ @rm -f $@.list
+ $(hide) unzip $@ -d $(VTS_TESTCASES_OUT)
+ #
+ @echo "build vts python package for NFC HAL"
+ $(hide) find hardware/interfaces/nfc/1.0/vts/functional -name '*.py' -or -name '*.config' -or -name '*.push' | sort > $@.list
+ $(hide) $(SOONG_ZIP) -d -o $@ -C hardware/interfaces/nfc/1.0/vts/functional -l $@.list
+ @rm -f $@.list
+ $(hide) unzip $@ -d $(VTS_TESTCASES_OUT)
+ #
+ @echo "build vts python package for power HAL"
+ $(hide) find hardware/interfaces/power/1.0/vts/functional -name '*.py' -or -name '*.config' -or -name '*.push' | sort > $@.list
+ $(hide) $(SOONG_ZIP) -d -o $@ -C hardware/interfaces/power/1.0/vts/functional -l $@.list
+ @rm -f $@.list
+ $(hide) unzip $@ -d $(VTS_TESTCASES_OUT)
+ #
+ @echo "build vts python package for thermal HAL"
+ $(hide) find hardware/interfaces/thermal/1.0/vts/functional -name '*.py' -or -name '*.config' -or -name '*.push' | sort > $@.list
+ $(hide) $(SOONG_ZIP) -d -o $@ -C hardware/interfaces/thermal/1.0/vts/functional -l $@.list
+ @rm -f $@.list
+ $(hide) unzip $@ -d $(VTS_TESTCASES_OUT)
+ #
+ @echo "build vts python package for vibrator HAL"
+ $(hide) find hardware/interfaces/vibrator/1.0/vts/functional -name '*.py' -or -name '*.config' -or -name '*.push' | sort > $@.list
+ $(hide) $(SOONG_ZIP) -d -o $@ -C hardware/interfaces/vibrator/1.0/vts/functional -l $@.list
+ @rm -f $@.list
+ $(hide) unzip $@ -d $(VTS_TESTCASES_OUT)
+ #
+ @echo "build vts python package for sensors HAL"
+ $(hide) find hardware/interfaces/sensors/1.0/vts/functional -name '*.py' -or -name '*.config' -or -name '*.push' | sort > $@.list
+ $(hide) $(SOONG_ZIP) -d -o $@ -C hardware/interfaces/sensors/1.0/vts/functional -l $@.list
+ @rm -f $@.list
+ $(hide) unzip $@ -d $(VTS_TESTCASES_OUT)
+ #
+ @echo "build vts python package for VR HAL"
+ $(hide) find hardware/interfaces/vr/1.0/vts/functional -name '*.py' -or -name '*.config' -or -name '*.push' | sort > $@.list
+ $(hide) $(SOONG_ZIP) -d -o $@ -C hardware/interfaces/vr/1.0/vts/functional -l $@.list
+ @rm -f $@.list
+ $(hide) unzip $@ -d $(VTS_TESTCASES_OUT)
+ #
+ @echo "build vts python package for tv hdmi_cec HAL"
+ $(hide) find hardware/interfaces/tv/cec/1.0/vts/functional -name '*.py' -or -name '*.config' -or -name '*.push' | sort > $@.list
+ $(hide) $(SOONG_ZIP) -d -o $@ -C hardware/interfaces/tv/cec/1.0/vts/functional -l $@.list
+ @rm -f $@.list
+ $(hide) unzip $@ -d $(VTS_TESTCASES_OUT)
+ #
$(hide) touch -f $(VTS_TESTCASES_OUT)/vts/__init__.py
$(VTS_CAMERAITS_ZIP): $(SOONG_ZIP)
diff --git a/README.md b/README.md
index 7b88886..7d0bccf 100644
--- a/README.md
+++ b/README.md
@@ -8,9 +8,16 @@
VTS has mainly two types of test suites:
- * automated (e.g., fuzzing) and
- * structural (e.g., gTest) testing.
+ * automated (e.g., record-and-replay and fuzzing) and
+ * structural (e.g., gTest and host-driven python) testing.
While the VTS framework and test cases are designed for userdebug or eng build
devices, some test cases can be run on user build devices using its app namely,
-VTS Agent App.
\ No newline at end of file
+VTS Agent App.
+
+__Table of Contents__
+
+1. [VTS User Manual](doc/user_manual.md)
+2. [Where to find VTS test cases](testcases/README.md)
+3. [VTS Test Developer Manual](doc/test_developer_manual.md)
+4. [VTS Framework Developer Manual](doc/framework_developer_manual.md)
diff --git a/agents/hal/AgentRequestHandler.cpp b/agents/hal/AgentRequestHandler.cpp
index d4d8bb7..bd71ebe 100644
--- a/agents/hal/AgentRequestHandler.cpp
+++ b/agents/hal/AgentRequestHandler.cpp
@@ -117,8 +117,9 @@
int driver_type, const string& service_name, const string& file_path,
int target_class, int target_type, float target_version,
const string& target_package, const string& target_component_name,
- const string& module_name, int bits) {
- cout << "[runner->agent] command " << __FUNCTION__ << endl;
+ const string& module_name, const string& hw_binder_service_name, int bits) {
+ cout << "[runner->agent] command " << __FUNCTION__ << " (file_path="
+ << file_path << ")" << endl;
ResponseCode result = FAIL;
// TODO: shall check whether there's a service with the same name and return
@@ -254,7 +255,8 @@
cout << "[agent->driver]: LoadHal " << module_name << endl;
result = client->LoadHal(file_path, target_class, target_type,
target_version, target_package,
- target_component_name, module_name);
+ target_component_name,
+ hw_binder_service_name, module_name);
cout << "[driver->agent]: LoadHal returns " << result << endl;
if (result == VTS_DRIVER_RESPONSE_SUCCESS) {
response_msg.set_response_code(SUCCESS);
@@ -508,7 +510,8 @@
command_msg.file_path(), command_msg.target_class(),
command_msg.target_type(), command_msg.target_version() / 100.0,
command_msg.target_package(), command_msg.target_component_name(),
- command_msg.module_name(), command_msg.bits());
+ command_msg.module_name(), command_msg.hw_binder_service_name(),
+ command_msg.bits());
case VTS_AGENT_COMMAND_READ_SPECIFICATION:
return ReadSpecification(command_msg.service_name());
case LIST_APIS:
diff --git a/agents/hal/AgentRequestHandler.h b/agents/hal/AgentRequestHandler.h
index 229f1a1..bc23351 100644
--- a/agents/hal/AgentRequestHandler.h
+++ b/agents/hal/AgentRequestHandler.h
@@ -68,7 +68,8 @@
int target_type, float target_version,
const string& target_package,
const string& target_component_name,
- const string& module_name, int bits);
+ const string& module_name,
+ const string& hw_binder_service_name, int bits);
// for the VTS_AGENT_COMMAND_READ_SPECIFICATION`
bool ReadSpecification(const string& component_name);
diff --git a/agents/hal/SocketClientToDriver.cpp b/agents/hal/SocketClientToDriver.cpp
index 90d85f0..cd1b8f4 100644
--- a/agents/hal/SocketClientToDriver.cpp
+++ b/agents/hal/SocketClientToDriver.cpp
@@ -69,6 +69,7 @@
float target_version,
const string& target_package,
const string& target_component_name,
+ const string& hw_binder_service_name,
const string& module_name) {
VtsDriverControlCommandMessage command_message;
command_message.set_command_type(LOAD_HAL);
@@ -79,6 +80,7 @@
command_message.set_target_package(target_package);
command_message.set_target_component_name(target_component_name);
command_message.set_module_name(module_name);
+ command_message.set_hw_binder_service_name(hw_binder_service_name);
if (!VtsSocketSendMessage(command_message)) return -1;
VtsDriverControlResponseMessage response_message;
diff --git a/agents/hal/SocketClientToDriver.h b/agents/hal/SocketClientToDriver.h
index 877c321..62fc36d 100644
--- a/agents/hal/SocketClientToDriver.h
+++ b/agents/hal/SocketClientToDriver.h
@@ -43,6 +43,7 @@
int32_t LoadHal(const string& file_path, int target_class, int target_type,
float target_version, const string& target_package,
const string& target_component_name,
+ const string& hw_binder_service_name,
const string& module_name);
// Sends a LIST_FUNCTIONS request.
diff --git a/build-python.sh b/build-python.sh
index 2a8b09d..bf35300 100755
--- a/build-python.sh
+++ b/build-python.sh
@@ -18,13 +18,16 @@
## Modifies import statement in proto files.
sed -i 's/import "test\/vts\/proto\/ComponentSpecificationMessage.proto";/import "ComponentSpecificationMessage.proto";/g' proto/AndroidSystemControlMessage.proto
+sed -i 's/import "test\/vts\/proto\/ComponentSpecificationMessage.proto";/import "ComponentSpecificationMessage.proto";/g' proto/VtsProfilingMessage.proto
## Compiles modified proto files to .py files.
protoc -I=proto --python_out=proto proto/AndroidSystemControlMessage.proto
protoc -I=proto --python_out=proto proto/ComponentSpecificationMessage.proto
+protoc -I=proto --python_out=proto proto/VtsProfilingMessage.proto
## Restores import statement in proto files.
sed -i 's/import "ComponentSpecificationMessage.proto";/import "test\/vts\/proto\/ComponentSpecificationMessage.proto";/g' proto/AndroidSystemControlMessage.proto
+sed -i 's/import "ComponentSpecificationMessage.proto";/import "test\/vts\/proto\/ComponentSpecificationMessage.proto";/g' proto/VtsProfilingMessage.proto
protoc -I=proto --python_out=proto proto/ComponentSpecificationMessage.proto
protoc -I=proto --python_out=proto proto/VtsReportMessage.proto
diff --git a/create-image-angler_treble.sh b/create-image-angler_treble.sh
index 6d09e36..2e39ac6 100755
--- a/create-image-angler_treble.sh
+++ b/create-image-angler_treble.sh
@@ -16,4 +16,4 @@
source create-image.sh
-vts_multidevice_create_image angler_treble
+vts_multidevice_create_image angler ENABLE_TREBLE=true
diff --git a/create-image.sh b/create-image.sh
index b918812..b3f773b 100755
--- a/create-image.sh
+++ b/create-image.sh
@@ -17,7 +17,15 @@
function vts_multidevice_create_image {
DEVICE=$1
+ rm ${ANDROID_BUILD_TOP}/test/vts/testcases/hal/nfc/ -rf
+ rm ${ANDROID_BUILD_TOP}/test/vts/testcases/hal/vibrator/ -rf
+ rm ${ANDROID_BUILD_TOP}/test/vts/testcases/hal/vr/ -rf
+ rm ${ANDROID_BUILD_TOP}/test/vts/testcases/hal/tv_cec/ -rf
. ${ANDROID_BUILD_TOP}/build/make/envsetup.sh
- cd ${ANDROID_BUILD_TOP}; lunch ${DEVICE}-userdebug
+ cd ${ANDROID_BUILD_TOP}; lunch ${DEVICE}-userdebug $2
cd ${ANDROID_BUILD_TOP}/test/vts; mma -j 32 && cd ${ANDROID_BUILD_TOP}; make vts adb -j 32
+ cp ${ANDROID_BUILD_TOP}/hardware/interfaces/nfc/1.0/vts/functional/vts/testcases/hal/nfc/ ${ANDROID_BUILD_TOP}/test/vts/testcases/hal/ -rf
+ cp ${ANDROID_BUILD_TOP}/hardware/interfaces/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/ ${ANDROID_BUILD_TOP}/test/vts/testcases/hal/ -rf
+ cp ${ANDROID_BUILD_TOP}/hardware/interfaces/vr/1.0/vts/functional/vts/testcases/hal/vr/ ${ANDROID_BUILD_TOP}/test/vts/testcases/hal/ -rf
+ cp ${ANDROID_BUILD_TOP}/hardware/interfaces/tv/cec/1.0/vts/functional/vts/testcases/hal/tv_cec/ ${ANDROID_BUILD_TOP}/test/vts/testcases/hal/ -rf
}
diff --git a/doc/developer_testing/kernel/ltp.md b/doc/developer_testing/kernel/ltp.md
index 37a2737..8f5fe8f 100644
--- a/doc/developer_testing/kernel/ltp.md
+++ b/doc/developer_testing/kernel/ltp.md
@@ -1,9 +1,5 @@
# How to run LTP tests on Android
-__Note: LTP module is currently only available on master branch. If you are on
-a Nougat branch, please switch to the master branch first and then run VTS against your
-Nougat device.__
-
0. [VTS Setup](../../setup/index.md)
1. [Run all the VTS LTP test case locally](run_all_ltp_testcases.md)
2. [Run individual VTS LTP test case locally](run_individual_ltp_testcase.md)
diff --git a/doc/developer_testing/kernel/run_all_ltp_testcases.md b/doc/developer_testing/kernel/run_all_ltp_testcases.md
index 17cefc9..7fb79a3 100644
--- a/doc/developer_testing/kernel/run_all_ltp_testcases.md
+++ b/doc/developer_testing/kernel/run_all_ltp_testcases.md
@@ -8,6 +8,6 @@
## 3. Run kernel LTP test from VTS-TradeFed console
`> run vts-kernel`
-This will take around 30 minutes to run.
+This will take from 30 minutes to 2 hours to run.
The test results can be found under `out/host/linux-x86/vts/android-vts/results/`,
while the device logcat and host logs can be found under `out/host/linux-x86/vts/android-vts/logs/`.
diff --git a/doc/framework_developer_manual.md b/doc/framework_developer_manual.md
new file mode 100644
index 0000000..84f2bed
--- /dev/null
+++ b/doc/framework_developer_manual.md
@@ -0,0 +1,8 @@
+# VTS Framework Developer Manual
+
+VTS infrastructure and service design docs will be available publically.
+Until then, please contact Android Partner Engineering.
+
+## 1. Web Dashboard and Notification
+
+[Overview](web/vts_dashboard.md)
\ No newline at end of file
diff --git a/doc/test_developer_manual.md b/doc/test_developer_manual.md
new file mode 100644
index 0000000..7e4d657
--- /dev/null
+++ b/doc/test_developer_manual.md
@@ -0,0 +1,3 @@
+# VTS Test Developer Manual
+
+[Manual](testcase_develop_manual/index.md)
diff --git a/doc/testcase_develop_manual/codelab_host_driven_test.md b/doc/testcase_develop_manual/codelab_host_driven_test.md
index f8ea23f..516a2cf 100644
--- a/doc/testcase_develop_manual/codelab_host_driven_test.md
+++ b/doc/testcase_develop_manual/codelab_host_driven_test.md
@@ -14,7 +14,7 @@
`$ repo sync -j 32`
-Then to check the vts project directory,
+Then to check the VTS project directory,
`$ ls test/vts`
@@ -61,7 +61,8 @@
```
---
-Multiple instances of `compatibility:include-filter` option can be added to include more tests under a test suite.
+Multiple instances of `compatibility:include-filter` option can be added
+to include more tests under a test suite.
## 2. Build and Run
@@ -80,10 +81,27 @@
### 2.2. Run
+You may run your test using VTS TradeFed console. First, start VTS TradeFed console:
+
`$ vts-tradefed`
+Then, use run command to start your test plan:
+
`> run vts-codelab`
+If your test module is not in a test plan, you can specify test module to run directly:
+
+`> run vts -m <your test module name>`
+
+Instead of using TradeFed console, you may also run test directly through shall and make it faster by
+disabling system check and run on primary ABI only:
+
+`vts-tradefed run commandAndExit vts --skip-all-system-status-check --primary-abi-only
+--skip-preconditions --module <your test module name> -l INFO`
+
+The `-l INFO` argument in the end would allow VTS TradeFed print host log to terminal (you may want
+to set Scrollback lines to a higher value in your terminal's setting).
+
If your test case can violate some SELinux rules, please run:
`host$ adb shell`
@@ -92,6 +110,11 @@
`target$ setenforce 0`
+Tip: you may put the build command and test run command together:
+
+`make vts -j10 && vts-tradefed run commandAndExit vts --skip-all-system-status-check --primary-abi-only
+--skip-preconditions --module <your test module name> -l INFO`
+
## 3. Customize your test configuration (Optional)
@@ -144,7 +167,7 @@
At last, add the following line to `com.android.tradefed.testtype.VtsMultiDeviceTest` class
in `AndroidTest.xml`:
-`<option name="test-config-path" value="vts-config/testcases/<your project directiry>/<your project name>.config" />`
+`<option name="test-config-path" value="vts/testcases/<your project directiry>/<your project name>.config" />`
Your config file will overwrite the following default json object defined at
`test/vts/tools/vts-tradefed/res/default/DefaultTestCase.config`
@@ -167,12 +190,9 @@
## 4. Serving
-[Dashboard](https://android-vts-internal.googleplex.com)
-
Once a new test case is added to one of the launched test suites,
it is automatically executed in a test lab (e.g., using some common devices).
The exact schedule, and the used branches and devices are all customizable.
-Please contact an EngProd representative to your team, or vts-dev@google.com.
Results from the test lab are automatically visible on the dashboard, but local
runs may also be visible for debugging purposes if tests are run on a machine
diff --git a/doc/testcase_develop_manual/codelab_native_code_coverage.md b/doc/testcase_develop_manual/codelab_native_code_coverage.md
index 2d00470..0e23a34 100644
--- a/doc/testcase_develop_manual/codelab_native_code_coverage.md
+++ b/doc/testcase_develop_manual/codelab_native_code_coverage.md
@@ -1,60 +1,43 @@
# Codelab - VTS Native Code Coverage Measurement
-## 1. Build Rule Configuration
-
-### 1.1. Enable code coverage instrumentation
+## 1. Enable Coverage Instrumentation on Device Build
To enable code global coverage instrumentation, two environment variables must be
-set: NATIVE_COVERAGE must be set to true and COVERAGE_DIRS must specify a space-
-delimited list of directories for which coverage will be enabled. For example:
+set: NATIVE_COVERAGE must be set to true, and COVERAGE_PATHS must specify a comma-
+separated list of directories for which coverage will be enabled. For example:
```
export NATIVE_COVERAGE=true
-export COVERAGE_DIRS="test/vts/hals/light"
+export COVERAGE_PATHS="test/vts/hals/light,hardware/interfaces"
```
-To enable coverage on more than one directory, simply add it to the COVERAGE_DIRS
-variable using spaces to delimit entries.
-
-
-
-
-### 1.2. Configure module makefile
-
-For the runner to be able to locate coverage files later, the
-following must be added right below a target module specified its Android.mk
-file.
-
-```
-include $(BUILD_SHARED_LIBRARY)
-include test/vts/tools/build/Android.packaging_sharedlib.mk
-```
-
-
## 2. Modify Your VTS Test Case
If you have not already,
[Codelab for Host-Driven Tests](codelab_host_driven_test.md)
gives an overview of how to write a VTS test case. This section assumes you have
-completed that codelab and have at least one VTS test case which you would like
-to enable this code coverage measurement.
+completed that codelab and have at least one VTS test case (either host-driven or
+target-side) which you would like to enable this code coverage measurement.
-### 2.1. Enable webservice uploading
+### 2.1. Configure the test
In order to upload the measured code coverage data to a Google App Engine (GAE)
hosted database and show that on your VTS dashboard, let's add:
-`"use_gae_db": true`
-
-to `<target test case name>.config` file.
+`"use_gae_db": true` and `"coverage": true` to `<target test case name>.config` file.
Then let's also specify the source files which you have enabled code coverage
instrumentation and would like to see the measured line coverage data by adding:
```
-"modules": ["<module-name>",...],
-"git_project_path": "<git-project-name>",
-"git_project_name": "<git-project-path>"
+"coverage": true,
+"modules": [{
+ "module_name": "<module name>",
+ "git_project": {
+ "name": "<git project name>",
+ "path": "<path to git project root>"
+ }
+ },...]
```
to the same config file. Note that the module name must match the local module
@@ -66,33 +49,117 @@
```
{
- ...
- "modules": ["system/lib64/hw/lights.vts"],
- "git_project_path": "test/vts",
- "git_project_name": "platform/test/vts"
+ "use_gae_db": true
+ "coverage": true,
+ "modules": [{
+ "module_name": "system/lib64/hw/lights.vts",
+ "git_project": {
+ "name": "platform/test/vts",
+ "path": "test/vts"
+ }
+ }]
}
```
-### 2.2. Test case code
+### 2.2. Target-Side Tests
-In each test case (i.e., a method whose name starts with `test`), let's add
-the following right after each API call.
+#### 2.2.1. Add build flags to the test build file
+
+Locate the `Android.bp` file adjacent to the .cpp target-side test file. In order
+for coverage files to be created at the end of test execution, the test file must
+also be built with coverage flags. Add the flag `--coverage` to the cflags and
+ldflags lists.
+
+For example, the build file for the target-side NFC test has the following
+definition:
```
-result = self.dut.hal.<target hal module name>.<target api>(<a list of args>)
-last_coverage_data = {}
-for coverage_msg in result.raw_coverage_data:
- last_coverage_data[coverage_msg.file_path] = coverage_msg.gcda
+cc_test {
+ name: "nfc_hidl_hal_test",
+ gtest: true,
+ srcs: ["nfc_hidl_hal_test.cpp"],
+ shared_libs: [
+ "libbase",
+ "liblog",
+ "libcutils",
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "libnativehelper",
+ "libutils",
+ "android.hardware.nfc@1.0",
+ ],
+ static_libs: ["libgtest"],
+ cflags: [
+ "--coverage",
+ "-O0",
+ "-g",
+ ],
+ ldflags: [
+ "--coverage"
+ ]
+}
```
-At the end of each test case, let's also add:
+The rest is automatic and coverage will automatically be uploaded to the VTS
+dashboard with each invocation.
-`self.SetCoverageData(last_coverage_data)`
+### 2.3. Host-Driven Tests
-so that the VTS runner knows about the measured coverage data.
+Host-driven tests have more flexibility for coverage measurement, as the host
+may request coverage files after each API call, at the end of a test case, or when
+all test cases have completed.
-An example is available at
-`test/vts/testcases/fuzz/hal_light/conventional_standalone/StandaloneLightFuzzTest.py`.
+#### 2.3.1. Setup the test to run in passthrough mode.
+
+Currently coverage for host-driven tests is only supported while the HAL is in
+passthrough mode. To enable this, execute the following before initializing the
+HAL:
+
+```
+self.dut.shell.one.Execute("setprop vts.hal.vts.hidl.get_stub true")
+```
+
+#### 2.3.2. Measure coverage at the end of an API call
+
+Coverage is available with the result of each API call. To add it to the dashboard
+for display, call `self.SetCoverageData` with the contents of `result.raw_coverage_data`.
+
+For example, in a test of the lights HAL, the following would gather coverage
+after an API call to set the light:
+
+```
+result = self.dut.hal.light.set_light(None, gene) # host-driven API call to light HAL
+self.SetCoverageData(result.raw_coverage_data)
+```
+
+
+#### 2.3.3. Measure coverage at the end of a test case
+
+After a test case has completed, coverage can be gathered independently of an
+API call. Coverage can be requested from the device under test (dut) with the
+method `GetRawCodeCoverage()`.
+
+For example, at the end of a host-side NFC test case, coverage data is fetched using:
+
+```
+self.SetCoverageData(self.dut.hal.nfc.GetRawCodeCoverage())
+```
+
+#### 2.3.4. Measure coverage by pulling all coverage files from the device
+
+For coarse coverage measurement (e.g. after running all of the tests), coverage
+can be requested by pulling any coverage-related output files from the device
+manually over ADB. The `coverage_utils.py` utility provides a function to fetch
+and process the files.
+
+In the case of NFC, the coverage data is fetched with the following code:
+
+```
+from vts.utils.python.coverage import coverage_utils
+self.SetCoverageData(coverage_utils.GetGcdaDict(self.dut.hal.nfc))
+```
+
## 3. Serving
diff --git a/doc/testcase_develop_manual/index.md b/doc/testcase_develop_manual/index.md
index c8d0f36..c8ad3de 100644
--- a/doc/testcase_develop_manual/index.md
+++ b/doc/testcase_develop_manual/index.md
@@ -11,6 +11,8 @@
As the Android system is being used widely (i.e., requiring frequent security
patching and fast feature launch velocity), we think that it is a right cultural shift for this time.
+Currently, all VTS tests are designed for userdebug or eng build devices only.
+
__Table of Contents__
1. Host-Driven Tests
diff --git a/doc/user_manual.md b/doc/user_manual.md
new file mode 100644
index 0000000..70aca3a
--- /dev/null
+++ b/doc/user_manual.md
@@ -0,0 +1,128 @@
+# VTS User Manual
+
+## 1. Setup
+
+### 1.1. Host setup
+
+* [Setup Manual](setup/index.md)
+
+### 1.2. Checkout master git repository
+
+[Download Android Source Code](https://source.android.com/source/downloading.html)
+
+`$ export branch=master`
+
+`$ mkdir ${branch}`
+
+`$ cd ${branch}`
+
+`$ repo init -b ${branch} -u persistent https://android.googlesource.com/platform/manifest`
+
+`$ repo sync -j 8`
+
+### 1.3. Build an Android image
+
+`$ cd ${branch}`
+
+`$ . build/make/envsetup.sh`
+
+`$ lunch aosp_arm64-userdebug # or <your device>-userdebug`
+
+The below is an optional step:
+
+`$ make -j 8`
+
+If this fails, please do:
+
+`$ repo sync -j 8`
+
+`$ make -j 8`
+
+Such can happen because tip of tree (ToT) may not always be buildable.
+
+### 1.4. Build a VTS package
+
+`$ cd ${branch}`
+
+`$ make vts ENABLE_TREBLE=true -j8`
+
+Or use the exact command:
+
+`$ make -j8 vts showcommands dist TARGET_PRODUCT=aosp_arm64 WITH_DEXPREOPT=false TARGET_BUILD_VARIANT=userdebug ENABLE_TREBLE=true`
+
+### 1.5. Connect to an Android device
+
+Let's connect an Android device and a host computer using a USB cable.
+
+* On an Android device, Setting -> About Phone -> Click repeatedly 'Build number' until developer mode is enabled.
+* On an Android device, Setting -> Developer options -> Turn on 'USB debugging'
+* On a host, run `adb devices` from a command line shell.
+* On a Android device, confirm that the host is trusted.
+* On a host, type `adb shell` and if that works, we're ready.
+
+## 2. Run VTS Tests
+
+### 2.1. Run a VTS test plan
+
+`$ vts-tradefed`
+
+`> run vts`
+
+```
+…
+…
+08-16 09:36:03 I/ResultReporter: Saved logs for device_logcat in .../out/host/linux-x86/vts/android-vts/logs/2016.08.16_09.17.13/device_logcat_7912321856562095748.zip
+08-16 09:36:03 I/ResultReporter: Saved logs for host_log in .../out/host/linux-x86/vts/android-vts/logs/2016.08.16_09.17.13/host_log_2775945280523850018.zip
+08-16 09:36:04 I/ResultReporter: Invocation finished in 18m 50s. PASSED: 18, FAILED: 0, NOT EXECUTED: 2, MODULES: 8 of 10
+08-16 09:36:04 I/ResultReporter: Test Result: .../out/host/linux-x86/vts/android-vts/results/2016.08.16_09.17.13/test_result.xml
+08-16 09:36:04 I/ResultReporter: Full Result: .../out/host/linux-x86/vts/android-vts/results/2016.08.16_09.17.13.zip
+```
+
+### 2.2. Test report for APFE (Android Partner Front-End)
+
+The uploadable report xml file can be found at
+
+`out/host/linux-x86/vts/android-vts/results/`
+
+After Android O release, you will be able to upload that xml file to [AFPE](https://partner.android.com)
+and obtain a certificate.
+
+### 2.3. Check the test logs
+
+`$ vi out/host/linux-x86/vts/android-vts/logs/`
+
+Then select a directory which captures the time stamp of your test run (e.g., 2016.08.16_09.17.13).
+
+Then select `host_log_<timestamp>.zip` and host_log.txt in that zip file for host log.
+
+Then select `device_logcat_<timestamp>.zip` and device_logcat.txt in that zip file for device log.
+
+## 3. Run Options for Advanced Users
+
+### 3.1. List of VTS Plans
+
+* __vts__: All default VTS tests (To be finalized before Android O release).
+* __vts-camera-its__: For camera ITS (Image Test Suite) tests ported to VTS.
+* __vts-codelab__: For VTS codelab.
+* __vts-coverage__: For VTS code coverage tests.
+* __vts-fuzz__: For VTS Fuzz tests.
+* __vts-gce__: For VTS tests which can be run on Google Compute Engine (GCE).
+* __vts-hal-hidl-profiling__: For VTS HIDL HAL profiling tasks.
+* __vts-hal-hidl__: For VTS HIDL HAL tests.
+* __vts-host__: For VTS host-driven tests.
+* __vts-kernel__: For VTS kernel tests.
+* __vts-library__: For VTS native library tests.
+* __vts-presubmit__: For VTS pre-submit tests.
+* __vts-security__: For VTS security tests.
+* __vts-system__: For VTS system tests.
+
+### 3.2. Run kernel test cases
+
+LTP (Linux Test Project) is part of vts-kernel.
+[This doc](developer_testing/kernel/ltp.md) shows how to run each LTP test case.
+
+## 4. Debugging
+
+### 4.1. Run VTS tests directly for debugging
+
+[Run directly from command line](testcase_develop_manual/run_vts_directly.md)
diff --git a/doc/web/notification_samples.md b/doc/web/notification_samples.md
new file mode 100644
index 0000000..cff8770
--- /dev/null
+++ b/doc/web/notification_samples.md
@@ -0,0 +1,39 @@
+# VTS Dashboard Notification Samples
+
+## Introduction
+
+The VTS Alert and Performance jobs monitor the Dashboard for changes on a regular
+basis. The services notify subscibers via email when attention is required.
+
+## VTS Alert Job
+
+The alerting job monitors for test breakages, fixes, and loss of service. When
+new data is uploaded to the database, the alerting job scans for breakages or fixes
+and sends emails accordingly. If tests are idle for more than 24 hours, a warning
+is sent out as well.
+
+### Sample Email
+
+<div style='border: 1px solid gray; padding: 25px; margin: 20px 0'>
+<i><b>Subject:</b> New test failures in SampleCameraV2Test @ 3572205</i><br><br>
+Hello,<br><br>Test cases are failing in SampleCameraV2Test for device build ID(s): 3572205.<br><br>
+The following test cases failed in the latest test run:<br>
+- <b>testCameraNormal</b><br><br><br>
+
+For details, visit the <a href="#">VTS dashboard.</a>
+</div>
+
+
+
+## VTS Performance Digests
+
+Each day, the VTS Dashboard scans tests which have accompanying performance
+data. If so, it compares the past 24 hours to the 24 hours that preceeded it and
+summaries the changes in performance.
+
+### Sample Email
+
+<div style='border: 1px solid gray; padding: 25px; margin: 20px 0'>
+<i><b>Subject:</b> Daily Performance Digest: BinderPerformanceTest</i><br><br>
+<p style='font-family: arial'><b>BinderPerformanceTest</b></p><table cellpadding='2' style='border-collapse: collapse; border: 1px solid black; font-size: 12px; font-family: arial;'><tr><td colspan='7'>binder_vector_roundtrip_latency_benchmark_64bits</td></tr><tr><td colspan='7'>Roundtrip Binder RPC Latency (nanoseconds)</td></tr><tr><th style='border: 1px solid black; border-bottom: none; background-color: lightgray;' ></th><th style='border: 1px solid black; border-bottom: none; background-color: lightgray;' colspan='2'>12-15-2016</th><th style='border: 1px solid black; border-bottom: none; background-color: lightgray;' colspan='2'>12-14-2016</th><th style='border: 1px solid black; border-bottom: none; background-color: lightgray;' colspan='2'>Difference</th></tr><tr><th style='border: 1px solid black; border-bottom-width: 2px; border-top: 1px dotted gray; background-color: lightgray;'>Message Size (Bytes)</th><th style='border: 1px solid black; border-bottom-width: 2px; border-top: 1px dotted gray; background-color: lightgray;'>Mean</th><th style='border: 1px solid black; border-bottom-width: 2px; border-top: 1px dotted gray; background-color: lightgray;'>Std</th><th style='border: 1px solid black; border-bottom-width: 2px; border-top: 1px dotted gray; background-color: lightgray;'>Mean</th><th style='border: 1px solid black; border-bottom-width: 2px; border-top: 1px dotted gray; background-color: lightgray;'>Std</th><th style='border: 1px solid black; border-bottom-width: 2px; border-top: 1px dotted gray; background-color: lightgray;'>Mean</th><th style='border: 1px solid black; border-bottom-width: 2px; border-top: 1px dotted gray; background-color: lightgray;'>Std</th></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>4</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>65263.43</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>16243.85</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>61950.12</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>15198.13</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.05348354679551394);'>3313.32</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.06880574577749773);'>1045.72</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>8</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>62017.23</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>15297.71</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>60683.64</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>14546.73</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.021976199308481374);'>1333.6</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.05162533230917583);'>750.98</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>16</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>59171.27</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>14061.87</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>58840.29</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>14305.1</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.0056250589761115315);'>330.99</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.0);'>-243.23</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>32</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>60201.4</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>13759.66</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>57687.63</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>14320.71</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.04357542043270162);'>2513.77</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.0);'>-561.05</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>64</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>59526</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>13138.61</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>58134.28</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>13776.87</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.02393979154608629);'>1391.73</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.0);'>-638.26</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>128</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>59658.09</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>12699.15</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>58215.99</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>13895.32</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.02477162979154056);'>1442.11</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.0);'>-1196.17</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>256</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>58869.27</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>13307.27</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>57888.51</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>13175.08</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.016942232349139386);'>980.77</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.010033364490373902);'>132.2</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>512</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>60097.32</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>13595.57</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>58211.45</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>13352.47</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.03239680669694265);'>1885.87</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.018206369625088432);'>243.1</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>1024</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>59900.84</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>13540.77</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>58655.61</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>13696.13</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.021229565030634223);'>1245.24</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.0);'>-155.36</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>2k</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>60377.91</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>13060.9</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>60063.71</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>13907.18</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.005231078774897549);'>314.2</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.0);'>-846.27</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>4k</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>77967.83</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>16944.06</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>76550.12</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>18052.7</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.018520011278221876);'>1417.71</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.0);'>-1108.63</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>8k</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>90121.44</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>21365.7</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>87814.47</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>22779.75</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.02627099084257229);'>2306.98</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.0);'>-1414.05</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>16k</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>123431.76</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>24890.05</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>116002.24</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>27537.16</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.06404635766565732);'>7429.53</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.0);'>-2647.11</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>32k</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>179830.98</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>37024.92</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>179219.42</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>40480.43</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.0034123528276210962);'>611.56</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.0);'>-3455.5</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>64k</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>310777.84</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>68022.61</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>325255.19</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>73006.23</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.0);'>-14477.35</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.0);'>-4983.61</td></tr></table><br><table cellpadding='2' style='border-collapse: collapse; border: 1px solid black; font-size: 12px; font-family: arial;'><tr><td colspan='7'>binder_vector_roundtrip_latency_benchmark_32bits</td></tr><tr><td colspan='7'>Roundtrip Binder RPC Latency (nanoseconds)</td></tr><tr><th style='border: 1px solid black; border-bottom: none; background-color: lightgray;' ></th><th style='border: 1px solid black; border-bottom: none; background-color: lightgray;' colspan='2'>12-15-2016</th><th style='border: 1px solid black; border-bottom: none; background-color: lightgray;' colspan='2'>12-14-2016</th><th style='border: 1px solid black; border-bottom: none; background-color: lightgray;' colspan='2'>Difference</th></tr><tr><th style='border: 1px solid black; border-bottom-width: 2px; border-top: 1px dotted gray; background-color: lightgray;'>Message Size (Bytes)</th><th style='border: 1px solid black; border-bottom-width: 2px; border-top: 1px dotted gray; background-color: lightgray;'>Mean</th><th style='border: 1px solid black; border-bottom-width: 2px; border-top: 1px dotted gray; background-color: lightgray;'>Std</th><th style='border: 1px solid black; border-bottom-width: 2px; border-top: 1px dotted gray; background-color: lightgray;'>Mean</th><th style='border: 1px solid black; border-bottom-width: 2px; border-top: 1px dotted gray; background-color: lightgray;'>Std</th><th style='border: 1px solid black; border-bottom-width: 2px; border-top: 1px dotted gray; background-color: lightgray;'>Mean</th><th style='border: 1px solid black; border-bottom-width: 2px; border-top: 1px dotted gray; background-color: lightgray;'>Std</th></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>4</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>56309.18</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>13006.27</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>52456.53</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>9413.16</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.07344467700622763);'>3852.66</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.3817111941575617);'>3593.11</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>8</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>56697.55</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>13180.45</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>52979.84</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>9885.85</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.07017220506617967);'>3717.72</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.3332647598238697);'>3294.61</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>16</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>57496.8</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>12518.8</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>53909.06</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>10273.64</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.0665517258404399);'>3587.75</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.21853593904259516);'>2245.16</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>32</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>57159.51</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>12736.12</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>53308.35</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>10055.59</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.07224310715938732);'>3851.17</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.2665714523398815);'>2680.54</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>64</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>57339.59</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>12823.4</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>53487.21</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>10158.66</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.07202424546046335);'>3852.38</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.26231286775275375);'>2664.75</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>128</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>56847.74</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>13227.75</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>53429.37</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>10033.76</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.0639791653819366);'>3418.37</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.3183236013355946);'>3193.99</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>256</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>56602.05</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>13421.4</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>53552.06</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>10186.89</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.05695376750564279);'>3050</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.31751710651965814);'>3234.51</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>512</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>56847.58</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>13612.71</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>53603.97</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>9695.52</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.060510768173666414);'>3243.62</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.4040216055624986);'>3917.2</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>1024</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>57763.24</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>13104.91</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>54644.6</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>9829.59</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.05707142632570563);'>3118.65</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.3332103586458765);'>3275.33</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>2k</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>59425.7</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>12980.45</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>56566.91</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>9826.89</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.050538310013586586);'>2858.8</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.32091148755758103);'>3153.57</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>4k</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>76829.82</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>15204.6</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>73593.79</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>13091.01</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.04397155961413002);'>3236.04</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.16145347317506317);'>2113.59</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>8k</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>88549.51</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>19759.19</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>82768.58</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>15674.11</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.06984458128993302);'>5780.94</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.2606261864393722);'>4085.09</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>16k</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>112841.27</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>27083.73</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>103774.14</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>21473.39</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.08737362661583523);'>9067.13</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.26126945416091857);'>5610.34</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>32k</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>156421.89</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>42701.39</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>148318.5</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>33647.01</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.05463504947732912);'>8103.39</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.26909911742510617);'>9054.39</td></tr><tr><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;'>64k</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>272601.44</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>89228.41</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;'>272605.1</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;'>72075.39</td><td style='border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;background-color: rgba(255, 0, 0, 0.0);'>-3.65</td><td style='border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;background-color: rgba(255, 0, 0, 0.2379872529135535);'>17153.03</td></tr></table>
+</div>
diff --git a/doc/web/vts_dashboard.md b/doc/web/vts_dashboard.md
index 09f6649..638131a 100644
--- a/doc/web/vts_dashboard.md
+++ b/doc/web/vts_dashboard.md
@@ -6,15 +6,15 @@
## High Level Design
-The high level view is that tests are through tradefed on multiple devices and results are uploaded to cloud Bigtable
-database using Protocol Buffer. The Google app engine then reads data from the cloud and presents it on the dashboard.
+The high level view is that tests are through TradeFed on multiple devices and results are uploaded to cloud Bigtable
+database using Protocol Buffer. The Google App Engine then reads data from the cloud and presents it on the dashboard.

## Google App Engine Architecture
The following diagram discusses the flow of the dashboard wrt to the directory :
-/vts/web/dashboard/appengine/servlet/src/main/java/com/google/android/vts/servlet
+`/vts/web/dashboard/appengine/servlet/src/main/java/com/google/android/vts/servlet`

@@ -48,41 +48,43 @@
```
2. Maven is used for build. Install Maven 3.3.9:
- Download maven from:
+ Download `maven` from:
https://maven.apache.org/download.cgi
Steps to Install Maven:
1) Unzip the Binary tar:
- tar -zxf apache-maven-3.3.3-bin.tar.gz
+ `tar -zxf apache-maven-3.3.3-bin.tar.gz`
- 2) Move the application directory to /usr/local
- sudo cp -R apache-maven-3.3.3 /usr/local
+ 2) Move the application directory to `/usr/local`:
+ `sudo cp -R apache-maven-3.3.3 /usr/local`
- 3) Make a soft link in /usr/bin for universal access of mvn
- sudo ln -s /usr/local/apache-maven-3.3.3/bin/mvn /usr/bin/mvn
+ 3) Make a soft link in `/usr/bin` for universal access of `mvn`:
+ `sudo ln -s /usr/local/apache-maven-3.3.3/bin/mvn /usr/bin/mvn`
4) Verify maven installation:
- $ mvn -v
+ `$ mvn -v`
The output should resemble this:
+```
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)
Maven home: /opt/apache-maven-3.3.9
Java version: 1.8.0_45-internal, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-88-generic", arch: "amd64", family: "unix"
+```
3. Install Google Cloud SDK. Follow the instructions listed on official source:
https://cloud.google.com/sdk/docs/quickstart-linux
The default location where the application searches for a google-cloud-sdk is:
- /usr/local/share/google/google-cloud-sdk
+ `/usr/local/share/google/google-cloud-sdk`
- Therefore move the extracted folder to this location: /usr/local/share/google/
+ Therefore move the extracted folder to this location: `/usr/local/share/google/`
Otherwise, to have a custom location, specify the location of
- google-cloud-sdk in /vts/web/dashboard/appengine/servlet/pom.xml by putting the configuration:
+ google-cloud-sdk in `/vts/web/dashboard/appengine/servlet/pom.xml` by putting the configuration:
```
<configuration>
diff --git a/drivers/libprofiling/VtsProfilingInterface.cpp b/drivers/libprofiling/VtsProfilingInterface.cpp
index 77a3004..3654cd4 100644
--- a/drivers/libprofiling/VtsProfilingInterface.cpp
+++ b/drivers/libprofiling/VtsProfilingInterface.cpp
@@ -23,6 +23,7 @@
#include <google/protobuf/text_format.h>
#include "test/vts/proto/VtsDriverControlMessage.pb.h"
+#include "test/vts/proto/VtsProfilingMessage.pb.h"
using namespace std;
@@ -90,18 +91,24 @@
LOG(ERROR) << "Profiler not initialized. ";
return false;
}
- string msg_str;
- if (!google::protobuf::TextFormat::PrintToString(message, &msg_str)) {
+
+ // Build the VTSProfilingRecord and print it to string.
+ VtsProfilingRecord record;
+ record.set_timestamp(NanoTime());
+ record.set_event((InstrumentationEventType)static_cast<int>(event));
+ record.set_package(package);
+ record.set_version(stof(version));
+ record.set_interface(interface);
+ *record.mutable_func_msg() = message;
+ string record_str;
+ if (!google::protobuf::TextFormat::PrintToString(record, &record_str)) {
LOG(ERROR) << "Can't print the message";
return false;
}
+ // Write the record string to trace file.
mutex_.lock();
- // Record the event data with the following format:
- // timestamp,event,package_name,package_version,interface_name,message
- trace_output_ << NanoTime() << "," << event << "," << package << ","
- << version << "," << interface << "," << message.name() << "\n";
- trace_output_ << msg_str << "\n";
+ trace_output_ << record_str << "\n";
trace_output_.flush();
mutex_.unlock();
diff --git a/testcases/hal/sensors/__init__.py b/harnesses/__init__.py
similarity index 100%
rename from testcases/hal/sensors/__init__.py
rename to harnesses/__init__.py
diff --git a/testcases/hal/light/__init__.py b/harnesses/cloud_client/__init__.py
similarity index 100%
rename from testcases/hal/light/__init__.py
rename to harnesses/cloud_client/__init__.py
diff --git a/harnesses/cloud_client/cloud_client.py b/harnesses/cloud_client/cloud_client.py
new file mode 100644
index 0000000..292ff3a
--- /dev/null
+++ b/harnesses/cloud_client/cloud_client.py
@@ -0,0 +1,91 @@
+#!/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
+from google.cloud import pubsub
+from google.cloud.exceptions import NotFound
+from oauth2client.service_account import ServiceAccountCredentials
+from time import sleep
+
+from vts.harnesses.cloud_client import cloud_client_controller
+
+
+class CloudClient(object):
+ """Communicates with App Engine to receive and run VTS tests.
+
+ Attributes:
+ clientName: string, the name of the runner machine. This must be pre-
+ enrolled with the PubSub service.
+ POLL_INTERVAL: int, the fequency at which pubsub service is polled (seconds)
+ MAX_MESSAGES: int, the maximum number of commands to receive at once
+ """
+
+ POLL_INTERVAL = 5
+ MAX_MESSAGES = 100
+
+ def __init__(self, clientName, oauth2_service_json, path_cmdfile=None):
+ """Inits the object with the client name and a PubSub subscription
+
+ Args:
+ clientName: the name of the client. Must be pre-enrolled with the
+ PubSub service.
+ oauth2_service_json: path (string) to the service account JSON
+ keyfile.
+ """
+ self.clientName = clientName
+ credentials = ServiceAccountCredentials.from_json_keyfile_name(
+ oauth2_service_json)
+ self._client = pubsub.Client(credentials=credentials)
+ self._topic = self._client.topic(clientName)
+ self._sub = self._topic.subscription(clientName)
+ self._controller = cloud_client_controller.CloudClientController(
+ path_cmdfile)
+
+ def Pull(self):
+ """Fetches new messages from the PubSub subscription.
+
+ Receives and acknowledges the commands published to the client's
+ subscription.
+
+ Returns:
+ list of commands (strings) from PubSub subscription.
+ """
+ logging.info("Waiting for commands: %s", self.clientName)
+ results = self._sub.pull(
+ return_immediately=True, max_messages=self.MAX_MESSAGES)
+
+ if results:
+ logging.info("Commands received: %s", results)
+ self._sub.acknowledge([ack_id for ack_id, message in results])
+ return [message.data for ack_id, message in results]
+
+ return None
+
+ def Run(self):
+ """Indefinitely pulls and invokes new commands from the PubSub service.
+ """
+ try:
+ while True:
+ commands = self.Pull()
+ print(commands)
+ if not commands:
+ sleep(self.POLL_INTERVAL)
+ else:
+ self._controller.ExecuteTradeFedCommands(commands)
+ except NotFound as e:
+ logging.error("No subscription created for client %s",
+ self.clientName)
diff --git a/harnesses/cloud_client/cloud_client_controller.py b/harnesses/cloud_client/cloud_client_controller.py
new file mode 100644
index 0000000..fed07d6
--- /dev/null
+++ b/harnesses/cloud_client/cloud_client_controller.py
@@ -0,0 +1,46 @@
+#
+# Copyright 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
+
+from vts.utils.python.common import cmd_utils
+
+
+class CloudClientController(object):
+ '''Controller class to interact with TradeFed.
+
+ Attributes:
+ path_cmdfile: string, path to TradeFed cmdfile
+ '''
+ DEFAULT_PATH_CMDFILE = 'cmdfile.txt'
+
+ def __init__(self, path_cmdfile=None):
+ if not path_cmdfile:
+ path_cmdfile = self.DEFAULT_PATH_CMDFILE
+ self._path_cmdfile = path_cmdfile
+
+ def ExecuteTfCommands(self, cmds):
+ '''Execute a TradeFed command or a list of TradeFed commands.
+
+ Args:
+ cmds: string or list of string, commands
+ '''
+ if not isinstance(cmds, list):
+ cmds = [cmds]
+
+ cmd = '\n'.join(cmds)
+
+ with open(self._path_cmdfile, 'w') as f:
+ f.write(cmd)
\ No newline at end of file
diff --git a/harnesses/tradefed/src/com/android/compatibility/common/tradefed/targetprep/HidlProfilerPreparer.java b/harnesses/tradefed/src/com/android/compatibility/common/tradefed/targetprep/HidlProfilerPreparer.java
new file mode 100644
index 0000000..fff3d3c
--- /dev/null
+++ b/harnesses/tradefed/src/com/android/compatibility/common/tradefed/targetprep/HidlProfilerPreparer.java
@@ -0,0 +1,133 @@
+/*
+ * 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.
+ */
+
+package com.android.compatibility.common.tradefed.targetprep;
+
+import com.android.ddmlib.IDevice;
+import com.android.ddmlib.Log;
+import com.android.tradefed.build.IBuildInfo;
+import com.android.tradefed.config.Option;
+import com.android.tradefed.config.OptionClass;
+import com.android.tradefed.device.DeviceNotAvailableException;
+import com.android.tradefed.device.ITestDevice;
+import com.android.tradefed.targetprep.ITargetCleaner;
+import com.android.tradefed.targetprep.TargetSetupError;
+import com.android.tradefed.targetprep.BuildError;
+import com.android.tradefed.testtype.IAbi;
+import com.android.tradefed.testtype.IAbiReceiver;
+
+/**
+ * A {@link HidlProfilerPreparer} that attempts to enable and disable HIDL profiling on a target device.
+ * <p />
+ * This is used when one wants to do such setup and cleanup operations in Java instead of the
+ * VTS Python runner, Python test template, or Python test case.
+ */
+@OptionClass(alias = "push-file")
+public class HidlProfilerPreparer implements ITargetCleaner, IAbiReceiver {
+ private static final String LOG_TAG = "HidlProfilerPreparer";
+
+ private static final String TARGET_PROFILING_TRACE_PATH = "/data/local/tmp/";
+ private static final String TARGET_PROFILING_LIBRARY_PATH = "/data/local/tmp/<bitness>";
+
+ @Option(name="target-profiling-trace-path", description=
+ "The target-side path to store the profiling trace file(s).")
+ private String mTargetProfilingTracePath = TARGET_PROFILING_TRACE_PATH;
+
+ @Option(name="target-profiling-library-path", description=
+ "The target-side path to store the profiling trace file(s). " +
+ "Use <bitness> to auto fill in 32 or 64 depending on the target device bitness.")
+ private String mTargetProfilingLibraryPath = TARGET_PROFILING_LIBRARY_PATH;
+
+ @Option(name="copy-generated-trace-files", description=
+ "Whether to copy the generated trace files to a host-side, " +
+ "designated destination dir")
+ private boolean mCopyGeneratedTraceFiles = false;
+
+ private IAbi mAbi = null;
+
+ /**
+ * Set mTargetProfilingTracePath. Exposed for testing.
+ */
+ void setTargetProfilingTracePath(String path) {
+ mTargetProfilingTracePath = path;
+ }
+
+ /**
+ * Set mTargetProfilingLibraryPath. Exposed for testing.
+ */
+ void setTargetProfilingLibraryPath(String path) {
+ mTargetProfilingLibraryPath = path;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setAbi(IAbi abi){
+ mAbi = abi;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setUp(ITestDevice device, IBuildInfo buildInfo) throws TargetSetupError, BuildError,
+ DeviceNotAvailableException {
+ // Cleanup any existing traces
+ Log.d(LOG_TAG, String.format("Deleting any existing target-side trace files in %s.",
+ mTargetProfilingTracePath));
+ device.executeShellCommand(
+ String.format("rm %s/*.vts.trace", mTargetProfilingTracePath));
+
+ Log.d(LOG_TAG, String.format("Starting the HIDL profiling (bitness: %s).",
+ mAbi.getBitness()));
+ mTargetProfilingLibraryPath = mTargetProfilingLibraryPath.replace(
+ "<bitness>", mAbi.getBitness());
+ Log.d(LOG_TAG, String.format("Target Profiling Library Path: %s",
+ mTargetProfilingLibraryPath));
+ device.executeShellCommand(
+ String.format("setprop hal.instrumentation.lib.path %s",
+ mTargetProfilingLibraryPath));
+ device.executeShellCommand(
+ "setprop hal.instrumentation.enable true");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void tearDown(ITestDevice device, IBuildInfo buildInfo, Throwable e)
+ throws DeviceNotAvailableException {
+ Log.d(LOG_TAG, "Stopping the HIDL Profiling.");
+ // Disables VTS Profiling
+ device.executeShellCommand("setprop hal.instrumentation.lib.path \"\"");
+ device.executeShellCommand("setprop hal.instrumentation.enable false");
+
+ // Gets trace files from the target.
+ if (!mTargetProfilingTracePath.endsWith("/")) {
+ mTargetProfilingTracePath += "/";
+ }
+ String trace_file_list_string = device.executeShellCommand(
+ String.format("ls %s*.vts.trace", mTargetProfilingTracePath));
+ Log.d(LOG_TAG, String.format("Generated trace files: %s",
+ trace_file_list_string));
+
+ if (mCopyGeneratedTraceFiles) {
+ // TODO(yim): adb pull from the target to a host-side directory (provided by a config
+ // stored in a private repository).
+ }
+ }
+}
diff --git a/harnesses/tradefed/src/com/android/tradefed/targetprep/VtsPythonVirtualenvPreparer.java b/harnesses/tradefed/src/com/android/tradefed/targetprep/VtsPythonVirtualenvPreparer.java
index 47099a8..253e887 100644
--- a/harnesses/tradefed/src/com/android/tradefed/targetprep/VtsPythonVirtualenvPreparer.java
+++ b/harnesses/tradefed/src/com/android/tradefed/targetprep/VtsPythonVirtualenvPreparer.java
@@ -47,6 +47,8 @@
private static final String PIP = "pip";
private static final String PATH = "PATH";
+ private static final String OS_NAME = "os.name";
+ private static final String WINDOWS = "Windows";
protected static final String PYTHONPATH = "PYTHONPATH";
private static final int BASE_TIMEOUT = 1000 * 60;
private static final String[] DEFAULT_DEP_MODULES = {
@@ -163,11 +165,18 @@
mRequirementsFile = f;
}
+ /**
+ * This method returns whether the OS is Windows.
+ */
+ private static boolean isOnWindows() {
+ return System.getProperty(OS_NAME).contains(WINDOWS);
+ }
+
private void activate() {
- File binDir = new File(mVenvDir, "bin");
+ File binDir = new File(mVenvDir, isOnWindows() ? "Scripts" : "bin");
mRunUtil.setWorkingDir(binDir);
String path = System.getenv(PATH);
- mRunUtil.setEnvVariable(PATH, binDir + ":" + path);
+ mRunUtil.setEnvVariable(PATH, binDir + File.pathSeparator + path);
File pipFile = new File(binDir, PIP);
pipFile.setExecutable(true);
mPip = pipFile.getAbsolutePath();
diff --git a/harnesses/tradefed/src/com/android/tradefed/testtype/VtsMultiDeviceTest.java b/harnesses/tradefed/src/com/android/tradefed/testtype/VtsMultiDeviceTest.java
index d8f29dc..36452a0 100644
--- a/harnesses/tradefed/src/com/android/tradefed/testtype/VtsMultiDeviceTest.java
+++ b/harnesses/tradefed/src/com/android/tradefed/testtype/VtsMultiDeviceTest.java
@@ -68,6 +68,8 @@
static final String DATA_FILE_PATH = "data_file_path";
static final String LOG_PATH = "log_path";
static final String NAME = "name";
+ static final String OS_NAME = "os.name";
+ static final String WINDOWS = "Windows";
static final String PYTHONPATH = "PYTHONPATH";
static final String SERIAL = "serial";
static final String TEST_SUITE = "test_suite";
@@ -84,6 +86,7 @@
static final String BINARY_TEST_PROFILING_LIBRARY_PATHS = "binary_test_profiling_library_paths";
static final String BINARY_TEST_TYPE_GTEST = "gtest";
static final String BINARY_TEST_TYPE_LLVMFUZZER = "llvmfuzzer";
+ static final String ENABLE_PROFILING = "enable_profiling";
static final String TEMPLATE_BINARY_TEST_PATH = "vts/testcases/template/binary_test/binary_test";
static final String TEMPLATE_GTEST_BINARY_TEST_PATH = "vts/testcases/template/gtest_binary_test/gtest_binary_test";
static final String TEMPLATE_LLVMFUZZER_TEST_PATH = "vts/testcases/template/llvmfuzzer_test/llvmfuzzer_test";
@@ -127,6 +130,9 @@
isTimeVal = true)
private long mRuntimeHint = 60000; // 1 minute
+ @Option(name = "enable-profiling", description = "Enable profiling for the tests.")
+ private boolean mEnableProfiling = false;
+
@Option(name = "run-32bit-on-64bit-abi",
description = "Whether to run 32bit tests on 64bit abi.")
private boolean mRun32bBitOn64BitAbi = false;
@@ -515,6 +521,11 @@
new JSONArray(mBinaryTestLdLibraryPaths));
CLog.i("Added %s to the Json object", BINARY_TEST_LD_LIBRARY_PATHS);
}
+
+ if (mEnableProfiling) {
+ jsonObject.put(ENABLE_PROFILING, mEnableProfiling);
+ CLog.i("Added %s to the Json object", ENABLE_PROFILING);
+ }
if (!mBinaryTestProfilingLibraryPaths.isEmpty()) {
jsonObject.put(BINARY_TEST_PROFILING_LIBRARY_PATHS,
new JSONArray(mBinaryTestProfilingLibraryPaths));
@@ -569,7 +580,7 @@
mPythonBin = getPythonBinary();
}
String[] baseOpts = {mPythonBin, "-m"};
- String[] testModule = {mTestCasePath, jsonFilePath};
+ String[] testModule = {mTestCasePath.replace("/", "."), jsonFilePath};
String[] cmd;
cmd = ArrayUtil.buildArray(baseOpts, testModule);
@@ -689,12 +700,23 @@
}
/**
- * This method sets the python path. It's based on the based on the
+ * This method returns whether the OS is Windows.
+ */
+ private static boolean isOnWindows() {
+ return System.getProperty(OS_NAME).contains(WINDOWS);
+ }
+
+ /**
+ * This method sets the python path. It's based on the
* assumption that the environment variable $ANDROID_BUILD_TOP is set.
*/
private void setPythonPath() {
StringBuilder sb = new StringBuilder();
- sb.append(System.getenv(PYTHONPATH));
+ String separator = File.pathSeparator;
+ if (System.getenv(PYTHONPATH) != null) {
+ sb.append(separator);
+ sb.append(System.getenv(PYTHONPATH));
+ }
// to get the path for android-vts/testcases/ which keeps the VTS python code under vts.
if (mBuildInfo != null) {
@@ -707,37 +729,44 @@
/* pass */
}
if (testDir != null) {
- sb.append(":");
+ sb.append(separator);
mTestCaseDataDir = testDir.getAbsolutePath();
sb.append(mTestCaseDataDir);
} else if (mBuildInfo.getFile(VTS) != null) {
- sb.append(":");
+ sb.append(separator);
sb.append(mBuildInfo.getFile(VTS).getAbsolutePath()).append("/..");
}
}
// for when one uses PythonVirtualenvPreparer.
if (mBuildInfo.getFile(PYTHONPATH) != null) {
- sb.append(":");
+ sb.append(separator);
sb.append(mBuildInfo.getFile(PYTHONPATH).getAbsolutePath());
}
if (System.getenv("ANDROID_BUILD_TOP") != null) {
- sb.append(":");
+ sb.append(separator);
sb.append(System.getenv("ANDROID_BUILD_TOP")).append("/test");
}
- mPythonPath = sb.toString();
+ if (sb.length() == 0) {
+ throw new RuntimeException("Could not find python path on host machine");
+ }
+ mPythonPath = sb.substring(1);
CLog.i("mPythonPath: %s", mPythonPath);
}
/**
- * This method gets the python binary
+ * This method gets the python binary.
*/
private String getPythonBinary() {
+ boolean isWindows = isOnWindows();
+ String python = (isWindows ? "python.exe" : "python");
try {
File venvDir = FileUtil.createNamedTempDir(
mBuildInfo.getTestTag() + "-virtualenv-" +
mBuildInfo.getDeviceSerial().replaceAll(":", "_"));
- File pythonBinaryFile = new File(venvDir.getAbsolutePath(), "bin/python");
+ String binDir = (isWindows ? "Script" : "bin");
+ File pythonBinaryFile = new File(venvDir.getAbsolutePath(),
+ binDir + File.separator + python);
if (pythonBinaryFile.exists()) {
return pythonBinaryFile.getAbsolutePath();
}
@@ -745,11 +774,12 @@
/* pass */
}
- IRunUtil runUtil = RunUtil.getDefault();
- CommandResult c = runUtil.runTimedCmd(1000, "which", "python");
+ IRunUtil runUtil = (mRunUtil == null ? RunUtil.getDefault() : mRunUtil);
+ CommandResult c = runUtil.runTimedCmd(1000,
+ (isWindows ? "where" : "which"), python);
String pythonBin = c.getStdout().trim();
if (pythonBin.length() == 0) {
- throw new RuntimeException("Could not find python binary on host "
+ throw new RuntimeException("Could not find " + python + " on host "
+ "machine");
}
return pythonBin;
diff --git a/harnesses/tradefed/tests/src/com/android/tradefed/testtype/VtsMultiDeviceTestTest.java b/harnesses/tradefed/tests/src/com/android/tradefed/testtype/VtsMultiDeviceTestTest.java
index 10b45e6..9e9616a 100644
--- a/harnesses/tradefed/tests/src/com/android/tradefed/testtype/VtsMultiDeviceTestTest.java
+++ b/harnesses/tradefed/tests/src/com/android/tradefed/testtype/VtsMultiDeviceTestTest.java
@@ -15,32 +15,40 @@
*/
package com.android.tradefed.testtype;
+import com.android.tradefed.build.FolderBuildInfo;
+import com.android.tradefed.build.IBuildInfo;
import com.android.tradefed.device.DeviceNotAvailableException;
import com.android.tradefed.device.ITestDevice;
import com.android.tradefed.result.ITestInvocationListener;
-import com.android.tradefed.util.ArrayUtil;
import com.android.tradefed.util.CommandResult;
import com.android.tradefed.util.CommandStatus;
import com.android.tradefed.util.IRunUtil;
-
+import com.android.tradefed.util.StreamUtil;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileWriter;
import junit.framework.TestCase;
import org.easymock.EasyMock;
+import org.easymock.IAnswer;
+import org.json.JSONObject;
/**
* Unit tests for {@link VtsMultiDeviceTest}.
+ * This class requires testcase config files.
+ * The working directory is assumed to be
+ * test/
+ * which contains the same config as the build output
+ * out/host/linux-x86/vts/android-vts/testcases/
*/
public class VtsMultiDeviceTestTest extends TestCase {
private ITestInvocationListener mMockInvocationListener = null;
- private ITestDevice mMockITestDevice = null;
- private IRunUtil mRunUtil = null;
+ private IBuildInfo mBuildInfo = null;
private VtsMultiDeviceTest mTest = null;
private static final String TEST_CASE_PATH =
- "test/vts/testcases/host/sample/SampleLightTest";
+ "vts/testcases/host/sample/SampleLightTest";
private static final String TEST_CONFIG_PATH =
- "test/vts/testcases/host/sample/SampleLightTest.config";
- private static final long TEST_TIMEOUT = 1000 * 60 * 5;
- private String[] mCommand = null;
+ "vts/testcases/host/camera/conventional/3_4/SampleCameraV3Test.config";
/**
* Helper to initialize the various EasyMocks we'll need.
@@ -48,30 +56,98 @@
@Override
protected void setUp() throws Exception {
super.setUp();
- mTest = new VtsMultiDeviceTest();
- mRunUtil = EasyMock.createMock(IRunUtil.class);
+ mBuildInfo = new FolderBuildInfo("MOCK_ID", "MOCK_NAME");
+ mBuildInfo.addBuildAttribute("ROOT_DIR", "DIR_NOT_EXIST");
+ mBuildInfo.addBuildAttribute("ROOT_DIR2", "DIR_NOT_EXIST");
+ mBuildInfo.addBuildAttribute("SUITE_NAME", "JUNIT_TEST_SUITE");
+ mBuildInfo.setDeviceSerial("1234567890");
mMockInvocationListener = EasyMock.createMock(ITestInvocationListener.class);
- mMockITestDevice = EasyMock.createMock(ITestDevice.class);
- mTest.setRunUtil(mRunUtil);
- //build the command
- String[] baseOpts = {"/usr/bin/python", "-m"};
- String[] testModule = {TEST_CASE_PATH, TEST_CONFIG_PATH};
- mCommand = ArrayUtil.buildArray(baseOpts, testModule);
+ mTest = new VtsMultiDeviceTest();
+ mTest.setBuild(mBuildInfo);
+ mTest.setTestCasePath(TEST_CASE_PATH);
+ mTest.setTestConfigPath(TEST_CONFIG_PATH);
+ }
+
+ /**
+ * Create a mock IRunUtil which
+ * 1. finds Python binary file and returns a mock path
+ * 2. executes the found Python binary,
+ * creates empty log file and returns expectedStatus
+ */
+ private static IRunUtil createMockRunUtil(
+ String findFileCommand, String pythonBin,
+ CommandStatus expectedStatus) {
+ IRunUtil runUtil = EasyMock.createMock(IRunUtil.class);
+ CommandResult findResult = new CommandResult();
+ findResult.setStatus(CommandStatus.SUCCESS);
+ findResult.setStdout("mock/" + pythonBin);
+ EasyMock.expect(runUtil.runTimedCmd(EasyMock.anyLong(),
+ EasyMock.eq(findFileCommand), EasyMock.eq(pythonBin))).
+ andReturn(findResult);
+
+ IAnswer<CommandResult> answer = new IAnswer<CommandResult>() {
+ @Override
+ public CommandResult answer() throws Throwable {
+ // find log path
+ String logPath = null;
+ try (FileInputStream fi = new FileInputStream(
+ (String) EasyMock.getCurrentArguments()[4])) {
+ JSONObject configJson = new JSONObject(
+ StreamUtil.getStringFromStream(fi));
+ logPath = (String) configJson.get(VtsMultiDeviceTest.LOG_PATH);
+ }
+ // create a test result on log path
+ try (FileWriter fw = new FileWriter(
+ logPath + File.separator + "test_run_summary.json")) {
+ JSONObject outJson = new JSONObject();
+ fw.write(outJson.toString());
+ }
+ CommandResult commandResult = new CommandResult();
+ commandResult.setStatus(expectedStatus);
+ return commandResult;
+ }
+ };
+ EasyMock.expect(runUtil.runTimedCmd(EasyMock.anyLong(),
+ EasyMock.eq("mock/" + pythonBin), EasyMock.eq("-m"),
+ EasyMock.eq(TEST_CASE_PATH.replace("/", ".")),
+ EasyMock.endsWith(".json"))).
+ andAnswer(answer).times(0, 1);
+ EasyMock.replay(runUtil);
+ return runUtil;
+ }
+
+ /**
+ * Create a Mock ITestDevice with necessary getter methods.
+ */
+ private static ITestDevice createMockDevice() {
+ // TestDevice
+ ITestDevice device = EasyMock.createMock(ITestDevice.class);
+ try {
+ EasyMock.expect(device.getSerialNumber()).
+ andReturn("1234567890").atLeastOnce();
+ EasyMock.expect(device.getBuildAlias()).
+ andReturn("BUILD_ALIAS");
+ EasyMock.expect(device.getBuildFlavor()).
+ andReturn("BUILD_FLAVOR");
+ EasyMock.expect(device.getBuildId()).
+ andReturn("BUILD_ID");
+ EasyMock.expect(device.getProductType()).
+ andReturn("PRODUCT_TYPE");
+ EasyMock.expect(device.getProductVariant()).
+ andReturn("PRODUCT_VARIANT");
+ } catch (DeviceNotAvailableException e) {
+ fail();
+ }
+ EasyMock.replay(device);
+ return device;
}
/**
* Test the run method with a normal input.
*/
- public void testRunNormalInput(){
- mTest.setDevice(mMockITestDevice);
- mTest.setTestCasePath(TEST_CASE_PATH);
- mTest.setTestConfigPath(TEST_CONFIG_PATH);
-
- CommandResult commandResult = new CommandResult();
- commandResult.setStatus(CommandStatus.SUCCESS);
- EasyMock.expect(mRunUtil.runTimedCmd(TEST_TIMEOUT, mCommand)).
- andReturn(commandResult);
- EasyMock.replay(mRunUtil);
+ public void testRunNormalInput() {
+ mTest.setDevice(createMockDevice());
+ mTest.setRunUtil(createMockRunUtil("which", "python", CommandStatus.SUCCESS));
try {
mTest.run(mMockInvocationListener);
} catch (IllegalArgumentException e) {
@@ -86,9 +162,25 @@
}
/**
+ * Test the run method with a normal input and Windows environment variable.
+ */
+ public void testRunNormalInputOnWindows()
+ throws IllegalArgumentException, DeviceNotAvailableException {
+ String originalName = System.getProperty(VtsMultiDeviceTest.OS_NAME);
+ System.setProperty(VtsMultiDeviceTest.OS_NAME, VtsMultiDeviceTest.WINDOWS);
+ mTest.setDevice(createMockDevice());
+ mTest.setRunUtil(createMockRunUtil("where", "python.exe", CommandStatus.SUCCESS));
+ try {
+ mTest.run(mMockInvocationListener);
+ } finally {
+ System.setProperty(VtsMultiDeviceTest.OS_NAME, originalName);
+ }
+ }
+
+ /**
* Test the run method when the device is set null.
*/
- public void testRunDevice(){
+ public void testRunDeviceNotAvailable() {
mTest.setDevice(null);
try {
mTest.run(mMockInvocationListener);
@@ -105,21 +197,20 @@
* Test the run method with abnormal input data.
*/
public void testRunNormalInputCommandFailed() {
- mTest.setDevice(mMockITestDevice);
- CommandResult commandResult = new CommandResult();
- commandResult.setStatus(CommandStatus.FAILED);
- EasyMock.expect(mRunUtil.runTimedCmd(TEST_TIMEOUT, mCommand)).
- andReturn(commandResult);
- EasyMock.replay(mRunUtil);
+ mTest.setDevice(createMockDevice());
+ mTest.setRunUtil(createMockRunUtil("which", "python", CommandStatus.FAILED));
try {
mTest.run(mMockInvocationListener);
fail();
- } catch (RuntimeException e) {
- // expected
- } catch (DeviceNotAvailableException e) {
- // not expected
- fail();
- e.printStackTrace();
- }
+ } catch (RuntimeException e) {
+ if (!"Failed to run VTS test".equals(e.getMessage())) {
+ fail();
+ }
+ // expected
+ } catch (DeviceNotAvailableException e) {
+ // not expected
+ fail();
+ e.printStackTrace();
+ }
}
}
diff --git a/proto/Android.bp b/proto/Android.bp
index f97f581..644d8a5 100644
--- a/proto/Android.bp
+++ b/proto/Android.bp
@@ -22,6 +22,7 @@
srcs: [
"AndroidSystemControlMessage.proto",
"ComponentSpecificationMessage.proto",
+ "VtsProfilingMessage.proto",
],
proto: {
diff --git a/proto/AndroidSystemControlMessage.proto b/proto/AndroidSystemControlMessage.proto
index 4e28a83..a781844 100644
--- a/proto/AndroidSystemControlMessage.proto
+++ b/proto/AndroidSystemControlMessage.proto
@@ -116,6 +116,9 @@
// the name of a target component (currently used for HIDL HALs only).
optional bytes target_component_name = 3009;
+ // the name of a HW Binder service to use (only needed for HIDL HAL).
+ optional bytes hw_binder_service_name = 3021;
+
// for LIST_APIS
// none
diff --git a/proto/AndroidSystemControlMessage_pb2.py b/proto/AndroidSystemControlMessage_pb2.py
index 790dc9c..7678798 100644
--- a/proto/AndroidSystemControlMessage_pb2.py
+++ b/proto/AndroidSystemControlMessage_pb2.py
@@ -15,7 +15,7 @@
DESCRIPTOR = _descriptor.FileDescriptor(
name='AndroidSystemControlMessage.proto',
package='android.vts',
- serialized_pb='\n!AndroidSystemControlMessage.proto\x12\x0b\x61ndroid.vts\x1a#ComponentSpecificationMessage.proto\"\xa3\x03\n\"AndroidSystemControlCommandMessage\x12.\n\x0c\x63ommand_type\x18\x01 \x01(\x0e\x32\x18.android.vts.CommandType\x12\x0e\n\x05paths\x18\xe9\x07 \x03(\x0c\x12\x16\n\rcallback_port\x18\xcd\x08 \x01(\x05\x12\x15\n\x0cservice_name\x18\xd1\x0f \x01(\x0c\x12\x30\n\x0b\x64river_type\x18\xb9\x17 \x01(\x0e\x32\x1a.android.vts.VtsDriverType\x12\x12\n\tfile_path\x18\xba\x17 \x01(\x0c\x12\r\n\x04\x62its\x18\xbb\x17 \x01(\x05\x12\x15\n\x0ctarget_class\x18\xbc\x17 \x01(\x05\x12\x14\n\x0btarget_type\x18\xbd\x17 \x01(\x05\x12\x17\n\x0etarget_version\x18\xbe\x17 \x01(\x05\x12\x14\n\x0bmodule_name\x18\xbf\x17 \x01(\x0c\x12\x17\n\x0etarget_package\x18\xc0\x17 \x01(\x0c\x12\x1e\n\x15target_component_name\x18\xc1\x17 \x01(\x0c\x12\x0c\n\x03\x61rg\x18\xa1\x1f \x01(\x0c\x12\x16\n\rshell_command\x18\x89\' \x03(\x0c\"\xd3\x01\n#AndroidSystemControlResponseMessage\x12\x30\n\rresponse_code\x18\x01 \x01(\x0e\x32\x19.android.vts.ResponseCode\x12\x0f\n\x06reason\x18\xe9\x07 \x01(\x0c\x12\x13\n\nfile_names\x18\xea\x07 \x03(\x0c\x12\r\n\x04spec\x18\xeb\x07 \x01(\x0c\x12\x0f\n\x06result\x18\xec\x07 \x01(\x0c\x12\x0f\n\x06stdout\x18\xd1\x0f \x03(\x0c\x12\x0f\n\x06stderr\x18\xd2\x0f \x03(\x0c\x12\x12\n\texit_code\x18\xd3\x0f \x03(\x05\"i\n#AndroidSystemCallbackRequestMessage\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x36\n\x03\x61rg\x18\x0b \x03(\x0b\x32).android.vts.VariableSpecificationMessage\"X\n$AndroidSystemCallbackResponseMessage\x12\x30\n\rresponse_code\x18\x01 \x01(\x0e\x32\x19.android.vts.ResponseCode*\xa5\x02\n\x0b\x43ommandType\x12\x18\n\x14UNKNOWN_COMMAND_TYPE\x10\x00\x12\r\n\tLIST_HALS\x10\x01\x12\x11\n\rSET_HOST_INFO\x10\x02\x12\x08\n\x04PING\x10\x03\x12\x18\n\x14\x43HECK_DRIVER_SERVICE\x10\x65\x12\x19\n\x15LAUNCH_DRIVER_SERVICE\x10\x66\x12(\n$VTS_AGENT_COMMAND_READ_SPECIFICATION\x10g\x12\x0e\n\tLIST_APIS\x10\xc9\x01\x12\r\n\x08\x43\x41LL_API\x10\xca\x01\x12$\n\x1fVTS_AGENT_COMMAND_GET_ATTRIBUTE\x10\xcb\x01\x12,\n\'VTS_AGENT_COMMAND_EXECUTE_SHELL_COMMAND\x10\xad\x02*@\n\x0cResponseCode\x12\x19\n\x15UNKNOWN_RESPONSE_CODE\x10\x00\x12\x0b\n\x07SUCCESS\x10\x01\x12\x08\n\x04\x46\x41IL\x10\x02*\xfd\x01\n\rVtsDriverType\x12\x1a\n\x16UKNOWN_VTS_DRIVER_TYPE\x10\x00\x12$\n VTS_DRIVER_TYPE_HAL_CONVENTIONAL\x10\x01\x12\x1e\n\x1aVTS_DRIVER_TYPE_HAL_LEGACY\x10\x02\x12\x1c\n\x18VTS_DRIVER_TYPE_HAL_HIDL\x10\x03\x12\x31\n-VTS_DRIVER_TYPE_HAL_HIDL_WRAPPED_CONVENTIONAL\x10\x04\x12\x1e\n\x1aVTS_DRIVER_TYPE_LIB_SHARED\x10\x0b\x12\x19\n\x15VTS_DRIVER_TYPE_SHELL\x10\x15')
+ serialized_pb='\n!AndroidSystemControlMessage.proto\x12\x0b\x61ndroid.vts\x1a#ComponentSpecificationMessage.proto\"\xc4\x03\n\"AndroidSystemControlCommandMessage\x12.\n\x0c\x63ommand_type\x18\x01 \x01(\x0e\x32\x18.android.vts.CommandType\x12\x0e\n\x05paths\x18\xe9\x07 \x03(\x0c\x12\x16\n\rcallback_port\x18\xcd\x08 \x01(\x05\x12\x15\n\x0cservice_name\x18\xd1\x0f \x01(\x0c\x12\x30\n\x0b\x64river_type\x18\xb9\x17 \x01(\x0e\x32\x1a.android.vts.VtsDriverType\x12\x12\n\tfile_path\x18\xba\x17 \x01(\x0c\x12\r\n\x04\x62its\x18\xbb\x17 \x01(\x05\x12\x15\n\x0ctarget_class\x18\xbc\x17 \x01(\x05\x12\x14\n\x0btarget_type\x18\xbd\x17 \x01(\x05\x12\x17\n\x0etarget_version\x18\xbe\x17 \x01(\x05\x12\x14\n\x0bmodule_name\x18\xbf\x17 \x01(\x0c\x12\x17\n\x0etarget_package\x18\xc0\x17 \x01(\x0c\x12\x1e\n\x15target_component_name\x18\xc1\x17 \x01(\x0c\x12\x1f\n\x16hw_binder_service_name\x18\xcd\x17 \x01(\x0c\x12\x0c\n\x03\x61rg\x18\xa1\x1f \x01(\x0c\x12\x16\n\rshell_command\x18\x89\' \x03(\x0c\"\xd3\x01\n#AndroidSystemControlResponseMessage\x12\x30\n\rresponse_code\x18\x01 \x01(\x0e\x32\x19.android.vts.ResponseCode\x12\x0f\n\x06reason\x18\xe9\x07 \x01(\x0c\x12\x13\n\nfile_names\x18\xea\x07 \x03(\x0c\x12\r\n\x04spec\x18\xeb\x07 \x01(\x0c\x12\x0f\n\x06result\x18\xec\x07 \x01(\x0c\x12\x0f\n\x06stdout\x18\xd1\x0f \x03(\x0c\x12\x0f\n\x06stderr\x18\xd2\x0f \x03(\x0c\x12\x12\n\texit_code\x18\xd3\x0f \x03(\x05\"i\n#AndroidSystemCallbackRequestMessage\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x36\n\x03\x61rg\x18\x0b \x03(\x0b\x32).android.vts.VariableSpecificationMessage\"X\n$AndroidSystemCallbackResponseMessage\x12\x30\n\rresponse_code\x18\x01 \x01(\x0e\x32\x19.android.vts.ResponseCode*\xa5\x02\n\x0b\x43ommandType\x12\x18\n\x14UNKNOWN_COMMAND_TYPE\x10\x00\x12\r\n\tLIST_HALS\x10\x01\x12\x11\n\rSET_HOST_INFO\x10\x02\x12\x08\n\x04PING\x10\x03\x12\x18\n\x14\x43HECK_DRIVER_SERVICE\x10\x65\x12\x19\n\x15LAUNCH_DRIVER_SERVICE\x10\x66\x12(\n$VTS_AGENT_COMMAND_READ_SPECIFICATION\x10g\x12\x0e\n\tLIST_APIS\x10\xc9\x01\x12\r\n\x08\x43\x41LL_API\x10\xca\x01\x12$\n\x1fVTS_AGENT_COMMAND_GET_ATTRIBUTE\x10\xcb\x01\x12,\n\'VTS_AGENT_COMMAND_EXECUTE_SHELL_COMMAND\x10\xad\x02*@\n\x0cResponseCode\x12\x19\n\x15UNKNOWN_RESPONSE_CODE\x10\x00\x12\x0b\n\x07SUCCESS\x10\x01\x12\x08\n\x04\x46\x41IL\x10\x02*\xfd\x01\n\rVtsDriverType\x12\x1a\n\x16UKNOWN_VTS_DRIVER_TYPE\x10\x00\x12$\n VTS_DRIVER_TYPE_HAL_CONVENTIONAL\x10\x01\x12\x1e\n\x1aVTS_DRIVER_TYPE_HAL_LEGACY\x10\x02\x12\x1c\n\x18VTS_DRIVER_TYPE_HAL_HIDL\x10\x03\x12\x31\n-VTS_DRIVER_TYPE_HAL_HIDL_WRAPPED_CONVENTIONAL\x10\x04\x12\x1e\n\x1aVTS_DRIVER_TYPE_LIB_SHARED\x10\x0b\x12\x19\n\x15VTS_DRIVER_TYPE_SHELL\x10\x15')
_COMMANDTYPE = _descriptor.EnumDescriptor(
name='CommandType',
@@ -70,8 +70,8 @@
],
containing_type=None,
options=None,
- serialized_start=921,
- serialized_end=1214,
+ serialized_start=954,
+ serialized_end=1247,
)
CommandType = enum_type_wrapper.EnumTypeWrapper(_COMMANDTYPE)
@@ -96,8 +96,8 @@
],
containing_type=None,
options=None,
- serialized_start=1216,
- serialized_end=1280,
+ serialized_start=1249,
+ serialized_end=1313,
)
ResponseCode = enum_type_wrapper.EnumTypeWrapper(_RESPONSECODE)
@@ -138,8 +138,8 @@
],
containing_type=None,
options=None,
- serialized_start=1283,
- serialized_end=1536,
+ serialized_start=1316,
+ serialized_end=1569,
)
VtsDriverType = enum_type_wrapper.EnumTypeWrapper(_VTSDRIVERTYPE)
@@ -266,14 +266,21 @@
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
- name='arg', full_name='android.vts.AndroidSystemControlCommandMessage.arg', index=13,
+ name='hw_binder_service_name', full_name='android.vts.AndroidSystemControlCommandMessage.hw_binder_service_name', index=13,
+ number=3021, type=12, cpp_type=9, label=1,
+ has_default_value=False, default_value="",
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='arg', full_name='android.vts.AndroidSystemControlCommandMessage.arg', index=14,
number=4001, type=12, cpp_type=9, label=1,
has_default_value=False, default_value="",
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
- name='shell_command', full_name='android.vts.AndroidSystemControlCommandMessage.shell_command', index=14,
+ name='shell_command', full_name='android.vts.AndroidSystemControlCommandMessage.shell_command', index=15,
number=5001, type=12, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
@@ -289,7 +296,7 @@
is_extendable=False,
extension_ranges=[],
serialized_start=88,
- serialized_end=507,
+ serialized_end=540,
)
@@ -365,8 +372,8 @@
options=None,
is_extendable=False,
extension_ranges=[],
- serialized_start=510,
- serialized_end=721,
+ serialized_start=543,
+ serialized_end=754,
)
@@ -400,8 +407,8 @@
options=None,
is_extendable=False,
extension_ranges=[],
- serialized_start=723,
- serialized_end=828,
+ serialized_start=756,
+ serialized_end=861,
)
@@ -428,8 +435,8 @@
options=None,
is_extendable=False,
extension_ranges=[],
- serialized_start=830,
- serialized_end=918,
+ serialized_start=863,
+ serialized_end=951,
)
_ANDROIDSYSTEMCONTROLCOMMANDMESSAGE.fields_by_name['command_type'].enum_type = _COMMANDTYPE
diff --git a/proto/ComponentSpecificationMessage.proto b/proto/ComponentSpecificationMessage.proto
index 920de4c..8be1f06 100644
--- a/proto/ComponentSpecificationMessage.proto
+++ b/proto/ComponentSpecificationMessage.proto
@@ -70,6 +70,14 @@
VIBRATOR = 12;
// For a thermal submodule.
THERMAL=13;
+ // For tv hdmi_cec submodule
+ TV_CEC = 15;
+ // For sensors submodule
+ SENSORS=16;
+ // For vehicle submodule
+ VEHICLE=17;
+ // For a VR submodule.
+ VR = 18;
// for bionic's libm
BIONIC_LIBM = 1001;
@@ -102,6 +110,7 @@
TYPE_SUBMODULE = 11;
TYPE_UNION = 12;
TYPE_HIDL_INTERFACE = 13;
+ TYPE_HANDLE = 14;
}
@@ -260,10 +269,11 @@
// the variable type which is one of:
// TYPE_SCALAR, TYPE_STRING, TYPE_ENUM, TYPE_ARRAY,
- // TYPE_VECTOR, TYPE_STRUCT, TYPE_UNION
+ // TYPE_VECTOR, TYPE_STRUCT, TYPE_UNION, TYPE_HIDL_CALLBACK,
+ // TYPE_HIDL_INTERFACE, TYPE_HANDLE
//
// not yet supported:
- // "template", "typedef", "handle", "binder", "parcelable".
+ // "template", "typedef", "binder", "parcelable".
optional VariableType type = 2;
// the actual value(s) for an scalar data type.
@@ -273,6 +283,8 @@
optional StringDataValueMessage string_value = 111;
+ // for the definition of enum type only.
+ // The value of a eunm variable is stored in scalar_value message.
optional EnumDataValueMessage enum_value = 121;
// for both TYPE_ARRAY (using size field) and TYPE_VECTOR.
diff --git a/proto/ComponentSpecificationMessage_pb2.py b/proto/ComponentSpecificationMessage_pb2.py
index ecf784d..4d61f98 100644
--- a/proto/ComponentSpecificationMessage_pb2.py
+++ b/proto/ComponentSpecificationMessage_pb2.py
@@ -14,7 +14,7 @@
DESCRIPTOR = _descriptor.FileDescriptor(
name='ComponentSpecificationMessage.proto',
package='android.vts',
- serialized_pb='\n#ComponentSpecificationMessage.proto\x12\x0b\x61ndroid.vts\"e\n\x1c\x43\x61llFlowSpecificationMessage\x12\x14\n\x05\x65ntry\x18\x01 \x01(\x08:\x05\x66\x61lse\x12\x13\n\x04\x65xit\x18\x02 \x01(\x08:\x05\x66\x61lse\x12\x0c\n\x04next\x18\x0b \x03(\x0c\x12\x0c\n\x04prev\x18\x0c \x03(\x0c\"C\n NativeCodeCoverageRawDataMessage\x12\x11\n\tfile_path\x18\x01 \x01(\x0c\x12\x0c\n\x04gcda\x18\x0b \x01(\x0c\"\xa3\x05\n\x1c\x46unctionSpecificationMessage\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\x16\n\x0esubmodule_name\x18\x02 \x01(\x0c\x12>\n\x0breturn_type\x18\x0b \x01(\x0b\x32).android.vts.VariableSpecificationMessage\x12\x43\n\x10return_type_hidl\x18\x0c \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12N\n\x1areturn_type_submodule_spec\x18\r \x01(\x0b\x32*.android.vts.ComponentSpecificationMessage\x12\x36\n\x03\x61rg\x18\x15 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12;\n\x08\x63\x61llflow\x18\x1f \x03(\x0b\x32).android.vts.CallFlowSpecificationMessage\x12\x13\n\x0bis_callback\x18) \x01(\x08\x12J\n\x10\x66unction_pointer\x18* \x01(\x0b\x32\x30.android.vts.FunctionPointerSpecificationMessage\x12\x16\n\x0eprofiling_data\x18\x65 \x03(\x02\x12 \n\x17processed_coverage_data\x18\xc9\x01 \x03(\r\x12I\n\x11raw_coverage_data\x18\xca\x01 \x03(\x0b\x32-.android.vts.NativeCodeCoverageRawDataMessage\x12\x14\n\x0bparent_path\x18\xad\x02 \x01(\x0c\x12\x17\n\x0esyscall_number\x18\x91\x03 \x01(\r\"\xf5\x02\n\x16ScalarDataValueMessage\x12\x0e\n\x06\x62ool_t\x18\x01 \x01(\x05\x12\x0e\n\x06int8_t\x18\x0b \x01(\x05\x12\x0f\n\x07uint8_t\x18\x0c \x01(\r\x12\x0c\n\x04\x63har\x18\r \x01(\x05\x12\r\n\x05uchar\x18\x0e \x01(\r\x12\x0f\n\x07int16_t\x18\x15 \x01(\x05\x12\x10\n\x08uint16_t\x18\x16 \x01(\r\x12\x0f\n\x07int32_t\x18\x1f \x01(\x05\x12\x10\n\x08uint32_t\x18 \x01(\r\x12\x0f\n\x07int64_t\x18) \x01(\x03\x12\x10\n\x08uint64_t\x18* \x01(\x04\x12\x0f\n\x07\x66loat_t\x18\x65 \x01(\x02\x12\x10\n\x08\x64ouble_t\x18\x66 \x01(\x01\x12\x10\n\x07pointer\x18\xc9\x01 \x01(\r\x12\x0f\n\x06opaque\x18\xca\x01 \x01(\r\x12\x15\n\x0cvoid_pointer\x18\xd3\x01 \x01(\r\x12\x15\n\x0c\x63har_pointer\x18\xd4\x01 \x01(\r\x12\x16\n\ruchar_pointer\x18\xd5\x01 \x01(\r\x12\x18\n\x0fpointer_pointer\x18\xfb\x01 \x01(\r\"\xd1\x01\n#FunctionPointerSpecificationMessage\x12\x15\n\rfunction_name\x18\x01 \x01(\x0c\x12\x0f\n\x07\x61\x64\x64ress\x18\x0b \x01(\r\x12\n\n\x02id\x18\x15 \x01(\x0c\x12\x36\n\x03\x61rg\x18\x65 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12>\n\x0breturn_type\x18o \x01(\x0b\x32).android.vts.VariableSpecificationMessage\"9\n\x16StringDataValueMessage\x12\x0f\n\x07message\x18\x01 \x01(\x0c\x12\x0e\n\x06length\x18\x0b \x01(\r\"z\n\x14\x45numDataValueMessage\x12\x12\n\nenumerator\x18\x01 \x03(\x0c\x12\x39\n\x0cscalar_value\x18\x02 \x03(\x0b\x32#.android.vts.ScalarDataValueMessage\x12\x13\n\x0bscalar_type\x18\x03 \x01(\x0c\"\x8b\x07\n\x1cVariableSpecificationMessage\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\'\n\x04type\x18\x02 \x01(\x0e\x32\x19.android.vts.VariableType\x12\x39\n\x0cscalar_value\x18\x65 \x01(\x0b\x32#.android.vts.ScalarDataValueMessage\x12\x13\n\x0bscalar_type\x18\x66 \x01(\x0c\x12\x39\n\x0cstring_value\x18o \x01(\x0b\x32#.android.vts.StringDataValueMessage\x12\x35\n\nenum_value\x18y \x01(\x0b\x32!.android.vts.EnumDataValueMessage\x12@\n\x0cvector_value\x18\x83\x01 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12\x14\n\x0bvector_size\x18\x84\x01 \x01(\x05\x12@\n\x0cstruct_value\x18\x8d\x01 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12\x14\n\x0bstruct_type\x18\x8e\x01 \x01(\x0c\x12>\n\nsub_struct\x18\x8f\x01 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12?\n\x0bunion_value\x18\x97\x01 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12\x13\n\nunion_type\x18\x98\x01 \x01(\x0c\x12=\n\tsub_union\x18\x99\x01 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12\x18\n\x0fpredefined_type\x18\xc9\x01 \x01(\x0c\x12K\n\x10\x66unction_pointer\x18\xdd\x01 \x03(\x0b\x32\x30.android.vts.FunctionPointerSpecificationMessage\x12\x1b\n\x12hidl_callback_type\x18\xe7\x01 \x01(\x0c\x12\x17\n\x08is_input\x18\xad\x02 \x01(\x08:\x04true\x12\x19\n\tis_output\x18\xae\x02 \x01(\x08:\x05\x66\x61lse\x12\x18\n\x08is_const\x18\xaf\x02 \x01(\x08:\x05\x66\x61lse\x12\x1b\n\x0bis_callback\x18\xb0\x02 \x01(\x08:\x05\x66\x61lse\"\xfb\x01\n\x1aStructSpecificationMessage\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\x19\n\nis_pointer\x18\x02 \x01(\x08:\x05\x66\x61lse\x12\x37\n\x03\x61pi\x18\xe9\x07 \x03(\x0b\x32).android.vts.FunctionSpecificationMessage\x12<\n\nsub_struct\x18\xd1\x0f \x03(\x0b\x32\'.android.vts.StructSpecificationMessage\x12=\n\tattribute\x18\xb9\x17 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\"\xd5\x01\n\x1dInterfaceSpecificationMessage\x12\x37\n\x03\x61pi\x18\xd1\x0f \x03(\x0b\x32).android.vts.FunctionSpecificationMessage\x12=\n\tattribute\x18\xb9\x17 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12<\n\nsub_struct\x18\xa1\x1f \x03(\x0b\x32\'.android.vts.StructSpecificationMessage\"\xca\x03\n\x1d\x43omponentSpecificationMessage\x12\x34\n\x0f\x63omponent_class\x18\x01 \x01(\x0e\x32\x1b.android.vts.ComponentClass\x12\x32\n\x0e\x63omponent_type\x18\x02 \x01(\x0e\x32\x1a.android.vts.ComponentType\x12!\n\x16\x63omponent_type_version\x18\x03 \x01(\x02:\x01\x31\x12\x16\n\x0e\x63omponent_name\x18\x04 \x01(\x0c\x12,\n\x0btarget_arch\x18\x05 \x01(\x0e\x32\x17.android.vts.TargetArch\x12\x0f\n\x07package\x18\x0b \x01(\x0c\x12\x0e\n\x06import\x18\x0c \x03(\x0c\x12%\n\x1coriginal_data_structure_name\x18\xe9\x07 \x01(\x0c\x12\x0f\n\x06header\x18\xea\x07 \x03(\x0c\x12>\n\tinterface\x18\xd1\x0f \x01(\x0b\x32*.android.vts.InterfaceSpecificationMessage\x12=\n\tattribute\x18\xb5\x10 \x03(\x0b\x32).android.vts.VariableSpecificationMessage*\xc9\x01\n\x0e\x43omponentClass\x12\x11\n\rUNKNOWN_CLASS\x10\x00\x12\x14\n\x10HAL_CONVENTIONAL\x10\x01\x12\x1e\n\x1aHAL_CONVENTIONAL_SUBMODULE\x10\x02\x12\x0e\n\nHAL_LEGACY\x10\x03\x12\x0c\n\x08HAL_HIDL\x10\x04\x12!\n\x1dHAL_HIDL_WRAPPED_CONVENTIONAL\x10\x05\x12\x0e\n\nLIB_SHARED\x10\x0b\x12\n\n\x06KERNEL\x10\x15\x12\x11\n\rKERNEL_MODULE\x10\x16*\xfe\x01\n\rComponentType\x12\x10\n\x0cUNKNOWN_TYPE\x10\x00\x12\t\n\x05\x41UDIO\x10\x01\x12\n\n\x06\x43\x41MERA\x10\x02\x12\x07\n\x03GPS\x10\x03\x12\t\n\x05LIGHT\x10\x04\x12\x08\n\x04WIFI\x10\x05\x12\n\n\x06MOBILE\x10\x06\x12\r\n\tBLUETOOTH\x10\x07\x12\x07\n\x03NFC\x10\x08\x12\t\n\x05POWER\x10\t\x12\x0c\n\x08MEMTRACK\x10\n\x12\x07\n\x03\x42\x46P\x10\x0b\x12\x0c\n\x08VIBRATOR\x10\x0c\x12\x0b\n\x07THERMAL\x10\r\x12\x10\n\x0b\x42IONIC_LIBM\x10\xe9\x07\x12\x10\n\x0b\x42IONIC_LIBC\x10\xea\x07\x12\x13\n\x0eVNDK_LIBCUTILS\x10\xcd\x08\x12\x0c\n\x07SYSCALL\x10\xd1\x0f*\xa0\x02\n\x0cVariableType\x12\x19\n\x15UNKNOWN_VARIABLE_TYPE\x10\x00\x12\x13\n\x0fTYPE_PREDEFINED\x10\x01\x12\x0f\n\x0bTYPE_SCALAR\x10\x02\x12\x0f\n\x0bTYPE_STRING\x10\x03\x12\r\n\tTYPE_ENUM\x10\x04\x12\x0e\n\nTYPE_ARRAY\x10\x05\x12\x0f\n\x0bTYPE_VECTOR\x10\x06\x12\x0f\n\x0bTYPE_STRUCT\x10\x07\x12\x19\n\x15TYPE_FUNCTION_POINTER\x10\x08\x12\r\n\tTYPE_VOID\x10\t\x12\x16\n\x12TYPE_HIDL_CALLBACK\x10\n\x12\x12\n\x0eTYPE_SUBMODULE\x10\x0b\x12\x0e\n\nTYPE_UNION\x10\x0c\x12\x17\n\x13TYPE_HIDL_INTERFACE\x10\r*Q\n\nTargetArch\x12\x17\n\x13UNKNOWN_TARGET_ARCH\x10\x00\x12\x13\n\x0fTARGET_ARCH_ARM\x10\x01\x12\x15\n\x11TARGET_ARCH_ARM64\x10\x02')
+ serialized_pb='\n#ComponentSpecificationMessage.proto\x12\x0b\x61ndroid.vts\"e\n\x1c\x43\x61llFlowSpecificationMessage\x12\x14\n\x05\x65ntry\x18\x01 \x01(\x08:\x05\x66\x61lse\x12\x13\n\x04\x65xit\x18\x02 \x01(\x08:\x05\x66\x61lse\x12\x0c\n\x04next\x18\x0b \x03(\x0c\x12\x0c\n\x04prev\x18\x0c \x03(\x0c\"C\n NativeCodeCoverageRawDataMessage\x12\x11\n\tfile_path\x18\x01 \x01(\x0c\x12\x0c\n\x04gcda\x18\x0b \x01(\x0c\"\xa3\x05\n\x1c\x46unctionSpecificationMessage\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\x16\n\x0esubmodule_name\x18\x02 \x01(\x0c\x12>\n\x0breturn_type\x18\x0b \x01(\x0b\x32).android.vts.VariableSpecificationMessage\x12\x43\n\x10return_type_hidl\x18\x0c \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12N\n\x1areturn_type_submodule_spec\x18\r \x01(\x0b\x32*.android.vts.ComponentSpecificationMessage\x12\x36\n\x03\x61rg\x18\x15 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12;\n\x08\x63\x61llflow\x18\x1f \x03(\x0b\x32).android.vts.CallFlowSpecificationMessage\x12\x13\n\x0bis_callback\x18) \x01(\x08\x12J\n\x10\x66unction_pointer\x18* \x01(\x0b\x32\x30.android.vts.FunctionPointerSpecificationMessage\x12\x16\n\x0eprofiling_data\x18\x65 \x03(\x02\x12 \n\x17processed_coverage_data\x18\xc9\x01 \x03(\r\x12I\n\x11raw_coverage_data\x18\xca\x01 \x03(\x0b\x32-.android.vts.NativeCodeCoverageRawDataMessage\x12\x14\n\x0bparent_path\x18\xad\x02 \x01(\x0c\x12\x17\n\x0esyscall_number\x18\x91\x03 \x01(\r\"\xf5\x02\n\x16ScalarDataValueMessage\x12\x0e\n\x06\x62ool_t\x18\x01 \x01(\x05\x12\x0e\n\x06int8_t\x18\x0b \x01(\x05\x12\x0f\n\x07uint8_t\x18\x0c \x01(\r\x12\x0c\n\x04\x63har\x18\r \x01(\x05\x12\r\n\x05uchar\x18\x0e \x01(\r\x12\x0f\n\x07int16_t\x18\x15 \x01(\x05\x12\x10\n\x08uint16_t\x18\x16 \x01(\r\x12\x0f\n\x07int32_t\x18\x1f \x01(\x05\x12\x10\n\x08uint32_t\x18 \x01(\r\x12\x0f\n\x07int64_t\x18) \x01(\x03\x12\x10\n\x08uint64_t\x18* \x01(\x04\x12\x0f\n\x07\x66loat_t\x18\x65 \x01(\x02\x12\x10\n\x08\x64ouble_t\x18\x66 \x01(\x01\x12\x10\n\x07pointer\x18\xc9\x01 \x01(\r\x12\x0f\n\x06opaque\x18\xca\x01 \x01(\r\x12\x15\n\x0cvoid_pointer\x18\xd3\x01 \x01(\r\x12\x15\n\x0c\x63har_pointer\x18\xd4\x01 \x01(\r\x12\x16\n\ruchar_pointer\x18\xd5\x01 \x01(\r\x12\x18\n\x0fpointer_pointer\x18\xfb\x01 \x01(\r\"\xd1\x01\n#FunctionPointerSpecificationMessage\x12\x15\n\rfunction_name\x18\x01 \x01(\x0c\x12\x0f\n\x07\x61\x64\x64ress\x18\x0b \x01(\r\x12\n\n\x02id\x18\x15 \x01(\x0c\x12\x36\n\x03\x61rg\x18\x65 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12>\n\x0breturn_type\x18o \x01(\x0b\x32).android.vts.VariableSpecificationMessage\"9\n\x16StringDataValueMessage\x12\x0f\n\x07message\x18\x01 \x01(\x0c\x12\x0e\n\x06length\x18\x0b \x01(\r\"z\n\x14\x45numDataValueMessage\x12\x12\n\nenumerator\x18\x01 \x03(\x0c\x12\x39\n\x0cscalar_value\x18\x02 \x03(\x0b\x32#.android.vts.ScalarDataValueMessage\x12\x13\n\x0bscalar_type\x18\x03 \x01(\x0c\"\x8b\x07\n\x1cVariableSpecificationMessage\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\'\n\x04type\x18\x02 \x01(\x0e\x32\x19.android.vts.VariableType\x12\x39\n\x0cscalar_value\x18\x65 \x01(\x0b\x32#.android.vts.ScalarDataValueMessage\x12\x13\n\x0bscalar_type\x18\x66 \x01(\x0c\x12\x39\n\x0cstring_value\x18o \x01(\x0b\x32#.android.vts.StringDataValueMessage\x12\x35\n\nenum_value\x18y \x01(\x0b\x32!.android.vts.EnumDataValueMessage\x12@\n\x0cvector_value\x18\x83\x01 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12\x14\n\x0bvector_size\x18\x84\x01 \x01(\x05\x12@\n\x0cstruct_value\x18\x8d\x01 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12\x14\n\x0bstruct_type\x18\x8e\x01 \x01(\x0c\x12>\n\nsub_struct\x18\x8f\x01 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12?\n\x0bunion_value\x18\x97\x01 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12\x13\n\nunion_type\x18\x98\x01 \x01(\x0c\x12=\n\tsub_union\x18\x99\x01 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12\x18\n\x0fpredefined_type\x18\xc9\x01 \x01(\x0c\x12K\n\x10\x66unction_pointer\x18\xdd\x01 \x03(\x0b\x32\x30.android.vts.FunctionPointerSpecificationMessage\x12\x1b\n\x12hidl_callback_type\x18\xe7\x01 \x01(\x0c\x12\x17\n\x08is_input\x18\xad\x02 \x01(\x08:\x04true\x12\x19\n\tis_output\x18\xae\x02 \x01(\x08:\x05\x66\x61lse\x12\x18\n\x08is_const\x18\xaf\x02 \x01(\x08:\x05\x66\x61lse\x12\x1b\n\x0bis_callback\x18\xb0\x02 \x01(\x08:\x05\x66\x61lse\"\xfb\x01\n\x1aStructSpecificationMessage\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\x19\n\nis_pointer\x18\x02 \x01(\x08:\x05\x66\x61lse\x12\x37\n\x03\x61pi\x18\xe9\x07 \x03(\x0b\x32).android.vts.FunctionSpecificationMessage\x12<\n\nsub_struct\x18\xd1\x0f \x03(\x0b\x32\'.android.vts.StructSpecificationMessage\x12=\n\tattribute\x18\xb9\x17 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\"\xd5\x01\n\x1dInterfaceSpecificationMessage\x12\x37\n\x03\x61pi\x18\xd1\x0f \x03(\x0b\x32).android.vts.FunctionSpecificationMessage\x12=\n\tattribute\x18\xb9\x17 \x03(\x0b\x32).android.vts.VariableSpecificationMessage\x12<\n\nsub_struct\x18\xa1\x1f \x03(\x0b\x32\'.android.vts.StructSpecificationMessage\"\xca\x03\n\x1d\x43omponentSpecificationMessage\x12\x34\n\x0f\x63omponent_class\x18\x01 \x01(\x0e\x32\x1b.android.vts.ComponentClass\x12\x32\n\x0e\x63omponent_type\x18\x02 \x01(\x0e\x32\x1a.android.vts.ComponentType\x12!\n\x16\x63omponent_type_version\x18\x03 \x01(\x02:\x01\x31\x12\x16\n\x0e\x63omponent_name\x18\x04 \x01(\x0c\x12,\n\x0btarget_arch\x18\x05 \x01(\x0e\x32\x17.android.vts.TargetArch\x12\x0f\n\x07package\x18\x0b \x01(\x0c\x12\x0e\n\x06import\x18\x0c \x03(\x0c\x12%\n\x1coriginal_data_structure_name\x18\xe9\x07 \x01(\x0c\x12\x0f\n\x06header\x18\xea\x07 \x03(\x0c\x12>\n\tinterface\x18\xd1\x0f \x01(\x0b\x32*.android.vts.InterfaceSpecificationMessage\x12=\n\tattribute\x18\xb5\x10 \x03(\x0b\x32).android.vts.VariableSpecificationMessage*\xc9\x01\n\x0e\x43omponentClass\x12\x11\n\rUNKNOWN_CLASS\x10\x00\x12\x14\n\x10HAL_CONVENTIONAL\x10\x01\x12\x1e\n\x1aHAL_CONVENTIONAL_SUBMODULE\x10\x02\x12\x0e\n\nHAL_LEGACY\x10\x03\x12\x0c\n\x08HAL_HIDL\x10\x04\x12!\n\x1dHAL_HIDL_WRAPPED_CONVENTIONAL\x10\x05\x12\x0e\n\nLIB_SHARED\x10\x0b\x12\n\n\x06KERNEL\x10\x15\x12\x11\n\rKERNEL_MODULE\x10\x16*\xac\x02\n\rComponentType\x12\x10\n\x0cUNKNOWN_TYPE\x10\x00\x12\t\n\x05\x41UDIO\x10\x01\x12\n\n\x06\x43\x41MERA\x10\x02\x12\x07\n\x03GPS\x10\x03\x12\t\n\x05LIGHT\x10\x04\x12\x08\n\x04WIFI\x10\x05\x12\n\n\x06MOBILE\x10\x06\x12\r\n\tBLUETOOTH\x10\x07\x12\x07\n\x03NFC\x10\x08\x12\t\n\x05POWER\x10\t\x12\x0c\n\x08MEMTRACK\x10\n\x12\x07\n\x03\x42\x46P\x10\x0b\x12\x0c\n\x08VIBRATOR\x10\x0c\x12\x0b\n\x07THERMAL\x10\r\x12\n\n\x06TV_CEC\x10\x0f\x12\x0b\n\x07SENSORS\x10\x10\x12\x0b\n\x07VEHICLE\x10\x11\x12\x06\n\x02VR\x10\x12\x12\x10\n\x0b\x42IONIC_LIBM\x10\xe9\x07\x12\x10\n\x0b\x42IONIC_LIBC\x10\xea\x07\x12\x13\n\x0eVNDK_LIBCUTILS\x10\xcd\x08\x12\x0c\n\x07SYSCALL\x10\xd1\x0f*\xb1\x02\n\x0cVariableType\x12\x19\n\x15UNKNOWN_VARIABLE_TYPE\x10\x00\x12\x13\n\x0fTYPE_PREDEFINED\x10\x01\x12\x0f\n\x0bTYPE_SCALAR\x10\x02\x12\x0f\n\x0bTYPE_STRING\x10\x03\x12\r\n\tTYPE_ENUM\x10\x04\x12\x0e\n\nTYPE_ARRAY\x10\x05\x12\x0f\n\x0bTYPE_VECTOR\x10\x06\x12\x0f\n\x0bTYPE_STRUCT\x10\x07\x12\x19\n\x15TYPE_FUNCTION_POINTER\x10\x08\x12\r\n\tTYPE_VOID\x10\t\x12\x16\n\x12TYPE_HIDL_CALLBACK\x10\n\x12\x12\n\x0eTYPE_SUBMODULE\x10\x0b\x12\x0e\n\nTYPE_UNION\x10\x0c\x12\x17\n\x13TYPE_HIDL_INTERFACE\x10\r\x12\x0f\n\x0bTYPE_HANDLE\x10\x0e*Q\n\nTargetArch\x12\x17\n\x13UNKNOWN_TARGET_ARCH\x10\x00\x12\x13\n\x0fTARGET_ARCH_ARM\x10\x01\x12\x15\n\x11TARGET_ARCH_ARM64\x10\x02')
_COMPONENTCLASS = _descriptor.EnumDescriptor(
name='ComponentClass',
@@ -129,26 +129,42 @@
options=None,
type=None),
_descriptor.EnumValueDescriptor(
- name='BIONIC_LIBM', index=14, number=1001,
+ name='TV_CEC', index=14, number=15,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
- name='BIONIC_LIBC', index=15, number=1002,
+ name='SENSORS', index=15, number=16,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
- name='VNDK_LIBCUTILS', index=16, number=1101,
+ name='VEHICLE', index=16, number=17,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
- name='SYSCALL', index=17, number=2001,
+ name='VR', index=17, number=18,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='BIONIC_LIBM', index=18, number=1001,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='BIONIC_LIBC', index=19, number=1002,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='VNDK_LIBCUTILS', index=20, number=1101,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='SYSCALL', index=21, number=2001,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=3719,
- serialized_end=3973,
+ serialized_end=4019,
)
ComponentType = enum_type_wrapper.EnumTypeWrapper(_COMPONENTTYPE)
@@ -214,11 +230,15 @@
name='TYPE_HIDL_INTERFACE', index=13, number=13,
options=None,
type=None),
+ _descriptor.EnumValueDescriptor(
+ name='TYPE_HANDLE', index=14, number=14,
+ options=None,
+ type=None),
],
containing_type=None,
options=None,
- serialized_start=3976,
- serialized_end=4264,
+ serialized_start=4022,
+ serialized_end=4327,
)
VariableType = enum_type_wrapper.EnumTypeWrapper(_VARIABLETYPE)
@@ -243,8 +263,8 @@
],
containing_type=None,
options=None,
- serialized_start=4266,
- serialized_end=4347,
+ serialized_start=4329,
+ serialized_end=4410,
)
TargetArch = enum_type_wrapper.EnumTypeWrapper(_TARGETARCH)
@@ -271,6 +291,10 @@
BFP = 11
VIBRATOR = 12
THERMAL = 13
+TV_CEC = 15
+SENSORS = 16
+VEHICLE = 17
+VR = 18
BIONIC_LIBM = 1001
BIONIC_LIBC = 1002
VNDK_LIBCUTILS = 1101
@@ -289,6 +313,7 @@
TYPE_SUBMODULE = 11
TYPE_UNION = 12
TYPE_HIDL_INTERFACE = 13
+TYPE_HANDLE = 14
UNKNOWN_TARGET_ARCH = 0
TARGET_ARCH_ARM = 1
TARGET_ARCH_ARM64 = 2
diff --git a/proto/VtsDriverControlMessage.proto b/proto/VtsDriverControlMessage.proto
index 970a37b..85b4d98 100644
--- a/proto/VtsDriverControlMessage.proto
+++ b/proto/VtsDriverControlMessage.proto
@@ -85,6 +85,9 @@
// the name of a target component (currently used for HIDL HALs only).
optional bytes target_component_name = 1207;
+ // the name of a HW Binder service to use (only needed for HIDL HAL).
+ optional bytes hw_binder_service_name = 1221;
+
// for LIST_FUNCTIONS
// none
diff --git a/proto/VtsDriverControlMessage_pb2.py b/proto/VtsDriverControlMessage_pb2.py
deleted file mode 100644
index 1c34538..0000000
--- a/proto/VtsDriverControlMessage_pb2.py
+++ /dev/null
@@ -1,269 +0,0 @@
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: VtsDriverControlMessage.proto
-
-from google.protobuf.internal import enum_type_wrapper
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import descriptor_pb2
-# @@protoc_insertion_point(imports)
-
-
-
-
-DESCRIPTOR = _descriptor.FileDescriptor(
- name='VtsDriverControlMessage.proto',
- package='android.vts',
- serialized_pb='\n\x1dVtsDriverControlMessage.proto\x12\x0b\x61ndroid.vts\"\x85\x02\n\x1eVtsDriverControlCommandMessage\x12\x37\n\x0c\x63ommand_type\x18\x01 \x01(\x0e\x32!.android.vts.VtsDriverCommandType\x12\x14\n\x0bstatus_type\x18\xcd\x08 \x01(\x05\x12\x12\n\tfile_path\x18\xb1\t \x01(\x0c\x12\x15\n\x0ctarget_class\x18\xb2\t \x01(\x05\x12\x14\n\x0btarget_type\x18\xb3\t \x01(\x05\x12\x17\n\x0etarget_version\x18\xb4\t \x01(\x02\x12\x14\n\x0bmodule_name\x18\xb5\t \x01(\x0c\x12\x0c\n\x03\x61rg\x18\xf9\n \x01(\x0c\x12\x16\n\rshell_command\x18\xd1\x0f \x03(\x0c\"\xc0\x01\n\x1fVtsDriverControlResponseMessage\x12\x39\n\rresponse_code\x18\x01 \x01(\x0e\x32\".android.vts.VtsDriverResponseCode\x12\x14\n\x0creturn_value\x18\x0b \x01(\x05\x12\x16\n\x0ereturn_message\x18\x0c \x01(\x0c\x12\x0f\n\x06stdout\x18\xe9\x07 \x03(\x0c\x12\x0f\n\x06stderr\x18\xea\x07 \x03(\x0c\x12\x12\n\texit_code\x18\xeb\x07 \x03(\x05*\xb5\x01\n\x14VtsDriverCommandType\x12#\n\x1fUNKNOWN_VTS_DRIVER_COMMAND_TYPE\x10\x00\x12\x08\n\x04\x45XIT\x10\x01\x12\x0e\n\nGET_STATUS\x10\x02\x12\x0c\n\x08LOAD_HAL\x10\x65\x12\x12\n\x0eLIST_FUNCTIONS\x10\x66\x12\x11\n\rCALL_FUNCTION\x10g\x12\x14\n\x0f\x45XECUTE_COMMAND\x10\xc9\x01\x12\x13\n\x0eINVOKE_SYSCALL\x10\xca\x01*|\n\x15VtsDriverResponseCode\x12$\n UNKNOWN_VTS_DRIVER_RESPONSE_CODE\x10\x00\x12\x1f\n\x1bVTS_DRIVER_RESPONSE_SUCCESS\x10\x01\x12\x1c\n\x18VTS_DRIVER_RESPONSE_FAIL\x10\x02')
-
-_VTSDRIVERCOMMANDTYPE = _descriptor.EnumDescriptor(
- name='VtsDriverCommandType',
- full_name='android.vts.VtsDriverCommandType',
- filename=None,
- file=DESCRIPTOR,
- values=[
- _descriptor.EnumValueDescriptor(
- name='UNKNOWN_VTS_DRIVER_COMMAND_TYPE', index=0, number=0,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='EXIT', index=1, number=1,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='GET_STATUS', index=2, number=2,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='LOAD_HAL', index=3, number=101,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='LIST_FUNCTIONS', index=4, number=102,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='CALL_FUNCTION', index=5, number=103,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='EXECUTE_COMMAND', index=6, number=201,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='INVOKE_SYSCALL', index=7, number=202,
- options=None,
- type=None),
- ],
- containing_type=None,
- options=None,
- serialized_start=506,
- serialized_end=687,
-)
-
-VtsDriverCommandType = enum_type_wrapper.EnumTypeWrapper(_VTSDRIVERCOMMANDTYPE)
-_VTSDRIVERRESPONSECODE = _descriptor.EnumDescriptor(
- name='VtsDriverResponseCode',
- full_name='android.vts.VtsDriverResponseCode',
- filename=None,
- file=DESCRIPTOR,
- values=[
- _descriptor.EnumValueDescriptor(
- name='UNKNOWN_VTS_DRIVER_RESPONSE_CODE', index=0, number=0,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='VTS_DRIVER_RESPONSE_SUCCESS', index=1, number=1,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='VTS_DRIVER_RESPONSE_FAIL', index=2, number=2,
- options=None,
- type=None),
- ],
- containing_type=None,
- options=None,
- serialized_start=689,
- serialized_end=813,
-)
-
-VtsDriverResponseCode = enum_type_wrapper.EnumTypeWrapper(_VTSDRIVERRESPONSECODE)
-UNKNOWN_VTS_DRIVER_COMMAND_TYPE = 0
-EXIT = 1
-GET_STATUS = 2
-LOAD_HAL = 101
-LIST_FUNCTIONS = 102
-CALL_FUNCTION = 103
-EXECUTE_COMMAND = 201
-INVOKE_SYSCALL = 202
-UNKNOWN_VTS_DRIVER_RESPONSE_CODE = 0
-VTS_DRIVER_RESPONSE_SUCCESS = 1
-VTS_DRIVER_RESPONSE_FAIL = 2
-
-
-
-_VTSDRIVERCONTROLCOMMANDMESSAGE = _descriptor.Descriptor(
- name='VtsDriverControlCommandMessage',
- full_name='android.vts.VtsDriverControlCommandMessage',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='command_type', full_name='android.vts.VtsDriverControlCommandMessage.command_type', index=0,
- number=1, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='status_type', full_name='android.vts.VtsDriverControlCommandMessage.status_type', index=1,
- number=1101, type=5, cpp_type=1, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='file_path', full_name='android.vts.VtsDriverControlCommandMessage.file_path', index=2,
- number=1201, type=12, cpp_type=9, label=1,
- has_default_value=False, default_value="",
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='target_class', full_name='android.vts.VtsDriverControlCommandMessage.target_class', index=3,
- number=1202, type=5, cpp_type=1, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='target_type', full_name='android.vts.VtsDriverControlCommandMessage.target_type', index=4,
- number=1203, type=5, cpp_type=1, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='target_version', full_name='android.vts.VtsDriverControlCommandMessage.target_version', index=5,
- number=1204, type=2, cpp_type=6, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='module_name', full_name='android.vts.VtsDriverControlCommandMessage.module_name', index=6,
- number=1205, type=12, cpp_type=9, label=1,
- has_default_value=False, default_value="",
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='arg', full_name='android.vts.VtsDriverControlCommandMessage.arg', index=7,
- number=1401, type=12, cpp_type=9, label=1,
- has_default_value=False, default_value="",
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='shell_command', full_name='android.vts.VtsDriverControlCommandMessage.shell_command', index=8,
- number=2001, type=12, cpp_type=9, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- options=None,
- is_extendable=False,
- extension_ranges=[],
- serialized_start=47,
- serialized_end=308,
-)
-
-
-_VTSDRIVERCONTROLRESPONSEMESSAGE = _descriptor.Descriptor(
- name='VtsDriverControlResponseMessage',
- full_name='android.vts.VtsDriverControlResponseMessage',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='response_code', full_name='android.vts.VtsDriverControlResponseMessage.response_code', index=0,
- number=1, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='return_value', full_name='android.vts.VtsDriverControlResponseMessage.return_value', index=1,
- number=11, type=5, cpp_type=1, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='return_message', full_name='android.vts.VtsDriverControlResponseMessage.return_message', index=2,
- number=12, type=12, cpp_type=9, label=1,
- has_default_value=False, default_value="",
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='stdout', full_name='android.vts.VtsDriverControlResponseMessage.stdout', index=3,
- number=1001, type=12, cpp_type=9, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='stderr', full_name='android.vts.VtsDriverControlResponseMessage.stderr', index=4,
- number=1002, type=12, cpp_type=9, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='exit_code', full_name='android.vts.VtsDriverControlResponseMessage.exit_code', index=5,
- number=1003, type=5, cpp_type=1, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- options=None,
- is_extendable=False,
- extension_ranges=[],
- serialized_start=311,
- serialized_end=503,
-)
-
-_VTSDRIVERCONTROLCOMMANDMESSAGE.fields_by_name['command_type'].enum_type = _VTSDRIVERCOMMANDTYPE
-_VTSDRIVERCONTROLRESPONSEMESSAGE.fields_by_name['response_code'].enum_type = _VTSDRIVERRESPONSECODE
-DESCRIPTOR.message_types_by_name['VtsDriverControlCommandMessage'] = _VTSDRIVERCONTROLCOMMANDMESSAGE
-DESCRIPTOR.message_types_by_name['VtsDriverControlResponseMessage'] = _VTSDRIVERCONTROLRESPONSEMESSAGE
-
-class VtsDriverControlCommandMessage(_message.Message):
- __metaclass__ = _reflection.GeneratedProtocolMessageType
- DESCRIPTOR = _VTSDRIVERCONTROLCOMMANDMESSAGE
-
- # @@protoc_insertion_point(class_scope:android.vts.VtsDriverControlCommandMessage)
-
-class VtsDriverControlResponseMessage(_message.Message):
- __metaclass__ = _reflection.GeneratedProtocolMessageType
- DESCRIPTOR = _VTSDRIVERCONTROLRESPONSEMESSAGE
-
- # @@protoc_insertion_point(class_scope:android.vts.VtsDriverControlResponseMessage)
-
-
-# @@protoc_insertion_point(module_scope)
diff --git a/proto/VtsProfilingMessage.proto b/proto/VtsProfilingMessage.proto
new file mode 100644
index 0000000..0ae9d4b
--- /dev/null
+++ b/proto/VtsProfilingMessage.proto
@@ -0,0 +1,63 @@
+// Copyright 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.
+
+syntax = "proto2";
+
+package android.vts;
+
+import "test/vts/proto/ComponentSpecificationMessage.proto";
+
+// Type of an instrumentation event.
+enum InstrumentationEventType {
+ // Entry event on the server side of a binderized HAL.
+ SERVER_API_ENTRY = 0;
+ // Exit event on the server side of a binderized HAL.
+ SERVER_API_EXIT = 1;
+ // Entry event on the client side of a binderized HAL.
+ CLIENT_API_ENTRY = 2;
+ // Exit event on the client side of a binderized HAL.
+ CLIENT_API_EXIT = 3;
+ // Entry event of a synchronize callback.
+ SYNC_CALLBACK_ENTRY = 4;
+ // Exit event of a synchronize callback.
+ SYNC_CALLBACK_EXIT = 5;
+ // Entry event of a asynchronize callback.
+ ASYNC_CALLBACK_ENTRY = 6;
+ // Exit event of a asynchronize callback.
+ ASYNC_CALLBACK_EXIT = 7;
+ // Entry event of a passthrough HAL.
+ PASSTHROUGH_ENTRY = 8;
+ // Exit event of a passthrough HAL.
+ PASSTHROUGH_EXIT = 9;
+}
+
+// To specify a VTS profiling record.
+message VtsProfilingRecord {
+ // The timestamp of the profiling record.
+ optional uint32 timestamp = 1;
+ // Type of the profiling event.
+ optional InstrumentationEventType event = 2;
+ // Package name of the profiling HAL.
+ optional bytes package = 3;
+ // Version of the profiling HAL.
+ optional float version = 4;
+ // Interface name of the profiling HAL.
+ optional bytes interface = 5;
+ // Message of the called function.
+ optional FunctionSpecificationMessage func_msg = 6;
+}
+
+message VtsProfilingMessage {
+ repeated VtsProfilingRecord records = 1;
+}
diff --git a/proto/VtsProfilingMessage_pb2.py b/proto/VtsProfilingMessage_pb2.py
new file mode 100644
index 0000000..fde937f
--- /dev/null
+++ b/proto/VtsProfilingMessage_pb2.py
@@ -0,0 +1,196 @@
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: VtsProfilingMessage.proto
+
+from google.protobuf.internal import enum_type_wrapper
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import descriptor_pb2
+# @@protoc_insertion_point(imports)
+
+
+import ComponentSpecificationMessage_pb2
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+ name='VtsProfilingMessage.proto',
+ package='android.vts',
+ serialized_pb='\n\x19VtsProfilingMessage.proto\x12\x0b\x61ndroid.vts\x1a#ComponentSpecificationMessage.proto\"\xcf\x01\n\x12VtsProfilingRecord\x12\x11\n\ttimestamp\x18\x01 \x01(\r\x12\x34\n\x05\x65vent\x18\x02 \x01(\x0e\x32%.android.vts.InstrumentationEventType\x12\x0f\n\x07package\x18\x03 \x01(\x0c\x12\x0f\n\x07version\x18\x04 \x01(\x02\x12\x11\n\tinterface\x18\x05 \x01(\x0c\x12;\n\x08\x66unc_msg\x18\x06 \x01(\x0b\x32).android.vts.FunctionSpecificationMessage\"G\n\x13VtsProfilingMessage\x12\x30\n\x07records\x18\x01 \x03(\x0b\x32\x1f.android.vts.VtsProfilingRecord*\x81\x02\n\x18InstrumentationEventType\x12\x14\n\x10SERVER_API_ENTRY\x10\x00\x12\x13\n\x0fSERVER_API_EXIT\x10\x01\x12\x14\n\x10\x43LIENT_API_ENTRY\x10\x02\x12\x13\n\x0f\x43LIENT_API_EXIT\x10\x03\x12\x17\n\x13SYNC_CALLBACK_ENTRY\x10\x04\x12\x16\n\x12SYNC_CALLBACK_EXIT\x10\x05\x12\x18\n\x14\x41SYNC_CALLBACK_ENTRY\x10\x06\x12\x17\n\x13\x41SYNC_CALLBACK_EXIT\x10\x07\x12\x15\n\x11PASSTHROUGH_ENTRY\x10\x08\x12\x14\n\x10PASSTHROUGH_EXIT\x10\t')
+
+_INSTRUMENTATIONEVENTTYPE = _descriptor.EnumDescriptor(
+ name='InstrumentationEventType',
+ full_name='android.vts.InstrumentationEventType',
+ filename=None,
+ file=DESCRIPTOR,
+ values=[
+ _descriptor.EnumValueDescriptor(
+ name='SERVER_API_ENTRY', index=0, number=0,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='SERVER_API_EXIT', index=1, number=1,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='CLIENT_API_ENTRY', index=2, number=2,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='CLIENT_API_EXIT', index=3, number=3,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='SYNC_CALLBACK_ENTRY', index=4, number=4,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='SYNC_CALLBACK_EXIT', index=5, number=5,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='ASYNC_CALLBACK_ENTRY', index=6, number=6,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='ASYNC_CALLBACK_EXIT', index=7, number=7,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='PASSTHROUGH_ENTRY', index=8, number=8,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='PASSTHROUGH_EXIT', index=9, number=9,
+ options=None,
+ type=None),
+ ],
+ containing_type=None,
+ options=None,
+ serialized_start=363,
+ serialized_end=620,
+)
+
+InstrumentationEventType = enum_type_wrapper.EnumTypeWrapper(_INSTRUMENTATIONEVENTTYPE)
+SERVER_API_ENTRY = 0
+SERVER_API_EXIT = 1
+CLIENT_API_ENTRY = 2
+CLIENT_API_EXIT = 3
+SYNC_CALLBACK_ENTRY = 4
+SYNC_CALLBACK_EXIT = 5
+ASYNC_CALLBACK_ENTRY = 6
+ASYNC_CALLBACK_EXIT = 7
+PASSTHROUGH_ENTRY = 8
+PASSTHROUGH_EXIT = 9
+
+
+
+_VTSPROFILINGRECORD = _descriptor.Descriptor(
+ name='VtsProfilingRecord',
+ full_name='android.vts.VtsProfilingRecord',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='timestamp', full_name='android.vts.VtsProfilingRecord.timestamp', index=0,
+ number=1, type=13, cpp_type=3, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='event', full_name='android.vts.VtsProfilingRecord.event', index=1,
+ number=2, type=14, cpp_type=8, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='package', full_name='android.vts.VtsProfilingRecord.package', index=2,
+ number=3, type=12, cpp_type=9, label=1,
+ has_default_value=False, default_value="",
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='version', full_name='android.vts.VtsProfilingRecord.version', index=3,
+ number=4, type=2, cpp_type=6, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='interface', full_name='android.vts.VtsProfilingRecord.interface', index=4,
+ number=5, type=12, cpp_type=9, label=1,
+ has_default_value=False, default_value="",
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='func_msg', full_name='android.vts.VtsProfilingRecord.func_msg', index=5,
+ number=6, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ options=None,
+ is_extendable=False,
+ extension_ranges=[],
+ serialized_start=80,
+ serialized_end=287,
+)
+
+
+_VTSPROFILINGMESSAGE = _descriptor.Descriptor(
+ name='VtsProfilingMessage',
+ full_name='android.vts.VtsProfilingMessage',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='records', full_name='android.vts.VtsProfilingMessage.records', index=0,
+ number=1, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ options=None,
+ is_extendable=False,
+ extension_ranges=[],
+ serialized_start=289,
+ serialized_end=360,
+)
+
+_VTSPROFILINGRECORD.fields_by_name['event'].enum_type = _INSTRUMENTATIONEVENTTYPE
+_VTSPROFILINGRECORD.fields_by_name['func_msg'].message_type = ComponentSpecificationMessage_pb2._FUNCTIONSPECIFICATIONMESSAGE
+_VTSPROFILINGMESSAGE.fields_by_name['records'].message_type = _VTSPROFILINGRECORD
+DESCRIPTOR.message_types_by_name['VtsProfilingRecord'] = _VTSPROFILINGRECORD
+DESCRIPTOR.message_types_by_name['VtsProfilingMessage'] = _VTSPROFILINGMESSAGE
+
+class VtsProfilingRecord(_message.Message):
+ __metaclass__ = _reflection.GeneratedProtocolMessageType
+ DESCRIPTOR = _VTSPROFILINGRECORD
+
+ # @@protoc_insertion_point(class_scope:android.vts.VtsProfilingRecord)
+
+class VtsProfilingMessage(_message.Message):
+ __metaclass__ = _reflection.GeneratedProtocolMessageType
+ DESCRIPTOR = _VTSPROFILINGMESSAGE
+
+ # @@protoc_insertion_point(class_scope:android.vts.VtsProfilingMessage)
+
+
+# @@protoc_insertion_point(module_scope)
diff --git a/proto/VtsReportMessage.proto b/proto/VtsReportMessage.proto
index bfe5f33..fa41b3c 100644
--- a/proto/VtsReportMessage.proto
+++ b/proto/VtsReportMessage.proto
@@ -39,6 +39,15 @@
VTS_TARGET_SIDE_FUZZING = 4;
}
+enum VtsProfilingRegressionMode {
+ UNKNOWN_REGRESSION_MODE = 0;
+ // disable analysis
+ VTS_REGRESSION_MODE_DISABLED = 1;
+ // interpret increases in values as regression
+ VTS_REGRESSION_MODE_INCREASING = 2;
+ // interpret decreases in values as regression
+ VTS_REGRESSION_MODE_DECREASING= 3;
+}
enum VtsProfilingType {
UNKNOWN_VTS_PROFILING_TYPE = 0;
@@ -101,6 +110,13 @@
}
+// To specify the information about a host node.
+message VtsHostInfo {
+ // the host name (i.e., full domain name).
+ optional bytes hostname = 1;
+}
+
+
// To specify a test case execution report.
message TestCaseReportMessage {
// the test case name.
@@ -123,6 +139,7 @@
// the instrumentation point name.
optional bytes name = 1;
optional VtsProfilingType type = 2;
+ optional VtsProfilingRegressionMode regression_mode = 3;
// profiling start and end time stamp (for performance).
optional int64 start_timestamp = 11;
@@ -192,6 +209,9 @@
// email addresses of subscribers to the test results
repeated bytes subscriber_email = 6;
+ // info about the host computer
+ optional VtsHostInfo host_info = 7;
+
// test case reports
repeated TestCaseReportMessage test_case = 11;
diff --git a/proto/VtsReportMessage_pb2.py b/proto/VtsReportMessage_pb2.py
index 1ab1323..aa8cf18 100644
--- a/proto/VtsReportMessage_pb2.py
+++ b/proto/VtsReportMessage_pb2.py
@@ -14,7 +14,7 @@
DESCRIPTOR = _descriptor.FileDescriptor(
name='VtsReportMessage.proto',
package='android.vts',
- serialized_pb='\n\x16VtsReportMessage.proto\x12\x0b\x61ndroid.vts\"\xe0\x01\n\x18\x41ndroidDeviceInfoMessage\x12\x14\n\x0cproduct_type\x18\x01 \x01(\x0c\x12\x17\n\x0fproduct_variant\x18\x02 \x01(\x0c\x12\x14\n\x0c\x62uild_flavor\x18\x0b \x01(\x0c\x12\x10\n\x08\x62uild_id\x18\x0c \x01(\x0c\x12\x0e\n\x06\x62ranch\x18\x15 \x01(\x0c\x12\x13\n\x0b\x62uild_alias\x18\x16 \x01(\x0c\x12\x11\n\tapi_level\x18\x1f \x01(\x0c\x12\x10\n\x08\x61\x62i_name\x18\x33 \x01(\x0c\x12\x13\n\x0b\x61\x62i_bitness\x18\x34 \x01(\x0c\x12\x0e\n\x06serial\x18\x65 \x01(\x0c\"g\n\x10\x41ndroidBuildInfo\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x0c\n\x04name\x18\x0b \x01(\x0c\x12\x12\n\nbuild_type\x18\x0c \x01(\x0c\x12\x0e\n\x06\x62ranch\x18\r \x01(\x0c\x12\x15\n\rbuild_summary\x18\x15 \x01(\x0c\"\xbd\x01\n\x15TestCaseReportMessage\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\x30\n\x0btest_result\x18\x0b \x01(\x0e\x32\x1b.android.vts.TestCaseResult\x12\x17\n\x0fstart_timestamp\x18\x15 \x01(\x03\x12\x15\n\rend_timestamp\x18\x16 \x01(\x03\x12\x34\n\x08\x63overage\x18\x1f \x03(\x0b\x32\".android.vts.CoverageReportMessage\"\xcd\x01\n\x16ProfilingReportMessage\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12+\n\x04type\x18\x02 \x01(\x0e\x32\x1d.android.vts.VtsProfilingType\x12\x17\n\x0fstart_timestamp\x18\x0b \x01(\x03\x12\x15\n\rend_timestamp\x18\x0c \x01(\x03\x12\r\n\x05label\x18\x15 \x03(\x0c\x12\r\n\x05value\x18\x16 \x03(\x03\x12\x14\n\x0cx_axis_label\x18\x1f \x01(\x0c\x12\x14\n\x0cy_axis_label\x18 \x01(\x0c\"\xe5\x01\n\x15\x43overageReportMessage\x12\x11\n\tfile_path\x18\x0b \x01(\x0c\x12\x14\n\x0cproject_name\x18\x0c \x01(\x0c\x12\x10\n\x08revision\x18\r \x01(\x0c\x12\x1c\n\x14line_coverage_vector\x18\x17 \x03(\x05\x12\x18\n\x10total_line_count\x18\x65 \x01(\x05\x12\x1a\n\x12\x63overed_line_count\x18\x66 \x01(\x05\x12\x14\n\x08\x64ir_path\x18\x01 \x01(\x0c\x42\x02\x18\x01\x12\x15\n\tfile_name\x18\x02 \x01(\x0c\x42\x02\x18\x01\x12\x10\n\x04html\x18\x03 \x01(\x0c\x42\x02\x18\x01\"\xc0\x03\n\x11TestReportMessage\x12\x12\n\ntest_suite\x18\x01 \x01(\x0c\x12\x0c\n\x04test\x18\x02 \x01(\x0c\x12+\n\ttest_type\x18\x03 \x01(\x0e\x32\x18.android.vts.VtsTestType\x12:\n\x0b\x64\x65vice_info\x18\x04 \x03(\x0b\x32%.android.vts.AndroidDeviceInfoMessage\x12\x31\n\nbuild_info\x18\x05 \x01(\x0b\x32\x1d.android.vts.AndroidBuildInfo\x12\x18\n\x10subscriber_email\x18\x06 \x03(\x0c\x12\x35\n\ttest_case\x18\x0b \x03(\x0b\x32\".android.vts.TestCaseReportMessage\x12\x36\n\tprofiling\x18\x15 \x03(\x0b\x32#.android.vts.ProfilingReportMessage\x12\x17\n\x0fstart_timestamp\x18\x65 \x01(\x03\x12\x15\n\rend_timestamp\x18\x66 \x01(\x03\x12\x34\n\x08\x63overage\x18g \x03(\x0b\x32\".android.vts.CoverageReportMessage*\xb3\x01\n\x0eTestCaseResult\x12\x12\n\x0eUNKNOWN_RESULT\x10\x00\x12\x19\n\x15TEST_CASE_RESULT_PASS\x10\x01\x12\x19\n\x15TEST_CASE_RESULT_FAIL\x10\x02\x12\x19\n\x15TEST_CASE_RESULT_SKIP\x10\x03\x12\x1e\n\x1aTEST_CASE_RESULT_EXCEPTION\x10\x04\x12\x1c\n\x18TEST_CASE_RESULT_TIMEOUT\x10\x05*\x9c\x01\n\x0bVtsTestType\x12\x18\n\x14UNKNOWN_VTS_TESTTYPE\x10\x00\x12\x1e\n\x1aVTS_HOST_DRIVEN_STRUCTURAL\x10\x01\x12\x1b\n\x17VTS_HOST_DRIVEN_FUZZING\x10\x02\x12\x19\n\x15VTS_TARGET_SIDE_GTEST\x10\x03\x12\x1b\n\x17VTS_TARGET_SIDE_FUZZING\x10\x04*{\n\x10VtsProfilingType\x12\x1e\n\x1aUNKNOWN_VTS_PROFILING_TYPE\x10\x00\x12 \n\x1cVTS_PROFILING_TYPE_TIMESTAMP\x10\x01\x12%\n!VTS_PROFILING_TYPE_LABELED_VECTOR\x10\x02\x42)\n\x15\x63om.android.vts.protoB\x10VtsReportMessage')
+ serialized_pb='\n\x16VtsReportMessage.proto\x12\x0b\x61ndroid.vts\"\xe0\x01\n\x18\x41ndroidDeviceInfoMessage\x12\x14\n\x0cproduct_type\x18\x01 \x01(\x0c\x12\x17\n\x0fproduct_variant\x18\x02 \x01(\x0c\x12\x14\n\x0c\x62uild_flavor\x18\x0b \x01(\x0c\x12\x10\n\x08\x62uild_id\x18\x0c \x01(\x0c\x12\x0e\n\x06\x62ranch\x18\x15 \x01(\x0c\x12\x13\n\x0b\x62uild_alias\x18\x16 \x01(\x0c\x12\x11\n\tapi_level\x18\x1f \x01(\x0c\x12\x10\n\x08\x61\x62i_name\x18\x33 \x01(\x0c\x12\x13\n\x0b\x61\x62i_bitness\x18\x34 \x01(\x0c\x12\x0e\n\x06serial\x18\x65 \x01(\x0c\"g\n\x10\x41ndroidBuildInfo\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x0c\n\x04name\x18\x0b \x01(\x0c\x12\x12\n\nbuild_type\x18\x0c \x01(\x0c\x12\x0e\n\x06\x62ranch\x18\r \x01(\x0c\x12\x15\n\rbuild_summary\x18\x15 \x01(\x0c\"\x1f\n\x0bVtsHostInfo\x12\x10\n\x08hostname\x18\x01 \x01(\x0c\"\xbd\x01\n\x15TestCaseReportMessage\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12\x30\n\x0btest_result\x18\x0b \x01(\x0e\x32\x1b.android.vts.TestCaseResult\x12\x17\n\x0fstart_timestamp\x18\x15 \x01(\x03\x12\x15\n\rend_timestamp\x18\x16 \x01(\x03\x12\x34\n\x08\x63overage\x18\x1f \x03(\x0b\x32\".android.vts.CoverageReportMessage\"\x8f\x02\n\x16ProfilingReportMessage\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x12+\n\x04type\x18\x02 \x01(\x0e\x32\x1d.android.vts.VtsProfilingType\x12@\n\x0fregression_mode\x18\x03 \x01(\x0e\x32\'.android.vts.VtsProfilingRegressionMode\x12\x17\n\x0fstart_timestamp\x18\x0b \x01(\x03\x12\x15\n\rend_timestamp\x18\x0c \x01(\x03\x12\r\n\x05label\x18\x15 \x03(\x0c\x12\r\n\x05value\x18\x16 \x03(\x03\x12\x14\n\x0cx_axis_label\x18\x1f \x01(\x0c\x12\x14\n\x0cy_axis_label\x18 \x01(\x0c\"\xe5\x01\n\x15\x43overageReportMessage\x12\x11\n\tfile_path\x18\x0b \x01(\x0c\x12\x14\n\x0cproject_name\x18\x0c \x01(\x0c\x12\x10\n\x08revision\x18\r \x01(\x0c\x12\x1c\n\x14line_coverage_vector\x18\x17 \x03(\x05\x12\x18\n\x10total_line_count\x18\x65 \x01(\x05\x12\x1a\n\x12\x63overed_line_count\x18\x66 \x01(\x05\x12\x14\n\x08\x64ir_path\x18\x01 \x01(\x0c\x42\x02\x18\x01\x12\x15\n\tfile_name\x18\x02 \x01(\x0c\x42\x02\x18\x01\x12\x10\n\x04html\x18\x03 \x01(\x0c\x42\x02\x18\x01\"\xed\x03\n\x11TestReportMessage\x12\x12\n\ntest_suite\x18\x01 \x01(\x0c\x12\x0c\n\x04test\x18\x02 \x01(\x0c\x12+\n\ttest_type\x18\x03 \x01(\x0e\x32\x18.android.vts.VtsTestType\x12:\n\x0b\x64\x65vice_info\x18\x04 \x03(\x0b\x32%.android.vts.AndroidDeviceInfoMessage\x12\x31\n\nbuild_info\x18\x05 \x01(\x0b\x32\x1d.android.vts.AndroidBuildInfo\x12\x18\n\x10subscriber_email\x18\x06 \x03(\x0c\x12+\n\thost_info\x18\x07 \x01(\x0b\x32\x18.android.vts.VtsHostInfo\x12\x35\n\ttest_case\x18\x0b \x03(\x0b\x32\".android.vts.TestCaseReportMessage\x12\x36\n\tprofiling\x18\x15 \x03(\x0b\x32#.android.vts.ProfilingReportMessage\x12\x17\n\x0fstart_timestamp\x18\x65 \x01(\x03\x12\x15\n\rend_timestamp\x18\x66 \x01(\x03\x12\x34\n\x08\x63overage\x18g \x03(\x0b\x32\".android.vts.CoverageReportMessage*\xb3\x01\n\x0eTestCaseResult\x12\x12\n\x0eUNKNOWN_RESULT\x10\x00\x12\x19\n\x15TEST_CASE_RESULT_PASS\x10\x01\x12\x19\n\x15TEST_CASE_RESULT_FAIL\x10\x02\x12\x19\n\x15TEST_CASE_RESULT_SKIP\x10\x03\x12\x1e\n\x1aTEST_CASE_RESULT_EXCEPTION\x10\x04\x12\x1c\n\x18TEST_CASE_RESULT_TIMEOUT\x10\x05*\x9c\x01\n\x0bVtsTestType\x12\x18\n\x14UNKNOWN_VTS_TESTTYPE\x10\x00\x12\x1e\n\x1aVTS_HOST_DRIVEN_STRUCTURAL\x10\x01\x12\x1b\n\x17VTS_HOST_DRIVEN_FUZZING\x10\x02\x12\x19\n\x15VTS_TARGET_SIDE_GTEST\x10\x03\x12\x1b\n\x17VTS_TARGET_SIDE_FUZZING\x10\x04*\xa3\x01\n\x1aVtsProfilingRegressionMode\x12\x1b\n\x17UNKNOWN_REGRESSION_MODE\x10\x00\x12 \n\x1cVTS_REGRESSION_MODE_DISABLED\x10\x01\x12\"\n\x1eVTS_REGRESSION_MODE_INCREASING\x10\x02\x12\"\n\x1eVTS_REGRESSION_MODE_DECREASING\x10\x03*{\n\x10VtsProfilingType\x12\x1e\n\x1aUNKNOWN_VTS_PROFILING_TYPE\x10\x00\x12 \n\x1cVTS_PROFILING_TYPE_TIMESTAMP\x10\x01\x12%\n!VTS_PROFILING_TYPE_LABELED_VECTOR\x10\x02\x42)\n\x15\x63om.android.vts.protoB\x10VtsReportMessage')
_TESTCASERESULT = _descriptor.EnumDescriptor(
name='TestCaseResult',
@@ -49,8 +49,8 @@
],
containing_type=None,
options=None,
- serialized_start=1455,
- serialized_end=1634,
+ serialized_start=1599,
+ serialized_end=1778,
)
TestCaseResult = enum_type_wrapper.EnumTypeWrapper(_TESTCASERESULT)
@@ -83,11 +83,41 @@
],
containing_type=None,
options=None,
- serialized_start=1637,
- serialized_end=1793,
+ serialized_start=1781,
+ serialized_end=1937,
)
VtsTestType = enum_type_wrapper.EnumTypeWrapper(_VTSTESTTYPE)
+_VTSPROFILINGREGRESSIONMODE = _descriptor.EnumDescriptor(
+ name='VtsProfilingRegressionMode',
+ full_name='android.vts.VtsProfilingRegressionMode',
+ filename=None,
+ file=DESCRIPTOR,
+ values=[
+ _descriptor.EnumValueDescriptor(
+ name='UNKNOWN_REGRESSION_MODE', index=0, number=0,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='VTS_REGRESSION_MODE_DISABLED', index=1, number=1,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='VTS_REGRESSION_MODE_INCREASING', index=2, number=2,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='VTS_REGRESSION_MODE_DECREASING', index=3, number=3,
+ options=None,
+ type=None),
+ ],
+ containing_type=None,
+ options=None,
+ serialized_start=1940,
+ serialized_end=2103,
+)
+
+VtsProfilingRegressionMode = enum_type_wrapper.EnumTypeWrapper(_VTSPROFILINGREGRESSIONMODE)
_VTSPROFILINGTYPE = _descriptor.EnumDescriptor(
name='VtsProfilingType',
full_name='android.vts.VtsProfilingType',
@@ -109,8 +139,8 @@
],
containing_type=None,
options=None,
- serialized_start=1795,
- serialized_end=1918,
+ serialized_start=2105,
+ serialized_end=2228,
)
VtsProfilingType = enum_type_wrapper.EnumTypeWrapper(_VTSPROFILINGTYPE)
@@ -125,6 +155,10 @@
VTS_HOST_DRIVEN_FUZZING = 2
VTS_TARGET_SIDE_GTEST = 3
VTS_TARGET_SIDE_FUZZING = 4
+UNKNOWN_REGRESSION_MODE = 0
+VTS_REGRESSION_MODE_DISABLED = 1
+VTS_REGRESSION_MODE_INCREASING = 2
+VTS_REGRESSION_MODE_DECREASING = 3
UNKNOWN_VTS_PROFILING_TYPE = 0
VTS_PROFILING_TYPE_TIMESTAMP = 1
VTS_PROFILING_TYPE_LABELED_VECTOR = 2
@@ -278,6 +312,34 @@
)
+_VTSHOSTINFO = _descriptor.Descriptor(
+ name='VtsHostInfo',
+ full_name='android.vts.VtsHostInfo',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='hostname', full_name='android.vts.VtsHostInfo.hostname', index=0,
+ number=1, type=12, cpp_type=9, label=1,
+ has_default_value=False, default_value="",
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ options=None,
+ is_extendable=False,
+ extension_ranges=[],
+ serialized_start=371,
+ serialized_end=402,
+)
+
+
_TESTCASEREPORTMESSAGE = _descriptor.Descriptor(
name='TestCaseReportMessage',
full_name='android.vts.TestCaseReportMessage',
@@ -329,8 +391,8 @@
options=None,
is_extendable=False,
extension_ranges=[],
- serialized_start=372,
- serialized_end=561,
+ serialized_start=405,
+ serialized_end=594,
)
@@ -356,42 +418,49 @@
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
- name='start_timestamp', full_name='android.vts.ProfilingReportMessage.start_timestamp', index=2,
+ name='regression_mode', full_name='android.vts.ProfilingReportMessage.regression_mode', index=2,
+ number=3, type=14, cpp_type=8, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='start_timestamp', full_name='android.vts.ProfilingReportMessage.start_timestamp', index=3,
number=11, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
- name='end_timestamp', full_name='android.vts.ProfilingReportMessage.end_timestamp', index=3,
+ name='end_timestamp', full_name='android.vts.ProfilingReportMessage.end_timestamp', index=4,
number=12, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
- name='label', full_name='android.vts.ProfilingReportMessage.label', index=4,
+ name='label', full_name='android.vts.ProfilingReportMessage.label', index=5,
number=21, type=12, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
- name='value', full_name='android.vts.ProfilingReportMessage.value', index=5,
+ name='value', full_name='android.vts.ProfilingReportMessage.value', index=6,
number=22, type=3, cpp_type=2, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
- name='x_axis_label', full_name='android.vts.ProfilingReportMessage.x_axis_label', index=6,
+ name='x_axis_label', full_name='android.vts.ProfilingReportMessage.x_axis_label', index=7,
number=31, type=12, cpp_type=9, label=1,
has_default_value=False, default_value="",
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
- name='y_axis_label', full_name='android.vts.ProfilingReportMessage.y_axis_label', index=7,
+ name='y_axis_label', full_name='android.vts.ProfilingReportMessage.y_axis_label', index=8,
number=32, type=12, cpp_type=9, label=1,
has_default_value=False, default_value="",
message_type=None, enum_type=None, containing_type=None,
@@ -406,8 +475,8 @@
options=None,
is_extendable=False,
extension_ranges=[],
- serialized_start=564,
- serialized_end=769,
+ serialized_start=597,
+ serialized_end=868,
)
@@ -490,8 +559,8 @@
options=None,
is_extendable=False,
extension_ranges=[],
- serialized_start=772,
- serialized_end=1001,
+ serialized_start=871,
+ serialized_end=1100,
)
@@ -545,35 +614,42 @@
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
- name='test_case', full_name='android.vts.TestReportMessage.test_case', index=6,
+ name='host_info', full_name='android.vts.TestReportMessage.host_info', index=6,
+ number=7, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='test_case', full_name='android.vts.TestReportMessage.test_case', index=7,
number=11, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
- name='profiling', full_name='android.vts.TestReportMessage.profiling', index=7,
+ name='profiling', full_name='android.vts.TestReportMessage.profiling', index=8,
number=21, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
- name='start_timestamp', full_name='android.vts.TestReportMessage.start_timestamp', index=8,
+ name='start_timestamp', full_name='android.vts.TestReportMessage.start_timestamp', index=9,
number=101, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
- name='end_timestamp', full_name='android.vts.TestReportMessage.end_timestamp', index=9,
+ name='end_timestamp', full_name='android.vts.TestReportMessage.end_timestamp', index=10,
number=102, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
- name='coverage', full_name='android.vts.TestReportMessage.coverage', index=10,
+ name='coverage', full_name='android.vts.TestReportMessage.coverage', index=11,
number=103, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
@@ -588,21 +664,24 @@
options=None,
is_extendable=False,
extension_ranges=[],
- serialized_start=1004,
- serialized_end=1452,
+ serialized_start=1103,
+ serialized_end=1596,
)
_TESTCASEREPORTMESSAGE.fields_by_name['test_result'].enum_type = _TESTCASERESULT
_TESTCASEREPORTMESSAGE.fields_by_name['coverage'].message_type = _COVERAGEREPORTMESSAGE
_PROFILINGREPORTMESSAGE.fields_by_name['type'].enum_type = _VTSPROFILINGTYPE
+_PROFILINGREPORTMESSAGE.fields_by_name['regression_mode'].enum_type = _VTSPROFILINGREGRESSIONMODE
_TESTREPORTMESSAGE.fields_by_name['test_type'].enum_type = _VTSTESTTYPE
_TESTREPORTMESSAGE.fields_by_name['device_info'].message_type = _ANDROIDDEVICEINFOMESSAGE
_TESTREPORTMESSAGE.fields_by_name['build_info'].message_type = _ANDROIDBUILDINFO
+_TESTREPORTMESSAGE.fields_by_name['host_info'].message_type = _VTSHOSTINFO
_TESTREPORTMESSAGE.fields_by_name['test_case'].message_type = _TESTCASEREPORTMESSAGE
_TESTREPORTMESSAGE.fields_by_name['profiling'].message_type = _PROFILINGREPORTMESSAGE
_TESTREPORTMESSAGE.fields_by_name['coverage'].message_type = _COVERAGEREPORTMESSAGE
DESCRIPTOR.message_types_by_name['AndroidDeviceInfoMessage'] = _ANDROIDDEVICEINFOMESSAGE
DESCRIPTOR.message_types_by_name['AndroidBuildInfo'] = _ANDROIDBUILDINFO
+DESCRIPTOR.message_types_by_name['VtsHostInfo'] = _VTSHOSTINFO
DESCRIPTOR.message_types_by_name['TestCaseReportMessage'] = _TESTCASEREPORTMESSAGE
DESCRIPTOR.message_types_by_name['ProfilingReportMessage'] = _PROFILINGREPORTMESSAGE
DESCRIPTOR.message_types_by_name['CoverageReportMessage'] = _COVERAGEREPORTMESSAGE
@@ -620,6 +699,12 @@
# @@protoc_insertion_point(class_scope:android.vts.AndroidBuildInfo)
+class VtsHostInfo(_message.Message):
+ __metaclass__ = _reflection.GeneratedProtocolMessageType
+ DESCRIPTOR = _VTSHOSTINFO
+
+ # @@protoc_insertion_point(class_scope:android.vts.VtsHostInfo)
+
class TestCaseReportMessage(_message.Message):
__metaclass__ = _reflection.GeneratedProtocolMessageType
DESCRIPTOR = _TESTCASEREPORTMESSAGE
diff --git a/run-angler.sh b/run-angler.sh
index 87941d1..0ec3604 100755
--- a/run-angler.sh
+++ b/run-angler.sh
@@ -23,5 +23,7 @@
# PYTHONPATH=$PYTHONPATH:.. python -m vts.testcases.host.camera.conventional.3_4.SampleCameraV3Test
# PYTHONPATH=$PYTHONPATH:.. python -m vts.testcases.hal.nfc.hidl.host.NfcHidlBasicTest
# PYTHONPATH=$PYTHONPATH:.. python -m vts.testcases.hal.vibrator.hidl.host.VibratorHidlTest
+# PYTHONPATH=$PYTHONPATH:.. python -m vts.testcases.hal.vr.hidl.host.VrHidlTest
+# PYTHONPATH=$PYTHONPATH:.. python -m vts.testcases.hal.tv_cec.hidl.host.TvCecHidlTest
# PYTHONPATH=$PYTHONPATH:.. python -m vts.testcases.host.shell.SampleShellTest
# PYTHONPATH=$PYTHONPATH:.. python -m vts.testcases.fuzz_test.lib_bionic.LibBionicLibmFuzzTest
diff --git a/runners/host/base_test.py b/runners/host/base_test.py
index ff312e8..dd8ff84 100644
--- a/runners/host/base_test.py
+++ b/runners/host/base_test.py
@@ -432,13 +432,13 @@
if hasattr(self, keys.ConfigKeys.IKEY_ABI_BITNESS):
bitness = getattr(self, keys.ConfigKeys.IKEY_ABI_BITNESS)
+ run_32bit_on_64bit_abi = getattr(
+ self, keys.ConfigKeys.IKEY_RUN_32BIT_ON_64BIT_ABI, False)
asserts.skipIf(
- (test_name[-len(const.SUFFIX_32BIT):].lower() ==
- const.SUFFIX_32BIT and bitness != "32") or
- (test_name[-len(const.SUFFIX_64BIT):].lower() ==
- const.SUFFIX_64BIT and bitness != "64" and
- not getattr(self, keys.ConfigKeys.IKEY_RUN_32BIT_ON_64BIT_ABI,
- False)),
+ (test_name.lower().endswith(const.SUFFIX_32BIT) and
+ bitness != "32") or
+ (test_name.lower().endswith(const.SUFFIX_64BIT) and
+ bitness != "64" and not run_32bit_on_64bit_abi),
"Test case '{}' excluded as abi bitness is {}.".format(
test_name, bitness))
diff --git a/runners/host/base_test_with_webdb.py b/runners/host/base_test_with_webdb.py
index 0a21dc0..1c92ee2 100644
--- a/runners/host/base_test_with_webdb.py
+++ b/runners/host/base_test_with_webdb.py
@@ -19,6 +19,7 @@
import io
import logging
import os
+import socket
import traceback
import time
import xml.etree.ElementTree as ET
@@ -69,15 +70,12 @@
USE_GAE_DB = "use_gae_db"
COVERAGE = "coverage"
MODULES = "modules"
- GIT_PROJECT_NAME = "git_project_name"
- GIT_PROJECT_PATH = "git_project_path"
SERVICE_JSON_PATH = "service_key_json_path"
COVERAGE_ZIP = "coverage_zip"
- REVISION = "revision"
+ REVISION_DICT = "revision_dict"
STATUS_TABLE = "vts_status_table"
BIGTABLE_BASE_URL = "bigtable_base_url"
BRANCH = "master"
- ENABLE_PROFILING = "enable_profiling"
VTS_PROFILING_TRACING_PATH = "profiling_trace_path"
def __init__(self, configs):
@@ -88,13 +86,14 @@
is called.
"""
self.getUserParams(opt_param_names=[
- self.USE_GAE_DB, self.BIGTABLE_BASE_URL, self.MODULES,
- self.GIT_PROJECT_NAME, self.GIT_PROJECT_PATH,
+ self.USE_GAE_DB, self.BIGTABLE_BASE_URL, self.MODULES, self.COVERAGE,
self.SERVICE_JSON_PATH, keys.ConfigKeys.IKEY_DATA_FILE_PATH,
- keys.ConfigKeys.KEY_TESTBED_NAME, self.ENABLE_PROFILING,
- self.VTS_PROFILING_TRACING_PATH
+ keys.ConfigKeys.KEY_TESTBED_NAME, self.VTS_PROFILING_TRACING_PATH
])
+ self.enable_profiling = self.getUserParam(
+ keys.ConfigKeys.IKEY_ENABLE_PROFILING, default_value=False)
+
if getattr(self, self.USE_GAE_DB, False):
logging.info("GAE-DB: turned on")
self._report_msg = ReportMsg.TestReportMessage()
@@ -115,6 +114,7 @@
self._report_msg.test = test_module_name
self._report_msg.test_type = ReportMsg.VTS_HOST_DRIVEN_STRUCTURAL
self._report_msg.start_timestamp = self.GetTimestamp()
+ self._report_msg.host_info.hostname = socket.gethostname()
self.SetDeviceInfo(self._report_msg)
self.InitializeCoverage()
self._profiling = {}
@@ -348,7 +348,8 @@
labels,
values,
x_axis_label="x-axis",
- y_axis_label="y-axis"):
+ y_axis_label="y-axis",
+ regression_mode=ReportMsg.VTS_REGRESSION_MODE_INCREASING):
"""Adds the profiling data in order to upload to the web DB.
Args:
@@ -357,6 +358,8 @@
values: a list of values.
x-axis_label: string, the x-axis label title for a graph plot.
y-axis_label: string, the y-axis label title for a graph plot.
+ regression_mode: specifies the direction of change which indicates
+ performance regression.
"""
if not getattr(self, self.USE_GAE_DB, False):
logging.error("'use_gae_db' config is not True.")
@@ -370,6 +373,7 @@
self._profiling[name].name = name
self._profiling[
name].type = ReportMsg.VTS_PROFILING_TYPE_LABELED_VECTOR
+ self._profiling[name].regression_mode = regression_mode
for label, value in zip(labels, values):
self._profiling[name].label.append(label)
self._profiling[name].value.append(value)
@@ -406,6 +410,9 @@
Returns:
True if test is ready for coverage instrumentation, False otherwise.
"""
+ if not getattr(self, self.COVERAGE, False):
+ logging.info("coverage disabled in config")
+ return
setattr(self, self.COVERAGE, False)
if len(self._report_msg.device_info) == 0:
logging.error("could not read device info")
@@ -432,18 +439,6 @@
logging.error("couldn't find service json path")
return False
- # Get project name
- project_name = getattr(self, self.GIT_PROJECT_NAME, False)
- if not project_name:
- logging.error("couldn't find git project name")
- return False
-
- # Get project path
- project_path = getattr(self, self.GIT_PROJECT_PATH, False)
- if not project_path:
- logging.error("couldn't find project path")
- return False
-
# Instantiate build client
try:
build_client = artifact_fetcher.AndroidBuildClient(
@@ -454,21 +449,15 @@
# Fetch repo dictionary
try:
- repos = build_client.GetRepoDictionary(self.BRANCH, build_flavor,
- device_build_id)
+ revision_dict = build_client.GetRepoDictionary(self.BRANCH,
+ build_flavor,
+ device_build_id)
except:
logging.error("Could not read build info for branch %s, " +
- "target %s, id: %s" % (self.BRANCH, build_flavor,
- device_build_id))
+ "target %s, id: %s", self.BRANCH, build_flavor,
+ device_build_id)
return False
- # Get revision (commit ID) from manifest
- if project_name not in repos:
- logging.error("Could not find project %s in repo dictionary",
- project_name)
- return False
- revision = str(repos[project_name])
-
# Fetch coverage zip
try:
cov_zip = io.BytesIO(
@@ -482,7 +471,7 @@
))
return False
setattr(self, self.COVERAGE_ZIP, cov_zip)
- setattr(self, self.REVISION, revision)
+ setattr(self, self.REVISION_DICT, revision_dict)
setattr(self, self.COVERAGE, True)
return True
@@ -503,8 +492,6 @@
Returns:
True if the coverage data is successfully processed, False otherwise
"""
- logging.info("SetCoverageData %s", coverage_data)
-
if not getattr(self, self.COVERAGE, False):
logging.info("coverage disabled")
return False
@@ -516,9 +503,6 @@
if isinstance(coverage_data, RepeatedCompositeFieldContainer):
gcda_dict = {}
for coverage_msg in coverage_data:
- logging.info("coverage file_path %s", coverage_msg.file_path)
- logging.info("coverage gcda len %d bytes",
- len(coverage_msg.gcda))
gcda_dict[coverage_msg.file_path] = coverage_msg.gcda
elif isinstance(coverage_data, dict):
gcda_dict = coverage_data
@@ -526,21 +510,19 @@
logging.error("unexpected coverage_data type: %s",
str(type(coverage_data)))
return False
+ logging.info("coverage file paths %s", str([fp for fp in gcda_dict]))
report_msg = self._report_msg if isGlobal else self._current_test_report_msg
try:
cov_zip = getattr(self, self.COVERAGE_ZIP)
modules = getattr(self, self.MODULES)
- project_name = getattr(self, self.GIT_PROJECT_NAME)
- project_path = getattr(self, self.GIT_PROJECT_PATH)
- revision = getattr(self, self.REVISION)
+ revision_dict = getattr(self, self.REVISION_DICT)
except AttributeError as e:
logging.error("attributes not found %s", str(e))
return False
coverage_utils.ProcessCoverageData(report_msg, cov_zip, modules,
- gcda_dict, project_name,
- project_path, revision)
+ gcda_dict, revision_dict)
return True
def ProcessAndUploadTraceData(self, dut, profiling_trace_path):
diff --git a/runners/host/keys.py b/runners/host/keys.py
index 4fef7ff..5217180 100644
--- a/runners/host/keys.py
+++ b/runners/host/keys.py
@@ -62,6 +62,9 @@
IKEY_API_LEVEL = "api_level"
IKEY_SERIAL = "serial"
+ # Keys for profiling
+ IKEY_ENABLE_PROFILING = "enable_profiling"
+
# A list of keys whose values in configs should not be passed to test
# classes without unpacking first.
RESERVED_KEYS = (KEY_TESTBED, KEY_LOG_PATH, KEY_TEST_PATHS)
diff --git a/runners/host/tcp_client/vts_tcp_client.py b/runners/host/tcp_client/vts_tcp_client.py
index e79b9e0..5158b3a 100755
--- a/runners/host/tcp_client/vts_tcp_client.py
+++ b/runners/host/tcp_client/vts_tcp_client.py
@@ -135,7 +135,8 @@
def LaunchDriverService(self, driver_type, service_name, bits,
file_path=None, target_class=None, target_type=None,
target_version=None, target_package=None,
- target_component_name=None):
+ target_component_name=None,
+ hw_binder_service_name=None):
"""RPC to LAUNCH_DRIVER_SERVICE."""
logging.info("service_name: %s", service_name)
logging.info("file_path: %s", file_path)
@@ -150,7 +151,8 @@
target_type=target_type,
target_version=target_version,
target_package=target_package,
- target_component_name=target_component_name)
+ target_component_name=target_component_name,
+ hw_binder_service_name=hw_binder_service_name)
resp = self.RecvResponse()
logging.info("resp for LAUNCH_DRIVER_SERVICE: %s", resp)
return (resp.response_code == SysMsg_pb2.SUCCESS)
@@ -190,9 +192,12 @@
result_scalar = None
if (result.return_type_hidl[0].type ==
CompSpecMsg_pb2.TYPE_SCALAR):
- result_scalar = getattr(
- result.return_type_hidl[0].scalar_value,
- result.return_type_hidl[0].scalar_type)
+ scalar_type = getattr(result.return_type_hidl[0],
+ "scalar_type", "")
+ if scalar_type:
+ result_scalar = getattr(
+ result.return_type_hidl[0].scalar_value,
+ scalar_type)
elif (result.return_type_hidl[0].type ==
CompSpecMsg_pb2.TYPE_ENUM):
scalar_type = getattr(result.return_type_hidl[0],
@@ -302,6 +307,7 @@
target_version=None,
target_package=None,
target_component_name=None,
+ hw_binder_service_name=None,
module_name=None,
service_name=None,
callback_port=None,
@@ -341,6 +347,9 @@
if target_component_name is not None:
command_msg.target_component_name = target_component_name
+ if hw_binder_service_name is not None:
+ command_msg.hw_binder_service_name = hw_binder_service_name
+
if module_name is not None:
command_msg.module_name = module_name
@@ -390,10 +399,10 @@
try:
if index != 0:
logging.info("retrying...")
- header = self.channel.readline()
- len = int(header.strip("\n"))
- logging.info("resp %d bytes", len)
- data = self.channel.read(len)
+ header = self.channel.readline().strip("\n")
+ length = int(header) if header else 0
+ logging.info("resp %d bytes", length)
+ data = self.channel.read(length)
response_msg = SysMsg_pb2.AndroidSystemControlResponseMessage()
response_msg.ParseFromString(data)
logging.debug("Response %s", "success"
diff --git a/script/setup.sh b/script/setup.sh
index 0b60a91..6bda7a9 100755
--- a/script/setup.sh
+++ b/script/setup.sh
@@ -38,6 +38,7 @@
sudo pip install requests
sudo pip install httplib2
sudo pip install google-api-python-client
+sudo pip install google-cloud-pubsub
echo "Install packages for Camera ITS tests"
sudo apt-get install python-tk
diff --git a/setup.sh b/setup.sh
index e58a0f9..d1fcdd4 100755
--- a/setup.sh
+++ b/setup.sh
@@ -47,11 +47,9 @@
adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib/libprotobuf-cpp-full.so /data/local/tmp/32/
adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/libprotobuf-cpp-full.so /data/local/tmp/64/
- echo "install vts driver for hidl"
- adb push ${ANDROID_BUILD_TOP}/out/target/product/${DEVICE}/system/lib/libvts_driver_hidl_nfc@1.0.so /data/local/tmp/32/
- adb push ${ANDROID_BUILD_TOP}/out/target/product/${DEVICE}/system/lib64/libvts_driver_hidl_nfc@1.0.so /data/local/tmp/64/
- adb push ${ANDROID_BUILD_TOP}/out/target/product/${DEVICE}/system/lib/libvts_driver_hidl_vibrator@1.0.so /data/local/tmp/32/
- adb push ${ANDROID_BUILD_TOP}/out/target/product/${DEVICE}/system/lib64/libvts_driver_hidl_vibrator@1.0.so /data/local/tmp/64/
+ echo "install vts drivers for hidl"
+ adb push ${ANDROID_BUILD_TOP}/out/target/product/${DEVICE}/system/lib/android.hardware.*.vts.driver@1.0.so /data/local/tmp/32/
+ adb push ${ANDROID_BUILD_TOP}/out/target/product/${DEVICE}/system/lib64/android.hardware.*.vts.driver@1.0.so /data/local/tmp/64/
echo "install hal packages"
adb shell mkdir -p /data/local/tmp/32/hw
@@ -66,8 +64,8 @@
adb push ${ANDROID_BUILD_TOP}/out/target/product/${DEVICE}/obj/EXECUTABLES/libhwbinder_benchmark_intermediates/LINKED/libhwbinder_benchmark64 /data/local/tmp/64/
# uncomment for hidl in non-treble devices
- # adb push ${ANDROID_BUILD_TOP}/out/target/product/${DEVICE}/system/lib/android.hardware.nfc@1.0.so /data/local/tmp/32/hw/android.hardware.nfc@1.0.so
- # adb push ${ANDROID_BUILD_TOP}/out/target/product/${DEVICE}/system/lib64/android.hardware.nfc@1.0.so /data/local/tmp/64/hw/android.hardware.nfc@1.0.so
+ # adb push ${ANDROID_BUILD_TOP}/out/target/product/${DEVICE}/system/lib/android.hardware.nfc.vts.driver@1.0.so /data/local/tmp/32/hw/
+ # adb push ${ANDROID_BUILD_TOP}/out/target/product/${DEVICE}/system/lib64/android.hardware.nfc.vts.driver@1.0.so /data/local/tmp/64/hw/
# adb push images/${DEVICE}/32/libhwbinder.so /data/local/tmp/32/libhwbinder.so
# adb push images/${DEVICE}/64/libhwbinder.so /data/local/tmp/64/libhwbinder.so
@@ -82,9 +80,10 @@
adb push ${ANDROID_BUILD_TOP}/test/vts/specification/hal_conventional/WifiHalV1.vts /data/local/tmp/spec/WifiHalV1.vts
adb push ${ANDROID_BUILD_TOP}/test/vts/specification/hal_conventional/BluetoothHalV1.vts /data/local/tmp/spec/BluetoothHalV1.vts
adb push ${ANDROID_BUILD_TOP}/test/vts/specification/hal_conventional/BluetoothHalV1bt_interface_t.vts /data/local/tmp/spec/BluetoothHalV1bt_interface_t.vts
- adb push ${ANDROID_BUILD_TOP}/hardware/interfaces/nfc/1.0/vts/Nfc.vts /data/local/tmp/spec/Nfc.vts
- adb push ${ANDROID_BUILD_TOP}/hardware/interfaces/nfc/1.0/vts/NfcClientCallback.vts /data/local/tmp/spec/NfcClientCallback.vts
- adb push ${ANDROID_BUILD_TOP}/hardware/interfaces/nfc/1.0/vts/types.vts /data/local/tmp/spec/types.vts
+ adb push ${ANDROID_BUILD_TOP}/hardware/interfaces/nfc/1.0/vts/*.vts /data/local/tmp/spec/
+ adb push ${ANDROID_BUILD_TOP}/hardware/interfaces/vr/1.0/vts/Vr.vts /data/local/tmp/spec/Vr.vts
+ # uncomment to test TV CEC HAL
+ # adb push ${ANDROID_BUILD_TOP}/hardware/interfaces/tv/cec/1.0/vts/*.vts /data/local/tmp/spec/
# uncomment to test vibrator HAL
# adb push ${ANDROID_BUILD_TOP}/hardware/interfaces/vibrator/1.0/vts/Vibrator.vts /data/local/tmp/spec/
# adb push ${ANDROID_BUILD_TOP}/hardware/interfaces/vibrator/1.0/vts/types.vts /data/local/tmp/spec/
diff --git a/specification/Android.mk b/specification/Android.mk
index 8928107..6b9fee8 100644
--- a/specification/Android.mk
+++ b/specification/Android.mk
@@ -54,6 +54,7 @@
liblog \
libdl \
libandroid_runtime \
+ libcamera_metadata \
libvts_datatype \
libvts_common \
libvts_measurement \
@@ -75,6 +76,8 @@
android.hardware.nfc@1.0 \
android.hardware.vibrator@1.0 \
android.hardware.thermal@1.0 \
+ android.hardware.vr@1.0 \
+ android.hardware.tv.cec@1.0 \
system/core/base/include \
ifeq ($(VTS_ENABLE_TREBLE), true)
@@ -90,12 +93,11 @@
libhidlbase \
libhidltransport \
libutils \
- android.hardware.nfc@1.0 \
- libvts_driver_hidl_nfc@1.0 \
- android.hardware.vibrator@1.0 \
- libvts_driver_hidl_vibrator@1.0 \
- android.hardware.thermal@1.0 \
- libvts_driver_hidl_thermal@1.0 \
+ android.hardware.nfc.vts.driver@1.0 \
+ android.hardware.vibrator.vts.driver@1.0 \
+ android.hardware.thermal.vts.driver@1.0 \
+ android.hardware.vr.vts.driver@1.0 \
+ android.hardware.tv.cec.vts.driver@1.0 \
endif
diff --git a/specification/vts_specification.mk b/specification/vts_specification.mk
index 3a2f326..ff1452e 100644
--- a/specification/vts_specification.mk
+++ b/specification/vts_specification.mk
@@ -18,5 +18,9 @@
harware/interfaces/vibrator/1.0/vts/types.vts:system/etc/types.vts \
harware/interfaces/thermal/1.0/vts/Thermal.vts:system/etc/Thermal.vts \
harware/interfaces/thermal/1.0/vts/types.vts:system/etc/types.vts \
+ harware/interfaces/vr/1.0/vts/Vr.vts:system/etc/Vr.vts \
+ harware/interfaces/tv/cec/1.0/vts/HdmiCec.vts:system/etc/HdmiCec.vts \
+ harware/interfaces/tv/cec/1.0/vts/HdmiCecCallback.vts:system/etc/HdmiCecCallback.vts \
+ harware/interfaces/tv/cec/1.0/vts/types.vts:system/etc/types.vts \
test/vts/specification/lib_bionic/libmV1.vts:system/etc/libmV1.vts \
test/vts/specification/lib_bionic/libcV1.vts:system/etc/libcV1.vts \
diff --git a/sysfuzzer/Android.bp b/sysfuzzer/Android.bp
index c155933..42127ae 100644
--- a/sysfuzzer/Android.bp
+++ b/sysfuzzer/Android.bp
@@ -17,5 +17,7 @@
subdirs = [
"common",
"libcodecoverage",
+ "libdatatype",
+ "libmeasurement",
"vtscompiler",
]
diff --git a/sysfuzzer/common/Android.bp b/sysfuzzer/common/Android.bp
index 112877d..d3711f9 100644
--- a/sysfuzzer/common/Android.bp
+++ b/sysfuzzer/common/Android.bp
@@ -55,6 +55,7 @@
"fuzz_tester/FuzzerCallbackBase.cpp",
"fuzz_tester/FuzzerWrapper.cpp",
"specification_parser/SpecificationBuilder.cpp",
+ "replayer/VtsHidlHalReplayer.cpp",
],
shared_libs: [
"libbinder",
diff --git a/sysfuzzer/common/component_loader/DllLoader.cpp b/sysfuzzer/common/component_loader/DllLoader.cpp
index 043b2b9..c669cd9 100644
--- a/sysfuzzer/common/component_loader/DllLoader.cpp
+++ b/sysfuzzer/common/component_loader/DllLoader.cpp
@@ -119,7 +119,8 @@
func = (loader_function)dlsym(handle_, function_name);
if ((error = dlerror()) != NULL) {
fputs(error, stderr);
- cerr << __FUNCTION__ << ": Can't find " << function_name << endl;
+ cerr << endl;
+ cerr << __func__ << ": Can't find " << function_name << endl;
return NULL;
}
return func;
diff --git a/sysfuzzer/common/fuzz_tester/FuzzerBase.cpp b/sysfuzzer/common/fuzz_tester/FuzzerBase.cpp
index 9619597..551cc60 100644
--- a/sysfuzzer/common/fuzz_tester/FuzzerBase.cpp
+++ b/sysfuzzer/common/fuzz_tester/FuzzerBase.cpp
@@ -35,7 +35,7 @@
#include "component_loader/DllLoader.h"
#include "utils/InterfaceSpecUtil.h"
-#include "gcda_parser.h"
+#include "GcdaParser.h"
using namespace std;
using namespace android;
@@ -329,7 +329,7 @@
return true;
}
-bool FuzzerBase::GetService(bool /*get_stub*/) {
+bool FuzzerBase::GetService(bool /*get_stub*/, const char* /*service_name*/) {
cerr << __func__ << " not impl" << endl;
return false;
}
@@ -479,9 +479,9 @@
#endif
if (string(filename).rfind(".gcda") != string::npos) {
string buffer = basepath + "/" + filename;
- vector<unsigned>* processed_data = android::vts::parse_gcda_file(
- buffer.c_str());
- for (const auto& data : *processed_data) {
+ vector<unsigned> processed_data =
+ android::vts::GcdaRawCoverageParser(buffer.c_str()).Parse();
+ for (const auto& data : processed_data) {
msg->mutable_processed_coverage_data()->Add(data);
}
diff --git a/sysfuzzer/common/fuzz_tester/FuzzerWrapper.cpp b/sysfuzzer/common/fuzz_tester/FuzzerWrapper.cpp
index 5e7d80c..6b05240 100644
--- a/sysfuzzer/common/fuzz_tester/FuzzerWrapper.cpp
+++ b/sysfuzzer/common/fuzz_tester/FuzzerWrapper.cpp
@@ -53,7 +53,7 @@
FuzzerBase* FuzzerWrapper::GetFuzzer(
const vts::ComponentSpecificationMessage& message) {
- cout << __func__ << endl;
+ cout << __func__ << ":" << __LINE__ << " entry" << endl;
if (spec_dll_path_.size() == 0) {
cerr << __func__ << ": spec_dll_path_ not set" << endl;
return NULL;
@@ -61,7 +61,7 @@
string function_name_prefix = GetFunctionNamePrefix(message);
const char* function_name_prefix_chars = function_name_prefix.c_str();
- cout << __FUNCTION__ << ": function name '" << function_name_prefix_chars
+ cout << __func__ << ": function name '" << function_name_prefix_chars
<< "'" << endl;
if (function_name_prefix_chars_ && function_name_prefix_chars &&
!strcmp(function_name_prefix_chars, function_name_prefix_chars_)) {
diff --git a/sysfuzzer/common/include/component_loader/DllLoader.h b/sysfuzzer/common/include/component_loader/DllLoader.h
index d44d903..5e41029 100644
--- a/sysfuzzer/common/include/component_loader/DllLoader.h
+++ b/sysfuzzer/common/include/component_loader/DllLoader.h
@@ -17,8 +17,6 @@
#ifndef __VTS_SYSFUZZER_COMMON_COMPONENTLOADER_DLLLOADER_H__
#define __VTS_SYSFUZZER_COMMON_COMPONENTLOADER_DLLLOADER_H__
-#include <stdio.h>
-
#include "hardware/hardware.h"
namespace android {
diff --git a/sysfuzzer/common/include/fuzz_tester/FuzzerBase.h b/sysfuzzer/common/include/fuzz_tester/FuzzerBase.h
index 35307de..cb5a776 100644
--- a/sysfuzzer/common/include/fuzz_tester/FuzzerBase.h
+++ b/sysfuzzer/common/include/fuzz_tester/FuzzerBase.h
@@ -40,7 +40,7 @@
// Gets the HIDL service.
// Returns true iff successful.
- virtual bool GetService(bool get_stub);
+ virtual bool GetService(bool get_stub, const char* service_name);
// Open Conventional Hal
int OpenConventionalHal(const char* module_name = NULL);
@@ -57,6 +57,19 @@
return false;
};
+ virtual bool CallFunction(
+ const vts::FunctionSpecificationMessage& /*func_msg*/,
+ const string& /*callback_socket_name*/,
+ vts::FunctionSpecificationMessage* /*result_msg*/) {
+ return false;
+ };
+
+ virtual bool VerifyResults(
+ const vts::FunctionSpecificationMessage& /*expected_result_msg*/,
+ const vts::FunctionSpecificationMessage& /*actual_result_msg*/) {
+ return false;
+ };
+
virtual bool GetAttribute(vts::FunctionSpecificationMessage* /*func_msg*/,
void** /*result*/) {
return false;
diff --git a/sysfuzzer/common/include/fuzz_tester/FuzzerCallbackBase.h b/sysfuzzer/common/include/fuzz_tester/FuzzerCallbackBase.h
index 703f97d..fdb0432 100644
--- a/sysfuzzer/common/include/fuzz_tester/FuzzerCallbackBase.h
+++ b/sysfuzzer/common/include/fuzz_tester/FuzzerCallbackBase.h
@@ -19,7 +19,6 @@
#include "component_loader/DllLoader.h"
-#include <map>
#include <string>
#include "test/vts/proto/ComponentSpecificationMessage.pb.h"
diff --git a/sysfuzzer/common/include/replayer/VtsHidlHalReplayer.h b/sysfuzzer/common/include/replayer/VtsHidlHalReplayer.h
new file mode 100644
index 0000000..fdafcf7
--- /dev/null
+++ b/sysfuzzer/common/include/replayer/VtsHidlHalReplayer.h
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+#ifndef __VTS_SYSFUZZER_COMMON_REPLAYER_VTSHIDLHALREPLAYER_H__
+#define __VTS_SYSFUZZER_COMMON_REPLAYER_VTSHIDLHALREPLAYER_H__
+
+#include "fuzz_tester/FuzzerWrapper.h"
+#include "test/vts/proto/ComponentSpecificationMessage.pb.h"
+
+namespace android {
+namespace vts {
+
+// Class to perform VTS record and replay test.
+// The class is responsible for:
+// 1) Load and parse a given trace file.
+// 2) Replay the API call sequence parsed from the trace file by calling
+// the HAL drive.
+// 3) Verify the return results of each API calls.
+class VtsHidlHalReplayer {
+ public:
+ VtsHidlHalReplayer(const char* spec_path, const char* callback_socket_name);
+
+ // Loads the given interface specification (.vts file) and parses it to
+ // ComponentSpecificationMessage.
+ bool LoadComponentSpecification(const float version, const char* package,
+ const char* component_name,
+ ComponentSpecificationMessage* message);
+
+ // Parses the trace file, stores the parsed sequence of API calls in
+ // func_msgs and the corresponding return results in result_msgs.
+ bool ParseTrace(const char* trace_file,
+ vector<FunctionSpecificationMessage>* func_msgs,
+ vector<FunctionSpecificationMessage>* result_msgs);
+
+ // Replays the API call sequence parsed from the trace file.
+ bool ReplayTrace(const char* spec_lib_file_path, const char* trace_file,
+ const float version, const char* package,
+ const char* component_name);
+
+ private:
+ // A FuzzerWrapper instance.
+ FuzzerWrapper wrapper_;
+ // The interface specification ASCII proto file.
+ const char* spec_path_;
+ // The server socket port # of the agent.
+ const char* callback_socket_name_;
+};
+
+} // namespace vts
+} // namespace android
+
+#endif // __VTS_SYSFUZZER_COMMON_REPLAYER_VTSHIDLHALREPLAYER_H__
diff --git a/sysfuzzer/common/include/specification_parser/SpecificationBuilder.h b/sysfuzzer/common/include/specification_parser/SpecificationBuilder.h
index 9d3bc68..2192294 100644
--- a/sysfuzzer/common/include/specification_parser/SpecificationBuilder.h
+++ b/sysfuzzer/common/include/specification_parser/SpecificationBuilder.h
@@ -77,6 +77,7 @@
int target_type, float target_version,
const char* target_package,
const char* target_component_name,
+ const char* hw_binder_service_name,
const char* module_name);
FuzzerBase* GetFuzzerBase(
@@ -105,6 +106,8 @@
char* spec_lib_file_path_;
char* dll_file_name_;
char* module_name_;
+ // HW binder service name only used for HIDL HAL
+ char* hw_binder_service_name_;
// the server socket port # of the agent.
const string& callback_socket_name_;
// map for submodule interface specification messages.
diff --git a/sysfuzzer/common/replayer/VtsHidlHalReplayer.cpp b/sysfuzzer/common/replayer/VtsHidlHalReplayer.cpp
new file mode 100644
index 0000000..584632a
--- /dev/null
+++ b/sysfuzzer/common/replayer/VtsHidlHalReplayer.cpp
@@ -0,0 +1,182 @@
+/*
+ * 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.
+ */
+#include "replayer/VtsHidlHalReplayer.h"
+
+#include <fstream>
+#include <iostream>
+#include <string>
+
+#include <cutils/properties.h>
+#include <google/protobuf/text_format.h>
+
+#include "fuzz_tester/FuzzerBase.h"
+#include "fuzz_tester/FuzzerWrapper.h"
+#include "specification_parser/InterfaceSpecificationParser.h"
+#include "test/vts/proto/ComponentSpecificationMessage.pb.h"
+#include "test/vts/proto/VtsProfilingMessage.pb.h"
+#include "utils/StringUtil.h"
+
+namespace android {
+namespace vts {
+
+VtsHidlHalReplayer::VtsHidlHalReplayer(const char* spec_path,
+ const char* callback_socket_name)
+ : spec_path_(spec_path), callback_socket_name_(callback_socket_name) {}
+
+bool VtsHidlHalReplayer::LoadComponentSpecification(
+ const float version, const char* package, const char* component_name,
+ ComponentSpecificationMessage* message) {
+ if (!spec_path_ || !spec_path_[0]) {
+ cerr << __func__ << "spec file not specified. " << endl;
+ return false;
+ }
+ if (!message) {
+ cerr << __func__ << "message could not be NULL. " << endl;
+ return false;
+ }
+ cout << __func__ << ": Checking spec file " << spec_path_ << endl;
+ if (InterfaceSpecificationParser::parse(spec_path_, message)) {
+ if (message->component_class() != HAL_HIDL) {
+ cerr << __func__ << ": only support Hidl Hal. " << endl;
+ return false;
+ }
+
+ if (message->component_type_version() != version ||
+ message->package() != package ||
+ message->component_name() != component_name) {
+ cerr << __func__
+ << ": spec file mismatch. expect: target_version: " << version
+ << ", package: " << package << ", component_name: " << component_name
+ << ", actual: target_version: " << message->component_type_version()
+ << ", package: " << message->package()
+ << ", component_name: " << message->component_name();
+ return false;
+ }
+ } else {
+ cerr << __func__ << ": can not parse spec: " << spec_path_ << endl;
+ return false;
+ }
+ return true;
+}
+
+bool VtsHidlHalReplayer::ParseTrace(const char* trace_file,
+ vector<FunctionSpecificationMessage>* func_msgs,
+ vector<FunctionSpecificationMessage>* result_msgs) {
+ std::ifstream in(trace_file, std::ios::in);
+ bool new_record = true;
+ std::string record_str;
+ std::string line;
+ while (std::getline(in, line)) {
+ // Assume records are separated by '\n'.
+ if (line.empty()) {
+ new_record = false;
+ }
+ if (new_record) {
+ record_str += line + "\n";
+ } else {
+ unique_ptr<VtsProfilingRecord> record(new VtsProfilingRecord());
+ if (!google::protobuf::TextFormat::MergeFromString(record_str,
+ record.get())) {
+ cerr << __func__ << ": Can't parse a given function message: "
+ << record_str << endl;
+ return false;
+ }
+ if (record->event() == InstrumentationEventType::SERVER_API_ENTRY
+ || record->event() == InstrumentationEventType::CLIENT_API_ENTRY
+ || record->event() == InstrumentationEventType::SYNC_CALLBACK_ENTRY
+ || record->event() == InstrumentationEventType::ASYNC_CALLBACK_ENTRY
+ || record->event() == InstrumentationEventType::PASSTHROUGH_ENTRY) {
+ func_msgs->push_back(record->func_msg());
+ } else {
+ result_msgs->push_back(record->func_msg());
+ }
+ new_record = true;
+ record_str.clear();
+ }
+ }
+ return true;
+}
+
+bool VtsHidlHalReplayer::ReplayTrace(const char* spec_lib_file_path,
+ const char* trace_file,
+ const float version, const char* package,
+ const char* component_name) {
+ ComponentSpecificationMessage interface_specification_message;
+ if (!LoadComponentSpecification(version, package, component_name,
+ &interface_specification_message)) {
+ cerr << __func__ << ": can not load component spec: " << spec_path_
+ << " for package: " << package << " version: " << version
+ << " component_name: " << component_name << endl;
+ return false;
+ }
+
+ if (!wrapper_.LoadInterfaceSpecificationLibrary(spec_lib_file_path)) {
+ return false;
+ }
+
+ FuzzerBase* fuzzer = wrapper_.GetFuzzer(interface_specification_message);
+ if (!fuzzer) {
+ cerr << __func__ << ": couldn't get a fuzzer base class" << endl;
+ return false;
+ }
+
+ // Get service for Hidl Hal.
+ char get_sub_property[PROPERTY_VALUE_MAX];
+ bool get_stub = false; /* default is binderized */
+ if (property_get("vts.hidl.get_stub", get_sub_property, "") > 0) {
+ if (!strcmp(get_sub_property, "true") ||
+ !strcmp(get_sub_property, "True") || !strcmp(get_sub_property, "1")) {
+ get_stub = true;
+ }
+ }
+ const char* service_name = interface_specification_message.package().substr(
+ interface_specification_message.package().find_last_of(".") + 1).c_str();
+ if (!fuzzer->GetService(get_stub, service_name)) {
+ cerr << __func__ << ": couldn't get service" << endl;
+ return false;
+ }
+
+ // Parse the trace file to get the sequence of function calls.
+ vector<FunctionSpecificationMessage> func_msgs;
+ vector<FunctionSpecificationMessage> result_msgs;
+ if (!ParseTrace(trace_file, &func_msgs, &result_msgs)) {
+ cerr << __func__ << ": couldn't parse trace file: " << trace_file
+ << endl;
+ return false;
+ }
+ // Replay each function call from the trace and verify the results.
+ for (size_t i = 0; i < func_msgs.size(); i++) {
+ vts::FunctionSpecificationMessage func_msg = func_msgs[i];
+ vts::FunctionSpecificationMessage expected_result_msg = result_msgs[i];
+ cout << __func__ << ": replay function: " << func_msg.DebugString();
+ vts::FunctionSpecificationMessage result_msg;
+ if (!fuzzer->CallFunction(func_msg, callback_socket_name_, &result_msg)) {
+ cerr << __func__ << ": replay function fail." << endl;
+ return false;
+ }
+ if (!fuzzer->VerifyResults(expected_result_msg, result_msg)) {
+ // Verification is not strict, i.e. if fail, output error message and
+ // continue the process.
+ cerr << __func__ << ": verification fail.\nexpected_result: "
+ << expected_result_msg.DebugString() << "\nactual_result: "
+ << result_msg.DebugString() << endl;
+ }
+ }
+ return true;
+}
+
+} // namespace vts
+} // namespace android
diff --git a/sysfuzzer/common/specification_parser/SpecificationBuilder.cpp b/sysfuzzer/common/specification_parser/SpecificationBuilder.cpp
index d92c6b1..71fa6e3 100644
--- a/sysfuzzer/common/specification_parser/SpecificationBuilder.cpp
+++ b/sysfuzzer/common/specification_parser/SpecificationBuilder.cpp
@@ -41,6 +41,7 @@
epoch_count_(epoch_count),
if_spec_msg_(NULL),
module_name_(NULL),
+ hw_binder_service_name_(NULL),
callback_socket_name_(callback_socket_name) {}
vts::ComponentSpecificationMessage*
@@ -131,17 +132,15 @@
FuzzerBase* SpecificationBuilder::GetFuzzerBase(
const vts::ComponentSpecificationMessage& iface_spec_msg,
const char* dll_file_name, const char* /*target_func_name*/) {
- cout << __func__ << ":" << __LINE__ << " "
- << "entry" << endl;
+ cout << __func__ << ":" << __LINE__ << " " << "entry" << endl;
FuzzerBase* fuzzer = wrapper_.GetFuzzer(iface_spec_msg);
if (!fuzzer) {
- cerr << __FUNCTION__ << ": couldn't get a fuzzer base class" << endl;
+ cerr << __func__ << ": couldn't get a fuzzer base class" << endl;
return NULL;
}
// TODO: don't load multiple times. reuse FuzzerBase*.
- cout << __func__ << ":" << __LINE__ << " "
- << "got fuzzer" << endl;
+ cout << __func__ << ":" << __LINE__ << " " << "got fuzzer" << endl;
if (iface_spec_msg.component_class() == HAL_HIDL) {
char get_sub_property[PROPERTY_VALUE_MAX];
bool get_stub = false; /* default is binderized */
@@ -152,7 +151,14 @@
get_stub = true;
}
}
- if (!fuzzer->GetService(get_stub)) {
+ const char* service_name;
+ if (hw_binder_service_name_ && strlen(hw_binder_service_name_) > 0) {
+ service_name = hw_binder_service_name_;
+ } else {
+ service_name = iface_spec_msg.package().substr(
+ iface_spec_msg.package().find_last_of(".") + 1).c_str();
+ }
+ if (!fuzzer->GetService(get_stub, service_name)) {
cerr << __FUNCTION__ << ": couldn't get service" << endl;
return NULL;
}
@@ -192,7 +198,8 @@
<< "entry object_pointer " << ((uint64_t)object_pointer) << endl;
FuzzerWrapper wrapper;
if (!wrapper.LoadInterfaceSpecificationLibrary(spec_lib_file_path_)) {
- cerr << __func__ << " can't load spec" << endl;
+ cerr << __func__ << " can't load specification lib, "
+ << spec_lib_file_path_ << endl;
return NULL;
}
FuzzerBase* fuzzer = wrapper.GetFuzzer(iface_spec_msg);
@@ -226,7 +233,34 @@
cerr << __FUNCTION__ << ": couldn't get a fuzzer base class" << endl;
return NULL;
}
- if (!fuzzer->LoadTargetComponent(dll_file_name)) return NULL;
+
+ if (iface_spec_msg.component_class() == HAL_HIDL) {
+ char get_sub_property[PROPERTY_VALUE_MAX];
+ bool get_stub = false; /* default is binderized */
+ if (property_get("vts.hidl.get_stub", get_sub_property, "") > 0) {
+ if (!strcmp(get_sub_property, "true") || !strcmp(get_sub_property, "True")
+ || !strcmp(get_sub_property, "1")) {
+ get_stub = true;
+ }
+ }
+ const char* service_name;
+ if (hw_binder_service_name_ && strlen(hw_binder_service_name_) > 0) {
+ service_name = hw_binder_service_name_;
+ } else {
+ service_name = iface_spec_msg.package().substr(
+ iface_spec_msg.package().find_last_of(".") + 1).c_str();
+ }
+ if (!fuzzer->GetService(get_stub, service_name)) {
+ cerr << __FUNCTION__ << ": couldn't get service" << endl;
+ return NULL;
+ }
+ } else {
+ if (!fuzzer->LoadTargetComponent(dll_file_name)) {
+ cerr << __FUNCTION__ << ": couldn't load target component file, "
+ << dll_file_name << endl;
+ return NULL;
+ }
+ }
for (const vts::FunctionSpecificationMessage& func_msg :
iface_spec_msg.interface().api()) {
@@ -241,7 +275,9 @@
bool SpecificationBuilder::LoadTargetComponent(
const char* dll_file_name, const char* spec_lib_file_path, int target_class,
int target_type, float target_version, const char* target_package,
- const char* target_component_name, const char* module_name) {
+ const char* target_component_name,
+ const char* hw_binder_service_name, const char* module_name) {
+ cout << __func__ << " entry dll_file_name = " << dll_file_name << endl;
if_spec_msg_ =
FindComponentSpecification(target_class, target_type, target_version,
module_name, target_package,
@@ -258,17 +294,21 @@
dll_file_name_ = (char*)malloc(strlen(dll_file_name) + 1);
strcpy(dll_file_name_, dll_file_name);
- // cout << "ifspec addr load at " << if_spec_msg_ << endl;
string output;
if_spec_msg_->SerializeToString(&output);
cout << "loaded ifspec length " << output.length() << endl;
- // cout << "loaded text " << strlen(output.c_str()) << endl;
- // cout << "loaded text " << output << endl;
module_name_ = (char*)malloc(strlen(module_name) + 1);
strcpy(module_name_, module_name);
- cout << __FUNCTION__ << ":" << __LINE__ << " module_name " << module_name_
+ cout << __func__ << ":" << __LINE__ << " module_name " << module_name_
<< endl;
+
+ if (hw_binder_service_name) {
+ hw_binder_service_name_ = (char*)malloc(strlen(hw_binder_service_name) + 1);
+ strcpy(hw_binder_service_name_, hw_binder_service_name);
+ cout << __func__ << ":" << __LINE__ << " hw_binder_service_name "
+ << hw_binder_service_name_ << endl;
+ }
return true;
}
@@ -303,8 +343,8 @@
}
cout << __func__ << ":" << __LINE__ << endl;
if (!func_fuzzer) {
- cerr << "can't find FuzzerBase for " << func_msg->name() << " using "
- << dll_file_name_ << endl;
+ cerr << "can't find FuzzerBase for '" << func_msg->name() << "' using '"
+ << dll_file_name_ << "'" << endl;
return empty_string;
}
@@ -342,13 +382,24 @@
cout << __func__ << ":" << __LINE__ << endl;
void* result;
+ FunctionSpecificationMessage result_msg;
func_fuzzer->FunctionCallBegin();
cout << __func__ << " Call Function " << func_msg->name() << " parent_path("
<< func_msg->parent_path() << ")" << endl;
- if (!func_fuzzer->Fuzz(func_msg, &result, callback_socket_name_)) {
- cerr << __func__ << " function not found - todo handle more explicitly"
- << endl;
- return *(new string("error"));
+ // For Hidl HAL, use CallFunction method.
+ if (if_spec_msg_ && if_spec_msg_->component_class() == HAL_HIDL) {
+ if (!func_fuzzer->CallFunction(*func_msg, callback_socket_name_,
+ &result_msg)) {
+ cerr << __func__ << " function not found - todo handle more explicitly"
+ << endl;
+ return *(new string("error"));
+ }
+ } else {
+ if (!func_fuzzer->Fuzz(func_msg, &result, callback_socket_name_)) {
+ cerr << __func__ << " function not found - todo handle more explicitly"
+ << endl;
+ return *(new string("error"));
+ }
}
cout << __func__ << ": called" << endl;
@@ -356,55 +407,8 @@
func_fuzzer->FunctionCallEnd(func_msg);
if (if_spec_msg_ && if_spec_msg_->component_class() == HAL_HIDL) {
- if (func_msg->return_type_hidl().size() == 1 &&
- func_msg->return_type_hidl(0).type() == TYPE_SCALAR) {
- auto& scalar_type = func_msg->return_type_hidl(0).scalar_type();
- VariableSpecificationMessage* return_type =
- func_msg->mutable_return_type_hidl(0);
- if (scalar_type == "int64_t") {
- return_type->mutable_scalar_value()->set_int64_t(*((int*)(&result)));
- } else if (scalar_type == "uint64_t") {
- return_type->mutable_scalar_value()->set_uint64_t(*((int*)(&result)));
- } else if (scalar_type == "int32_t") {
- return_type->mutable_scalar_value()->set_int32_t(*((int*)(&result)));
- } else if (scalar_type == "uint32_t") {
- return_type->mutable_scalar_value()->set_uint32_t(*((int*)(&result)));
- } else if (scalar_type == "int16_t") {
- return_type->mutable_scalar_value()->set_int16_t(*((int*)(&result)));
- } else if (scalar_type == "uint16_t") {
- return_type->mutable_scalar_value()->set_uint16_t(*((int*)(&result)));
- } else if (scalar_type == "int8_t") {
- return_type->mutable_scalar_value()->set_int8_t(*((int*)(&result)));
- } else if (scalar_type == "uint8_t") {
- return_type->mutable_scalar_value()->set_uint8_t(*((int*)(&result)));
- } else if (scalar_type == "float_t") {
- return_type->mutable_scalar_value()->set_float_t(*((int*)(&result)));
- } else if (scalar_type == "double_t") {
- return_type->mutable_scalar_value()->set_double_t(*((int*)(&result)));
- } else if (scalar_type == "bool_t") {
- return_type->mutable_scalar_value()->set_bool_t(*((int*)(&result)));
- } else {
- cerr << __func__ << ":" << __LINE__ << " ERROR unsupported scalar type "
- << scalar_type << endl;
- return *(new string("unsupported scalar type"));
- }
- cout << "result " << endl;
- } else if (func_msg->return_type_hidl().size() == 1 &&
- func_msg->return_type_hidl(0).type() == TYPE_ENUM) {
- VariableSpecificationMessage* return_type =
- func_msg->mutable_return_type_hidl(0);
- return_type->mutable_scalar_value()->set_int32_t(*((int*)(&result)));
- cout << "result " << endl;
- } else {
- func_msg->mutable_return_type()->set_type(TYPE_STRING);
- func_msg->mutable_return_type()->mutable_string_value()->set_message(
- *(string*)result);
- func_msg->mutable_return_type()->mutable_string_value()->set_length(
- ((string*)result)->size());
- free(result);
- }
string* output = new string();
- google::protobuf::TextFormat::PrintToString(*func_msg, output);
+ google::protobuf::TextFormat::PrintToString(result_msg, output);
return *output;
} else {
if (func_msg->return_type().type() == TYPE_PREDEFINED) {
@@ -634,7 +638,7 @@
const char* target_component_name) {
vts::ComponentSpecificationMessage* interface_specification_message =
FindComponentSpecification(target_class, target_type, target_version,
- target_package, target_component_name);
+ "", target_package, target_component_name);
cout << "ifspec addr " << interface_specification_message << endl;
if (!interface_specification_message) {
diff --git a/sysfuzzer/framework/SocketServer.cpp b/sysfuzzer/framework/SocketServer.cpp
index fb226ec..e1a1618 100644
--- a/sysfuzzer/framework/SocketServer.cpp
+++ b/sysfuzzer/framework/SocketServer.cpp
@@ -66,11 +66,13 @@
int target_type, float target_version,
const string& target_package,
const string& target_component_name,
+ const string& hw_binder_service_name,
const string& module_name) {
printf("VtsFuzzerServer::LoadHal(%s)\n", path.c_str());
bool success = spec_builder_.LoadTargetComponent(
path.c_str(), lib_path_, target_class, target_type, target_version,
target_package.c_str(), target_component_name.c_str(),
+ hw_binder_service_name.c_str(),
module_name.c_str());
cout << "Result: " << success << std::endl;
if (success) {
@@ -156,6 +158,7 @@
command_message.target_type(), command_message.target_version(),
command_message.target_package(),
command_message.target_component_name(),
+ command_message.hw_binder_service_name(),
command_message.module_name());
VtsDriverControlResponseMessage response_message;
response_message.set_response_code(VTS_DRIVER_RESPONSE_SUCCESS);
diff --git a/sysfuzzer/framework/SocketServer.h b/sysfuzzer/framework/SocketServer.h
index b87789a..94cb9c6 100644
--- a/sysfuzzer/framework/SocketServer.h
+++ b/sysfuzzer/framework/SocketServer.h
@@ -37,10 +37,12 @@
protected:
void Exit();
+
int32_t LoadHal(const string& path, int target_class, int target_type,
float target_version, const string& target_package,
- const string& module_name,
- const string& target_component_name);
+ const string& target_component_name,
+ const string& hw_binder_service_name,
+ const string& module_name);
int32_t Status(int32_t type);
const char* ReadSpecification(const string& name);
const char* Call(const string& arg);
diff --git a/sysfuzzer/framework/VtsFuzzerMain.cpp b/sysfuzzer/framework/VtsFuzzerMain.cpp
index 4878714..f2556ea 100644
--- a/sysfuzzer/framework/VtsFuzzerMain.cpp
+++ b/sysfuzzer/framework/VtsFuzzerMain.cpp
@@ -45,6 +45,7 @@
#include "binder/VtsFuzzerBinderService.h"
#include "specification_parser/InterfaceSpecificationParser.h"
#include "specification_parser/SpecificationBuilder.h"
+#include "replayer/VtsHidlHalReplayer.h"
#include "BinderServer.h"
#include "SocketServer.h"
@@ -61,6 +62,7 @@
// Dumps usage on stderr.
static void usage() {
+ // TODO(zhuoyao): update the usage message.
fprintf(
stderr,
"Usage: fuzzer [options] <target HAL file path>\n"
@@ -93,6 +95,11 @@
#endif
{"server", optional_argument, NULL, 'd'},
{"callback_socket_name", optional_argument, NULL, 'p'},
+ // TODO(zhuoyao):make mode a required_argument to support different
+ // execution mode. e.g.: fuzzer/driver/replayer.
+ {"mode", optional_argument, NULL, 'm'},
+ {"trace_path", optional_argument, NULL, 'r'},
+ {"spec_path", optional_argument, NULL, 'a'},
{NULL, 0, NULL, 0}};
int target_class;
int target_type;
@@ -108,6 +115,9 @@
string target_package;
string target_component_name;
string callback_socket_name;
+ string mode;
+ string trace_path;
+ string spec_path;;
while (true) {
int optionIndex = 0;
@@ -126,6 +136,8 @@
target_class_str.begin(), ::tolower);
if (!strcmp(target_class_str.c_str(), "hal_conventional")) {
target_class = vts::HAL_CONVENTIONAL;
+ } else if (!strcmp(target_class_str.c_str(), "hal_hidl")) {
+ target_class = vts::HAL_HIDL;
} else {
target_class = 0;
}
@@ -182,6 +194,15 @@
case 'n':
target_component_name = string(optarg);
break;
+ case 'm':
+ mode = string(optarg);
+ break;
+ case 'r':
+ trace_path = string(optarg);
+ break;
+ case 'a':
+ spec_path = string(optarg);
+ break;
default:
if (ic != '?') {
fprintf(stderr, "getopt_long returned unexpected value 0x%x\n", ic);
@@ -197,12 +218,20 @@
fprintf(stderr, "Must specify output file (see --help).\n");
return 2;
}
-
- bool success =
- spec_builder.Process(argv[optind], INTERFACE_SPEC_LIB_FILENAME,
- target_class, target_type, target_version,
- target_package.c_str(),
- target_component_name.c_str());
+ bool success;
+ if (mode == "replay") {
+ android::vts::VtsHidlHalReplayer replayer(spec_path.c_str(),
+ callback_socket_name.c_str());
+ success = replayer.ReplayTrace(argv[optind],
+ trace_path.c_str(), target_version,
+ target_package.c_str(),
+ target_component_name.c_str());
+ } else {
+ success = spec_builder.Process(argv[optind],INTERFACE_SPEC_LIB_FILENAME,
+ target_class, target_type, target_version,
+ target_package.c_str(),
+ target_component_name.c_str());
+ }
cout << "Result: " << success << endl;
if (success) {
cout << endl << PASSED_MARKER << endl;
diff --git a/sysfuzzer/libcodecoverage/Android.bp b/sysfuzzer/libcodecoverage/Android.bp
index 51cbc74..3cb7cd6 100644
--- a/sysfuzzer/libcodecoverage/Android.bp
+++ b/sysfuzzer/libcodecoverage/Android.bp
@@ -19,8 +19,8 @@
name: "libvts_codecoverage",
srcs: [
- "gcda_parser.cpp",
- "gcov_basic_io.cpp",
+ "GcdaParser.cpp",
+ "GcdaFile.cpp",
],
export_include_dirs: ["."],
diff --git a/sysfuzzer/libcodecoverage/GcdaFile.cpp b/sysfuzzer/libcodecoverage/GcdaFile.cpp
new file mode 100644
index 0000000..7beca35
--- /dev/null
+++ b/sysfuzzer/libcodecoverage/GcdaFile.cpp
@@ -0,0 +1,170 @@
+/*
+ * Copyright 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.
+ */
+
+#include "GcdaFile.h"
+
+#include <inttypes.h>
+#include <stdarg.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+namespace android {
+namespace vts {
+
+bool GcdaFile::Open() {
+ if (filename_.length() < 1) return false;
+ if (gcov_var_.file) return false;
+
+ memset(&gcov_var_, 0, sizeof(gcov_var_));
+ gcov_var_.overread = -1u;
+
+ gcov_var_.file = fopen(filename_.c_str(), "rb");
+ if (!gcov_var_.file) return false;
+ gcov_var_.mode = 0;
+ setbuf(gcov_var_.file, (char*)0);
+ return true;
+}
+
+int GcdaFile::Close() {
+ if (gcov_var_.file) {
+ fclose(gcov_var_.file);
+ gcov_var_.file = 0;
+ gcov_var_.length = 0;
+ }
+ free(gcov_var_.buffer);
+ gcov_var_.alloc = 0;
+ gcov_var_.buffer = 0;
+ gcov_var_.mode = 0;
+ return gcov_var_.error;
+}
+
+void GcdaFile::Sync(unsigned base, unsigned length) {
+ if (!gcov_var_.file) return;
+
+ base += length;
+ if (base - gcov_var_.start <= gcov_var_.length) {
+ gcov_var_.offset = base - gcov_var_.start;
+ } else {
+ gcov_var_.offset = gcov_var_.length = 0;
+ fseek(gcov_var_.file, base << 2, SEEK_SET);
+ gcov_var_.start = ftell(gcov_var_.file) >> 2;
+ }
+}
+unsigned GcdaFile::ReadStringArray(char** string_array, unsigned num_strings) {
+ unsigned i;
+ unsigned j;
+ unsigned len = 0;
+
+ for (j = 0; j < num_strings; j++) {
+ unsigned string_len = ReadUnsigned();
+ string_array[j] = (char*)malloc(string_len * sizeof(unsigned)); // xmalloc
+ for (i = 0; i < string_len; i++) {
+ ((unsigned*)string_array[j])[i] = ReadUnsigned();
+ }
+ len += (string_len + 1);
+ }
+ return len;
+}
+
+unsigned GcdaFile::ReadUnsigned() {
+ const unsigned* buffer = ReadWords(1);
+
+ if (!buffer) return 0;
+ return FromFile(buffer[0]);
+}
+
+void GcdaFile::Allocate(unsigned length) {
+ size_t new_size = gcov_var_.alloc;
+
+ if (!new_size) new_size = GCOV_BLOCK_SIZE;
+ new_size += length;
+ new_size *= 2;
+ gcov_var_.alloc = new_size;
+ gcov_var_.buffer = (unsigned*)realloc(gcov_var_.buffer, new_size << 2);
+}
+
+const unsigned* GcdaFile::ReadWords(unsigned words) {
+ const unsigned* result;
+ unsigned excess = gcov_var_.length - gcov_var_.offset;
+
+ if (!gcov_var_.file) return 0;
+
+ if (excess < words) {
+ gcov_var_.start += gcov_var_.offset;
+ memmove(gcov_var_.buffer, gcov_var_.buffer + gcov_var_.offset, excess * 4);
+ gcov_var_.offset = 0;
+ gcov_var_.length = excess;
+ if (gcov_var_.length + words > gcov_var_.alloc) {
+ Allocate(gcov_var_.length + words);
+ }
+ excess = gcov_var_.alloc - gcov_var_.length;
+ excess = fread(gcov_var_.buffer + gcov_var_.length, 1, excess << 2,
+ gcov_var_.file) >> 2;
+ gcov_var_.length += excess;
+ if (gcov_var_.length < words) {
+ gcov_var_.overread += words - gcov_var_.length;
+ gcov_var_.length = 0;
+ return 0;
+ }
+ }
+ result = &gcov_var_.buffer[gcov_var_.offset];
+ gcov_var_.offset += words;
+ return result;
+}
+
+int GcdaFile::Magic(unsigned magic, unsigned expected) {
+ if (magic == expected) return 1;
+ magic = (magic >> 16) | (magic << 16);
+ magic = ((magic & 0xff00ff) << 8) | ((magic >> 8) & 0xff00ff);
+ if (magic == expected) {
+ gcov_var_.endian = 1;
+ return -1;
+ }
+ return 0;
+}
+
+gcov_type GcdaFile::ReadCounter() {
+ gcov_type value;
+ const unsigned* buffer = ReadWords(2);
+ if (!buffer) return 0;
+ value = FromFile(buffer[0]);
+ if (sizeof(value) > sizeof(unsigned)) {
+ value |= ((gcov_type)FromFile(buffer[1])) << 32;
+ } else if (buffer[1]) {
+ gcov_var_.error = -1;
+ }
+ return value;
+}
+
+void GcdaFile::WriteBlock(unsigned size) {
+ int num_words = fwrite(gcov_var_.buffer, size << 2, 1, gcov_var_.file);
+ if (num_words != 1) {
+ gcov_var_.error = 1;
+ }
+ gcov_var_.start += size;
+ gcov_var_.offset -= size;
+}
+
+const char* GcdaFile::ReadString() {
+ unsigned length = ReadUnsigned();
+ if (!length) return 0;
+ return (const char*)ReadWords(length);
+}
+
+} // namespace vts
+} // namespace android
diff --git a/sysfuzzer/libcodecoverage/GcdaFile.h b/sysfuzzer/libcodecoverage/GcdaFile.h
new file mode 100644
index 0000000..832a580
--- /dev/null
+++ b/sysfuzzer/libcodecoverage/GcdaFile.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright 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.
+ */
+
+#ifndef __VTS_SYSFUZZER_LIBMEASUREMENT_GCDA_FILE_H__
+#define __VTS_SYSFUZZER_LIBMEASUREMENT_GCDA_FILE_H__
+
+#include <string>
+
+#include "gcov_basic_io.h"
+
+using namespace std;
+
+namespace android {
+namespace vts {
+
+// Basic I/O methods for a GCOV file.
+class GcdaFile {
+ public:
+ GcdaFile(const string& filename) :
+ filename_(filename) {}
+ virtual ~GcdaFile() {};
+
+ // Opens a file.
+ bool Open();
+
+ // Closes a file and returns any existing error code.
+ int Close();
+
+ // Synchronizes to the given base and length.
+ void Sync(unsigned base, unsigned length);
+
+ // Reads a string array where the maximum number of strings is also specified.
+ unsigned ReadStringArray(char** string_array, unsigned num_strings);
+
+ // Reads a string.
+ const char* ReadString();
+
+ // Reads an unsigned integer.
+ unsigned ReadUnsigned();
+
+ // Reads 'words' number of words.
+ const unsigned* ReadWords(unsigned words);
+
+ // Reads a counter.
+ gcov_type ReadCounter();
+
+ // Write a block using 'size'.
+ void WriteBlock(unsigned size);
+
+ // Allocates memory for length.
+ void Allocate(unsigned length);
+
+ // Processes the magic tag.
+ int Magic(unsigned magic, unsigned expected);
+
+ // Returns the current position in the file.
+ inline unsigned Position() const {
+ return gcov_var_.start + gcov_var_.offset;
+ }
+
+ // Returns non-zero error code if there's an error.
+ inline int IsError() const {
+ return gcov_var_.file ? gcov_var_.error : 1;
+ }
+
+ protected:
+ inline unsigned FromFile(unsigned value) {
+ if (gcov_var_.endian) {
+ value = (value >> 16) | (value << 16);
+ value = ((value & 0xff00ff) << 8) | ((value >> 8) & 0xff00ff);
+ }
+ return value;
+ }
+
+ private:
+ // The GCOV var data structure for an opened file.
+ struct gcov_var_t gcov_var_;
+ const string& filename_;
+};
+
+} // namespace vts
+} // namespace android
+
+#endif
diff --git a/sysfuzzer/libcodecoverage/GcdaParser.cpp b/sysfuzzer/libcodecoverage/GcdaParser.cpp
new file mode 100644
index 0000000..5fe7461
--- /dev/null
+++ b/sysfuzzer/libcodecoverage/GcdaParser.cpp
@@ -0,0 +1,132 @@
+/*
+ * Copyright 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.
+ */
+
+#include "GcdaParser.h"
+
+#include <iostream>
+#include <vector>
+
+#include "GcdaFile.h"
+
+using namespace std;
+
+namespace android {
+namespace vts {
+
+bool GcdaRawCoverageParser::ParseMagic() {
+ unsigned magic = gcda_file_->ReadUnsigned();
+ unsigned version;
+ const char* type = NULL;
+ int endianness = 0;
+ char m[4], v[4];
+
+ if ((endianness = gcda_file_->Magic(magic, GCOV_DATA_MAGIC))) {
+ type = "data";
+ } else {
+ cout << __func__ << ": not a GCOV file, " << filename_ << endl;
+ gcda_file_->Close();
+ return false;
+ }
+ version = gcda_file_->ReadUnsigned();
+ GCOV_UNSIGNED2STRING(v, version);
+ GCOV_UNSIGNED2STRING(m, magic);
+ if (version != GCOV_VERSION) {
+ char e[4];
+ GCOV_UNSIGNED2STRING(e, GCOV_VERSION);
+ }
+ return true;
+}
+
+void GcdaRawCoverageParser::ParseBody() {
+ unsigned tags[4];
+ unsigned depth = 0;
+ int cnt = 0;
+ bool found;
+ unsigned base;
+ unsigned position;
+ unsigned tag;
+ unsigned length;
+ unsigned tag_depth;
+ int error;
+ unsigned mask;
+
+ gcda_file_->ReadUnsigned(); // stamp
+ while (1) {
+ position = gcda_file_->Position();
+
+ tag = gcda_file_->ReadUnsigned();
+ if (!tag) break;
+
+ length = gcda_file_->ReadUnsigned();
+ base = gcda_file_->Position();
+ mask = GCOV_TAG_MASK(tag) >> 1;
+ for (tag_depth = 4; mask; mask >>= 8) {
+ if ((mask & 0xff) != 0xff) {
+ cerr << __func__ << ": invalid tag, " << tag << endl;
+ break;
+ }
+ tag_depth--;
+ }
+ found = false;
+
+ if (tag) {
+ if (depth && depth < tag_depth &&
+ !GCOV_TAG_IS_SUBTAG(tags[depth - 1], tag)) {
+ cerr << __func__ << ": incorrectly nested tag, " << tag << endl;
+ }
+ depth = tag_depth;
+ tags[depth - 1] = tag;
+ }
+
+ switch(tag) {
+ case GCOV_TAG_FUNCTION:
+ TagFunction(tag, length);
+ break;
+ case GCOV_TAG_BLOCKS:
+ TagBlocks(tag, length);
+ break;
+ case GCOV_TAG_ARCS:
+ TagArcs(tag, length);
+ break;
+ case GCOV_TAG_LINES:
+ TagLines(tag, length);
+ break;
+ }
+ gcda_file_->Sync(base, length);
+
+ if ((error = gcda_file_->IsError())) {
+ cerr << __func__ << ": I/O error at "
+ << gcda_file_->Position() << endl;
+ break;
+ }
+ }
+}
+
+vector<unsigned> GcdaRawCoverageParser::Parse() {
+ result.clear();
+ if (!gcda_file_->Open()) {
+ cerr << __func__ << " Cannot open a file, " << filename_ << endl;
+ return result;
+ }
+
+ if (!ParseMagic()) return result;
+ ParseBody();
+ gcda_file_->Close();
+ return result;
+}
+
+} // namespace vts
+} // namespace android
diff --git a/sysfuzzer/libcodecoverage/GcdaParser.h b/sysfuzzer/libcodecoverage/GcdaParser.h
new file mode 100644
index 0000000..3133cd4
--- /dev/null
+++ b/sysfuzzer/libcodecoverage/GcdaParser.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright 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.
+ */
+
+#ifndef __VTS_SYSFUZZER_LIBMEASUREMENT_GCDA_PARSER_H__
+#define __VTS_SYSFUZZER_LIBMEASUREMENT_GCDA_PARSER_H__
+
+#include <iostream>
+#include <string>
+#include <vector>
+
+#include "GcdaFile.h"
+
+using namespace std;
+
+namespace android {
+namespace vts {
+
+// Parses a GCDA file and extracts raw coverage info.
+class GcdaRawCoverageParser {
+ public:
+ GcdaRawCoverageParser(const char* filename)
+ : filename_(filename),
+ gcda_file_(new GcdaFile(filename_)) {}
+
+ virtual ~GcdaRawCoverageParser() {}
+
+ // Parses a given file and returns a vector which contains IDs of raw
+ // coverage measurement units (e.g., basic blocks).
+ vector<unsigned> Parse();
+
+ protected:
+ // Parses the GCOV magic number.
+ bool ParseMagic();
+
+ // Parses the GCOV file body.
+ void ParseBody();
+
+ // Processes tag for functions.
+ void TagFunction(unsigned /*tag*/, unsigned length) {
+ /* unsigned long pos = */ gcda_file_->Position();
+
+ if (length) {
+ gcda_file_->ReadUnsigned(); // ident %u
+ unsigned lineno_checksum = gcda_file_->ReadUnsigned();
+ result.push_back(lineno_checksum);
+ gcda_file_->ReadUnsigned(); // cfg_checksum 0x%08x
+ }
+ }
+
+ // Processes tag for blocks.
+ void TagBlocks(unsigned /*tag*/, unsigned length) {
+ unsigned n_blocks = GCOV_TAG_BLOCKS_NUM(length);
+ cout << __func__ << ": " << n_blocks << " blocks" << endl;
+ }
+
+ // Processes tag for arcs.
+ void TagArcs(unsigned /*tag*/, unsigned length) {
+ unsigned n_arcs = GCOV_TAG_ARCS_NUM(length);
+ cout << __func__ << ": " << n_arcs << " arcs" << endl;
+ }
+
+ // Processes tag for lines.
+ void TagLines(unsigned /*tag*/, unsigned /*length*/) {
+ cout << __func__ << endl;
+ }
+
+ private:
+ // the name of a target file.
+ const string filename_;
+
+ // global GcovFile data structure.
+ GcdaFile* gcda_file_;
+
+ // vector containing the parsed, raw coverage data.
+ vector<unsigned> result;
+};
+
+} // namespace vts
+} // namespace android
+
+#endif
diff --git a/sysfuzzer/libcodecoverage/gcda_parser.cpp b/sysfuzzer/libcodecoverage/gcda_parser.cpp
deleted file mode 100644
index 9d35dda..0000000
--- a/sysfuzzer/libcodecoverage/gcda_parser.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-#include "gcda_parser.h"
-
-#include <iostream>
-#include <vector>
-
-#include "gcov_basic_io.h"
-
-using namespace std;
-
-namespace android {
-namespace vts {
-
-static const tag_format_t tag_table[] = {
- {0, "NOP", NULL},
- {0, "UNKNOWN", NULL},
- {0, "COUNTERS", tag_counters},
- {GCOV_TAG_FUNCTION, "FUNCTION", tag_function},
- {GCOV_TAG_BLOCKS, "BLOCKS", tag_blocks},
- {GCOV_TAG_ARCS, "ARCS", tag_arcs},
- {GCOV_TAG_LINES, "LINES", tag_lines},
- {0, NULL, NULL}};
-
-void tag_counters(const char* filename, unsigned tag, unsigned length,
- vector<unsigned>* result) {
- unsigned n_counts = GCOV_TAG_COUNTER_NUM(length);
- printf("%s: %d counts\n", __FUNCTION__, n_counts);
-}
-
-void tag_function(const char* filename, unsigned tag, unsigned length,
- vector<unsigned>* result) {
- unsigned long pos = gcov_position();
-
- if (length) {
- gcov_read_unsigned(); // ident %u
- unsigned lineno_checksum = gcov_read_unsigned();
- result->push_back(lineno_checksum);
- gcov_read_unsigned(); // cfg_checksum 0x%08x
- }
-}
-
-void tag_blocks(const char* filename, unsigned tag, unsigned length,
- vector<unsigned>* result) {
- unsigned n_blocks = GCOV_TAG_BLOCKS_NUM(length);
- printf("%s: %u blocks\n", __FUNCTION__, n_blocks);
-}
-
-void tag_arcs(const char* filename, unsigned tag, unsigned length,
- vector<unsigned>* result) {
- unsigned n_arcs = GCOV_TAG_ARCS_NUM(length);
- printf("%s: %u arcs\n", __FUNCTION__, n_arcs);
-}
-
-void tag_lines(const char* filename, unsigned tag, unsigned length,
- vector<unsigned>* result) {
- printf("%s\n", __FUNCTION__);
-}
-
-vector<unsigned>* parse_gcda_file(const char* filename) {
- unsigned tags[4];
- unsigned depth = 0;
- vector<unsigned>* result;
-
- result = new vector<unsigned>();
- if (!gcov_open(filename, 1)) {
- fprintf(stderr, "%s:cannot open\n", filename);
- return result;
- }
-
- /* magic */
- {
- unsigned magic = gcov_read_unsigned();
- unsigned version;
- const char* type = NULL;
- int endianness = 0;
- char m[4], v[4];
-
- if ((endianness = gcov_magic(magic, GCOV_DATA_MAGIC))) {
- type = "data";
- } else {
- printf("%s:not a gcov file\n", filename);
- gcov_close();
- return result;
- }
- version = gcov_read_unsigned();
- GCOV_UNSIGNED2STRING(v, version);
- GCOV_UNSIGNED2STRING(m, magic);
- if (version != GCOV_VERSION) {
- char e[4];
- GCOV_UNSIGNED2STRING(e, GCOV_VERSION);
- }
- }
-
- gcov_read_unsigned(); // stamp
- int cnt = 0;
- bool found;
- while (1) {
- unsigned base, position = gcov_position();
- unsigned tag, length;
- tag_format_t const* format;
- unsigned tag_depth;
- int error;
- unsigned mask;
-
- tag = gcov_read_unsigned();
- if (!tag) break;
-
- length = gcov_read_unsigned();
- base = gcov_position();
- mask = GCOV_TAG_MASK(tag) >> 1;
- for (tag_depth = 4; mask; mask >>= 8) {
- if ((mask & 0xff) != 0xff) {
- printf("%s:tag `%08x' is invalid\n", filename, tag);
- break;
- }
- tag_depth--;
- }
- found = false;
- for (format = tag_table; format->name; format++) {
- if (format->tag == tag) {
- found = true;
- break;
- }
- }
- if (!found) format = &tag_table[GCOV_TAG_IS_COUNTER(tag) ? 2 : 1];
-
- if (tag) {
- if (depth && depth < tag_depth) {
- if (!GCOV_TAG_IS_SUBTAG(tags[depth - 1], tag))
- printf("%s:tag `%08x' is incorrectly nested\n", filename, tag);
- }
- depth = tag_depth;
- tags[depth - 1] = tag;
- }
- if (format->proc) {
- (*format->proc)(filename, tag, length, result);
- }
- gcov_sync(base, length);
- if ((error = gcov_is_error())) {
- printf(
- error < 0 ? "%s:counter overflow at %lu\n" : "%s:read error at %lu\n",
- filename, (long unsigned)gcov_position());
- break;
- }
- }
- gcov_close();
- return result;
-}
-
-} // namespace vts
-} // namespace android
diff --git a/sysfuzzer/libcodecoverage/gcda_parser.h b/sysfuzzer/libcodecoverage/gcda_parser.h
deleted file mode 100644
index ae4f7aa..0000000
--- a/sysfuzzer/libcodecoverage/gcda_parser.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef __VTS_SYSFUZZER_LIBMEASUREMENT_GCDA_PARSER_H__
-#define __VTS_SYSFUZZER_LIBMEASUREMENT_GCDA_PARSER_H__
-
-#include <vector>
-
-using namespace std;
-
-namespace android {
-namespace vts {
-
-typedef struct tag_format {
- unsigned tag;
- char const* name;
- void (*proc)(const char*, unsigned, unsigned, vector<unsigned>*);
-} tag_format_t;
-
-void tag_counters(const char* filename, unsigned tag, unsigned length,
- vector<unsigned>* result);
-void tag_function(const char* filename, unsigned tag, unsigned length,
- vector<unsigned>* result);
-void tag_blocks(const char* filename, unsigned tag, unsigned length,
- vector<unsigned>* result);
-void tag_arcs(const char* filename, unsigned tag, unsigned length,
- vector<unsigned>* result);
-void tag_lines(const char* filename, unsigned tag, unsigned length,
- vector<unsigned>* result);
-
-vector<unsigned>* parse_gcda_file(const char* filename);
-
-} // namespace vts
-} // namespace android
-
-#endif
diff --git a/sysfuzzer/libcodecoverage/gcda_parser_test.cpp b/sysfuzzer/libcodecoverage/gcda_parser_test.cpp
index 7632a13..5548ab4 100644
--- a/sysfuzzer/libcodecoverage/gcda_parser_test.cpp
+++ b/sysfuzzer/libcodecoverage/gcda_parser_test.cpp
@@ -14,27 +14,24 @@
* limitations under the License.
*/
-#include "gcda_parser.h"
-#include "gcda_basic_io.h"
+#include "gcov_basic_io.h"
#include <iostream>
#include <vector>
+#include "GcdaParser.h"
/*
* To test locally:
- * $ rm a.out; gcc gcda_parser.cpp gcov_basic_io.cpp -lstdc++; ./a.out
+ * $ rm a.out; gcc GcdaParser.cpp gcda_parser_test.cpp GcdaFile.cpp -lstdc++; ./a.out
*/
using namespace std;
int main() {
- std::vector<unsigned>* result =
- android::vts::parse_gcda_file("testdata/lights.gcda");
- if (result) {
- for (unsigned int index = 0; index < result->size(); index++) {
- cout << result->at(index) << endl;
- }
- delete result;
+ std::vector<unsigned> result =
+ android::vts::GcdaRawCoverageParser("testdata/lights.gcda").Parse();
+ for (unsigned int index = 0; index < result.size(); index++) {
+ cout << result.at(index) << endl;
}
return 0;
}
diff --git a/sysfuzzer/libcodecoverage/gcov_basic_io.cpp b/sysfuzzer/libcodecoverage/gcov_basic_io.cpp
deleted file mode 100644
index 7afcf9c..0000000
--- a/sysfuzzer/libcodecoverage/gcov_basic_io.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-#include "gcov_basic_io.h"
-
-#include <inttypes.h>
-#include <stdarg.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-namespace android {
-namespace vts {
-
-struct gcov_var_t gcov_var;
-
-unsigned gcov_position(void) { return gcov_var.start + gcov_var.offset; }
-
-int gcov_is_error() { return gcov_var.file ? gcov_var.error : 1; }
-
-static inline unsigned from_file(unsigned value) {
- if (gcov_var.endian) {
- value = (value >> 16) | (value << 16);
- value = ((value & 0xff00ff) << 8) | ((value >> 8) & 0xff00ff);
- }
- return value;
-}
-
-unsigned gcov_read_string_array(char** string_array, unsigned num_strings) {
- unsigned i, j, len = 0;
-
- for (j = 0; j < num_strings; j++) {
- unsigned string_len = gcov_read_unsigned();
- string_array[j] = (char*)malloc(string_len * sizeof(unsigned)); // xmalloc
- for (i = 0; i < string_len; i++)
- ((unsigned*)string_array[j])[i] = gcov_read_unsigned();
- len += (string_len + 1);
- }
- return len;
-}
-
-unsigned gcov_read_unsigned() {
- unsigned value;
- const unsigned* buffer = gcov_read_words(1);
-
- if (!buffer) return 0;
- value = from_file(buffer[0]);
- return value;
-}
-
-void gcov_allocate(unsigned length) {
- size_t new_size = gcov_var.alloc;
-
- if (!new_size) new_size = GCOV_BLOCK_SIZE;
- new_size += length;
- new_size *= 2;
- gcov_var.alloc = new_size;
- gcov_var.buffer = (unsigned*)realloc(gcov_var.buffer, new_size << 2);
-}
-
-const unsigned* gcov_read_words(unsigned words) {
- const unsigned* result;
- unsigned excess = gcov_var.length - gcov_var.offset;
-
- assert(gcov_var.mode > 0);
- if (excess < words) {
- gcov_var.start += gcov_var.offset;
- memmove(gcov_var.buffer, gcov_var.buffer + gcov_var.offset, excess * 4);
- gcov_var.offset = 0;
- gcov_var.length = excess;
- if (gcov_var.length + words > gcov_var.alloc) {
- gcov_allocate(gcov_var.length + words);
- }
- excess = gcov_var.alloc - gcov_var.length;
- excess = fread(gcov_var.buffer + gcov_var.length, 1, excess << 2,
- gcov_var.file) >>
- 2;
- gcov_var.length += excess;
- if (gcov_var.length < words) {
- gcov_var.overread += words - gcov_var.length;
- gcov_var.length = 0;
- return 0;
- }
- }
- result = &gcov_var.buffer[gcov_var.offset];
- gcov_var.offset += words;
- return result;
-}
-
-int gcov_magic(unsigned magic, unsigned expected) {
- if (magic == expected) return 1;
- magic = (magic >> 16) | (magic << 16);
- magic = ((magic & 0xff00ff) << 8) | ((magic >> 8) & 0xff00ff);
- if (magic == expected) {
- gcov_var.endian = 1;
- return -1;
- }
- return 0;
-}
-
-gcov_type gcov_read_counter() {
- gcov_type value;
- const unsigned* buffer = gcov_read_words(2);
- if (!buffer) return 0;
- value = from_file(buffer[0]);
- if (sizeof(value) > sizeof(unsigned)) {
- value |= ((gcov_type)from_file(buffer[1])) << 32;
- } else if (buffer[1]) {
- gcov_var.error = -1;
- }
- return value;
-}
-
-void gcov_write_block(unsigned size) {
- if (fwrite(gcov_var.buffer, size << 2, 1, gcov_var.file) != 1) {
- gcov_var.error = 1;
- }
- gcov_var.start += size;
- gcov_var.offset -= size;
-}
-
-const char* gcov_read_string() {
- unsigned length = gcov_read_unsigned();
- if (!length) return 0;
- return (const char*)gcov_read_words(length);
-}
-
-bool gcov_open(const char* name, int mode) {
- assert(!gcov_var.file);
-
- gcov_var.start = 0;
- gcov_var.offset = 0;
- gcov_var.length = 0;
- gcov_var.overread = -1u;
- gcov_var.error = 0;
- gcov_var.endian = 0;
-
- if (mode >= 0) {
- gcov_var.file = fopen(name, (mode > 0) ? "rb" : "r+b");
- }
-
- if (gcov_var.file) {
- gcov_var.mode = 1;
- } else if (mode <= 0) {
- gcov_var.file = fopen(name, "w+b");
- if (gcov_var.file) {
- gcov_var.mode = mode * 2 + 1;
- }
- }
- if (!gcov_var.file) return false;
-
- setbuf(gcov_var.file, (char*)0);
- return true;
-}
-
-void gcov_sync(unsigned base, unsigned length) {
- assert(gcov_var.mode > 0);
- base += length;
- if (base - gcov_var.start <= gcov_var.length) {
- gcov_var.offset = base - gcov_var.start;
- } else {
- gcov_var.offset = gcov_var.length = 0;
- fseek(gcov_var.file, base << 2, SEEK_SET);
- gcov_var.start = ftell(gcov_var.file) >> 2;
- }
-}
-
-int gcov_close() {
- if (gcov_var.file) {
- if (gcov_var.offset && gcov_var.mode < 0) {
- gcov_write_block(gcov_var.offset);
- }
- fclose(gcov_var.file);
- gcov_var.file = 0;
- gcov_var.length = 0;
- }
- free(gcov_var.buffer);
- gcov_var.alloc = 0;
- gcov_var.buffer = 0;
- gcov_var.mode = 0;
- return gcov_var.error;
-}
-
-} // namespace vts
-} // namespace android
diff --git a/sysfuzzer/libcodecoverage/gcov_basic_io.h b/sysfuzzer/libcodecoverage/gcov_basic_io.h
index 0a629a7..dcf180f 100644
--- a/sysfuzzer/libcodecoverage/gcov_basic_io.h
+++ b/sysfuzzer/libcodecoverage/gcov_basic_io.h
@@ -1,9 +1,6 @@
#ifndef __VTS_SYSFUZZER_LIBMEASUREMENT_GCOV_BASIC_IO_H__
#define __VTS_SYSFUZZER_LIBMEASUREMENT_GCOV_BASIC_IO_H__
-#include <inttypes.h>
-#include <stdarg.h>
-#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -50,11 +47,6 @@
enum { GCOV_COUNTERS };
-#define assert(EXPR) \
- { \
- if (!(EXPR)) exit(-1); \
- }
-
#define GCOV_VERSION ((unsigned)0x34303670) /* 406p */
#define GCOV_TAG_BUILD_INFO ((unsigned)0xa7000000)
@@ -122,34 +114,20 @@
} arc_t;
struct gcov_var_t {
- FILE *file;
- unsigned start; /* Position of first byte of block */
- unsigned offset; /* Read/write position within the block. */
- unsigned length; /* Read limit in the block. */
- unsigned overread; /* Number of words overread. */
- int error; /* < 0 overflow, > 0 disk error. */
- int mode; /* < 0 writing, > 0 reading */
- int endian; /* Swap endianness. */
+ FILE* file;
+ unsigned start; /* Position of first byte of block */
+ unsigned offset; /* Read/write position within the block. */
+ unsigned length; /* Read limit in the block. */
+ unsigned overread; /* Number of words overread. */
+ int error; /* < 0 overflow, > 0 disk error. */
+ int mode; /* < 0 writing, > 0 reading */
+ int endian; /* Swap endianness. */
/* Holds a variable length block, as the compiler can write
strings and needs to backtrack. */
size_t alloc;
- unsigned *buffer;
+ unsigned* buffer;
};
-unsigned gcov_position(void);
-int gcov_is_error();
-unsigned gcov_read_string_array(char **string_array, unsigned num_strings);
-unsigned gcov_read_unsigned();
-void gcov_allocate(unsigned length);
-const unsigned *gcov_read_words(unsigned words);
-int gcov_magic(unsigned magic, unsigned expected);
-gcov_type gcov_read_counter();
-void gcov_write_block(unsigned size);
-const char *gcov_read_string();
-bool gcov_open(const char *name, int mode);
-void gcov_sync(unsigned base, unsigned length);
-int gcov_close();
-
} // namespace vts
} // namespace android
diff --git a/sysfuzzer/libdatatype/Android.bp b/sysfuzzer/libdatatype/Android.bp
new file mode 100644
index 0000000..52f4a7d
--- /dev/null
+++ b/sysfuzzer/libdatatype/Android.bp
@@ -0,0 +1,41 @@
+//
+// 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.
+//
+
+cc_library_shared {
+ name: "libvts_datatype",
+ srcs: [
+ "vts_datatype.cpp",
+ "hal_light.cpp",
+ "hal_gps.cpp",
+ "hal_camera.cpp",
+ ],
+ cflags: [
+ "-Wall",
+ "-Werror",
+ ],
+ shared_libs: [
+ "libcutils",
+ "libcamera_metadata",
+ "libprotobuf-cpp-full",
+ "libvts_multidevice_proto",
+ ],
+ export_shared_lib_headers: [
+ "libcamera_metadata",
+ ],
+ export_include_dirs: [
+ "include",
+ ],
+}
diff --git a/sysfuzzer/libdatatype/Android.mk b/sysfuzzer/libdatatype/Android.mk
deleted file mode 100644
index 419138d..0000000
--- a/sysfuzzer/libdatatype/Android.mk
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# 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 := libvts_datatype
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS += -Wall -Werror
-
-LOCAL_SRC_FILES := \
- vts_datatype.cpp \
- hal_light.cpp \
- hal_gps.cpp \
- hal_camera.cpp \
-
-LOCAL_C_INCLUDES := \
- $(LOCAL_PATH)/include \
- bionic \
- libcore \
- external/protobuf/src \
- libvts_common \
- system/media/camera/include \
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libvts_common \
- libvts_multidevice_proto \
- libprotobuf-cpp-full \
-
-LOCAL_MULTILIB := both
-
-LOCAL_EXPORT_C_INCLUDE_DIRS := \
- $(LOCAL_PATH)/include \
- system/media/camera/include \
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/sysfuzzer/libmeasurement/Android.bp b/sysfuzzer/libmeasurement/Android.bp
new file mode 100644
index 0000000..7ed0bbb
--- /dev/null
+++ b/sysfuzzer/libmeasurement/Android.bp
@@ -0,0 +1,33 @@
+//
+// 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.
+//
+
+cc_library_shared {
+ name: "libvts_measurement",
+ srcs: [
+ "vts_measurement.cpp",
+ ],
+ cflags: [
+ "-Wall",
+ "-Werror",
+ ],
+ shared_libs: [
+ "libcutils",
+ "libvts_common",
+ ],
+ export_include_dirs: [
+ "include",
+ ],
+}
diff --git a/sysfuzzer/libmeasurement/Android.mk b/sysfuzzer/libmeasurement/Android.mk
deleted file mode 100644
index 8165156..0000000
--- a/sysfuzzer/libmeasurement/Android.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# 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 := libvts_measurement
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
- vts_measurement.cpp \
-
-LOCAL_C_INCLUDES := \
- $(LOCAL_PATH)/include \
- bionic \
- libcore \
- external/protobuf/src \
- test/vts/sysfuzzer/common/proto \
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libvts_common \
-
-LOCAL_PROTOC_FLAGS := \
- --proto_path=$(LOCAL_PATH)/../common/proto \
-
-LOCAL_PROTOC_OPTIMIZE_TYPE := full
-
-LOCAL_MULTILIB := both
-
-LOCAL_EXPORT_C_INCLUDE_DIRS := \
- $(LOCAL_PATH)/include \
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/sysfuzzer/vtscompiler/VtsCompilerMain.cpp b/sysfuzzer/vtscompiler/VtsCompilerMain.cpp
index 743e0f4..d4889c6 100644
--- a/sysfuzzer/vtscompiler/VtsCompilerMain.cpp
+++ b/sysfuzzer/vtscompiler/VtsCompilerMain.cpp
@@ -16,19 +16,38 @@
#include <stdlib.h>
#include <string.h>
+#include <dirent.h>
+#include <sys/stat.h>
#include <iostream>
#include "code_gen/CodeGenBase.h"
+#include "VtsCompilerUtils.h"
using namespace std;
+// To generate both header and source files,
+// Usage: vtsc -mDRIVER | -mPROFILER <.vts input file path> \
+// <header output dir> <C/C++ source output file path>
+// To generate only a header file,
+// Usage: vtsc -mDRIVER | -mPROFILER -tHEADER -b<base path> \
+// <.vts input file or dir path> <header output file or dir path>
+// To generate only a source file,
+// Usage: vtsc -mDRIVER | -mPROFILER -tSOURCE -b<base path> \
+// <.vts input file or dir path> \
+// <C/C++ source output file or dir path>
+// where <base path> is a base path of where .vts input file or dir is
+// stored but should be excluded when computing the package path of generated
+// source or header output file(s).
+
int main(int argc, char* argv[]) {
#ifdef VTS_DEBUG
cout << "Android VTS Compiler (AVTSC)" << endl;
#endif
int opt_count = 0;
android::vts::VtsCompileMode mode = android::vts::kDriver;
+ android::vts::VtsCompileFileType type = android::vts::VtsCompileFileType::kBoth;
+ string vts_base_dir;
for (int i = 0; i < argc; i++) {
#ifdef VTS_DEBUG
cout << "- args[" << i << "] " << argv[i] << endl;
@@ -43,13 +62,92 @@
#endif
}
}
+ if (argv[i][1] == 't') {
+ if (!strcmp(&argv[i][2], "HEADER")) {
+ type = android::vts::kHeader;
+#ifdef VTS_DEBUG
+ cout << "- type: HEADER" << endl;
+#endif
+ } else if (!strcmp(&argv[i][2], "SOURCE")) {
+ type = android::vts::kSource;
+#ifdef VTS_DEBUG
+ cout << "- type: SOURCE" << endl;
+#endif
+ }
+ }
+ if (argv[i][1] == 'b') {
+ vts_base_dir = &argv[i][2];
+#ifdef VTS_DEBUG
+ cout << "- VTS base dir: " << vts_base_dir << endl;
+#endif
+ }
}
}
if (argc < 5) {
cerr << "argc " << argc << " < 5" << endl;
return -1;
}
- android::vts::Translate(
- mode, argv[opt_count + 1], argv[opt_count + 2], argv[opt_count + 3]);
+ switch (type) {
+ case android::vts::kBoth:
+ android::vts::Translate(
+ mode, argv[opt_count + 1], argv[opt_count + 2], argv[opt_count + 3]);
+ break;
+ case android::vts::kHeader:
+ case android::vts::kSource: {
+ struct stat s;
+ bool is_dir = false;
+ if (vts_base_dir.length() > 0) {
+ if (chdir(vts_base_dir.c_str())) {
+ cerr << __func__ << " can't chdir to " << vts_base_dir << endl;
+ exit(-1);
+ }
+ }
+ if (stat(argv[opt_count + 1], &s) == 0) {
+ if (s.st_mode & S_IFDIR) {
+ is_dir = true;
+ }
+ }
+ cout << "is_dir: " << is_dir << endl;
+ if (!is_dir) {
+ android::vts::TranslateToFile(
+ mode, argv[opt_count + 1], argv[opt_count + 2], type);
+ } else {
+ DIR* input_dir;
+ struct dirent* ent;
+ if ((input_dir = opendir(argv[opt_count + 1])) != NULL) {
+ // argv[opt_count + 2] should be a directory. if that dir does not exist,
+ // that dir is created as part of the translation operation.
+ while ((ent = readdir(input_dir)) != NULL) {
+ if (!strncmp(&ent->d_name[strlen(ent->d_name)-4], ".vts", 4)) {
+ string src_file = android::vts::RemoveBaseDir(
+ android::vts::PathJoin(
+ argv[opt_count + 1], ent->d_name), vts_base_dir);
+ string dst_file = android::vts::RemoveBaseDir(
+ android::vts::PathJoin(
+ argv[opt_count + 2], ent->d_name), vts_base_dir);
+ if (type == android::vts::kHeader) {
+ dst_file = android::vts::PathJoin(dst_file.c_str(), ".h");
+ } else {
+ dst_file = android::vts::PathJoin(dst_file.c_str(), ".cpp");
+ }
+#ifdef VTS_DEBUG
+ cout << ent->d_name << endl;
+ cout << "<- " << src_file.c_str() << endl;
+ cout << "-> " << dst_file.c_str() << endl;
+#endif
+ android::vts::TranslateToFile(
+ mode, src_file.c_str(), dst_file.c_str(), type);
+ }
+ }
+ closedir(input_dir);
+ } else {
+ cerr << __func__ << " can't open the given input dir, "
+ << argv[opt_count + 1] << "." << endl;
+ exit(-1);
+ }
+ }
+ break;
+ }
+ }
return 0;
}
diff --git a/sysfuzzer/vtscompiler/VtsCompilerUtils.cpp b/sysfuzzer/vtscompiler/VtsCompilerUtils.cpp
index 7796c40..b786be6 100644
--- a/sysfuzzer/vtscompiler/VtsCompilerUtils.cpp
+++ b/sysfuzzer/vtscompiler/VtsCompilerUtils.cpp
@@ -82,12 +82,20 @@
return "bluetooth";
case NFC:
return "nfc";
+ case VEHICLE:
+ return "vehicle";
case VIBRATOR:
return "vibrator";
case THERMAL:
return "thermal";
+ case SENSORS:
+ return "sensors";
+ case VR:
+ return "vr";
case BIONIC_LIBM:
return "bionic_libm";
+ case TV_CEC:
+ return "tv_cec";
}
cerr << "error: invalid component_type " << component_type << endl;
exit(-1);
@@ -126,6 +134,7 @@
exit(-1);
}
+// TODO(zhuoyao): refactor and support TYPE_ARRAY.
string GetCppVariableType(const VariableSpecificationMessage& arg,
const ComponentSpecificationMessage* message) {
if (arg.type() == TYPE_VOID) {
@@ -191,7 +200,9 @@
<< arg.vector_value(0).type() << endl;
}
} else if (arg.type() == TYPE_HIDL_CALLBACK) {
- return arg.predefined_type();
+ return "sp<" + arg.predefined_type() + ">";
+ } else if (arg.type() == TYPE_HANDLE) {
+ return "::android::hardware::hidl_handle";
}
cerr << __func__ << ":" << __LINE__ << " "
<< ": type " << arg.type() << " not supported" << endl;
@@ -411,5 +422,41 @@
return out.str();
}
+string ClearStringWithNameSpaceAccess(const string& str) {
+ string result = str;
+ ReplaceSubString(result, "::", "__");
+ return result;
+}
+
+// Returns a string which joins the given dir_path and file_name.
+string PathJoin(const char* dir_path, const char* file_name) {
+ string result;
+ if (dir_path) {
+ result = dir_path;
+ if (!file_name) return result;
+ } else if (!file_name) return result;
+
+ if (file_name[0] != '.') {
+ if (result.c_str()[result.length()-1] != '/') {
+ result += "/";
+ }
+ }
+ result += file_name;
+ return result;
+}
+
+// Returns a string which remove given base_path from file_path if included.
+string RemoveBaseDir(const string& file_path, const string& base_path) {
+ if (strncmp(file_path.c_str(), base_path.c_str(), base_path.length())) {
+ return file_path;
+ }
+ string result;
+ result = &file_path.c_str()[base_path.length()];
+ if (result.c_str()[0] == '/') {
+ result = &result.c_str()[1];
+ }
+ return result;
+}
+
} // namespace vts
} // namespace android
diff --git a/sysfuzzer/vtscompiler/VtsCompilerUtils.h b/sysfuzzer/vtscompiler/VtsCompilerUtils.h
index c2f8d12..6a0d351 100644
--- a/sysfuzzer/vtscompiler/VtsCompilerUtils.h
+++ b/sysfuzzer/vtscompiler/VtsCompilerUtils.h
@@ -55,5 +55,15 @@
// Get HAL version string to be used to build a relevant dir path.
string GetVersionString(float version, bool for_macro=false);
+// Replace the name space access symbol "::" in the string to "__" to prevent
+// mis-interpretation in generated cpp code.
+string ClearStringWithNameSpaceAccess(const string& str);
+
+// Returns a string which joins the given dir_path and file_name.
+string PathJoin(const char* dir_path, const char* file_name);
+
+// Returns a string which remove given base_path from file_path if included.
+string RemoveBaseDir(const string& file_path, const string& base_path);
+
} // namespace vts
} // namespace android
diff --git a/sysfuzzer/vtscompiler/code_gen/CodeGenBase.cpp b/sysfuzzer/vtscompiler/code_gen/CodeGenBase.cpp
index 7971534..4facee7 100644
--- a/sysfuzzer/vtscompiler/code_gen/CodeGenBase.cpp
+++ b/sysfuzzer/vtscompiler/code_gen/CodeGenBase.cpp
@@ -54,7 +54,8 @@
CodeGenBase::~CodeGenBase() {}
-// Translates the vts proto file to C/C++ code and header files.
+// TODO(yim): deprecate this function after type specific translate functions
+// are used.
void Translate(VtsCompileMode mode,
const char* input_vts_file_path,
const char* output_header_dir_path,
@@ -139,5 +140,89 @@
}
}
+void TranslateToFile(VtsCompileMode mode,
+ const char* input_vts_file_path,
+ const char* output_file_path,
+ VtsCompileFileType file_type) {
+ string output_cpp_file_path_str = string(output_file_path);
+
+ size_t found;
+ found = output_cpp_file_path_str.find_last_of("/");
+ string vts_name = output_cpp_file_path_str
+ .substr(found + 1, output_cpp_file_path_str.length() - found - 5);
+
+ cout << "vts_name: " << vts_name << endl;
+
+ ComponentSpecificationMessage message;
+ if (InterfaceSpecificationParser::parse(input_vts_file_path, &message)) {
+ cout << message.component_class();
+ } else {
+ cerr << __func__ << " can't parse " << input_vts_file_path << endl;
+ }
+
+ FILE* output_file = fopen(output_file_path, "w");
+ if (output_file == NULL) {
+ cerr << __func__ << " could not open file " << output_file_path;
+ exit(-1);
+ }
+ Formatter out(output_file);
+
+ if (mode == kProfiler) {
+ unique_ptr<ProfilerCodeGenBase> profiler_generator;
+ switch (message.component_class()) {
+ case HAL_HIDL:
+ profiler_generator.reset(
+ new HalHidlProfilerCodeGen(input_vts_file_path, vts_name));
+ break;
+ default:
+ cerr << "not yet supported component_class "
+ << message.component_class();
+ exit(-1);
+ }
+ if (file_type == kHeader) {
+ profiler_generator->GenerateHeaderFile(out, message);
+ } else if (file_type == kSource){
+ profiler_generator->GenerateSourceFile(out, message);
+ } else {
+ cerr << __func__ << " doesn't support file_type = kBoth." << endl;
+ exit(-1);
+ }
+ } else if (mode == kDriver) {
+ unique_ptr<CodeGenBase> code_generator;
+ switch (message.component_class()) {
+ case HAL_CONVENTIONAL:
+ code_generator.reset(new HalCodeGen(input_vts_file_path, vts_name));
+ break;
+ case HAL_CONVENTIONAL_SUBMODULE:
+ code_generator.reset(
+ new HalSubmoduleCodeGen(input_vts_file_path, vts_name));
+ break;
+ case HAL_LEGACY:
+ code_generator.reset(
+ new LegacyHalCodeGen(input_vts_file_path, vts_name));
+ break;
+ case LIB_SHARED:
+ code_generator.reset(
+ new LibSharedCodeGen(input_vts_file_path, vts_name));
+ break;
+ case HAL_HIDL:
+ code_generator.reset(new HalHidlCodeGen(input_vts_file_path, vts_name));
+ break;
+ default:
+ cerr << "not yet supported component_class "
+ << message.component_class();
+ exit(-1);
+ }
+ if (file_type == kHeader) {
+ code_generator->GenerateHeaderFile(out, message);
+ } else if (file_type == kSource){
+ code_generator->GenerateSourceFile(out, message);
+ } else {
+ cerr << __func__ << " doesn't support file_type = kBoth." << endl;
+ exit(-1);
+ }
+ }
+}
+
} // namespace vts
} // namespace android
diff --git a/sysfuzzer/vtscompiler/code_gen/CodeGenBase.h b/sysfuzzer/vtscompiler/code_gen/CodeGenBase.h
index 628aff6..37be853 100644
--- a/sysfuzzer/vtscompiler/code_gen/CodeGenBase.h
+++ b/sysfuzzer/vtscompiler/code_gen/CodeGenBase.h
@@ -34,6 +34,13 @@
kProfiler
};
+// Specifies what kinds of files to generate.
+enum VtsCompileFileType {
+ kBoth = 0,
+ kHeader,
+ kSource,
+};
+
class CodeGenBase {
public:
explicit CodeGenBase(const char* input_vts_file_path, const string& vts_name);
@@ -43,6 +50,14 @@
virtual void GenerateAll(Formatter& header_out, Formatter& source_out,
const ComponentSpecificationMessage& message) = 0;
+ // Generates source file.
+ virtual void GenerateSourceFile(
+ Formatter& out, const ComponentSpecificationMessage& message) = 0;
+
+ // Generates header file.
+ virtual void GenerateHeaderFile(
+ Formatter& out, const ComponentSpecificationMessage& message) = 0;
+
const char* input_vts_file_path() const {
return input_vts_file_path_;
}
@@ -56,11 +71,19 @@
const string& vts_name_;
};
+// Translates the VTS proto file to C/C++ code and header files.
void Translate(VtsCompileMode mode,
const char* input_vts_file_path,
const char* output_header_dir_path,
const char* output_cpp_file_path);
+
+// Translates the VTS proto file to a C/C++ source or header file.
+void TranslateToFile(VtsCompileMode mode,
+ const char* input_vts_file_path,
+ const char* output_file_path,
+ VtsCompileFileType file_type);
+
} // namespace vts
} // namespace android
diff --git a/sysfuzzer/vtscompiler/code_gen/driver/DriverCodeGenBase.cpp b/sysfuzzer/vtscompiler/code_gen/driver/DriverCodeGenBase.cpp
index d336ccd..a9a75e3 100644
--- a/sysfuzzer/vtscompiler/code_gen/driver/DriverCodeGenBase.cpp
+++ b/sysfuzzer/vtscompiler/code_gen/driver/DriverCodeGenBase.cpp
@@ -37,453 +37,163 @@
void DriverCodeGenBase::GenerateAll(
Formatter& header_out, Formatter& source_out,
const ComponentSpecificationMessage& message) {
+ GenerateHeaderFile(header_out, message);
+ GenerateSourceFile(source_out, message);
+}
+
+void DriverCodeGenBase::GenerateHeaderFile(
+ Formatter& out, const ComponentSpecificationMessage& message) {
string component_name = GetComponentName(message);
if (component_name.empty()) {
cerr << __func__ << ":" << __LINE__ << " error component_name is empty"
<< "\n";
exit(-1);
}
- string fuzzer_extended_class_name;
- if (message.component_class() == HAL_CONVENTIONAL ||
- message.component_class() == HAL_CONVENTIONAL_SUBMODULE ||
- message.component_class() == HAL_HIDL ||
- message.component_class() == HAL_LEGACY ||
- message.component_class() == LIB_SHARED) {
- fuzzer_extended_class_name = "FuzzerExtended_" + component_name;
- }
- GenerateHeaderFile(header_out, message, fuzzer_extended_class_name);
- GenerateSourceFile(source_out, message, fuzzer_extended_class_name);
-}
+ string fuzzer_extended_class_name = "FuzzerExtended_" + component_name;
-
-void DriverCodeGenBase::GenerateHeaderFile(
- Formatter& out, const ComponentSpecificationMessage& message,
- const string& fuzzer_extended_class_name) {
- out << "#ifndef __VTS_SPEC_" << vts_name_ << "__" << "\n";
- out << "#define __VTS_SPEC_" << vts_name_ << "__" << "\n";
+ string macroized_package_name = message.package();
+ ReplaceSubString(macroized_package_name, ".", "_");
+ out << "#ifndef __VTS_SPEC_" << macroized_package_name
+ << "_" << vts_name_ << "__" << "\n";
+ out << "#define __VTS_SPEC_" << macroized_package_name
+ << "_" << vts_name_ << "__" << "\n";
out << "\n";
- out << "#include <stdio.h>" << "\n";
- out << "#include <stdarg.h>" << "\n";
- out << "#include <stdlib.h>" << "\n";
- out << "#include <string.h>" << "\n";
+
out << "#define LOG_TAG \"" << fuzzer_extended_class_name << "\"" << "\n";
- out << "#include <utils/Log.h>" << "\n";
- out << "#include <fuzz_tester/FuzzerBase.h>" << "\n";
- out << "#include <fuzz_tester/FuzzerCallbackBase.h>" << "\n";
- for (auto const& header : message.header()) {
- out << "#include " << header << "\n";
- }
- if (message.component_class() == HAL_HIDL && message.has_component_name()) {
- string package_path = message.package();
- ReplaceSubString(package_path, ".", "/");
- out << "#include <" << package_path << "/"
- << GetVersionString(message.component_type_version())
- << "/" << message.component_name() << ".h>" << "\n";
- if (message.component_name() != "types") {
- out << "#include <" << package_path << "/"
- << GetVersionString(message.component_type_version())
- << "/" << message.component_name() << ".h>" << "\n";
- }
- out << "#include <hidl/HidlSupport.h>" << "\n";
- }
- out << "\n\n" << "\n";
+ GenerateHeaderIncludeFiles(out, message, fuzzer_extended_class_name);
+
GenerateOpenNameSpaces(out, message);
-
- GenerateClassHeader(fuzzer_extended_class_name, out, message);
-
- string function_name_prefix = GetFunctionNamePrefix(message);
-
- std::stringstream ss;
- // return type
- out << "\n";
- ss << "android::vts::FuzzerBase* " << "\n";
- // function name
- ss << function_name_prefix << "(" << "\n";
- ss << ")";
-
- if (message.component_class() == HAL_HIDL &&
- message.component_name() != "types" &&
- !endsWith(message.component_name(), "Callback")) {
- GenerateHeaderGlobalFunctionDeclarations(out, ss.str());
- }
-
- if (message.component_class() == HAL_HIDL &&
- endsWith(message.component_name(), "Callback")) {
- out << "\n";
- out << "class Vts" << message.component_name().substr(1) << ": public "
- << message.component_name() << " {" << "\n";
- out << " public:" << "\n";
- out.indent();
- out << "Vts" << message.component_name().substr(1) << "() {};" << "\n";
- out << "\n";
- out << "virtual ~Vts" << message.component_name().substr(1) << "()"
- << " = default;" << "\n";
- out << "\n";
- for (const auto& api : message.interface().api()) {
- if (api.return_type_hidl_size() == 0 ||
- api.return_type_hidl(0).type() == TYPE_VOID) {
- out << "::android::hardware::Return<void> ";
-
- } else if (api.return_type_hidl(0).type() == TYPE_SCALAR ||
- api.return_type_hidl(0).type() == TYPE_ENUM) {
- out << "Return<" << api.return_type_hidl(0).scalar_type() << "> ";
- } else {
- out << "Status " << "\n";
- }
-
- out << api.name() << "(" << "\n";
- int arg_count = 0;
- for (const auto& arg : api.arg()) {
- if (arg_count > 0) out << "," << "\n";
- if (arg.type() == TYPE_ENUM) {
- if (arg.is_const()) {
- out << " const " << arg.predefined_type() << "&";
- } else {
- out << " " << arg.predefined_type();
- }
- out << " arg" << arg_count;
- } else if (arg.type() == TYPE_STRUCT) {
- out << " const " << arg.predefined_type() << "&";
- out << " arg" << arg_count;
- } else if (arg.type() == TYPE_VECTOR) {
- out << " const ";
- if (arg.vector_value(0).type() == TYPE_SCALAR) {
- if (arg.vector_value(0).scalar_type().length() == 0) {
- cerr << __func__ << ":" << __LINE__
- << " ERROR scalar_type not set" << "\n";
- exit(-1);
- }
- out << "::android::hardware::hidl_vec<"
- << arg.vector_value(0).scalar_type()
- << ">&";
- } else {
- cerr << __func__ << " unknown vector arg type "
- << arg.vector_value(0).type() << "\n";
- exit(-1);
- }
- out << " arg" << arg_count;
- } else if (arg.type() == TYPE_ARRAY) {
- out << " ";
- if (arg.is_const()) {
- out << "const ";
- }
- if (arg.vector_value(0).type() == TYPE_SCALAR) {
- out << arg.vector_value(0).scalar_type()
- << "[" << arg.vector_size() << "]";
- } else {
- cerr << __func__ << " unknown vector arg type "
- << arg.vector_value(0).type() << "\n";
- exit(-1);
- }
- out << " arg" << arg_count;
- } else {
- cerr << __func__ << " unknown arg type " << arg.type() << "\n";
- exit(-1);
- }
- arg_count++;
- }
- out << ") override;" << "\n";
- out << "\n";
- }
- out.unindent();
- out << "};" << "\n";
- out << "\n";
-
- out << "Vts" << message.component_name().substr(1) << "* VtsFuzzerCreate"
- << message.component_name() << "(const string& callback_socket_name);" << "\n";
- out << "\n";
- }
-
+ GenerateClassHeader(out, message, fuzzer_extended_class_name);
+ out << "\n\n";
+ GenerateHeaderGlobalFunctionDeclarations(out, message);
GenerateCloseNameSpaces(out);
out << "#endif" << "\n";
}
-
void DriverCodeGenBase::GenerateSourceFile(
- Formatter& out, const ComponentSpecificationMessage& message,
- const string& fuzzer_extended_class_name) {
- string input_vfs_file_path(input_vts_file_path_);
-
- out << "#include \"" << input_vfs_file_path << ".h\"" << "\n";
-
- if (message.component_class() == HAL_HIDL) {
-
- out << "#include <hidl/HidlSupport.h>" << "\n";
+ Formatter& out, const ComponentSpecificationMessage& message) {
+ string component_name = GetComponentName(message);
+ if (component_name.empty()) {
+ cerr << __func__ << ":" << __LINE__ << " error component_name is empty"
+ << "\n";
+ exit(-1);
}
+ string fuzzer_extended_class_name = "FuzzerExtended_" + component_name;
- out << "#include <iostream>" << "\n";
- out << "#include \"vts_datatype.h\"" << "\n";
- out << "#include \"vts_measurement.h\"" << "\n";
- for (auto const& header : message.header()) {
- out << "#include " << header << "\n";
- }
- if (message.component_class() == HAL_HIDL && message.has_component_name()) {
- out << "#include <hidl/HidlSupport.h>" << "\n";
-
- string package_path = message.package();
- ReplaceSubString(package_path, ".", "/");
- out << "#include <" << package_path << "/"
- << GetVersionString(message.component_type_version())
- << "/" << message.component_name() << ".h>" << "\n";
- for (const auto& import : message.import()) {
- string mutable_import = import;
- ReplaceSubString(mutable_import, ".", "/");
- ReplaceSubString(mutable_import, "@", "/");
- string base_dirpath = mutable_import.substr(
- 0, mutable_import.find_last_of("::") + 1);
- string base_filename = mutable_import.substr(
- mutable_import.find_last_of("::") + 1);
-
- if (base_filename == "types") {
- out << "#include \""
- << input_vfs_file_path.substr(
- 0, input_vfs_file_path.find_last_of("\\/"))
- << "/types.vts.h\"" << "\n";
- }
- if (base_filename != "types") {
- if (message.component_name() != base_filename) {
- out << "#include <" << package_path << "/"
- << GetVersionString(message.component_type_version())
- << "/" << base_filename << ".h>" << "\n";
- }
- if (base_filename.substr(0, 1) == "I") {
- out << "#include \""
- << input_vfs_file_path.substr(0, input_vfs_file_path.find_last_of("\\/"))
- << "/" << base_filename.substr(1, base_filename.find_last_of(".h"))
- << ".vts.h\"" << "\n";
- }
- } else if (message.component_name() != base_filename) {
- // TODO: consider restoring this when hidl packaging is fully defined.
- // cpp_ss << "#include <" << base_dirpath << base_filename << ".h>" << "\n";
- out << "#include <" << package_path << "/"
- << GetVersionString(message.component_type_version())
- << "/" << base_filename << ".h>" << "\n";
- }
- }
- }
+ GenerateSourceIncludeFiles(out, message, fuzzer_extended_class_name);
+ out << "\n\n";
GenerateOpenNameSpaces(out, message);
-
- out << "\n" << "\n";
- if (message.component_class() == HAL_CONVENTIONAL ||
- message.component_class() == HAL_CONVENTIONAL_SUBMODULE) {
- GenerateCppBodyCallbackFunction(out, message,
- fuzzer_extended_class_name);
- }
-
- out << "\n";
- GenerateCppBodyFuzzFunction(out, message, fuzzer_extended_class_name);
- GenerateCppBodyGetAttributeFunction(
- out, message, fuzzer_extended_class_name);
-
- if (message.component_class() == HAL_HIDL &&
- endsWith(message.component_name(), "Callback")) {
- out << "\n";
- for (const auto& api : message.interface().api()) {
- if (api.return_type_hidl_size() == 0 ||
- api.return_type_hidl(0).type() == TYPE_VOID) {
- out << "::android::hardware::Return<void> ";
- } else if (api.return_type_hidl(0).type() == TYPE_SCALAR ||
- api.return_type_hidl(0).type() == TYPE_ENUM) {
- out << "Return<" << api.return_type_hidl(0).scalar_type() << "> ";
- } else {
- out << "Status " << "\n";
- }
-
- out << "Vts" << message.component_name().substr(1) << "::"
- << api.name() << "(" << "\n";
- int arg_count = 0;
- for (const auto& arg : api.arg()) {
- if (arg_count > 0) out << "," << "\n";
- if (arg.type() == TYPE_ENUM) {
- if (arg.is_const()) {
- out << " const " << arg.predefined_type() << "&";
- } else {
- out << " " << arg.predefined_type();
- }
- out << " arg" << arg_count;
- } else if (arg.type() == TYPE_STRUCT) {
- out << " const " << arg.predefined_type() << "&";
- out << " arg" << arg_count;
- } else if (arg.type() == TYPE_VECTOR) {
- out << " const ";
- if (arg.vector_value(0).type() == TYPE_SCALAR) {
- if (arg.vector_value(0).scalar_type().length() == 0) {
- cerr << __func__ << ":" << __LINE__
- << " ERROR scalar_type not set" << "\n";
- exit(-1);
- }
- out << "::android::hardware::hidl_vec<"
- << arg.vector_value(0).scalar_type()
- << ">&";
- } else {
- cerr << __func__ << " unknown vector arg type "
- << arg.vector_value(0).type() << "\n";
- exit(-1);
- }
- out << " arg" << arg_count;
- } else if (arg.type() == TYPE_ARRAY) {
- out << " ";
- if (arg.is_const()) {
- out << "const ";
- }
- if (arg.vector_value(0).type() == TYPE_SCALAR) {
- out << arg.vector_value(0).scalar_type()
- << "[" << arg.vector_size() << "]";
- } else {
- cerr << __func__ << " unknown vector arg type "
- << arg.vector_value(0).type() << "\n";
- exit(-1);
- }
- out << " arg" << arg_count;
- } else {
- cerr << __func__ << " unknown arg type " << arg.type() << "\n";
- exit(-1);
- }
- arg_count++;
- }
- out << ") {" << "\n";
- out.indent();
- out << "cout << \"" << api.name() << " called\" << endl;" << "\n";
- if (api.return_type_hidl_size() == 0 ||
- api.return_type_hidl(0).type() == TYPE_VOID) {
- out << "return ::android::hardware::Void();" << "\n";
- } else {
- out << "return Status::ok();" << "\n";
- }
- out.unindent();
- out << "}" << "\n";
- out << "\n";
- }
-
- out << "Vts" << message.component_name().substr(1) << "* VtsFuzzerCreate"
- << message.component_name() << "(const string& callback_socket_name)";
- out << " {" << "\n";
- out.indent();
- out << "return new Vts" << message.component_name().substr(1) << "();"
- << "\n";
- out.unindent();
- out << "}" << "\n" << "\n";
- } else {
- if (message.component_class() != HAL_HIDL ||
- (message.component_name() != "types" &&
- !endsWith(message.component_name(), "Callback"))) {
- std::stringstream ss;
- // return type
- ss << "android::vts::FuzzerBase* " << "\n";
- // function name
- string function_name_prefix = GetFunctionNamePrefix(message);
- ss << function_name_prefix << "(" << "\n";
- ss << ")";
-
- GenerateCppBodyGlobalFunctions(out, ss.str(), fuzzer_extended_class_name);
- }
- }
-
+ GenerateClassImpl(out, message, fuzzer_extended_class_name);
+ GenerateCppBodyGlobalFunctions(out, message, fuzzer_extended_class_name);
GenerateCloseNameSpaces(out);
}
+void DriverCodeGenBase::GenerateClassHeader(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) {
+ out << "class " << fuzzer_extended_class_name << " : public FuzzerBase {"
+ << "\n";
+ out << " public:" << "\n";
-void DriverCodeGenBase::GenerateClassHeader(
- const string& fuzzer_extended_class_name, Formatter& out,
+ out.indent();
+ GenerateClassConstructionFunction(out, message, fuzzer_extended_class_name);
+ out.unindent();
+
+ out << " protected:" << "\n";
+
+ out.indent();
+ out << "bool Fuzz(FunctionSpecificationMessage* func_msg, void** result, "
+ << "const string& callback_socket_name);\n";
+ out << "bool CallFunction(const FunctionSpecificationMessage& func_msg, "
+ << "const string& callback_socket_name, "
+ << "FunctionSpecificationMessage* result_msg);\n";
+ out << "bool VerifyResults(const FunctionSpecificationMessage& expected_result, "
+ << "const FunctionSpecificationMessage& actual_result);\n";
+ out << "bool GetAttribute(FunctionSpecificationMessage* func_msg, "
+ << "void** result);\n";
+
+ // Produce Fuzz method(s) for sub_struct(s).
+ for (auto const& sub_struct : message.interface().sub_struct()) {
+ GenerateFuzzFunctionForSubStruct(out, sub_struct, "_");
+ }
+ // Generate additional function declarations if any.
+ GenerateAdditionalFuctionDeclarations(out, message,
+ fuzzer_extended_class_name);
+ out.unindent();
+
+ out << " private:" << "\n";
+
+ out.indent();
+ // Generate declarations of private members if any.
+ GeneratePrivateMemberDeclarations(out, message);
+ out.unindent();
+
+ out << "};\n";
+}
+
+void DriverCodeGenBase::GenerateClassImpl(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) {
+ GenerateCppBodyCallbackFunction(out, message, fuzzer_extended_class_name);
+ GenerateCppBodyFuzzFunction(out, message, fuzzer_extended_class_name);
+ GenerateCppBodyGetAttributeFunction(out, message, fuzzer_extended_class_name);
+ GenerateDriverFunctionImpl(out, message, fuzzer_extended_class_name);
+ GenerateVerificationFunctionImpl(out, message, fuzzer_extended_class_name);
+}
+
+void DriverCodeGenBase::GenerateHeaderIncludeFiles(Formatter& out,
+ const ComponentSpecificationMessage& message, const string&) {
+ for (auto const& header : message.header()) {
+ out << "#include " << header << "\n";
+ }
+ out << "\n\n";
+ out << "#include <stdio.h>" << "\n";
+ out << "#include <stdarg.h>" << "\n";
+ out << "#include <stdlib.h>" << "\n";
+ out << "#include <string.h>" << "\n";
+ out << "#include <utils/Log.h>" << "\n";
+
+ out << "#include <fuzz_tester/FuzzerBase.h>" << "\n";
+ out << "#include <fuzz_tester/FuzzerCallbackBase.h>" << "\n";
+ out << "\n\n";
+}
+
+void DriverCodeGenBase::GenerateSourceIncludeFiles(Formatter& out,
+ const ComponentSpecificationMessage& message, const string&) {
+ out << "#include \"" << input_vts_file_path_ << ".h\"" << "\n";
+
+ for (auto const& header : message.header()) {
+ out << "#include " << header << "\n";
+ }
+ out << "#include \"vts_datatype.h\"" << "\n";
+ out << "#include \"vts_measurement.h\"" << "\n";
+ out << "#include <iostream>" << "\n";
+}
+
+void DriverCodeGenBase::GenerateHeaderGlobalFunctionDeclarations(Formatter& out,
const ComponentSpecificationMessage& message) {
- if (message.component_class() != HAL_HIDL ||
- (message.component_name() != "types" &&
- !endsWith(message.component_name(), "Callback"))) {
- out << "class " << fuzzer_extended_class_name << " : public FuzzerBase {"
- << "\n";
- out << " public:" << "\n";
- out.indent();
- out << fuzzer_extended_class_name << "() : FuzzerBase(";
+ string function_name_prefix = GetFunctionNamePrefix(message);
- if (message.component_class() == HAL_CONVENTIONAL) {
- out << "HAL_CONVENTIONAL)";
- } else if (message.component_class() == HAL_CONVENTIONAL_SUBMODULE) {
- out << "HAL_CONVENTIONAL_SUBMODULE)";
- } else if (message.component_class() == HAL_HIDL) {
- if (message.component_name() != "types") {
- out << "HAL_HIDL), hw_binder_proxy_()";
- } else {
- out << "HAL_HIDL)";
- }
- } else if (message.component_class() == HAL_LEGACY) {
- out << "HAL_LEGACY)";
- } else if (message.component_class() == LIB_SHARED) {
- out << "LIB_SHARED)";
- }
+ out << "extern \"C\" {" << "\n";
+ out << "extern " << "android::vts::FuzzerBase* " << function_name_prefix
+ << "();\n";
+ out << "}" << "\n";
+}
- out << " { }" << "\n";
- out.unindent();
- out << " protected:" << "\n";
- out.indent();
- out << "bool Fuzz(FunctionSpecificationMessage* func_msg," << "\n"
- << " void** result, const string& callback_socket_name);"
- << "\n";
- out << "bool GetAttribute(FunctionSpecificationMessage* func_msg," << "\n"
- << " void** result);"
- << "\n";
+void DriverCodeGenBase::GenerateCppBodyGlobalFunctions(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) {
+ string function_name_prefix = GetFunctionNamePrefix(message);
- // produce Fuzz method(s) for sub_struct(s).
- for (auto const& sub_struct : message.interface().sub_struct()) {
- GenerateFuzzFunctionForSubStruct(out, sub_struct, "_");
- }
-
- if (message.component_class() == HAL_CONVENTIONAL_SUBMODULE) {
- string component_name = GetComponentName(message);
- out << "void SetSubModule(" << component_name << "* submodule) {"
- << "\n";
- out.indent();
- out << "submodule_ = submodule;" << "\n";
- out.unindent();
- out << "}" << "\n" << "\n";
- out.unindent();
- out << " private:" << "\n";
- out.indent();
- out << message.original_data_structure_name() << "* submodule_;" << "\n";
- }
-
- if (message.component_class() == HAL_HIDL
- && message.component_name() != "types") {
- out << "bool GetService(bool get_stub);" << "\n"
- << "\n";
- out.unindent();
- out << " private:" << "\n";
- out.indent();
- out << "sp<" << message.component_name() << "> hw_binder_proxy_;"
- << "\n";
- }
- out.unindent();
- out << "};" << "\n";
- }
-
- if (message.component_class() == HAL_HIDL &&
- message.component_name() == "types") {
- for (int attr_idx = 0;
- attr_idx < message.attribute_size() + message.interface().attribute_size();
- attr_idx++) {
- const auto& attribute = (attr_idx < message.attribute_size()) ?
- message.attribute(attr_idx) :
- message.interface().attribute(attr_idx - message.attribute_size());
- std::string attribute_name = attribute.name();
- ReplaceSubString(attribute_name, "::", "__");
- if (attribute.type() == TYPE_ENUM) {
- out << attribute.name() << " "
- << "Random" << attribute_name << "();"
- << "\n";
- } else if (attribute.type() == TYPE_STRUCT) {
- std::string attribute_name = attribute.name();
- ReplaceSubString(attribute_name, "::", "__");
- out << "void " << "MessageTo" << attribute_name
- << "(const VariableSpecificationMessage& var_msg, "
- << attribute.name() << "* arg);"
- << "\n";
- } else {
- cerr << __func__ << ":" << __LINE__ << " ERROR unsupported type "
- << attribute.type() << endl;
- exit(-1);
- }
- }
- }
+ out << "extern \"C\" {" << "\n";
+ out << "android::vts::FuzzerBase* " << function_name_prefix << "() {\n";
+ out.indent();
+ out << "return (android::vts::FuzzerBase*) " << "new android::vts::"
+ << fuzzer_extended_class_name << "();\n";
+ out.unindent();
+ out << "}\n\n";
+ out << "}\n";
}
void DriverCodeGenBase::GenerateFuzzFunctionForSubStruct(
@@ -507,6 +217,32 @@
out.unindent();
}
+void DriverCodeGenBase::GenerateDriverFunctionImpl(Formatter& out,
+ const ComponentSpecificationMessage& /*message*/,
+ const string& fuzzer_extended_class_name) {
+ out << "bool " << fuzzer_extended_class_name
+ << "::CallFunction(const FunctionSpecificationMessage&, const string&, "
+ << "FunctionSpecificationMessage* ) {\n";
+ out.indent();
+ out << "/* No implementation yet. */\n";
+ out << "return true;\n";
+ out.unindent();
+ out << "}\n";
+}
+
+void DriverCodeGenBase::GenerateVerificationFunctionImpl(Formatter& out,
+ const ComponentSpecificationMessage& /*message*/,
+ const string& fuzzer_extended_class_name) {
+ out << "bool " << fuzzer_extended_class_name
+ << "::VerifyResults(const FunctionSpecificationMessage&, "
+ << "const FunctionSpecificationMessage&) {\n";
+ out.indent();
+ out << "/* No implementation yet. */\n";
+ out << "return true;\n";
+ out.unindent();
+ out << "}\n";
+}
+
void DriverCodeGenBase::GenerateNamespaceName(
Formatter& out, const ComponentSpecificationMessage& message) {
if (message.component_class() == HAL_HIDL && message.has_package()) {
@@ -564,11 +300,5 @@
}
return component_name;
}
-
-void DriverCodeGenBase::GenerateCppBodyCallbackFunction(
- Formatter& /*out*/,
- const ComponentSpecificationMessage& /*message*/,
- const string& /*fuzzer_extended_class_name*/) {}
-
} // namespace vts
} // namespace android
diff --git a/sysfuzzer/vtscompiler/code_gen/driver/DriverCodeGenBase.h b/sysfuzzer/vtscompiler/code_gen/driver/DriverCodeGenBase.h
index e8a6144..5ff856d 100644
--- a/sysfuzzer/vtscompiler/code_gen/driver/DriverCodeGenBase.h
+++ b/sysfuzzer/vtscompiler/code_gen/driver/DriverCodeGenBase.h
@@ -42,41 +42,85 @@
virtual void GenerateAll(Formatter& header_out, Formatter& source_out,
const ComponentSpecificationMessage& message);
- protected:
// Generates source file.
virtual void GenerateSourceFile(
- Formatter& out, const ComponentSpecificationMessage& message,
- const string& fuzzer_extended_class_name);
+ Formatter& out, const ComponentSpecificationMessage& message);
// Generates header file.
virtual void GenerateHeaderFile(
- Formatter& out, const ComponentSpecificationMessage& message,
+ Formatter& out, const ComponentSpecificationMessage& message);
+
+ protected:
+
+ // Generates header code for a specific class.
+ virtual void GenerateClassHeader(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name);
+
+ // Generates source code for a specific class.
+ virtual void GenerateClassImpl(Formatter& out,
+ const ComponentSpecificationMessage& message,
const string& fuzzer_extended_class_name);
// Generates code for Fuzz(...) function body.
- virtual void GenerateCppBodyFuzzFunction(
- Formatter& out, const ComponentSpecificationMessage& message,
+ virtual void GenerateCppBodyFuzzFunction(Formatter& out,
+ const ComponentSpecificationMessage& message,
const string& fuzzer_extended_class_name) = 0;
// Generates code for GetAttribute(...) function body.
- virtual void GenerateCppBodyGetAttributeFunction(
- Formatter& out, const ComponentSpecificationMessage& message,
+ virtual void GenerateCppBodyGetAttributeFunction(Formatter& out,
+ const ComponentSpecificationMessage& message,
const string& fuzzer_extended_class_name) = 0;
- // Generates header code to declare the C/C++ global functions.
- virtual void GenerateHeaderGlobalFunctionDeclarations(
- Formatter& out, const string& function_prototype) = 0;
-
- // Generates C/C++ code for callback functions.
- virtual void GenerateCppBodyCallbackFunction(
- Formatter& out, const ComponentSpecificationMessage& message,
+ // Generates code for CallFuction(...) function body.
+ virtual void GenerateDriverFunctionImpl(Formatter& out,
+ const ComponentSpecificationMessage& message,
const string& fuzzer_extended_class_name);
- // Generates code for the bodies of the C/C++ global functions.
- virtual void GenerateCppBodyGlobalFunctions(
- Formatter& out, const string& function_prototype,
- const string& fuzzer_extended_class_name) = 0;
+ // Generates code for VerifyResults(...) function body.
+ virtual void GenerateVerificationFunctionImpl(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name);
+ // Generates C/C++ code for callback functions.
+ virtual void GenerateCppBodyCallbackFunction(Formatter& /*out*/,
+ const ComponentSpecificationMessage& /*message*/,
+ const string& /*fuzzer_extended_class_name*/) {};
+
+ // Generates header code for construction function.
+ virtual void GenerateClassConstructionFunction(Formatter& /*out*/,
+ const ComponentSpecificationMessage& /*message*/,
+ const string& /*fuzzer_extended_class_name*/) {};
+
+ // Generates header code for additional function declarations if any.
+ virtual void GenerateAdditionalFuctionDeclarations(Formatter& /*out*/,
+ const ComponentSpecificationMessage& /*message*/,
+ const string& /*fuzzer_extended_class_name*/) {};
+
+ // Generates header code to declare the C/C++ global functions.
+ virtual void GenerateHeaderGlobalFunctionDeclarations(Formatter& out,
+ const ComponentSpecificationMessage& message);
+
+ // Generates code for the bodies of the C/C++ global functions.
+ virtual void GenerateCppBodyGlobalFunctions(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name);
+
+ // Generates header code for include declarations.
+ virtual void GenerateHeaderIncludeFiles(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name);
+
+ // Generates source code for include declarations.
+ virtual void GenerateSourceIncludeFiles(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name);
+
+ // Generates header code for private member declarations if any.
+ virtual void GeneratePrivateMemberDeclarations(Formatter& /*out*/,
+ const ComponentSpecificationMessage& /*message*/) {};
+
+ //********** Utility functions *****************
// Generates the namespace name of a HIDL component, crashes otherwise.
void GenerateNamespaceName(
Formatter& out, const ComponentSpecificationMessage& message);
@@ -94,11 +138,6 @@
// Generates code that stops the measurement.
void GenerateCodeToStopMeasurement(Formatter& out);
- // Generate header code for a specific class.
- void GenerateClassHeader(const string& fuzzer_extended_class_name,
- Formatter& out,
- const ComponentSpecificationMessage& message);
-
string GetComponentName(const ComponentSpecificationMessage& message);
void GenerateFuzzFunctionForSubStruct(
diff --git a/sysfuzzer/vtscompiler/code_gen/driver/HalCodeGen.cpp b/sysfuzzer/vtscompiler/code_gen/driver/HalCodeGen.cpp
index 3bf5ca1..3705c14 100644
--- a/sysfuzzer/vtscompiler/code_gen/driver/HalCodeGen.cpp
+++ b/sysfuzzer/vtscompiler/code_gen/driver/HalCodeGen.cpp
@@ -24,6 +24,7 @@
#include "test/vts/proto/ComponentSpecificationMessage.pb.h"
#include "VtsCompilerUtils.h"
+#include "utils/InterfaceSpecUtil.h"
#include "utils/StringUtil.h"
using namespace std;
@@ -291,7 +292,6 @@
out.unindent();
out << "}" << "\n";
}
- out.unindent();
out << message.original_data_structure_name()
<< "* local_device = ";
@@ -852,24 +852,10 @@
out << "}" << "\n";
}
-void HalCodeGen::GenerateHeaderGlobalFunctionDeclarations(
- Formatter& out, const string& function_prototype) {
- out << "extern \"C\" {" << "\n";
- out << "extern " << function_prototype << ";" << "\n";
- out << "}" << "\n";
-}
-
-void HalCodeGen::GenerateCppBodyGlobalFunctions(
- Formatter& out, const string& function_prototype,
- const string& fuzzer_extended_class_name) {
- out << "extern \"C\" {" << "\n";
- out << function_prototype << " {" << "\n";
- out.indent();
- out << "return (android::vts::FuzzerBase*) "
- << "new android::vts::" << fuzzer_extended_class_name << "();" << "\n";
- out.unindent();
- out << "}" << "\n" << "\n";
- out << "}" << "\n";
+void HalCodeGen::GenerateClassConstructionFunction(Formatter& out,
+ const ComponentSpecificationMessage& /*message*/,
+ const string& fuzzer_extended_class_name) {
+ out << fuzzer_extended_class_name << "() : FuzzerBase(HAL_CONVENTIONAL) {}\n";
}
void HalCodeGen::GenerateSubStructFuzzFunctionCall(
diff --git a/sysfuzzer/vtscompiler/code_gen/driver/HalCodeGen.h b/sysfuzzer/vtscompiler/code_gen/driver/HalCodeGen.h
index 01f0f92..eb9af46 100644
--- a/sysfuzzer/vtscompiler/code_gen/driver/HalCodeGen.h
+++ b/sysfuzzer/vtscompiler/code_gen/driver/HalCodeGen.h
@@ -38,43 +38,37 @@
: DriverCodeGenBase(input_vts_file_path, vts_name) {}
protected:
- void GenerateCppBodyFuzzFunction(
- Formatter& out, const ComponentSpecificationMessage& message,
- const string& fuzzer_extended_class_name);
+ void GenerateCppBodyFuzzFunction(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
- void GenerateCppBodyFuzzFunction(
- Formatter& out, const StructSpecificationMessage& message,
- const string& fuzzer_extended_class_name,
- const string& original_data_structure_name,
- const string& parent_path);
+ void GenerateCppBodyGetAttributeFunction(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
- void GenerateCppBodyGetAttributeFunction(
- Formatter& out, const ComponentSpecificationMessage& message,
- const string& fuzzer_extended_class_name);
+ void GenerateCppBodyCallbackFunction(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
- void GenerateCppBodyGetAttributeFunction(
- Formatter& out, const StructSpecificationMessage& message,
+ void GenerateClassConstructionFunction(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
+
+ void GenerateSubStructFuzzFunctionCall(Formatter& out,
+ const StructSpecificationMessage& message, const string& parent_path);
+
+ void GenerateSubStructGetAttributeFunctionCall(Formatter& out,
+ const StructSpecificationMessage& message, const string& parent_path);
+
+ void GenerateCppBodyFuzzFunction(Formatter& out,
+ const StructSpecificationMessage& message,
const string& fuzzer_extended_class_name,
const string& original_data_structure_name, const string& parent_path);
- void GenerateCppBodyCallbackFunction(
- Formatter& out, const ComponentSpecificationMessage& message,
- const string& fuzzer_extended_class_name);
-
- void GenerateHeaderGlobalFunctionDeclarations(
- Formatter& out, const string& function_prototype);
-
- void GenerateCppBodyGlobalFunctions(Formatter& out,
- const string& function_prototype,
- const string& fuzzer_extended_class_name);
-
- void GenerateSubStructFuzzFunctionCall(
- Formatter& out, const StructSpecificationMessage& message,
- const string& parent_path);
-
- void GenerateSubStructGetAttributeFunctionCall(
- Formatter& out, const StructSpecificationMessage& message,
- const string& parent_path);
+ void GenerateCppBodyGetAttributeFunction(Formatter& out,
+ const StructSpecificationMessage& message,
+ const string& fuzzer_extended_class_name,
+ const string& original_data_structure_name, const string& parent_path);
// instance variable name (e.g., device_);
static const char* const kInstanceVariableName;
diff --git a/sysfuzzer/vtscompiler/code_gen/driver/HalHidlCodeGen.cpp b/sysfuzzer/vtscompiler/code_gen/driver/HalHidlCodeGen.cpp
index a729c6d..f291ee6 100644
--- a/sysfuzzer/vtscompiler/code_gen/driver/HalHidlCodeGen.cpp
+++ b/sysfuzzer/vtscompiler/code_gen/driver/HalHidlCodeGen.cpp
@@ -25,7 +25,7 @@
#include "test/vts/proto/ComponentSpecificationMessage.pb.h"
#include "VtsCompilerUtils.h"
-#include "code_gen/driver/HalCodeGen.h"
+#include "utils/InterfaceSpecUtil.h"
#include "utils/StringUtil.h"
using namespace std;
@@ -36,188 +36,119 @@
const char* const HalHidlCodeGen::kInstanceVariableName = "hw_binder_proxy_";
-void HalHidlCodeGen::GenerateCppBodyCallbackFunction(
- Formatter& out, const ComponentSpecificationMessage& message,
- const string& fuzzer_extended_class_name) {
- bool first_callback = true;
-
- for (int i = 0;
- i < message.attribute_size() + message.interface().attribute_size();
- i++) {
- const VariableSpecificationMessage& attribute = (i < message.attribute_size()) ?
- message.attribute(i) :
- message.interface().attribute(i - message.attribute_size());
- if (attribute.type() != TYPE_FUNCTION_POINTER || !attribute.is_callback()) {
- continue;
- }
-
- string name =
- "vts_callback_" + fuzzer_extended_class_name + "_" + attribute.name();
- if (first_callback) {
- out << "static string callback_socket_name_;" << "\n";
- first_callback = false;
- }
+void HalHidlCodeGen::GenerateCppBodyCallbackFunction(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& /*fuzzer_extended_class_name*/) {
+ if (endsWith(message.component_name(), "Callback")) {
out << "\n";
- out << "class " << name << " : public FuzzerCallbackBase {" << "\n";
- out << " public:" << "\n";
- out.indent();
- out << name << "(const string& callback_socket_name) {" << "\n";
- out << " callback_socket_name_ = callback_socket_name;" << "\n";
- out << " }" << "\n";
-
- int primitive_format_index = 0;
- for (const FunctionPointerSpecificationMessage& func_pt_spec :
- attribute.function_pointer()) {
- const string& callback_name = func_pt_spec.function_name();
- // TODO: callback's return value is assumed to be 'void'.
- out << "\n";
- out << "static ";
- bool has_return_value = false;
- if (!func_pt_spec.has_return_type() ||
- !func_pt_spec.return_type().has_type() ||
- func_pt_spec.return_type().type() == TYPE_VOID) {
- out << "void" << "\n";
- } else if (func_pt_spec.return_type().type() == TYPE_PREDEFINED) {
- out << func_pt_spec.return_type().predefined_type();
- has_return_value = true;
+ for (const auto& api : message.interface().api()) {
+ if (api.return_type_hidl_size() == 0
+ || api.return_type_hidl(0).type() == TYPE_VOID) {
+ out << "::android::hardware::Return<void> ";
+ } else if (api.return_type_hidl(0).type() == TYPE_SCALAR
+ || api.return_type_hidl(0).type() == TYPE_ENUM) {
+ out << "Return<" << api.return_type_hidl(0).scalar_type() << "> ";
} else {
- cerr << __func__ << ":" << __LINE__ << " ERROR unknown type "
- << func_pt_spec.return_type().type() << "\n";
- exit(-1);
+ out << "Status " << "\n";
}
- out << " " << callback_name << "(";
- int primitive_type_index;
- primitive_type_index = 0;
- for (const auto& arg : func_pt_spec.arg()) {
- if (primitive_type_index != 0) {
- out << ", ";
- }
- if (arg.is_const()) {
- out << "const ";
- }
- if (arg.type() == TYPE_SCALAR) {
- /*
- if (arg.scalar_type() == "pointer") {
- out << definition.aggregate_value(
- primitive_format_index).primitive_name(primitive_type_index)
- << " ";
- }
- */
- if (arg.scalar_type() == "char_pointer") {
- out << "char* ";
- } else if (arg.scalar_type() == "int32_t" ||
- arg.scalar_type() == "uint32_t" ||
- arg.scalar_type() == "size_t" ||
- arg.scalar_type() == "int64_t" ||
- arg.scalar_type() == "uint64_t") {
- out << arg.scalar_type() << " ";
- } else if (arg.scalar_type() == "bool_t") {
- out << "bool ";
- } else if (arg.scalar_type() == "void_pointer") {
- out << "void*";
+
+ out << "Vts" << message.component_name().substr(1) << "::" << api.name()
+ << "(" << "\n";
+ int arg_count = 0;
+ for (const auto& arg : api.arg()) {
+ if (arg_count > 0)
+ out << "," << "\n";
+ if (arg.type() == TYPE_ENUM) {
+ if (arg.is_const()) {
+ out << " const " << arg.predefined_type() << "&";
} else {
- cerr << __func__ << " unsupported scalar type " << arg.scalar_type()
- << "\n";
+ out << " " << arg.predefined_type();
+ }
+ out << " arg" << arg_count;
+ } else if (arg.type() == TYPE_SCALAR) {
+ if (arg.is_const()) {
+ out << " const " << arg.scalar_type() << "&";
+ } else {
+ out << " " << arg.scalar_type();
+ }
+ out << " arg" << arg_count;
+ } else if (arg.type() == TYPE_STRUCT) {
+ out << " const " << arg.predefined_type() << "&";
+ out << " arg" << arg_count;
+ } else if (arg.type() == TYPE_VECTOR) {
+ out << " const ";
+ if (arg.vector_value(0).type() == TYPE_SCALAR) {
+ if (arg.vector_value(0).scalar_type().length() == 0) {
+ cerr << __func__ << ":" << __LINE__
+ << " ERROR scalar_type not set" << "\n";
+ exit(-1);
+ }
+ out << "::android::hardware::hidl_vec<"
+ << arg.vector_value(0).scalar_type() << ">&";
+ } else if (arg.vector_value(0).type() == TYPE_STRUCT
+ || arg.vector_value(0).type() == TYPE_ENUM) {
+ out << "::android::hardware::hidl_vec<"
+ << arg.vector_value(0).predefined_type() << ">&";
+ } else {
+ cerr << __func__ << ":" << __LINE__ << " unknown vector arg type "
+ << arg.vector_value(0).type() << "\n";
exit(-1);
}
- } else if (arg.type() == TYPE_PREDEFINED) {
- out << arg.predefined_type() << " ";
+ out << " arg" << arg_count;
+ } else if (arg.type() == TYPE_ARRAY) {
+ out << " ";
+ if (arg.is_const()) {
+ out << "const ";
+ }
+ if (arg.vector_value(0).type() == TYPE_SCALAR) {
+ out << arg.vector_value(0).scalar_type() << "[" << arg.vector_size()
+ << "]";
+ } else {
+ cerr << __func__ << " unknown vector arg type "
+ << arg.vector_value(0).type() << "\n";
+ exit(-1);
+ }
+ out << " arg" << arg_count;
} else {
- cerr << __func__ << " unsupported type" << "\n";
+ cerr << __func__ << ":" << __LINE__ << " unknown arg type "
+ << arg.type() << "\n";
exit(-1);
}
- out << "arg" << primitive_type_index;
- primitive_type_index++;
+ arg_count++;
}
out << ") {" << "\n";
out.indent();
-#if USE_VAARGS
- out << "const char fmt[] = \""
- << definition.primitive_format(primitive_format_index) << "\";"
- << "\n";
- out << "va_list argp;" << "\n";
- out << "const char* p;" << "\n";
- out << "int i;" << "\n";
- out << "char* s;" << "\n";
- out << "char fmtbuf[256];" << "\n";
- out << "\n";
- out << "va_start(argp, fmt);" << "\n";
- out << "\n";
- out << "for (p = fmt; *p != '\\0'; p++) {" << "\n";
- out.indent();
- out << "if (*p != '%') {" << "\n";
- out.indent();
- out << "putchar(*p);" << "\n";
- out << "continue;" << "\n";
- out.unindent();
- out << "}" << "\n";
- out.unindent();
- out << "switch (*++p) {" << "\n";
- out.indent();
- out << "case 'c':" << "\n";
- out.indent();
- out << "i = va_arg(argp, int);" << "\n";
- out << "putchar(i);" << "\n";
- out << "break;" << "\n";
- out.unindent();
- out << "case 'd':" << "\n";
- out.indent();
- out << "i = va_arg(argp, int);" << "\n";
- out << "s = itoa(i, fmtbuf, 10);" << "\n";
- out << "fputs(s, stdout);" << "\n";
- out << "break;" << "\n";
- out.unindent();
- out << "case 's':" << "\n";
- out.indent();
- out << "s = va_arg(argp, char *);" << "\n";
- out << "fputs(s, stdout);" << "\n";
- out << "break;" << "\n";
- out.unindent();
- // out << " case 'p':
- out << "case '%':" << "\n";
- out.indent();
- out << "putchar('%');" << "\n";
- out << "break;" << "\n";
- out.unindent();
- out << "}" << "\n";
- out.unindent();
- out << "}" << "\n";
- out << "va_end(argp);" << "\n";
-#endif
- // TODO: check whether bytes is set and handle properly if not.
- out << "AndroidSystemCallbackRequestMessage callback_message;"
- << "\n";
- out << "callback_message.set_id(GetCallbackID(\"" << callback_name
- << "\"));" << "\n";
- out << "RpcCallToAgent(callback_message, callback_socket_name_);"
- << "\n";
- if (has_return_value) {
- // TODO: consider actual return type.
- out << "return NULL;";
+ out << "cout << \"" << api.name() << " called\" << endl;" << "\n";
+ if (api.return_type_hidl_size() == 0
+ || api.return_type_hidl(0).type() == TYPE_VOID) {
+ out << "return ::android::hardware::Void();" << "\n";
+ } else {
+ out << "return Status::ok();" << "\n";
}
out.unindent();
out << "}" << "\n";
out << "\n";
-
- primitive_format_index++;
}
- out << "\n";
+
+ out << "sp<" << message.component_name() << "> VtsFuzzerCreate"
+ << message.component_name() << "(const string& callback_socket_name)";
+ out << " {" << "\n";
+ out.indent();
+ out << "sp<" << message.component_name() << "> result;\n";
+ out << "result = new Vts" << message.component_name().substr(1) << "();\n";
+ out << "return result;\n";
out.unindent();
- out << " private:" << "\n";
- out << "};" << "\n";
- out << "\n";
+ out << "}" << "\n" << "\n";
}
}
-
-void HalHidlCodeGen::GenerateCppBodySyncCallbackFunction(
- Formatter& out, const ComponentSpecificationMessage& message,
+void HalHidlCodeGen::GenerateCppBodySyncCallbackFunction(Formatter& out,
+ const ComponentSpecificationMessage& message,
const string& fuzzer_extended_class_name) {
-
for (auto const& api : message.interface().api()) {
if (api.return_type_hidl_size() > 0) {
- out << "static void " << fuzzer_extended_class_name
- << api.name() << "_cb_func(";
+ out << "static void " << fuzzer_extended_class_name << api.name()
+ << "_cb_func(";
bool first_return_type = true;
int arg_index = 0;
for (const auto& return_type_hidl : api.return_type_hidl()) {
@@ -227,13 +158,9 @@
out << ", ";
}
if (return_type_hidl.type() == TYPE_SCALAR) {
- if (return_type_hidl.scalar_type() == "bool_t") {
- out << "bool";
- } else {
- out << return_type_hidl.scalar_type();
- }
- } else if (return_type_hidl.type() == TYPE_ENUM ||
- return_type_hidl.type() == TYPE_VECTOR) {
+ GenerateScalarTypeInC(out, return_type_hidl.scalar_type());
+ } else if (return_type_hidl.type() == TYPE_ENUM
+ || return_type_hidl.type() == TYPE_VECTOR) {
out << GetCppVariableType(return_type_hidl, &message);
} else if (return_type_hidl.type() == TYPE_STRING) {
out << "::android::hardware::hidl_string ";
@@ -242,12 +169,14 @@
out << return_type_hidl.predefined_type() << " ";
} else {
cerr << __func__ << ":" << __LINE__ << " ERROR no predefined type "
- << "\n";
+ << "\n";
exit(-1);
}
+ } else if (return_type_hidl.type() == TYPE_HANDLE) {
+ out << "native_handle_t* ";
} else {
cerr << __func__ << ":" << __LINE__ << " ERROR unsupported type "
- << return_type_hidl.type() << " for " << api.name() << "\n";
+ << return_type_hidl.type() << " for " << api.name() << "\n";
exit(-1);
}
out << " arg" << arg_index;
@@ -255,8 +184,8 @@
}
out << ") {" << "\n";
// TODO: support other non-scalar type and multiple args.
- out << " cout << \"callback " << api.name() << " called\""
- << " << endl;" << "\n";
+ out << " cout << \"callback " << api.name() << " called\"" << " << endl;"
+ << "\n";
out << "}" << "\n";
out << "std::function<" << "void(";
first_return_type = true;
@@ -267,38 +196,56 @@
out << ", ";
}
if (return_type_hidl.type() == TYPE_SCALAR) {
- if (return_type_hidl.scalar_type() == "bool_t") {
- out << "bool";
- } else {
- out << return_type_hidl.scalar_type();
- }
- } else if (return_type_hidl.type() == TYPE_ENUM ||
- return_type_hidl.type() == TYPE_VECTOR ||
- return_type_hidl.type() == TYPE_STRUCT) {
+ GenerateScalarTypeInC(out, return_type_hidl.scalar_type());
+ } else if (return_type_hidl.type() == TYPE_ENUM
+ || return_type_hidl.type() == TYPE_VECTOR
+ || return_type_hidl.type() == TYPE_STRUCT) {
out << GetCppVariableType(return_type_hidl, &message);
} else if (return_type_hidl.type() == TYPE_STRING) {
out << "::android::hardware::hidl_string";
+ } else if (return_type_hidl.type() == TYPE_HANDLE) {
+ out << "native_handle_t* ";
} else {
cerr << __func__ << ":" << __LINE__ << " ERROR unsupported type "
- << return_type_hidl.type() << " for " << api.name() << "\n";
+ << return_type_hidl.type() << " for " << api.name() << "\n";
exit(-1);
}
}
- out << ")> "
- << fuzzer_extended_class_name << api.name() << "_cb = "
- << fuzzer_extended_class_name << api.name() << "_cb_func;" << "\n";
+ out << ")> " << fuzzer_extended_class_name << api.name() << "_cb = "
+ << fuzzer_extended_class_name << api.name() << "_cb_func;" << "\n";
out << "\n" << "\n";
}
}
}
+void HalHidlCodeGen::GenerateScalarTypeInC(Formatter& out, const string& type) {
+ if (type == "bool_t") {
+ out << "bool";
+ } else if (type == "int8_t" ||
+ type == "uint8_t" ||
+ type == "int16_t" ||
+ type == "uint16_t" ||
+ type == "int32_t" ||
+ type == "uint32_t" ||
+ type == "int64_t" ||
+ type == "uint64_t" ||
+ type == "size_t") {
+ out << type;
+ } else if (type == "char_pointer") {
+ out << "char*";
+ } else if (type == "void_pointer") {
+ out << "void*";
+ } else {
+ cerr << __func__ << ":" << __LINE__
+ << " unsupported scalar type " << type << "\n";
+ exit(-1);
+ }
+}
+
void HalHidlCodeGen::GenerateCppBodyFuzzFunction(
Formatter& out, const ComponentSpecificationMessage& message,
const string& fuzzer_extended_class_name) {
- GenerateCppBodySyncCallbackFunction(
- out, message, fuzzer_extended_class_name);
-
set<string> callbacks;
for (auto const& api : message.interface().api()) {
for (auto const& arg : api.arg()) {
@@ -320,33 +267,6 @@
sub_struct.is_pointer() ? "->" : ".");
}
- out << "bool " << fuzzer_extended_class_name
- << "::GetService(bool get_stub) {" << "\n";
- out.indent();
-
- out << "static bool initialized = false;" << "\n";
- out << "if (!initialized) {" << "\n";
- out.indent();
- out << "cout << \"[agent:hal] HIDL getService\" << endl;" << "\n";
- string service_name = message.package().substr(
- message.package().find_last_of(".") + 1);
- if (service_name == "nfc") {
- // TODO(yim): remove this special case after b/32158398 is fixed.
- service_name = "nfc_nci";
- }
- out << "hw_binder_proxy_ = " << message.component_name()
- << "::getService(\""
- << service_name
- << "\", get_stub);" << "\n";
- out << "cout << \"[agent:hal] hw_binder_proxy_ = \" << "
- << "hw_binder_proxy_.get() << endl;" << "\n";
- out << "initialized = true;" << "\n";
- out.unindent();
- out << "}" << "\n";
- out << "return true;" << "\n";
- out.unindent();
- out << "}" << "\n" << "\n";
-
out << "bool " << fuzzer_extended_class_name << "::Fuzz(" << "\n";
out << " FunctionSpecificationMessage* func_msg," << "\n";
out << " void** result, const string& callback_socket_name) {" << "\n";
@@ -446,17 +366,27 @@
<< arg.vector_value(0).scalar_type() << "));"
<< "\n";
} else if (arg.vector_value(0).type() == TYPE_STRUCT) {
- out << arg.vector_value(0).struct_type() << "* "
+ out << arg.vector_value(0).predefined_type() << "* "
<< "arg" << arg_count << "buffer = ("
- << arg.vector_value(0).struct_type()
+ << arg.vector_value(0).predefined_type()
<< "*) malloc("
<< "func_msg->arg(" << arg_count
<< ").vector_size()"
<< " * sizeof("
- << arg.vector_value(0).struct_type() << "));"
+ << arg.vector_value(0).predefined_type() << "));"
+ << "\n";
+ } else if (arg.vector_value(0).type() == TYPE_ENUM) {
+ out << arg.vector_value(0).predefined_type() << "* "
+ << "arg" << arg_count << "buffer = ("
+ << arg.vector_value(0).predefined_type()
+ << "*) malloc("
+ << "func_msg->arg(" << arg_count
+ << ").vector_size()"
+ << " * sizeof("
+ << arg.vector_value(0).predefined_type() << "));"
<< "\n";
} else {
- cerr << __func__ << " " << __LINE__ << " ERROR unsupported vector sub-type "
+ cerr << __func__ << ":" << __LINE__ << " ERROR unsupported vector sub-type "
<< arg.vector_value(0).type() << "\n";
}
}
@@ -520,8 +450,7 @@
out << ") : ";
} else if (arg.type() == TYPE_ENUM) {
// TODO(yim): support this case
- cerr << __func__ << ":" << __LINE__ << " unknown type "
- << arg.type() << "\n";
+ out << "/* enum support */" << "\n";
} else if (arg.type() == TYPE_STRING) {
// TODO(yim): support this case
cerr << __func__ << ":" << __LINE__ << " unknown type "
@@ -545,10 +474,27 @@
<< "func_msg->arg(" << arg_count << ").vector_size(); "
<< "vector_index++) {" << "\n";
out.indent();
- out << "arg" << arg_count << "buffer[vector_index] = "
- << "func_msg->arg(" << arg_count << ").vector_value(vector_index)."
- << "scalar_value()." << arg.vector_value(0).scalar_type() << "();"
- << "\n";
+ if (arg.vector_value(0).type() == TYPE_SCALAR) {
+ out << "arg" << arg_count << "buffer[vector_index] = "
+ << "func_msg->arg(" << arg_count << ").vector_value(vector_index)."
+ << "scalar_value()." << arg.vector_value(0).scalar_type() << "();"
+ << "\n";
+ } else if (arg.vector_value(0).type() == TYPE_ENUM) {
+ std::string enum_attribute_name = arg.vector_value(0).predefined_type();
+ ReplaceSubString(enum_attribute_name, "::", "__");
+ out << "arg" << arg_count << "buffer[vector_index] = "
+ << "EnumValue" << enum_attribute_name
+ << "(func_msg->arg(" << arg_count << ").vector_value(vector_index)."
+ << "scalar_value());"
+ << "\n";
+ } else if (arg.vector_value(0).type() == TYPE_STRUCT) {
+ out << "/* arg" << arg_count << "buffer[vector_index] not initialized "
+ << "since TYPE_STRUCT not yet supported */" << "\n";
+ } else {
+ cerr << __func__ << ":" << __LINE__ << " ERROR unsupported type "
+ << arg.vector_value(0).type() << "\n";
+ exit(-1);
+ }
out.unindent();
out << "}" << "\n";
out << "arg" << arg_count << ".setToExternal("
@@ -590,8 +536,9 @@
out << kInstanceVariableName << "->" << api.name() << "(";
} else if (api.return_type_hidl(0).type() == TYPE_SCALAR) {
out << "*result = reinterpret_cast<void*>("
- << "(" << api.return_type_hidl(0).scalar_type() << ")"
- << kInstanceVariableName << "->" << api.name() << "(";
+ << "(";
+ GenerateScalarTypeInC(out, api.return_type_hidl(0).scalar_type());
+ out << ")" << kInstanceVariableName << "->" << api.name() << "(";
} else if (api.return_type_hidl(0).type() == TYPE_ENUM) {
if (api.return_type_hidl(0).has_scalar_type()) {
out << "*result = reinterpret_cast<void*>("
@@ -682,15 +629,17 @@
// Message to value converter
out << attribute.name() << " " << "EnumValue" << attribute_name
- << "(const EnumDataValueMessage& arg) {" << "\n";
- out << " return (" << attribute.name()
- << ") arg.scalar_value(0)."
- << attribute.enum_value().scalar_type() << "();" << "\n";
+ << "(const ScalarDataValueMessage& arg) {\n";
+ out.indent();
+ out << "return (" << attribute.name() << ") arg."
+ << attribute.enum_value().scalar_type() << "();\n";
+ out.unindent();
out << "}" << "\n";
// Random value generator
out << attribute.name() << " " << "Random" << attribute_name << "() {"
<< "\n";
+ out.indent();
out << attribute.enum_value().scalar_type() << " choice = "
<< "(" << attribute.enum_value().scalar_type() << ") "
<< "rand() / "
@@ -701,10 +650,22 @@
for (int index = 0; index < attribute.enum_value().enumerator().size(); index++) {
out << "if (choice == ";
out << "(" << attribute.enum_value().scalar_type() << ") ";
- if (attribute.enum_value().scalar_type() == "int32_t") {
+ if (attribute.enum_value().scalar_type() == "int8_t") {
+ out << attribute.enum_value().scalar_value(index).int8_t();
+ } else if (attribute.enum_value().scalar_type() == "uint8_t") {
+ out << attribute.enum_value().scalar_value(index).uint8_t();
+ } else if (attribute.enum_value().scalar_type() == "int16_t") {
+ out << attribute.enum_value().scalar_value(index).int16_t();
+ } else if (attribute.enum_value().scalar_type() == "uint16_t") {
+ out << attribute.enum_value().scalar_value(index).uint16_t();
+ } else if (attribute.enum_value().scalar_type() == "int32_t") {
out << attribute.enum_value().scalar_value(index).int32_t();
} else if (attribute.enum_value().scalar_type() == "uint32_t") {
out << attribute.enum_value().scalar_value(index).uint32_t();
+ } else if (attribute.enum_value().scalar_type() == "int64_t") {
+ out << attribute.enum_value().scalar_value(index).int64_t();
+ } else if (attribute.enum_value().scalar_type() == "uint64_t") {
+ out << attribute.enum_value().scalar_value(index).uint64_t();
} else {
cerr << __func__ << ":" << __LINE__ << " ERROR unsupported enum type "
<< attribute.enum_value().scalar_type() << "\n";
@@ -714,10 +675,11 @@
<< attribute.enum_value().enumerator(index)
<< ";" << "\n";
}
- out << " return "
+ out << "return "
<< attribute.name() << "::"
<< attribute.enum_value().enumerator(0)
<< ";" << "\n";
+ out.unindent();
out << "}" << "\n";
} else if (attribute.type() == TYPE_STRUCT) {
std::string attribute_name = attribute.name();
@@ -780,7 +742,7 @@
<< "EnumValue" << enum_attribute_name << "("
<< "var_msg.struct_value(" << struct_index
<< ").vector_value(value_index).struct_value("
- << sub_value_index << ").enum_value());" << "\n";
+ << sub_value_index << ").scalar_value());" << "\n";
sub_value_index++;
} else if (sub_struct_value.type() == TYPE_STRING) {
out << " arg->" << struct_value.name() << "[value_index]."
@@ -798,6 +760,20 @@
}
out.unindent();
out << "}" << "\n";
+ } else if (struct_value.vector_value(0).type() == TYPE_ENUM) {
+ std::string enum_attribute_name =
+ struct_value.vector_value(0).predefined_type();
+ out << "for (int value_index = 0; value_index < "
+ << "var_msg.struct_value(" << struct_index
+ << ").vector_size(); "
+ << "value_index++) {" << "\n";
+ out.indent();
+ out << "arg->" << struct_value.name() << "[value_index] = "
+ << "EnumValue" << enum_attribute_name << "("
+ << "var_msg.struct_value(" << struct_index
+ << ").vector_value(value_index).scalar_value());" << "\n";
+ out.unindent();
+ out << "}" << "\n";
} else {
cerr << __func__ << ":" << __LINE__ << " ERROR unsupported type "
<< struct_value.vector_value(0).type() << "\n";
@@ -830,16 +806,33 @@
out << "arg->" << struct_value.name() << " = "
<< "EnumValue" << enum_attribute_name << "("
<< "var_msg.struct_value(" << struct_index
- << ").enum_value());" << "\n";
+ << ").scalar_value());" << "\n";
} else if (struct_value.type() == TYPE_STRUCT) {
if (struct_value.has_predefined_type()) {
std::string struct_attribute_name = struct_value.predefined_type();
ReplaceSubString(struct_attribute_name, "::", "__");
+ // TODO(yim): support struct type.
out << "/*" << struct_value.predefined_type() << "*/";
- //"arg->" << struct_value.name() << " = "
- // << "" << enum_attribute_name << "("
- // << "var_msg.struct_value(" << struct_index
- // << ").enum_value());" << "\n";
+ } else {
+ cerr << __func__ << ":" << __LINE__ << " ERROR predefined_type "
+ << "not defined." << "\n";
+ exit(-1);
+ }
+ } else if (struct_value.type() == TYPE_UNION) {
+ if (struct_value.has_predefined_type()) {
+ std::string struct_attribute_name = struct_value.predefined_type();
+ ReplaceSubString(struct_attribute_name, "::", "__");
+ /*
+ * TODO(yim): support union which is defined inside a struct.
+ * A function needs to be auto-generated which can the pointer to
+ * a union instance and assign values in a recursive way.
+ * for (const auto& union_value : struct_value.union_value()) {
+ * out << "arg->" << struct_value.name() << "." << union_value.name() << " = "
+ * << "EnumValue" << enum_attribute_name << "("
+ * << "var_msg.struct_value(" << struct_index
+ * << ").enum_value());" << "\n";
+ * }
+ */
} else {
cerr << __func__ << ":" << __LINE__ << " ERROR predefined_type "
<< "not defined." << "\n";
@@ -862,8 +855,8 @@
}
}
-void HalHidlCodeGen::GenerateCppBodyFuzzFunction(
- Formatter& out, const StructSpecificationMessage& message,
+void HalHidlCodeGen::GenerateCppBodyFuzzFunction(Formatter& out,
+ const StructSpecificationMessage& message,
const string& fuzzer_extended_class_name,
const string& original_data_structure_name, const string& parent_path) {
for (auto const& sub_struct : message.sub_struct()) {
@@ -888,8 +881,8 @@
bool is_open;
for (auto const& api : message.api()) {
is_open = false;
- if ((parent_path_printable + message.name()) == "_common_methods" &&
- api.name() == "open") {
+ if ((parent_path_printable + message.name()) == "_common_methods"
+ && api.name() == "open") {
is_open = true;
}
@@ -908,10 +901,10 @@
if (arg.type() == TYPE_SCALAR) {
out << "(" << msg << ".type() == TYPE_SCALAR && " << msg
<< ".scalar_value()";
- if (arg.scalar_type() == "pointer" ||
- arg.scalar_type() == "char_pointer" ||
- arg.scalar_type() == "void_pointer" ||
- arg.scalar_type() == "function_pointer") {
+ if (arg.scalar_type() == "pointer"
+ || arg.scalar_type() == "char_pointer"
+ || arg.scalar_type() == "void_pointer"
+ || arg.scalar_type() == "function_pointer") {
out << ".has_pointer())? ";
out << "reinterpret_cast<" << GetCppVariableType(arg) << ">";
} else {
@@ -919,26 +912,24 @@
}
out << "(" << msg << ".scalar_value()";
- if (arg.scalar_type() == "bool_t" ||
- arg.scalar_type() == "int32_t" ||
- arg.scalar_type() == "uint32_t" ||
- arg.scalar_type() == "int64_t" ||
- arg.scalar_type() == "uint64_t" ||
- arg.scalar_type() == "int16_t" ||
- arg.scalar_type() == "uint16_t" ||
- arg.scalar_type() == "int8_t" ||
- arg.scalar_type() == "uint8_t" ||
- arg.scalar_type() == "float_t" ||
- arg.scalar_type() == "double_t") {
+ if (arg.scalar_type() == "bool_t" || arg.scalar_type() == "int32_t"
+ || arg.scalar_type() == "uint32_t"
+ || arg.scalar_type() == "int64_t"
+ || arg.scalar_type() == "uint64_t"
+ || arg.scalar_type() == "int16_t"
+ || arg.scalar_type() == "uint16_t"
+ || arg.scalar_type() == "int8_t" || arg.scalar_type() == "uint8_t"
+ || arg.scalar_type() == "float_t"
+ || arg.scalar_type() == "double_t") {
out << "." << arg.scalar_type() << "() ";
- } else if (arg.scalar_type() == "pointer" ||
- arg.scalar_type() == "char_pointer" ||
- arg.scalar_type() == "function_pointer" ||
- arg.scalar_type() == "void_pointer") {
+ } else if (arg.scalar_type() == "pointer"
+ || arg.scalar_type() == "char_pointer"
+ || arg.scalar_type() == "function_pointer"
+ || arg.scalar_type() == "void_pointer") {
out << ".pointer() ";
} else {
cerr << __func__ << " ERROR unsupported type " << arg.scalar_type()
- << "\n";
+ << "\n";
exit(-1);
}
out << ") : ";
@@ -963,10 +954,11 @@
out << "cout << \"Call an API.\" << endl;" << "\n";
out << "cout << \"local_device = \" << " << kInstanceVariableName
<< ".get();" << "\n";
- out << "*result = const_cast<void*>(reinterpret_cast<const void*>(new string("
- << kInstanceVariableName << "->" << parent_path << message.name()
- << "->" << api.name() << "(";
- if (arg_count > 0) out << "\n";
+ out << "*result = const_cast<void*>(reinterpret_cast<const void*>"
+ << "(new string(" << kInstanceVariableName << "->" << parent_path
+ << message.name() << "->" << api.name() << "(";
+ if (arg_count > 0)
+ out << "\n";
out.indent();
for (int index = 0; index < arg_count; index++) {
@@ -978,7 +970,8 @@
out.unindent();
if (api.return_type_hidl_size() > 0) {
- if (arg_count != 0) out << ", ";
+ if (arg_count != 0)
+ out << ", ";
out << fuzzer_extended_class_name << api.name() << "_cb";
// TODO: support callback as the last arg and setup barrier here to
// do *result = ...;
@@ -992,9 +985,8 @@
for (auto const& arg : api.arg()) {
if (arg.is_output()) {
// TODO check the return value
- out << GetConversionToProtobufFunctionName(arg) << "(arg"
- << arg_count << ", "
- << "func_msg->mutable_arg(" << arg_count << "));" << "\n";
+ out << GetConversionToProtobufFunctionName(arg) << "(arg" << arg_count
+ << ", " << "func_msg->mutable_arg(" << arg_count << "));" << "\n";
}
arg_count++;
}
@@ -1008,6 +1000,127 @@
out << "}" << "\n";
}
+void HalHidlCodeGen::GenerateDriverFunctionImpl(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) {
+ if (message.component_name() != "types"
+ && !endsWith(message.component_name(), "Callback")) {
+ out << "bool " << fuzzer_extended_class_name << "::CallFunction("
+ << "const FunctionSpecificationMessage& func_msg, "
+ << "const string& callback_socket_name, "
+ << "FunctionSpecificationMessage* result_msg) {\n";
+ out.indent();
+
+ out << "const char* func_name = func_msg.name().c_str();" << "\n";
+ out << "cout << \"Function: \" << __func__ << \" \" << func_name << endl;"
+ << "\n";
+
+ for (auto const& api : message.interface().api()) {
+ GenerateDriverImplForMethod(out, message, api);
+ }
+
+ out << "return false;\n";
+ out.unindent();
+ out << "}\n";
+ }
+}
+
+void HalHidlCodeGen::GenerateDriverImplForMethod(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const FunctionSpecificationMessage& func_msg) {
+ out << "if (!strcmp(func_name, \"" << func_msg.name() << "\")) {\n";
+ out.indent();
+ // Process the arguments.
+ for (int i = 0; i < func_msg.arg_size(); i++) {
+ const auto& arg = func_msg.arg(i);
+ string cur_arg_name = "arg" + std::to_string(i);
+ out << GetCppVariableType(arg, &message) << " " << cur_arg_name << ";\n";
+ GenerateDriverImplForTypedVariable(
+ out, arg, cur_arg_name, "func_msg.arg(" + std::to_string(i) + ")");
+ }
+
+ GenerateCodeToStartMeasurement(out);
+ // may need to check whether the function is actually defined.
+ out << "cout << \"Call an API\" << endl;" << "\n";
+ out << "cout << \"local_device = \" << " << kInstanceVariableName << ".get();"
+ << "\n";
+
+ // Define the return results and call the Hal function.
+ for (int index = 0; index < func_msg.return_type_hidl_size(); index++) {
+ const auto& return_type = func_msg.return_type_hidl(index);
+ out << GetCppVariableType(return_type, &message) << " result" << index
+ << ";\n";
+ }
+ if (CanElideCallback(func_msg)) {
+ out << "result0 = ";
+ GenerateHalFunctionCall(out, message, func_msg);
+ } else {
+ GenerateHalFunctionCall(out, message, func_msg);
+ }
+
+ GenerateCodeToStopMeasurement(out);
+
+ // Set the return results value to the proto message.
+ out << "result_msg->set_name(\"" << func_msg.name() << "\");\n";
+ for (int index = 0; index < func_msg.return_type_hidl_size(); index++) {
+ out << "VariableSpecificationMessage* result_val_" << index << " = "
+ << "result_msg->add_return_type_hidl();\n";
+ GenerateSetResultCodeForTypedVariable(out, func_msg.return_type_hidl(index),
+ "result_val_" + std::to_string(index),
+ "result" + std::to_string(index));
+ }
+
+ out << "cout << \"called\" << endl;\n";
+ out << "return true;\n";
+ out.unindent();
+ out << "}\n";
+}
+
+void HalHidlCodeGen::GenerateHalFunctionCall(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const FunctionSpecificationMessage& func_msg) {
+ out << kInstanceVariableName << "->" << func_msg.name() << "(";
+ for (int index = 0; index < func_msg.arg_size(); index++) {
+ out << "arg" << index;
+ if (index != (func_msg.arg_size() - 1)) out << ",";
+ }
+ if (func_msg.return_type_hidl_size() == 0
+ || func_msg.return_type_hidl(0).type() == TYPE_VOID
+ || CanElideCallback(func_msg)) {
+ out << ");\n";
+ } else {
+ out << (func_msg.arg_size() != 0 ? ", " : "");
+ GenerateSyncCallbackFunctionImpl(out, message, func_msg);
+ out << ");\n";
+ }
+}
+
+void HalHidlCodeGen::GenerateSyncCallbackFunctionImpl(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const FunctionSpecificationMessage& func_msg) {
+ out << "[&](";
+ for (int index = 0; index < func_msg.return_type_hidl_size(); index++) {
+ const auto& return_val = func_msg.return_type_hidl(index);
+ if (return_val.type() == TYPE_SCALAR) {
+ out << GetCppVariableType(return_val, &message);
+ } else {
+ out << "const " << GetCppVariableType(return_val, &message) << "&";
+ }
+ out << " arg" << index;
+ if (index != (func_msg.return_type_hidl_size() - 1)) out << ",";
+ }
+ out << "){\n";
+ out.indent();
+ out << "cout << \"callback " << func_msg.name() << " called\""
+ << " << endl;\n";
+
+ for (int index = 0; index < func_msg.return_type_hidl_size(); index++) {
+ out << "result" << index << " = arg" << index << ";\n";
+ }
+ out.unindent();
+ out << "}";
+}
+
void HalHidlCodeGen::GenerateCppBodyGetAttributeFunction(
Formatter& out, const ComponentSpecificationMessage& message,
const string& fuzzer_extended_class_name) {
@@ -1018,7 +1131,8 @@
out << " void** result) {" << "\n";
// TOOD: impl
- cerr << __func__ << " not supported for HIDL HAL yet" << "\n";
+ cerr << __func__ << ":" << __LINE__
+ << " not supported for HIDL HAL yet" << "\n";
out << " cerr << \"attribute not found\" << endl;" << "\n";
out << " return false;" << "\n";
@@ -1026,22 +1140,34 @@
}
}
-void HalHidlCodeGen::GenerateHeaderGlobalFunctionDeclarations(
- Formatter& out, const string& function_prototype) {
- out << "extern \"C\" {" << "\n";
- out << "extern " << function_prototype << ";" << "\n";
- out << "}" << "\n";
+void HalHidlCodeGen::GenerateClassConstructionFunction(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) {
+ out << fuzzer_extended_class_name << "() : FuzzerBase(";
+ if (message.component_name() != "types") {
+ out << "HAL_HIDL), hw_binder_proxy_()";
+ } else {
+ out << "HAL_HIDL)";
+ }
+ out << " {}" << "\n";
}
-void HalHidlCodeGen::GenerateCppBodyGlobalFunctions(
- Formatter& out, const string& function_prototype,
+void HalHidlCodeGen::GenerateHeaderGlobalFunctionDeclarations(Formatter& out,
+ const ComponentSpecificationMessage& message) {
+ if (message.component_name() != "types"
+ && !endsWith(message.component_name(), "Callback")) {
+ DriverCodeGenBase::GenerateHeaderGlobalFunctionDeclarations(out, message);
+ }
+}
+
+void HalHidlCodeGen::GenerateCppBodyGlobalFunctions(Formatter& out,
+ const ComponentSpecificationMessage& message,
const string& fuzzer_extended_class_name) {
- out << "extern \"C\" {" << "\n";
- out << function_prototype << " {" << "\n";
- out << " return (android::vts::FuzzerBase*) "
- << "new android::vts::" << fuzzer_extended_class_name << "();" << "\n";
- out << "}" << "\n" << "\n";
- out << "}" << "\n";
+ if (message.component_name() != "types"
+ && !endsWith(message.component_name(), "Callback")) {
+ DriverCodeGenBase::GenerateCppBodyGlobalFunctions(
+ out, message, fuzzer_extended_class_name);
+ }
}
void HalHidlCodeGen::GenerateSubStructFuzzFunctionCall(
@@ -1068,5 +1194,927 @@
}
}
+void HalHidlCodeGen::GenerateClassHeader(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) {
+ if (message.component_name() != "types"
+ && !endsWith(message.component_name(), "Callback")) {
+ DriverCodeGenBase::GenerateClassHeader(out, message,
+ fuzzer_extended_class_name);
+ } else if (message.component_name() == "types") {
+ for (int attr_idx = 0;
+ attr_idx
+ < message.attribute_size() + message.interface().attribute_size();
+ attr_idx++) {
+ const auto& attribute =
+ (attr_idx < message.attribute_size()) ?
+ message.attribute(attr_idx) :
+ message.interface().attribute(
+ attr_idx - message.attribute_size());
+ std::string attribute_name = attribute.name();
+ ReplaceSubString(attribute_name, "::", "__");
+ if (attribute.type() == TYPE_ENUM) {
+ out << attribute.name() << " " << "EnumValue" << attribute_name
+ << "(const ScalarDataValueMessage& arg);\n";
+ out << "\n";
+ out << attribute.name() << " " << "Random" << attribute_name << "();"
+ << "\n";
+ } else if (attribute.type() == TYPE_STRUCT
+ || attribute.type() == TYPE_UNION) {
+ std::string attribute_name = attribute.name();
+ ReplaceSubString(attribute_name, "::", "__");
+ out << "void " << "MessageTo" << attribute_name
+ << "(const VariableSpecificationMessage& var_msg, "
+ << attribute.name() << "* arg);" << "\n";
+ } else {
+ cerr << __func__ << ":" << __LINE__ << " ERROR unsupported type "
+ << attribute.type() << endl;
+ exit(-1);
+ }
+ }
+ for (const auto attribute: message.attribute()){
+ GenerateVerificationDeclForAttribute(out, attribute);
+ GenerateSetResultDeclForAttribute(out,attribute);
+ }
+ } else if (endsWith(message.component_name(), "Callback")) {
+ out << "\n";
+ out << "class Vts" << message.component_name().substr(1) << ": public "
+ << message.component_name() << " {" << "\n";
+ out << " public:" << "\n";
+ out.indent();
+ out << "Vts" << message.component_name().substr(1) << "() {};" << "\n";
+ out << "\n";
+ out << "virtual ~Vts" << message.component_name().substr(1) << "()"
+ << " = default;" << "\n";
+ out << "\n";
+ for (const auto& api : message.interface().api()) {
+ if (api.return_type_hidl_size() == 0
+ || api.return_type_hidl(0).type() == TYPE_VOID) {
+ out << "::android::hardware::Return<void> ";
+
+ } else if (api.return_type_hidl(0).type() == TYPE_SCALAR
+ || api.return_type_hidl(0).type() == TYPE_ENUM) {
+ out << "Return<" << api.return_type_hidl(0).scalar_type() << "> ";
+ } else {
+ out << "Status " << "\n";
+ }
+
+ out << api.name() << "(" << "\n";
+ int arg_count = 0;
+ for (const auto& arg : api.arg()) {
+ if (arg_count > 0)
+ out << "," << "\n";
+ if (arg.type() == TYPE_ENUM) {
+ if (arg.is_const()) {
+ out << " const " << arg.predefined_type() << "&";
+ } else {
+ out << " " << arg.predefined_type();
+ }
+ out << " arg" << arg_count;
+ } else if (arg.type() == TYPE_SCALAR) {
+ if (arg.is_const()) {
+ out << " const " << arg.scalar_type() << "&";
+ } else {
+ out << " " << arg.scalar_type();
+ }
+ } else if (arg.type() == TYPE_STRUCT) {
+ out << " const " << arg.predefined_type() << "&";
+ out << " arg" << arg_count;
+ } else if (arg.type() == TYPE_VECTOR) {
+ out << " const ";
+ if (arg.vector_value(0).type() == TYPE_SCALAR) {
+ if (arg.vector_value(0).scalar_type().length() == 0) {
+ cerr << __func__ << ":" << __LINE__
+ << " ERROR scalar_type not set" << "\n";
+ exit(-1);
+ }
+ out << "::android::hardware::hidl_vec<"
+ << arg.vector_value(0).scalar_type() << ">&";
+ } else if (arg.vector_value(0).type() == TYPE_STRUCT
+ || arg.vector_value(0).type() == TYPE_ENUM) {
+ if (arg.vector_value(0).predefined_type().length() == 0) {
+ cerr << __func__ << ":" << __LINE__
+ << " ERROR predefined_type not set" << "\n";
+ exit(-1);
+ }
+ out << "::android::hardware::hidl_vec<"
+ << arg.vector_value(0).predefined_type() << ">&";
+ } else {
+ cerr << __func__ << ":" << __LINE__ << " unknown vector arg type "
+ << arg.vector_value(0).type() << "\n";
+ exit(-1);
+ }
+ out << " arg" << arg_count;
+ } else if (arg.type() == TYPE_ARRAY) {
+ out << " ";
+ if (arg.is_const()) {
+ out << "const ";
+ }
+ if (arg.vector_value(0).type() == TYPE_SCALAR) {
+ out << arg.vector_value(0).scalar_type() << "[" << arg.vector_size()
+ << "]";
+ } else {
+ cerr << __func__ << " unknown vector arg type "
+ << arg.vector_value(0).type() << "\n";
+ exit(-1);
+ }
+ out << " arg" << arg_count;
+ } else {
+ cerr << __func__ << ":" << __LINE__ << " unknown arg type "
+ << arg.type() << "\n";
+ exit(-1);
+ }
+ arg_count++;
+ }
+ out << ") override;" << "\n";
+ out << "\n";
+ }
+ out.unindent();
+ out << "};" << "\n";
+ out << "\n";
+
+ out << "sp<" << message.component_name() << "> VtsFuzzerCreate"
+ << message.component_name() << "(const string& callback_socket_name);"
+ << "\n";
+ out << "\n";
+ }
+}
+
+void HalHidlCodeGen::GenerateClassImpl(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) {
+ if (message.component_name() != "types"
+ && !endsWith(message.component_name(), "Callback")) {
+ GenerateCppBodySyncCallbackFunction(out, message,
+ fuzzer_extended_class_name);
+ GenerateGetServiceImpl(out, message, fuzzer_extended_class_name);
+ DriverCodeGenBase::GenerateClassImpl(out, message,
+ fuzzer_extended_class_name);
+ for (auto attribute : message.attribute()) {
+ GenerateDriverImplForAttribute(out, attribute);
+ GenerateRandomFunctionForAttribute(out, attribute);
+ GenerateVerificationImplForAttribute(out, attribute);
+ GenerateSetResultImplForAttribute(out, attribute);
+ }
+ } else if (message.component_name() == "types") {
+ for (auto attribute : message.attribute()) {
+ GenerateDriverImplForAttribute(out, attribute);
+ GenerateRandomFunctionForAttribute(out, attribute);
+ GenerateVerificationImplForAttribute(out, attribute);
+ GenerateSetResultImplForAttribute(out, attribute);
+ }
+ } else if (endsWith(message.component_name(), "Callback")) {
+ GenerateCppBodyCallbackFunction(out, message, fuzzer_extended_class_name);
+ }
+}
+
+void HalHidlCodeGen::GenerateHeaderIncludeFiles(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) {
+ DriverCodeGenBase::GenerateHeaderIncludeFiles(out, message,
+ fuzzer_extended_class_name);
+ if (message.has_component_name()) {
+ string package_path = message.package();
+ ReplaceSubString(package_path, ".", "/");
+
+ out << "#include <" << package_path << "/"
+ << GetVersionString(message.component_type_version()) << "/"
+ << message.component_name() << ".h>" << "\n";
+ if (message.component_name() != "types") {
+ out << "#include <" << package_path << "/"
+ << GetVersionString(message.component_type_version()) << "/"
+ << message.component_name() << ".h>" << "\n";
+ }
+ out << "#include <hidl/HidlSupport.h>" << "\n";
+ }
+ out << "\n\n";
+}
+
+void HalHidlCodeGen::GenerateSourceIncludeFiles(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) {
+ DriverCodeGenBase::GenerateSourceIncludeFiles(out, message,
+ fuzzer_extended_class_name);
+ out << "#include <hidl/HidlSupport.h>\n";
+ string input_vfs_file_path(input_vts_file_path_);
+ if (message.has_component_name()) {
+ string package_path = message.package();
+ ReplaceSubString(package_path, ".", "/");
+ out << "#include <" << package_path << "/"
+ << GetVersionString(message.component_type_version()) << "/"
+ << message.component_name() << ".h>" << "\n";
+ for (const auto& import : message.import()) {
+ string mutable_import = import;
+
+ string base_filename = mutable_import.substr(
+ mutable_import.find_last_of("::") + 1);
+ string base_dirpath = mutable_import.substr(
+ 0, mutable_import.find_last_of("::") - 1);
+ string base_dirpath_without_version = base_dirpath.substr(
+ 0, mutable_import.find_last_of("@"));
+ string base_dirpath_version = base_dirpath.substr(
+ mutable_import.find_last_of("@") + 1);
+ ReplaceSubString(base_dirpath_without_version, ".", "/");
+ base_dirpath = base_dirpath_without_version + "/" + base_dirpath_version;
+
+ string package_path_with_version = package_path + "/" +
+ GetVersionString(message.component_type_version());
+ if (base_dirpath == package_path_with_version) {
+ if (base_filename == "types") {
+ out << "#include \""
+ << input_vfs_file_path.substr(
+ 0, input_vfs_file_path.find_last_of("\\/")) << "/types.vts.h\""
+ << "\n";
+ }
+ if (base_filename != "types") {
+ if (message.component_name() != base_filename) {
+ out << "#include <" << package_path << "/"
+ << GetVersionString(message.component_type_version()) << "/"
+ << base_filename << ".h>" << "\n";
+ }
+ if (base_filename.substr(0, 1) == "I") {
+ out << "#include \""
+ << input_vfs_file_path.substr(
+ 0, input_vfs_file_path.find_last_of("\\/")) << "/"
+ << base_filename.substr(1, base_filename.length() - 1)
+ << ".vts.h\"" << "\n";
+ }
+ } else if (message.component_name() != base_filename) {
+ // TODO: consider restoring this when hidl packaging is fully defined.
+ // cpp_ss << "#include <" << base_dirpath << base_filename << ".h>" << "\n";
+ out << "#include <" << package_path << "/"
+ << GetVersionString(message.component_type_version()) << "/"
+ << base_filename << ".h>" << "\n";
+ }
+ } else {
+ out << "#include <" << base_dirpath << "/"
+ << base_filename << ".h>" << "\n";
+ }
+ }
+ }
+}
+
+void HalHidlCodeGen::GenerateAdditionalFuctionDeclarations(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& /*fuzzer_extended_class_name*/) {
+ if (message.component_name() != "types"
+ && !endsWith(message.component_name(), "Callback")) {
+ out << "bool GetService(bool get_stub, const char* service_name);" << "\n\n";
+ }
+}
+
+void HalHidlCodeGen::GeneratePrivateMemberDeclarations(Formatter& out,
+ const ComponentSpecificationMessage& message) {
+ out << "sp<" << message.component_name() << "> hw_binder_proxy_;" << "\n";
+}
+
+void HalHidlCodeGen::GenerateRandomFunctionForAttribute(Formatter& out,
+ const VariableSpecificationMessage& attribute) {
+ // Random value generator
+ if (attribute.type() == TYPE_ENUM) {
+ string attribute_name = ClearStringWithNameSpaceAccess(attribute.name());
+ out << attribute.name() << " " << "Random" << attribute_name << "() {"
+ << "\n";
+ out.indent();
+ out << attribute.enum_value().scalar_type() << " choice = " << "("
+ << attribute.enum_value().scalar_type() << ") " << "rand() / "
+ << attribute.enum_value().enumerator().size() << ";" << "\n";
+ if (attribute.enum_value().scalar_type().find("u") != 0) {
+ out << "if (choice < 0) choice *= -1;" << "\n";
+ }
+ for (int index = 0; index < attribute.enum_value().enumerator().size();
+ index++) {
+ out << "if (choice == ";
+ out << "(" << attribute.enum_value().scalar_type() << ") ";
+ if (attribute.enum_value().scalar_type() == "int8_t") {
+ out << attribute.enum_value().scalar_value(index).int8_t();
+ } else if (attribute.enum_value().scalar_type() == "uint8_t") {
+ out << attribute.enum_value().scalar_value(index).uint8_t();
+ } else if (attribute.enum_value().scalar_type() == "int16_t") {
+ out << attribute.enum_value().scalar_value(index).int16_t();
+ } else if (attribute.enum_value().scalar_type() == "uint16_t") {
+ out << attribute.enum_value().scalar_value(index).uint16_t();
+ } else if (attribute.enum_value().scalar_type() == "int32_t") {
+ out << attribute.enum_value().scalar_value(index).int32_t();
+ } else if (attribute.enum_value().scalar_type() == "uint32_t") {
+ out << attribute.enum_value().scalar_value(index).uint32_t();
+ } else if (attribute.enum_value().scalar_type() == "int64_t") {
+ out << attribute.enum_value().scalar_value(index).int64_t();
+ } else if (attribute.enum_value().scalar_type() == "uint64_t") {
+ out << attribute.enum_value().scalar_value(index).uint64_t();
+ } else {
+ cerr << __func__ << ":" << __LINE__ << " ERROR unsupported enum type "
+ << attribute.enum_value().scalar_type() << "\n";
+ exit(-1);
+ }
+ out << ") return " << attribute.name() << "::"
+ << attribute.enum_value().enumerator(index) << ";" << "\n";
+ }
+ out << "return " << attribute.name() << "::"
+ << attribute.enum_value().enumerator(0) << ";" << "\n";
+ out.unindent();
+ out << "}" << "\n";
+ }
+}
+
+void HalHidlCodeGen::GenerateDriverImplForAttribute(Formatter& out,
+ const VariableSpecificationMessage& attribute) {
+ switch (attribute.type()) {
+ case TYPE_ENUM:
+ {
+ string func_name = "EnumValue"
+ + ClearStringWithNameSpaceAccess(attribute.name());
+ // Message to value converter
+ out << attribute.name() << " " << func_name
+ << "(const ScalarDataValueMessage& arg) {\n";
+ out.indent();
+ out << "return (" << attribute.name() << ") arg."
+ << attribute.enum_value().scalar_type() << "();\n";
+ out.unindent();
+ out << "}" << "\n";
+ break;
+ }
+ case TYPE_STRUCT:
+ {
+ // Recursively generate driver implementation method for all sub_types.
+ for (const auto sub_struct : attribute.sub_struct()) {
+ GenerateDriverImplForAttribute(out, sub_struct);
+ }
+ string func_name = "MessageTo"
+ + ClearStringWithNameSpaceAccess(attribute.name());
+ out << "void " << func_name
+ << "(const VariableSpecificationMessage& var_msg, "
+ << attribute.name() << "* arg) {" << "\n";
+ out.indent();
+ int struct_index = 0;
+ for (const auto& struct_value : attribute.struct_value()) {
+ GenerateDriverImplForTypedVariable(
+ out, struct_value, "arg->" + struct_value.name(),
+ "var_msg.struct_value(" + std::to_string(struct_index) + ")");
+ struct_index++;
+ }
+ out.unindent();
+ out << "}\n";
+ break;
+ }
+ case TYPE_UNION:
+ {
+ // Recursively generate driver implementation method for all sub_types.
+ for (const auto sub_union : attribute.sub_union()) {
+ GenerateDriverImplForAttribute(out, sub_union);
+ }
+ string func_name = "MessageTo"
+ + ClearStringWithNameSpaceAccess(attribute.name());
+ out << "void " << func_name
+ << "(const VariableSpecificationMessage& var_msg, "
+ << attribute.name() << "* arg) {" << "\n";
+ out.indent();
+ int union_index = 0;
+ for (const auto& union_value : attribute.union_value()) {
+ GenerateDriverImplForTypedVariable(
+ out, union_value, "arg->" + union_value.name(),
+ "var_msg.union_value(" + std::to_string(union_index) + ")");
+ union_index++;
+ }
+ out.unindent();
+ out << "}\n";
+ break;
+ }
+ default:
+ {
+ cerr << __func__ << " unsupported attribute type " << attribute.type()
+ << "\n";
+ }
+ }
+}
+
+void HalHidlCodeGen::GenerateGetServiceImpl(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) {
+ out << "bool " << fuzzer_extended_class_name
+ << "::GetService(bool get_stub, const char* service_name) {" << "\n";
+ out.indent();
+ out << "static bool initialized = false;" << "\n";
+ out << "if (!initialized) {" << "\n";
+ out.indent();
+ out << "cout << \"[agent:hal] HIDL getService\" << endl;" << "\n";
+ out << "if (service_name) {\n"
+ << " cout << \" - service name: \" << service_name << endl;" << "\n"
+ << "}\n";
+ out << "hw_binder_proxy_ = " << message.component_name() << "::getService("
+ << "service_name, get_stub);" << "\n";
+ out << "cout << \"[agent:hal] hw_binder_proxy_ = \" << "
+ << "hw_binder_proxy_.get() << endl;" << "\n";
+ out << "initialized = true;" << "\n";
+ out.unindent();
+ out << "}" << "\n";
+ out << "return true;" << "\n";
+ out.unindent();
+ out << "}" << "\n" << "\n";
+}
+
+void HalHidlCodeGen::GenerateDriverImplForTypedVariable(Formatter& out,
+ const VariableSpecificationMessage& val, const string& arg_name,
+ const string& arg_value_name) {
+ switch (val.type()) {
+ case TYPE_SCALAR:
+ {
+ out << arg_name << " = " << arg_value_name << ".scalar_value()."
+ << val.scalar_type() << "();\n";
+ break;
+ }
+ case TYPE_STRING:
+ {
+ out << arg_name << " = ::android::hardware::hidl_string("
+ << arg_value_name << ".string_value().message());\n";
+ break;
+ }
+ case TYPE_ENUM:
+ {
+ if (val.has_predefined_type()) {
+ string func_name = "EnumValue"
+ + ClearStringWithNameSpaceAccess(val.predefined_type());
+ out << arg_name << " = " << func_name << "(" << arg_value_name
+ << ".scalar_value());\n";
+ } else {
+ out << arg_name << " = (" << val.name() << ")" << arg_value_name << "."
+ << val.enum_value().scalar_type() << "();\n";
+ }
+ break;
+ }
+ case TYPE_VECTOR:
+ {
+ out << arg_name << ".resize(" << arg_value_name << ".vector_size());\n";
+ out << "for (int i = 0; i <" << arg_value_name
+ << ".vector_size(); i++) {\n";
+ out.indent();
+ GenerateDriverImplForTypedVariable(out, val.vector_value(0),
+ arg_name + "[i]",
+ arg_value_name + ".vector_value(i)");
+ out.unindent();
+ out << "}\n";
+ break;
+ }
+ case TYPE_ARRAY:
+ {
+ out << "for (int i = 0; i < " << arg_value_name
+ << ".vector_size(); i++) {\n";
+ out.indent();
+ GenerateDriverImplForTypedVariable(out, val.vector_value(0),
+ arg_name + "[i]",
+ arg_value_name + ".vector_value(i)");
+ out.unindent();
+ out << "}\n";
+ break;
+ }
+ case TYPE_STRUCT:
+ {
+ if (val.has_predefined_type()) {
+ string func_name = "MessageTo"
+ + ClearStringWithNameSpaceAccess(val.predefined_type());
+ out << func_name << "(" << arg_value_name << ", &("
+ << arg_name << "));\n";
+ } else {
+ int struct_index = 0;
+ for (const auto struct_field : val.struct_value()) {
+ string struct_field_name = arg_name + "." + struct_field.name();
+ string struct_field_value_name = arg_value_name + ".struct_value("
+ + std::to_string(struct_index) + ")";
+ GenerateDriverImplForTypedVariable(out, struct_field,
+ struct_field_name,
+ struct_field_value_name);
+ struct_index++;
+ }
+ }
+ break;
+ }
+ case TYPE_UNION:
+ {
+ if (val.has_predefined_type()) {
+ string func_name = "MessageTo"
+ + ClearStringWithNameSpaceAccess(val.predefined_type());
+ out << func_name << "(" << arg_value_name << ", &(" << arg_name
+ << "));\n";
+ } else {
+ int union_index = 0;
+ for (const auto union_field : val.union_value()) {
+ string union_field_name = arg_name + "." + union_field.name();
+ string union_field_value_name = arg_value_name + ".union_value("
+ + std::to_string(union_index) + ")";
+ GenerateDriverImplForTypedVariable(out, union_field, union_field_name,
+ union_field_value_name);
+ union_index++;
+ }
+ }
+ break;
+ }
+ case TYPE_HIDL_CALLBACK:
+ {
+ out << arg_name << " = VtsFuzzerCreate" << val.predefined_type()
+ << "(callback_socket_name);\n";
+ break;
+ }
+ case TYPE_HANDLE:
+ {
+ out << " ERROR: TYPE_HANDLE is not supported yet.\n";
+ break;
+ }
+ case TYPE_HIDL_INTERFACE:
+ {
+ out << " ERROR: TYPE_HIDL_INTERFACE is not supported yet.\n";
+ break;
+ }
+ default:
+ {
+ cerr << " ERROR: unsupported type.\n";
+ exit(-1);
+ }
+ }
+}
+
+// TODO(zhuoyao): Verify results based on verification rules instead of perform
+// an exact match.
+void HalHidlCodeGen::GenerateVerificationFunctionImpl(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) {
+ if (message.component_name() != "types"
+ && !endsWith(message.component_name(), "Callback")) {
+ // Generate the main profiler function.
+ out << "\nbool " << fuzzer_extended_class_name
+ << "::VerifyResults(const FunctionSpecificationMessage& expected_result, "
+ << "const FunctionSpecificationMessage& actual_result) {\n";
+ out.indent();
+ for (const FunctionSpecificationMessage api : message.interface().api()) {
+ out << "if (!strcmp(actual_result.name().c_str(), \"" << api.name()
+ << "\")) {\n";
+ out.indent();
+ out << "if (actual_result.return_type_hidl_size() != "
+ << "expected_result.return_type_hidl_size() "
+ << ") { return false; }\n";
+ for (int i = 0; i < api.return_type_hidl_size(); i++) {
+ std::string expected_result = "expected_result.return_type_hidl("
+ + std::to_string(i) + ")";
+ std::string actual_result = "actual_result.return_type_hidl("
+ + std::to_string(i) + ")";
+ GenerateVerificationCodeForTypedVariable(out, api.return_type_hidl(i),
+ expected_result,
+ actual_result);
+ }
+ out << "return true;\n";
+ out.unindent();
+ out << "}\n";
+ }
+ out << "return false;\n";
+ out.unindent();
+ out << "}\n\n";
+ }
+}
+
+void HalHidlCodeGen::GenerateVerificationCodeForTypedVariable(Formatter& out,
+ const VariableSpecificationMessage& val, const string& expected_result,
+ const string& actual_result) {
+ switch (val.type()) {
+ case TYPE_SCALAR:
+ {
+ out << "if (" << actual_result << ".scalar_value()." << val.scalar_type()
+ << "() != " << expected_result << ".scalar_value()."
+ << val.scalar_type() << "()) { return false; }\n";
+ break;
+ }
+ case TYPE_STRING:
+ {
+ out << "if (strcmp(" << actual_result
+ << ".string_value().message().c_str(), " << expected_result
+ << ".string_value().message().c_str())!= 0)" << "{ return false; }\n";
+ break;
+ }
+ case TYPE_ENUM:
+ {
+ if (val.has_predefined_type()) {
+ string func_name = "Verify"
+ + ClearStringWithNameSpaceAccess(val.predefined_type());
+ out << "if(!" << func_name << "(" << expected_result << ", "
+ << actual_result << ")) { return false; }\n";
+ } else {
+ out << "if (" << actual_result << ".scalar_value()."
+ << val.enum_value().scalar_type() << "() != " << expected_result
+ << ".scalar_value()." << val.enum_value().scalar_type()
+ << "()) { return false; }\n";
+ }
+ break;
+ }
+ case TYPE_VECTOR:
+ {
+ out << "for (int i = 0; i <" << expected_result
+ << ".vector_size(); i++) {\n";
+ out.indent();
+ GenerateVerificationCodeForTypedVariable(
+ out, val.vector_value(0), expected_result + ".vector_value(i)",
+ actual_result + ".vector_value(i)");
+ out.unindent();
+ out << "}\n";
+ break;
+ }
+ case TYPE_ARRAY:
+ {
+ out << "for (int i = 0; i < " << expected_result
+ << ".vector_size(); i++) {\n";
+ out.indent();
+ GenerateVerificationCodeForTypedVariable(
+ out, val.vector_value(0), expected_result + ".vector_value(i)",
+ actual_result + ".vector_value(i)");
+ out.unindent();
+ out << "}\n";
+ break;
+ }
+ case TYPE_STRUCT:
+ {
+ if (val.has_predefined_type()) {
+ string func_name = "Verify"
+ + ClearStringWithNameSpaceAccess(val.predefined_type());
+ out << "if (!" << func_name << "(" << expected_result << ", "
+ << actual_result << ")) { return false; }\n";
+ } else {
+ for (int i = 0; i < val.struct_value_size(); i++) {
+ string struct_field_actual_result = actual_result + ".struct_value("
+ + std::to_string(i) + ")";
+ string struct_field_expected_result = expected_result
+ + ".struct_value(" + std::to_string(i) + ")";
+ GenerateVerificationCodeForTypedVariable(out, val.struct_value(i),
+ struct_field_expected_result,
+ struct_field_actual_result);
+ }
+ }
+ break;
+ }
+ case TYPE_UNION:
+ {
+ if (val.has_predefined_type()) {
+ string func_name = "Verify"
+ + ClearStringWithNameSpaceAccess(val.predefined_type());
+ out << "if (!" << func_name << "(" << expected_result << ", "
+ << actual_result << ")) {return false; }\n";
+ } else {
+ for (int i = 0; i < val.union_value_size(); i++) {
+ string union_field_actual_result = actual_result + ".union_value("
+ + std::to_string(i) + ")";
+ string union_field_expected_result = expected_result + ".union_value("
+ + std::to_string(i) + ")";
+ GenerateVerificationCodeForTypedVariable(out, val.union_value(i),
+ union_field_expected_result,
+ union_field_actual_result);
+ }
+ }
+ break;
+ }
+ case TYPE_HIDL_CALLBACK:
+ {
+ out << " ERROR: TYPE_HIDL_CALLBACK is not supported yet.\n";
+ break;
+ }
+ case TYPE_HANDLE:
+ {
+ out << " ERROR: TYPE_HANDLE is not supported yet.\n";
+ break;
+ }
+ case TYPE_HIDL_INTERFACE:
+ {
+ out << " ERROR: TYPE_HIDL_INTERFACE is not supported yet.\n";
+ break;
+ }
+ default:
+ {
+ cerr << " ERROR: unsupported type.\n";
+ exit(-1);
+ }
+ }
+}
+
+void HalHidlCodeGen::GenerateVerificationDeclForAttribute(Formatter& out,
+ const VariableSpecificationMessage& attribute) {
+ if (attribute.type() == TYPE_STRUCT || attribute.type() == TYPE_UNION) {
+ // Recursively generate verification method implementation for all sub_types.
+ for (const auto sub_struct : attribute.sub_struct()) {
+ GenerateVerificationDeclForAttribute(out, sub_struct);
+ }
+ for (const auto sub_union : attribute.sub_union()) {
+ GenerateVerificationDeclForAttribute(out, sub_union);
+ }
+ }
+ std::string func_name = "bool Verify"
+ + ClearStringWithNameSpaceAccess(attribute.name());
+ out << func_name << "(const VariableSpecificationMessage& expected_result, "
+ << "const VariableSpecificationMessage& actual_result);\n";
+}
+
+void HalHidlCodeGen::GenerateVerificationImplForAttribute(Formatter& out,
+ const VariableSpecificationMessage& attribute) {
+ if (attribute.type() == TYPE_STRUCT || attribute.type() == TYPE_UNION) {
+ // Recursively generate verification method implementation for all sub_types.
+ for (const auto sub_struct : attribute.sub_struct()) {
+ GenerateVerificationImplForAttribute(out, sub_struct);
+ }
+ for (const auto sub_union : attribute.sub_union()) {
+ GenerateVerificationImplForAttribute(out, sub_union);
+ }
+ }
+ std::string func_name = "bool Verify"
+ + ClearStringWithNameSpaceAccess(attribute.name());
+ out << func_name << "(const VariableSpecificationMessage& expected_result, "
+ << "const VariableSpecificationMessage& actual_result){\n";
+ out.indent();
+ GenerateVerificationCodeForTypedVariable(out, attribute, "expected_result",
+ "actual_result");
+ out << "return true;\n";
+ out.unindent();
+ out << "}\n\n";
+}
+
+// TODO(zhuoyao): consider to generalize the pattern for
+// Verification/SetResult/DriverImpl.
+void HalHidlCodeGen::GenerateSetResultCodeForTypedVariable(Formatter& out,
+ const VariableSpecificationMessage& val, const string& result_msg,
+ const string& result_value) {
+ switch (val.type()) {
+ case TYPE_SCALAR:
+ {
+ out << result_msg << "->set_type(TYPE_SCALAR);\n";
+ out << result_msg << "->set_scalar_type(\"" << val.scalar_type()
+ << "\");\n";
+ out << result_msg << "->mutable_scalar_value()->set_" << val.scalar_type()
+ << "(" << result_value << ");\n";
+ break;
+ }
+ case TYPE_STRING:
+ {
+ out << result_msg << "->set_type(TYPE_STRING);\n";
+ out << result_msg << "->mutable_string_value()->set_message" << "("
+ << result_value << ".c_str());\n";
+ out << result_msg << "->mutable_string_value()->set_length" << "("
+ << result_value << ".size());\n";
+ break;
+ }
+ case TYPE_ENUM:
+ {
+ out << result_msg << "->set_type(TYPE_ENUM);\n";
+ if (val.has_predefined_type()) {
+ string func_name = "SetResult"
+ + ClearStringWithNameSpaceAccess(val.predefined_type());
+ out << func_name << "(" << result_msg << ", " << result_value << ");\n";
+ } else {
+ const string scalar_type = val.enum_value().scalar_type();
+ out << result_msg << "->set_scalar_type(\"" << scalar_type << "\");\n";
+ out << result_msg << "->mutable_scalar_value()->set_" << scalar_type
+ << "(static_cast<" << scalar_type << ">(" << result_value
+ << "));\n";
+ }
+ break;
+ }
+ case TYPE_VECTOR:
+ {
+ out << result_msg << "->set_type(TYPE_VECTOR);\n";
+ out << "for (int i = 0; i < (int)" << result_value << ".size(); i++) {\n";
+ out.indent();
+ string vector_element_name = result_msg + "_vector_i";
+ out << "auto *" << vector_element_name << " = " << result_msg
+ << "->add_vector_value();\n";
+ GenerateSetResultCodeForTypedVariable(out, val.vector_value(0),
+ vector_element_name,
+ result_value + "[i]");
+ out.unindent();
+ out << "}\n";
+ break;
+ }
+ case TYPE_ARRAY:
+ {
+ out << result_msg << "->set_type(TYPE_ARRAY);\n";
+ out << "for (int i = 0; i < " << val.vector_size() << "; i++) {\n";
+ out.indent();
+ string array_element_name = result_msg + "_array_i";
+ out << "auto *" << array_element_name << " = " << result_msg
+ << "->add_vector_value();\n";
+ GenerateSetResultCodeForTypedVariable(out, val.vector_value(0),
+ array_element_name,
+ result_value + "[i]");
+ out.unindent();
+ out << "}\n";
+ break;
+ }
+ case TYPE_STRUCT:
+ {
+ out << result_msg << "->set_type(TYPE_STRUCT);\n";
+ if (val.has_predefined_type()) {
+ string func_name = "SetResult"
+ + ClearStringWithNameSpaceAccess(val.predefined_type());
+ out << func_name << "(" << result_msg << ", " << result_value << ");\n";
+ } else {
+ for (const auto struct_field : val.struct_value()) {
+ string struct_field_name = result_msg + "_" + struct_field.name();
+ out << "auto *" << struct_field_name << " = " << result_msg
+ << "->add_struct_value();\n";
+ GenerateSetResultCodeForTypedVariable(
+ out, struct_field, struct_field_name,
+ result_value + "." + struct_field.name());
+ }
+ }
+ break;
+ }
+ case TYPE_UNION:
+ {
+ out << result_msg << "->set_type(TYPE_UNION);\n";
+ if (val.has_predefined_type()) {
+ string func_name = "SetResult"
+ + ClearStringWithNameSpaceAccess(val.predefined_type());
+ out << func_name << "(" << result_msg << ", " << result_value << ");\n";
+ } else {
+ for (const auto union_field : val.union_value()) {
+ string union_field_name = result_msg + "_" + union_field.name();
+ out << "auto *" << union_field_name << " = " << result_msg
+ << "->add_union_value();\n";
+ GenerateSetResultCodeForTypedVariable(
+ out, union_field, union_field_name,
+ result_value + "." + union_field.name());
+ }
+ }
+ break;
+ }
+ case TYPE_HIDL_CALLBACK:
+ {
+ out << result_msg << "->set_type(TYPE_HIDL_CALLBACK);\n";
+ out << " ERROR: TYPE_HIDL_CALLBACK is not supported yet.\n";
+ break;
+ }
+ case TYPE_HANDLE:
+ {
+ out << result_msg << "->set_type(TYPE_HANDLE);\n";
+ out << " ERROR: TYPE_HANDLE is not supported yet.\n";
+ break;
+ }
+ case TYPE_HIDL_INTERFACE:
+ {
+ out << result_msg << "->set_type(TYPE_HIDL_INTERFACE);\n";
+ out << " ERROR: TYPE_HIDL_INTERFACE is not supported yet.\n";
+ break;
+ }
+ default:
+ {
+ cerr << " ERROR: unsupported type.\n";
+ exit(-1);
+ }
+ }
+}
+
+void HalHidlCodeGen::GenerateSetResultDeclForAttribute(Formatter& out,
+ const VariableSpecificationMessage& attribute) {
+ if (attribute.type() == TYPE_STRUCT || attribute.type() == TYPE_UNION) {
+ // Recursively generate SetResult method implementation for all sub_types.
+ for (const auto sub_struct : attribute.sub_struct()) {
+ GenerateSetResultDeclForAttribute(out, sub_struct);
+ }
+ for (const auto sub_union : attribute.sub_union()) {
+ GenerateSetResultDeclForAttribute(out, sub_union);
+ }
+ }
+ string func_name = "void SetResult"
+ + ClearStringWithNameSpaceAccess(attribute.name());
+ out << func_name << "(VariableSpecificationMessage* result_msg, "
+ << attribute.name() << " result_value);\n";
+}
+
+void HalHidlCodeGen::GenerateSetResultImplForAttribute(Formatter& out,
+ const VariableSpecificationMessage& attribute) {
+ if (attribute.type() == TYPE_STRUCT || attribute.type() == TYPE_UNION) {
+ // Recursively generate SetResult method implementation for all sub_types.
+ for (const auto sub_struct : attribute.sub_struct()) {
+ GenerateSetResultImplForAttribute(out, sub_struct);
+ }
+ for (const auto sub_union : attribute.sub_union()) {
+ GenerateSetResultImplForAttribute(out, sub_union);
+ }
+ }
+ string func_name = "void SetResult"
+ + ClearStringWithNameSpaceAccess(attribute.name());
+ out << func_name << "(VariableSpecificationMessage* result_msg, "
+ << attribute.name() << " result_value){\n";
+ out.indent();
+ GenerateSetResultCodeForTypedVariable(out, attribute, "result_msg",
+ "result_value");
+ out.unindent();
+ out << "}\n\n";
+}
+
+bool HalHidlCodeGen::CanElideCallback(
+ const FunctionSpecificationMessage& func_msg) {
+ // Can't elide callback for void or tuple-returning methods
+ if (func_msg.return_type_hidl_size() != 1) {
+ return false;
+ }
+ if (func_msg.return_type_hidl(0).type() == TYPE_SCALAR
+ || func_msg.return_type_hidl(0).type() == TYPE_ENUM) {
+ return true;
+ }
+ return false;
+}
+
} // namespace vts
} // namespace android
diff --git a/sysfuzzer/vtscompiler/code_gen/driver/HalHidlCodeGen.h b/sysfuzzer/vtscompiler/code_gen/driver/HalHidlCodeGen.h
index 3327867..93d5226 100644
--- a/sysfuzzer/vtscompiler/code_gen/driver/HalHidlCodeGen.h
+++ b/sysfuzzer/vtscompiler/code_gen/driver/HalHidlCodeGen.h
@@ -37,39 +37,144 @@
: DriverCodeGenBase(input_vts_file_path, vts_name) {}
protected:
- void GenerateCppBodyFuzzFunction(Formatter& out,
- const ComponentSpecificationMessage& message,
- const string& fuzzer_extended_class_name);
+ void GenerateClassHeader(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
+
+ void GenerateClassImpl(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
void GenerateCppBodyFuzzFunction(Formatter& out,
- const StructSpecificationMessage& message,
- const string& fuzzer_extended_class_name,
- const string& original_data_structure_name,
- const string& parent_path);
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
- void GenerateCppBodyGetAttributeFunction(
- Formatter& out, const ComponentSpecificationMessage& message,
- const string& fuzzer_extended_class_name);
+ virtual void GenerateDriverFunctionImpl(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
- void GenerateCppBodyCallbackFunction(
- Formatter& out, const ComponentSpecificationMessage& message,
- const string& fuzzer_extended_class_name);
+ void GenerateVerificationFunctionImpl(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
- void GenerateHeaderGlobalFunctionDeclarations(
- Formatter& out, const string& function_prototype);
+ void GenerateCppBodyGetAttributeFunction(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
+
+ void GenerateCppBodyCallbackFunction(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
+
+ void GenerateClassConstructionFunction(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
+
+ void GenerateHeaderGlobalFunctionDeclarations(Formatter& out,
+ const ComponentSpecificationMessage& message) override;
void GenerateCppBodyGlobalFunctions(Formatter& out,
- const string& function_prototype,
- const string& fuzzer_extended_class_name);
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
- void GenerateSubStructFuzzFunctionCall(
- Formatter& out, const StructSpecificationMessage& message,
- const string& parent_path);
+ void GenerateHeaderIncludeFiles(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
- void GenerateCppBodySyncCallbackFunction(
- Formatter& out, const ComponentSpecificationMessage& message,
+ void GenerateSourceIncludeFiles(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
+
+ void GenerateAdditionalFuctionDeclarations(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
+
+ void GeneratePrivateMemberDeclarations(Formatter& out,
+ const ComponentSpecificationMessage& message) override;
+
+ void GenerateCppBodyFuzzFunction(Formatter& out,
+ const StructSpecificationMessage& message,
+ const string& fuzzer_extended_class_name,
+ const string& original_data_structure_name, const string& parent_path);
+
+ void GenerateCppBodySyncCallbackFunction(Formatter& out,
+ const ComponentSpecificationMessage& message,
const string& fuzzer_extended_class_name);
+ void GenerateSubStructFuzzFunctionCall(Formatter& out,
+ const StructSpecificationMessage& message, const string& parent_path);
+
+ // Generates a scalar type in C/C++.
+ void GenerateScalarTypeInC(Formatter& out, const string& type);
+
+ // Generates the driver function implementation for a method.
+ void GenerateDriverImplForMethod(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const FunctionSpecificationMessage& func_msg);
+
+ // Generates the code to perform a Hal function call.
+ void GenerateHalFunctionCall(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const FunctionSpecificationMessage& func_msg);
+
+ // Generates the implementation of a callback passed to the Hal function call.
+ void GenerateSyncCallbackFunctionImpl(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const FunctionSpecificationMessage& func_msg);
+
+ // Generates the driver function implementation for attributes defined within
+ // an interface or in a types.hal.
+ void GenerateDriverImplForAttribute(Formatter& out,
+ const VariableSpecificationMessage& attribute);
+
+ // Generates the driver code for a typed variable.
+ void GenerateDriverImplForTypedVariable(Formatter& out,
+ const VariableSpecificationMessage& val, const string& arg_name,
+ const string& arg_value_name);
+
+ // Generates the verification function declarations for attributes defined
+ // within an interface or in a types.hal.
+ void GenerateVerificationDeclForAttribute(Formatter& out,
+ const VariableSpecificationMessage& attribute);
+
+ // Generates the verification function implementation for attributes defined
+ // within an interface or in a types.hal.
+ void GenerateVerificationImplForAttribute(Formatter& out,
+ const VariableSpecificationMessage& attribute);
+
+ // Generates the verification code for a typed variable.
+ void GenerateVerificationCodeForTypedVariable(Formatter& out,
+ const VariableSpecificationMessage& val, const string& result_value,
+ const string& expected_result);
+
+ // Generates the SetResult function declarations for attributes defined
+ // within an interface or in a types.hal.
+ void GenerateSetResultDeclForAttribute(Formatter& out,
+ const VariableSpecificationMessage& attribute);
+
+ // Generates the SetResult function implementation for attributes defined
+ // within an interface or in a types.hal.
+ void GenerateSetResultImplForAttribute(Formatter& out,
+ const VariableSpecificationMessage& attribute);
+
+ // Generates the SetResult code for a typed variable.
+ void GenerateSetResultCodeForTypedVariable(Formatter& out,
+ const VariableSpecificationMessage& val, const string& result_msg,
+ const string& result_val);
+
+ // Generates the random function implementation for attributes defined within
+ // an interface or in a types.hal.
+ void GenerateRandomFunctionForAttribute(Formatter& out,
+ const VariableSpecificationMessage& attribute);
+
+ // Generates the getService function implementation for an interface.
+ void GenerateGetServiceImpl(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name);
+
+ // Returns true if we could omit the callback function and return result
+ // directly.
+ bool CanElideCallback(const FunctionSpecificationMessage& func_msg);
+
// instance variable name (e.g., device_);
static const char* const kInstanceVariableName;
};
diff --git a/sysfuzzer/vtscompiler/code_gen/driver/HalSubmoduleCodeGen.cpp b/sysfuzzer/vtscompiler/code_gen/driver/HalSubmoduleCodeGen.cpp
index 6cdc232..8019b8a 100644
--- a/sysfuzzer/vtscompiler/code_gen/driver/HalSubmoduleCodeGen.cpp
+++ b/sysfuzzer/vtscompiler/code_gen/driver/HalSubmoduleCodeGen.cpp
@@ -33,8 +33,28 @@
const char* const HalSubmoduleCodeGen::kInstanceVariableName = "submodule_";
-void HalSubmoduleCodeGen::GenerateHeaderGlobalFunctionDeclarations(
- Formatter& /*h_ss*/, const string& /*function_prototype*/) {}
+void HalSubmoduleCodeGen::GenerateClassConstructionFunction(Formatter& out,
+ const ComponentSpecificationMessage& /*message*/,
+ const string& fuzzer_extended_class_name) {
+ out << fuzzer_extended_class_name
+ << "() : FuzzerBase(HAL_CONVENTIONAL_SUBMODULE) {}\n";
+}
+
+void HalSubmoduleCodeGen::GenerateAdditionalFuctionDeclarations(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& /*fuzzer_extended_class_name*/) {
+ string component_name = GetComponentName(message);
+ out << "void SetSubModule(" << component_name << "* submodule) {" << "\n";
+ out.indent();
+ out << "submodule_ = submodule;" << "\n";
+ out.unindent();
+ out << "}" << "\n" << "\n";
+}
+
+void HalSubmoduleCodeGen::GeneratePrivateMemberDeclarations(Formatter& out,
+ const ComponentSpecificationMessage& message) {
+ out << message.original_data_structure_name() << "* submodule_;\n";
+}
} // namespace vts
} // namespace android
diff --git a/sysfuzzer/vtscompiler/code_gen/driver/HalSubmoduleCodeGen.h b/sysfuzzer/vtscompiler/code_gen/driver/HalSubmoduleCodeGen.h
index 02f9595..bc5a1c6 100644
--- a/sysfuzzer/vtscompiler/code_gen/driver/HalSubmoduleCodeGen.h
+++ b/sysfuzzer/vtscompiler/code_gen/driver/HalSubmoduleCodeGen.h
@@ -34,11 +34,20 @@
class HalSubmoduleCodeGen : public HalCodeGen {
public:
HalSubmoduleCodeGen(const char* input_vts_file_path, const string& vts_name)
- : HalCodeGen(input_vts_file_path, vts_name) {}
+ : HalCodeGen(input_vts_file_path, vts_name) {
+ }
protected:
- void GenerateHeaderGlobalFunctionDeclarations(
- Formatter& out, const string& function_prototype);
+ void GenerateClassConstructionFunction(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
+
+ void GenerateAdditionalFuctionDeclarations(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
+
+ void GeneratePrivateMemberDeclarations(Formatter& out,
+ const ComponentSpecificationMessage& message) override;
// instance variable name (e.g., submodule_);
static const char* const kInstanceVariableName;
diff --git a/sysfuzzer/vtscompiler/code_gen/driver/LegacyHalCodeGen.cpp b/sysfuzzer/vtscompiler/code_gen/driver/LegacyHalCodeGen.cpp
index cdd8b17..2df1f82 100644
--- a/sysfuzzer/vtscompiler/code_gen/driver/LegacyHalCodeGen.cpp
+++ b/sysfuzzer/vtscompiler/code_gen/driver/LegacyHalCodeGen.cpp
@@ -125,9 +125,11 @@
out << "}" << "\n";
}
-
-void LegacyHalCodeGen::GenerateHeaderGlobalFunctionDeclarations(
- Formatter& /*h_ss*/, const string& /*function_prototype*/) {}
+void LegacyHalCodeGen::GenerateClassConstructionFunction(Formatter& out,
+ const ComponentSpecificationMessage& /*message*/,
+ const string& fuzzer_extended_class_name) {
+ out << fuzzer_extended_class_name << "() : FuzzerBase(HAL_LEGACY) {}\n";
+}
} // namespace vts
} // namespace android
diff --git a/sysfuzzer/vtscompiler/code_gen/driver/LegacyHalCodeGen.h b/sysfuzzer/vtscompiler/code_gen/driver/LegacyHalCodeGen.h
index 70814b1..deefa05 100644
--- a/sysfuzzer/vtscompiler/code_gen/driver/LegacyHalCodeGen.h
+++ b/sysfuzzer/vtscompiler/code_gen/driver/LegacyHalCodeGen.h
@@ -38,15 +38,20 @@
protected:
void GenerateCppBodyFuzzFunction(Formatter& out,
- const ComponentSpecificationMessage& message,
- const string& fuzzer_extended_class_name);
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
- void GenerateCppBodyGetAttributeFunction(
- Formatter& out, const ComponentSpecificationMessage& message,
- const string& fuzzer_extended_class_name);
+ void GenerateCppBodyGetAttributeFunction(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
- void GenerateHeaderGlobalFunctionDeclarations(
- Formatter& out, const string& function_prototype);
+ void GenerateCppBodyCallbackFunction(Formatter& /*out*/,
+ const ComponentSpecificationMessage& /*message*/,
+ const string& /*fuzzer_extended_class_name*/) override {};
+
+ void GenerateClassConstructionFunction(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
// instance variable name (e.g., submodule_);
static const char* const kInstanceVariableName;
diff --git a/sysfuzzer/vtscompiler/code_gen/driver/LibSharedCodeGen.cpp b/sysfuzzer/vtscompiler/code_gen/driver/LibSharedCodeGen.cpp
index e8277d8..fe20906 100644
--- a/sysfuzzer/vtscompiler/code_gen/driver/LibSharedCodeGen.cpp
+++ b/sysfuzzer/vtscompiler/code_gen/driver/LibSharedCodeGen.cpp
@@ -144,7 +144,7 @@
}
// TODO: if there were pointers, free them.
out << "return false;" << "\n";
- out.indent();
+ out.unindent();
out << "}" << "\n";
}
@@ -166,8 +166,11 @@
out << "}" << "\n";
}
-void LibSharedCodeGen::GenerateHeaderGlobalFunctionDeclarations(
- Formatter& /*out*/, const string& /*function_prototype*/) {}
+void LibSharedCodeGen::GenerateClassConstructionFunction(Formatter& out,
+ const ComponentSpecificationMessage& /*message*/,
+ const string& fuzzer_extended_class_name) {
+ out << fuzzer_extended_class_name << "() : FuzzerBase(LIB_SHARED) {}\n";
+}
} // namespace vts
} // namespace android
diff --git a/sysfuzzer/vtscompiler/code_gen/driver/LibSharedCodeGen.h b/sysfuzzer/vtscompiler/code_gen/driver/LibSharedCodeGen.h
index d6dcce0..091fed5 100644
--- a/sysfuzzer/vtscompiler/code_gen/driver/LibSharedCodeGen.h
+++ b/sysfuzzer/vtscompiler/code_gen/driver/LibSharedCodeGen.h
@@ -38,16 +38,20 @@
protected:
void GenerateCppBodyFuzzFunction(Formatter& out,
- const ComponentSpecificationMessage& message,
- const string& fuzzer_extended_class_name);
-
- void GenerateCppBodyGetAttributeFunction(
- Formatter& out,
const ComponentSpecificationMessage& message,
- const string& fuzzer_extended_class_name);
+ const string& fuzzer_extended_class_name) override;
- void GenerateHeaderGlobalFunctionDeclarations(
- Formatter& out, const string& function_prototype);
+ void GenerateCppBodyGetAttributeFunction(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
+
+ void GenerateCppBodyCallbackFunction(Formatter& /*out*/,
+ const ComponentSpecificationMessage& /*message*/,
+ const string& /*fuzzer_extended_class_name*/) override {};
+
+ void GenerateClassConstructionFunction(Formatter& out,
+ const ComponentSpecificationMessage& message,
+ const string& fuzzer_extended_class_name) override;
// instance variable name (e.g., submodule_);
static const char* const kInstanceVariableName;
diff --git a/sysfuzzer/vtscompiler/code_gen/profiler/HalHidlProfilerCodeGen.cpp b/sysfuzzer/vtscompiler/code_gen/profiler/HalHidlProfilerCodeGen.cpp
index 3dac661..aa02cf0 100644
--- a/sysfuzzer/vtscompiler/code_gen/profiler/HalHidlProfilerCodeGen.cpp
+++ b/sysfuzzer/vtscompiler/code_gen/profiler/HalHidlProfilerCodeGen.cpp
@@ -53,13 +53,9 @@
<< arg_value << ");\n";
} else {
const std::string scalar_type = val.enum_value().scalar_type();
- out << arg_name << "->mutable_enum_value()->add_scalar_value()->set_"
- << scalar_type << "(static_cast<" << scalar_type << ">(" << arg_value
- << "));\n";
- out << arg_name
- << "->mutable_enum_value()->set_scalar_type(\""
- << scalar_type
- << "\");\n";
+ out << arg_name << "->mutable_scalar_value()->set_" << scalar_type
+ << "(static_cast<" << scalar_type << ">(" << arg_value << "));\n";
+ out << arg_name << "->set_scalar_type(\"" << scalar_type << "\");\n";
}
}
@@ -163,6 +159,7 @@
// TODO(b/32141398): Support profiling in passthrough mode.
out << "case HidlInstrumentor::CLIENT_API_ENTRY:\n";
out << "case HidlInstrumentor::SERVER_API_ENTRY:\n";
+ out << "case HidlInstrumentor::PASSTHROUGH_ENTRY:\n";
out << "{\n";
out.indent();
ComponentSpecificationMessage message;
@@ -195,6 +192,7 @@
// TODO(b/32141398): Support profiling in passthrough mode.
out << "case HidlInstrumentor::CLIENT_API_EXIT:\n";
out << "case HidlInstrumentor::SERVER_API_EXIT:\n";
+ out << "case HidlInstrumentor::PASSTHROUGH_EXIT:\n";
out << "{\n";
out.indent();
out << "if ((*args).size() != " << method.return_type_hidl().size() << ") {\n";
diff --git a/sysfuzzer/vtscompiler/test/golden/DRIVER/BluetoothHalV1.driver.cpp b/sysfuzzer/vtscompiler/test/golden/DRIVER/BluetoothHalV1.driver.cpp
new file mode 100644
index 0000000..c7af66a
--- /dev/null
+++ b/sysfuzzer/vtscompiler/test/golden/DRIVER/BluetoothHalV1.driver.cpp
@@ -0,0 +1,77 @@
+#include "test/vts/specification/hal_conventional/BluetoothHalV1.vts.h"
+#include <hardware/hardware.h>
+#include <hardware/bluetooth.h>
+#include "vts_datatype.h"
+#include "vts_measurement.h"
+#include <iostream>
+
+
+namespace android {
+namespace vts {
+bool FuzzerExtended_bluetooth_module_t::Fuzz(
+ FunctionSpecificationMessage* func_msg,
+ void** result, const string& callback_socket_name) {
+ const char* func_name = func_msg->name().c_str();
+ cout << "Function: " << __func__ << " '" << func_name << "'" << endl;
+ bluetooth_module_t* local_device = reinterpret_cast<bluetooth_module_t*>(device_);
+ if (local_device == NULL) {
+ cout << "use hmi " << (uint64_t)hmi_ << endl;
+ local_device = reinterpret_cast<bluetooth_module_t*>(hmi_);
+ }
+ if (local_device == NULL) {
+ cerr << "both device_ and hmi_ are NULL." << endl;
+ return false;
+ }
+ if (!strcmp(func_name, "get_bluetooth_interface")) {
+ cout << "match" << endl;
+ VtsMeasurement vts_measurement;
+ vts_measurement.Start();
+ cout << "hit2." << device_ << endl;
+ if (reinterpret_cast<bluetooth_module_t*>(local_device)->get_bluetooth_interface == NULL) {
+ cerr << "api not set." << endl;
+ return false;
+ }
+ cout << "Call an API." << endl;
+ cout << "local_device = " << local_device;
+ *result = const_cast<void*>(reinterpret_cast<const void*>(local_device->get_bluetooth_interface()));
+ vector<float>* measured = vts_measurement.Stop();
+ cout << "time " << (*measured)[0] << endl;
+ cout << "called" << endl;
+ return true;
+ }
+ cerr << "func not found" << endl;
+ return false;
+}
+bool FuzzerExtended_bluetooth_module_t::GetAttribute(
+ FunctionSpecificationMessage* func_msg,
+ void** result) {
+ const char* func_name = func_msg->name().c_str();
+ cout << "Function: " << __func__ << " '" << func_name << "'" << endl;
+ bluetooth_module_t* local_device = reinterpret_cast<bluetooth_module_t*>(device_);
+ if (local_device == NULL) {
+ cout << "use hmi " << (uint64_t)hmi_ << endl;
+ local_device = reinterpret_cast<bluetooth_module_t*>(hmi_);
+ }
+ if (local_device == NULL) {
+ cerr << "both device_ and hmi_ are NULL." << endl;
+ return false;
+ }
+ cerr << "attribute not found" << endl;
+ return false;
+}
+bool FuzzerExtended_bluetooth_module_t::CallFunction(const FunctionSpecificationMessage&, const string&, FunctionSpecificationMessage* ) {
+ /* No implementation yet. */
+ return true;
+}
+bool FuzzerExtended_bluetooth_module_t::VerifyResults(const FunctionSpecificationMessage&, const FunctionSpecificationMessage&) {
+ /* No implementation yet. */
+ return true;
+}
+extern "C" {
+android::vts::FuzzerBase* vts_func_1_7_1_() {
+ return (android::vts::FuzzerBase*) new android::vts::FuzzerExtended_bluetooth_module_t();
+}
+
+}
+} // namespace vts
+} // namespace android
diff --git a/sysfuzzer/vtscompiler/test/golden/DRIVER/BluetoothHalV1bt_interface_t.driver.cpp b/sysfuzzer/vtscompiler/test/golden/DRIVER/BluetoothHalV1bt_interface_t.driver.cpp
new file mode 100644
index 0000000..de8e18d
--- /dev/null
+++ b/sysfuzzer/vtscompiler/test/golden/DRIVER/BluetoothHalV1bt_interface_t.driver.cpp
@@ -0,0 +1,300 @@
+#include "test/vts/specification/hal_conventional/BluetoothHalV1bt_interface_t.vts.h"
+#include <hardware/hardware.h>
+#include <hardware/bluetooth.h>
+#include "vts_datatype.h"
+#include "vts_measurement.h"
+#include <iostream>
+
+
+namespace android {
+namespace vts {
+static string callback_socket_name_;
+
+class vts_callback_FuzzerExtended_bt_interface_t_bt_callbacks_t : public FuzzerCallbackBase {
+ public:
+ vts_callback_FuzzerExtended_bt_interface_t_bt_callbacks_t(const string& callback_socket_name) {
+ callback_socket_name_ = callback_socket_name;
+ }
+
+ static void
+ adapter_state_changed_cb(bt_state_t arg0) {
+ AndroidSystemCallbackRequestMessage callback_message;
+ callback_message.set_id(GetCallbackID("adapter_state_changed_cb"));
+ VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+ var_msg0->set_type(TYPE_PREDEFINED);
+ RpcCallToAgent(callback_message, callback_socket_name_);
+ }
+
+
+ static void
+ adapter_properties_cb(bt_status_t arg0, int32_t arg1, bt_property_t* arg2) {
+ AndroidSystemCallbackRequestMessage callback_message;
+ callback_message.set_id(GetCallbackID("adapter_properties_cb"));
+ VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+ var_msg0->set_type(TYPE_PREDEFINED);
+ VariableSpecificationMessage* var_msg1 = callback_message.add_arg();
+ var_msg1->set_type(TYPE_SCALAR);
+ var_msg1->set_scalar_type("int32_t");
+ var_msg1->mutable_scalar_value()->set_int32_t(0);
+ VariableSpecificationMessage* var_msg2 = callback_message.add_arg();
+ var_msg2->set_type(TYPE_PREDEFINED);
+ RpcCallToAgent(callback_message, callback_socket_name_);
+ }
+
+
+ static void
+ remote_device_properties_cb(bt_status_t arg0, bt_bdaddr_t* arg1, int32_t arg2, bt_property_t* arg3) {
+ AndroidSystemCallbackRequestMessage callback_message;
+ callback_message.set_id(GetCallbackID("remote_device_properties_cb"));
+ VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+ var_msg0->set_type(TYPE_PREDEFINED);
+ VariableSpecificationMessage* var_msg1 = callback_message.add_arg();
+ var_msg1->set_type(TYPE_PREDEFINED);
+ VariableSpecificationMessage* var_msg2 = callback_message.add_arg();
+ var_msg2->set_type(TYPE_SCALAR);
+ var_msg2->set_scalar_type("int32_t");
+ var_msg2->mutable_scalar_value()->set_int32_t(0);
+ VariableSpecificationMessage* var_msg3 = callback_message.add_arg();
+ var_msg3->set_type(TYPE_PREDEFINED);
+ RpcCallToAgent(callback_message, callback_socket_name_);
+ }
+
+
+ static void
+ device_found_cb(int32_t arg0, bt_property_t* arg1) {
+ AndroidSystemCallbackRequestMessage callback_message;
+ callback_message.set_id(GetCallbackID("device_found_cb"));
+ VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+ var_msg0->set_type(TYPE_SCALAR);
+ var_msg0->set_scalar_type("int32_t");
+ var_msg0->mutable_scalar_value()->set_int32_t(0);
+ VariableSpecificationMessage* var_msg1 = callback_message.add_arg();
+ var_msg1->set_type(TYPE_PREDEFINED);
+ RpcCallToAgent(callback_message, callback_socket_name_);
+ }
+
+
+ static void
+ discovery_state_changed_cb(bt_discovery_state_t arg0) {
+ AndroidSystemCallbackRequestMessage callback_message;
+ callback_message.set_id(GetCallbackID("discovery_state_changed_cb"));
+ VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+ var_msg0->set_type(TYPE_PREDEFINED);
+ RpcCallToAgent(callback_message, callback_socket_name_);
+ }
+
+
+ static void
+ pin_request_cb(bt_bdaddr_t* arg0, bt_bdname_t* arg1, uint32_t arg2, bool arg3) {
+ AndroidSystemCallbackRequestMessage callback_message;
+ callback_message.set_id(GetCallbackID("pin_request_cb"));
+ VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+ var_msg0->set_type(TYPE_PREDEFINED);
+ VariableSpecificationMessage* var_msg1 = callback_message.add_arg();
+ var_msg1->set_type(TYPE_PREDEFINED);
+ VariableSpecificationMessage* var_msg2 = callback_message.add_arg();
+ var_msg2->set_type(TYPE_SCALAR);
+ var_msg2->set_scalar_type("uint32_t");
+ var_msg2->mutable_scalar_value()->set_uint32_t(0);
+ VariableSpecificationMessage* var_msg3 = callback_message.add_arg();
+ var_msg3->set_type(TYPE_SCALAR);
+ var_msg3->set_scalar_type("bool_t");
+ var_msg3->mutable_scalar_value()->set_bool_t(0);
+ RpcCallToAgent(callback_message, callback_socket_name_);
+ }
+
+
+ static void
+ ssp_request_cb(bt_bdaddr_t* arg0, bt_bdname_t* arg1, uint32_t arg2, bt_ssp_variant_t arg3, uint32_t arg4) {
+ AndroidSystemCallbackRequestMessage callback_message;
+ callback_message.set_id(GetCallbackID("ssp_request_cb"));
+ VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+ var_msg0->set_type(TYPE_PREDEFINED);
+ VariableSpecificationMessage* var_msg1 = callback_message.add_arg();
+ var_msg1->set_type(TYPE_PREDEFINED);
+ VariableSpecificationMessage* var_msg2 = callback_message.add_arg();
+ var_msg2->set_type(TYPE_SCALAR);
+ var_msg2->set_scalar_type("uint32_t");
+ var_msg2->mutable_scalar_value()->set_uint32_t(0);
+ VariableSpecificationMessage* var_msg3 = callback_message.add_arg();
+ var_msg3->set_type(TYPE_PREDEFINED);
+ VariableSpecificationMessage* var_msg4 = callback_message.add_arg();
+ var_msg4->set_type(TYPE_SCALAR);
+ var_msg4->set_scalar_type("uint32_t");
+ var_msg4->mutable_scalar_value()->set_uint32_t(0);
+ RpcCallToAgent(callback_message, callback_socket_name_);
+ }
+
+
+ static void
+ bond_state_changed_cb(bt_status_t arg0, bt_bdaddr_t* arg1, bt_bond_state_t arg2) {
+ AndroidSystemCallbackRequestMessage callback_message;
+ callback_message.set_id(GetCallbackID("bond_state_changed_cb"));
+ VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+ var_msg0->set_type(TYPE_PREDEFINED);
+ VariableSpecificationMessage* var_msg1 = callback_message.add_arg();
+ var_msg1->set_type(TYPE_PREDEFINED);
+ VariableSpecificationMessage* var_msg2 = callback_message.add_arg();
+ var_msg2->set_type(TYPE_PREDEFINED);
+ RpcCallToAgent(callback_message, callback_socket_name_);
+ }
+
+
+ static void
+ acl_state_changed_cb(bt_status_t arg0, bt_bdaddr_t* arg1, bt_acl_state_t arg2) {
+ AndroidSystemCallbackRequestMessage callback_message;
+ callback_message.set_id(GetCallbackID("acl_state_changed_cb"));
+ VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+ var_msg0->set_type(TYPE_PREDEFINED);
+ VariableSpecificationMessage* var_msg1 = callback_message.add_arg();
+ var_msg1->set_type(TYPE_PREDEFINED);
+ VariableSpecificationMessage* var_msg2 = callback_message.add_arg();
+ var_msg2->set_type(TYPE_PREDEFINED);
+ RpcCallToAgent(callback_message, callback_socket_name_);
+ }
+
+
+ static void
+ thread_evt_cb(bt_cb_thread_evt arg0) {
+ AndroidSystemCallbackRequestMessage callback_message;
+ callback_message.set_id(GetCallbackID("thread_evt_cb"));
+ VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+ var_msg0->set_type(TYPE_PREDEFINED);
+ RpcCallToAgent(callback_message, callback_socket_name_);
+ }
+
+
+ static void
+ dut_mode_recv_cb(uint16_t arg0, unsigned char* arg1, uint8_t arg2) {
+ AndroidSystemCallbackRequestMessage callback_message;
+ callback_message.set_id(GetCallbackID("dut_mode_recv_cb"));
+ VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+ var_msg0->set_type(TYPE_SCALAR);
+ var_msg0->set_scalar_type("uint16_t");
+ var_msg0->mutable_scalar_value()->set_uint16_t(0);
+ VariableSpecificationMessage* var_msg1 = callback_message.add_arg();
+ var_msg1->set_type(TYPE_SCALAR);
+ var_msg1->set_scalar_type("uchar_pointer");
+ var_msg1->mutable_scalar_value()->set_uchar_pointer(0);
+ VariableSpecificationMessage* var_msg2 = callback_message.add_arg();
+ var_msg2->set_type(TYPE_SCALAR);
+ var_msg2->set_scalar_type("uint8_t");
+ var_msg2->mutable_scalar_value()->set_uint8_t(0);
+ RpcCallToAgent(callback_message, callback_socket_name_);
+ }
+
+
+ static void
+ le_test_mode_cb(bt_status_t arg0, uint16_t arg1) {
+ AndroidSystemCallbackRequestMessage callback_message;
+ callback_message.set_id(GetCallbackID("le_test_mode_cb"));
+ VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+ var_msg0->set_type(TYPE_PREDEFINED);
+ VariableSpecificationMessage* var_msg1 = callback_message.add_arg();
+ var_msg1->set_type(TYPE_SCALAR);
+ var_msg1->set_scalar_type("uint16_t");
+ var_msg1->mutable_scalar_value()->set_uint16_t(0);
+ RpcCallToAgent(callback_message, callback_socket_name_);
+ }
+
+
+ static void
+ energy_info_cb(bt_activity_energy_info* arg0, bt_uid_traffic_t* arg1) {
+ AndroidSystemCallbackRequestMessage callback_message;
+ callback_message.set_id(GetCallbackID("energy_info_cb"));
+ VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+ var_msg0->set_type(TYPE_PREDEFINED);
+ VariableSpecificationMessage* var_msg1 = callback_message.add_arg();
+ var_msg1->set_type(TYPE_PREDEFINED);
+ RpcCallToAgent(callback_message, callback_socket_name_);
+ }
+
+
+ private:
+};
+
+bool FuzzerExtended_bt_interface_t::Fuzz(
+ FunctionSpecificationMessage* func_msg,
+ void** result, const string& callback_socket_name) {
+ const char* func_name = func_msg->name().c_str();
+ cout << "Function: " << __func__ << " '" << func_name << "'" << endl;
+ bt_interface_t* local_device = reinterpret_cast<bt_interface_t*>(device_);
+ if (local_device == NULL) {
+ cout << "use hmi " << (uint64_t)hmi_ << endl;
+ local_device = reinterpret_cast<bt_interface_t*>(hmi_);
+ }
+ if (local_device == NULL) {
+ cerr << "both device_ and hmi_ are NULL." << endl;
+ return false;
+ }
+ if (!strcmp(func_name, "init")) {
+ cout << "match" << endl;
+ vts_callback_FuzzerExtended_bt_interface_t_bt_callbacks_t* arg0callback = new vts_callback_FuzzerExtended_bt_interface_t_bt_callbacks_t(callback_socket_name);
+ arg0callback->Register(func_msg->arg(0));
+ bt_callbacks_t* arg0 = (bt_callbacks_t*) malloc(sizeof(bt_callbacks_t*));
+ arg0->adapter_state_changed_cb = arg0callback->adapter_state_changed_cb;
+ arg0->adapter_properties_cb = arg0callback->adapter_properties_cb;
+ arg0->remote_device_properties_cb = arg0callback->remote_device_properties_cb;
+ arg0->device_found_cb = arg0callback->device_found_cb;
+ arg0->discovery_state_changed_cb = arg0callback->discovery_state_changed_cb;
+ arg0->pin_request_cb = arg0callback->pin_request_cb;
+ arg0->ssp_request_cb = arg0callback->ssp_request_cb;
+ arg0->bond_state_changed_cb = arg0callback->bond_state_changed_cb;
+ arg0->acl_state_changed_cb = arg0callback->acl_state_changed_cb;
+ arg0->thread_evt_cb = arg0callback->thread_evt_cb;
+ arg0->dut_mode_recv_cb = arg0callback->dut_mode_recv_cb;
+ arg0->le_test_mode_cb = arg0callback->le_test_mode_cb;
+ arg0->energy_info_cb = arg0callback->energy_info_cb;
+ cout << "arg0 = " << arg0 << endl;
+ VtsMeasurement vts_measurement;
+ vts_measurement.Start();
+ cout << "hit2." << device_ << endl;
+ if (reinterpret_cast<bt_interface_t*>(local_device)->init == NULL) {
+ cerr << "api not set." << endl;
+ return false;
+ }
+ cout << "Call an API." << endl;
+ cout << "local_device = " << local_device;
+ *result = const_cast<void*>(reinterpret_cast<const void*>(local_device->init(
+ arg0)));
+ vector<float>* measured = vts_measurement.Stop();
+ cout << "time " << (*measured)[0] << endl;
+ cout << "called" << endl;
+ return true;
+ }
+ cerr << "func not found" << endl;
+ return false;
+}
+bool FuzzerExtended_bt_interface_t::GetAttribute(
+ FunctionSpecificationMessage* func_msg,
+ void** result) {
+ const char* func_name = func_msg->name().c_str();
+ cout << "Function: " << __func__ << " '" << func_name << "'" << endl;
+ bt_interface_t* local_device = reinterpret_cast<bt_interface_t*>(device_);
+ if (local_device == NULL) {
+ cout << "use hmi " << (uint64_t)hmi_ << endl;
+ local_device = reinterpret_cast<bt_interface_t*>(hmi_);
+ }
+ if (local_device == NULL) {
+ cerr << "both device_ and hmi_ are NULL." << endl;
+ return false;
+ }
+ cerr << "attribute not found" << endl;
+ return false;
+}
+bool FuzzerExtended_bt_interface_t::CallFunction(const FunctionSpecificationMessage&, const string&, FunctionSpecificationMessage* ) {
+ /* No implementation yet. */
+ return true;
+}
+bool FuzzerExtended_bt_interface_t::VerifyResults(const FunctionSpecificationMessage&, const FunctionSpecificationMessage&) {
+ /* No implementation yet. */
+ return true;
+}
+extern "C" {
+android::vts::FuzzerBase* vts_func_2_7_1_() {
+ return (android::vts::FuzzerBase*) new android::vts::FuzzerExtended_bt_interface_t();
+}
+
+}
+} // namespace vts
+} // namespace android
diff --git a/sysfuzzer/vtscompiler/test/golden/DRIVER/Nfc.driver.cpp b/sysfuzzer/vtscompiler/test/golden/DRIVER/Nfc.driver.cpp
index b883a71..85e30e9 100644
--- a/sysfuzzer/vtscompiler/test/golden/DRIVER/Nfc.driver.cpp
+++ b/sysfuzzer/vtscompiler/test/golden/DRIVER/Nfc.driver.cpp
@@ -1,67 +1,68 @@
#include "hardware/interfaces/nfc/1.0/vts/Nfc.vts.h"
-#include <hidl/HidlSupport.h>
-#include <iostream>
#include "vts_datatype.h"
#include "vts_measurement.h"
+#include <iostream>
#include <hidl/HidlSupport.h>
#include <android/hardware/nfc/1.0/INfc.h>
#include <android/hardware/nfc/1.0/INfcClientCallback.h>
#include "hardware/interfaces/nfc/1.0/vts/NfcClientCallback.vts.h"
#include "hardware/interfaces/nfc/1.0/vts/types.vts.h"
#include <android/hardware/nfc/1.0/types.h>
+
+
using namespace android::hardware::nfc::V1_0;
namespace android {
namespace vts {
-
-
-
-static void FuzzerExtended_INfcopen_cb_func(int32_t arg0) {
+static void FuzzerExtended_INfcopen_cb_func(::android::hardware::nfc::V1_0::NfcStatus arg0) {
cout << "callback open called" << endl;
}
-std::function<void(int32_t)> FuzzerExtended_INfcopen_cb = FuzzerExtended_INfcopen_cb_func;
+std::function<void(::android::hardware::nfc::V1_0::NfcStatus)> FuzzerExtended_INfcopen_cb = FuzzerExtended_INfcopen_cb_func;
-static void FuzzerExtended_INfcwrite_cb_func(int32_t arg0) {
+static void FuzzerExtended_INfcwrite_cb_func(uint32_t arg0) {
cout << "callback write called" << endl;
}
-std::function<void(int32_t)> FuzzerExtended_INfcwrite_cb = FuzzerExtended_INfcwrite_cb_func;
+std::function<void(uint32_t)> FuzzerExtended_INfcwrite_cb = FuzzerExtended_INfcwrite_cb_func;
-static void FuzzerExtended_INfccoreInitialized_cb_func(int32_t arg0) {
+static void FuzzerExtended_INfccoreInitialized_cb_func(::android::hardware::nfc::V1_0::NfcStatus arg0) {
cout << "callback coreInitialized called" << endl;
}
-std::function<void(int32_t)> FuzzerExtended_INfccoreInitialized_cb = FuzzerExtended_INfccoreInitialized_cb_func;
+std::function<void(::android::hardware::nfc::V1_0::NfcStatus)> FuzzerExtended_INfccoreInitialized_cb = FuzzerExtended_INfccoreInitialized_cb_func;
-static void FuzzerExtended_INfcprediscover_cb_func(int32_t arg0) {
+static void FuzzerExtended_INfcprediscover_cb_func(::android::hardware::nfc::V1_0::NfcStatus arg0) {
cout << "callback prediscover called" << endl;
}
-std::function<void(int32_t)> FuzzerExtended_INfcprediscover_cb = FuzzerExtended_INfcprediscover_cb_func;
+std::function<void(::android::hardware::nfc::V1_0::NfcStatus)> FuzzerExtended_INfcprediscover_cb = FuzzerExtended_INfcprediscover_cb_func;
-static void FuzzerExtended_INfcclose_cb_func(int32_t arg0) {
+static void FuzzerExtended_INfcclose_cb_func(::android::hardware::nfc::V1_0::NfcStatus arg0) {
cout << "callback close called" << endl;
}
-std::function<void(int32_t)> FuzzerExtended_INfcclose_cb = FuzzerExtended_INfcclose_cb_func;
+std::function<void(::android::hardware::nfc::V1_0::NfcStatus)> FuzzerExtended_INfcclose_cb = FuzzerExtended_INfcclose_cb_func;
-static void FuzzerExtended_INfccontrolGranted_cb_func(int32_t arg0) {
+static void FuzzerExtended_INfccontrolGranted_cb_func(::android::hardware::nfc::V1_0::NfcStatus arg0) {
cout << "callback controlGranted called" << endl;
}
-std::function<void(int32_t)> FuzzerExtended_INfccontrolGranted_cb = FuzzerExtended_INfccontrolGranted_cb_func;
+std::function<void(::android::hardware::nfc::V1_0::NfcStatus)> FuzzerExtended_INfccontrolGranted_cb = FuzzerExtended_INfccontrolGranted_cb_func;
-static void FuzzerExtended_INfcpowerCycle_cb_func(int32_t arg0) {
+static void FuzzerExtended_INfcpowerCycle_cb_func(::android::hardware::nfc::V1_0::NfcStatus arg0) {
cout << "callback powerCycle called" << endl;
}
-std::function<void(int32_t)> FuzzerExtended_INfcpowerCycle_cb = FuzzerExtended_INfcpowerCycle_cb_func;
+std::function<void(::android::hardware::nfc::V1_0::NfcStatus)> FuzzerExtended_INfcpowerCycle_cb = FuzzerExtended_INfcpowerCycle_cb_func;
-bool FuzzerExtended_INfc::GetService(bool get_stub) {
+bool FuzzerExtended_INfc::GetService(bool get_stub, const char* service_name) {
static bool initialized = false;
if (!initialized) {
cout << "[agent:hal] HIDL getService" << endl;
- hw_binder_proxy_ = INfc::getService("nfc_nci", get_stub);
+ if (service_name) {
+ cout << " - service name: " << service_name << endl;
+ }
+ hw_binder_proxy_ = INfc::getService(service_name, get_stub);
cout << "[agent:hal] hw_binder_proxy_ = " << hw_binder_proxy_.get() << endl;
initialized = true;
}
@@ -79,7 +80,7 @@
vts_measurement.Start();
cout << "Call an API" << endl;
cout << "local_device = " << hw_binder_proxy_.get();
- *result = reinterpret_cast<void*>((int32_t)hw_binder_proxy_->open(
+ *result = reinterpret_cast<void*>((::android::hardware::nfc::V1_0::NfcStatus)hw_binder_proxy_->open(
arg0));
vector<float>* measured = vts_measurement.Stop();
cout << "time " << (*measured)[0] << endl;
@@ -97,7 +98,7 @@
vts_measurement.Start();
cout << "Call an API" << endl;
cout << "local_device = " << hw_binder_proxy_.get();
- *result = reinterpret_cast<void*>((int32_t)hw_binder_proxy_->write(
+ *result = reinterpret_cast<void*>((uint32_t)hw_binder_proxy_->write(
arg0));
vector<float>* measured = vts_measurement.Stop();
cout << "time " << (*measured)[0] << endl;
@@ -115,7 +116,7 @@
vts_measurement.Start();
cout << "Call an API" << endl;
cout << "local_device = " << hw_binder_proxy_.get();
- *result = reinterpret_cast<void*>((int32_t)hw_binder_proxy_->coreInitialized(
+ *result = reinterpret_cast<void*>((::android::hardware::nfc::V1_0::NfcStatus)hw_binder_proxy_->coreInitialized(
arg0));
vector<float>* measured = vts_measurement.Stop();
cout << "time " << (*measured)[0] << endl;
@@ -127,7 +128,7 @@
vts_measurement.Start();
cout << "Call an API" << endl;
cout << "local_device = " << hw_binder_proxy_.get();
- *result = reinterpret_cast<void*>((int32_t)hw_binder_proxy_->prediscover());
+ *result = reinterpret_cast<void*>((::android::hardware::nfc::V1_0::NfcStatus)hw_binder_proxy_->prediscover());
vector<float>* measured = vts_measurement.Stop();
cout << "time " << (*measured)[0] << endl;
cout << "called" << endl;
@@ -138,7 +139,7 @@
vts_measurement.Start();
cout << "Call an API" << endl;
cout << "local_device = " << hw_binder_proxy_.get();
- *result = reinterpret_cast<void*>((int32_t)hw_binder_proxy_->close());
+ *result = reinterpret_cast<void*>((::android::hardware::nfc::V1_0::NfcStatus)hw_binder_proxy_->close());
vector<float>* measured = vts_measurement.Stop();
cout << "time " << (*measured)[0] << endl;
cout << "called" << endl;
@@ -149,7 +150,7 @@
vts_measurement.Start();
cout << "Call an API" << endl;
cout << "local_device = " << hw_binder_proxy_.get();
- *result = reinterpret_cast<void*>((int32_t)hw_binder_proxy_->controlGranted());
+ *result = reinterpret_cast<void*>((::android::hardware::nfc::V1_0::NfcStatus)hw_binder_proxy_->controlGranted());
vector<float>* measured = vts_measurement.Stop();
cout << "time " << (*measured)[0] << endl;
cout << "called" << endl;
@@ -160,7 +161,7 @@
vts_measurement.Start();
cout << "Call an API" << endl;
cout << "local_device = " << hw_binder_proxy_.get();
- *result = reinterpret_cast<void*>((int32_t)hw_binder_proxy_->powerCycle());
+ *result = reinterpret_cast<void*>((::android::hardware::nfc::V1_0::NfcStatus)hw_binder_proxy_->powerCycle());
vector<float>* measured = vts_measurement.Stop();
cout << "time " << (*measured)[0] << endl;
cout << "called" << endl;
@@ -174,11 +175,179 @@
cerr << "attribute not found" << endl;
return false;
}
+bool FuzzerExtended_INfc::CallFunction(const FunctionSpecificationMessage& func_msg, const string& callback_socket_name, FunctionSpecificationMessage* result_msg) {
+ const char* func_name = func_msg.name().c_str();
+ cout << "Function: " << __func__ << " " << func_name << endl;
+ if (!strcmp(func_name, "open")) {
+ sp<INfcClientCallback> arg0;
+ arg0 = VtsFuzzerCreateINfcClientCallback(callback_socket_name);
+ VtsMeasurement vts_measurement;
+ vts_measurement.Start();
+ cout << "Call an API" << endl;
+ cout << "local_device = " << hw_binder_proxy_.get();
+ ::android::hardware::nfc::V1_0::NfcStatus result0;
+ result0 = hw_binder_proxy_->open(arg0);
+ vector<float>* measured = vts_measurement.Stop();
+ cout << "time " << (*measured)[0] << endl;
+ result_msg->set_name("open");
+ VariableSpecificationMessage* result_val_0 = result_msg->add_return_type_hidl();
+ result_val_0->set_type(TYPE_ENUM);
+ SetResult__android__hardware__nfc__V1_0__NfcStatus(result_val_0, result0);
+ cout << "called" << endl;
+ return true;
+ }
+ if (!strcmp(func_name, "write")) {
+ ::android::hardware::hidl_vec<uint8_t> arg0;
+ arg0.resize(func_msg.arg(0).vector_size());
+ for (int i = 0; i <func_msg.arg(0).vector_size(); i++) {
+ arg0[i] = func_msg.arg(0).vector_value(i).scalar_value().uint8_t();
+ }
+ VtsMeasurement vts_measurement;
+ vts_measurement.Start();
+ cout << "Call an API" << endl;
+ cout << "local_device = " << hw_binder_proxy_.get();
+ uint32_t result0;
+ result0 = hw_binder_proxy_->write(arg0);
+ vector<float>* measured = vts_measurement.Stop();
+ cout << "time " << (*measured)[0] << endl;
+ result_msg->set_name("write");
+ VariableSpecificationMessage* result_val_0 = result_msg->add_return_type_hidl();
+ result_val_0->set_type(TYPE_SCALAR);
+ result_val_0->set_scalar_type("uint32_t");
+ result_val_0->mutable_scalar_value()->set_uint32_t(result0);
+ cout << "called" << endl;
+ return true;
+ }
+ if (!strcmp(func_name, "coreInitialized")) {
+ ::android::hardware::hidl_vec<uint8_t> arg0;
+ arg0.resize(func_msg.arg(0).vector_size());
+ for (int i = 0; i <func_msg.arg(0).vector_size(); i++) {
+ arg0[i] = func_msg.arg(0).vector_value(i).scalar_value().uint8_t();
+ }
+ VtsMeasurement vts_measurement;
+ vts_measurement.Start();
+ cout << "Call an API" << endl;
+ cout << "local_device = " << hw_binder_proxy_.get();
+ ::android::hardware::nfc::V1_0::NfcStatus result0;
+ result0 = hw_binder_proxy_->coreInitialized(arg0);
+ vector<float>* measured = vts_measurement.Stop();
+ cout << "time " << (*measured)[0] << endl;
+ result_msg->set_name("coreInitialized");
+ VariableSpecificationMessage* result_val_0 = result_msg->add_return_type_hidl();
+ result_val_0->set_type(TYPE_ENUM);
+ SetResult__android__hardware__nfc__V1_0__NfcStatus(result_val_0, result0);
+ cout << "called" << endl;
+ return true;
+ }
+ if (!strcmp(func_name, "prediscover")) {
+ VtsMeasurement vts_measurement;
+ vts_measurement.Start();
+ cout << "Call an API" << endl;
+ cout << "local_device = " << hw_binder_proxy_.get();
+ ::android::hardware::nfc::V1_0::NfcStatus result0;
+ result0 = hw_binder_proxy_->prediscover();
+ vector<float>* measured = vts_measurement.Stop();
+ cout << "time " << (*measured)[0] << endl;
+ result_msg->set_name("prediscover");
+ VariableSpecificationMessage* result_val_0 = result_msg->add_return_type_hidl();
+ result_val_0->set_type(TYPE_ENUM);
+ SetResult__android__hardware__nfc__V1_0__NfcStatus(result_val_0, result0);
+ cout << "called" << endl;
+ return true;
+ }
+ if (!strcmp(func_name, "close")) {
+ VtsMeasurement vts_measurement;
+ vts_measurement.Start();
+ cout << "Call an API" << endl;
+ cout << "local_device = " << hw_binder_proxy_.get();
+ ::android::hardware::nfc::V1_0::NfcStatus result0;
+ result0 = hw_binder_proxy_->close();
+ vector<float>* measured = vts_measurement.Stop();
+ cout << "time " << (*measured)[0] << endl;
+ result_msg->set_name("close");
+ VariableSpecificationMessage* result_val_0 = result_msg->add_return_type_hidl();
+ result_val_0->set_type(TYPE_ENUM);
+ SetResult__android__hardware__nfc__V1_0__NfcStatus(result_val_0, result0);
+ cout << "called" << endl;
+ return true;
+ }
+ if (!strcmp(func_name, "controlGranted")) {
+ VtsMeasurement vts_measurement;
+ vts_measurement.Start();
+ cout << "Call an API" << endl;
+ cout << "local_device = " << hw_binder_proxy_.get();
+ ::android::hardware::nfc::V1_0::NfcStatus result0;
+ result0 = hw_binder_proxy_->controlGranted();
+ vector<float>* measured = vts_measurement.Stop();
+ cout << "time " << (*measured)[0] << endl;
+ result_msg->set_name("controlGranted");
+ VariableSpecificationMessage* result_val_0 = result_msg->add_return_type_hidl();
+ result_val_0->set_type(TYPE_ENUM);
+ SetResult__android__hardware__nfc__V1_0__NfcStatus(result_val_0, result0);
+ cout << "called" << endl;
+ return true;
+ }
+ if (!strcmp(func_name, "powerCycle")) {
+ VtsMeasurement vts_measurement;
+ vts_measurement.Start();
+ cout << "Call an API" << endl;
+ cout << "local_device = " << hw_binder_proxy_.get();
+ ::android::hardware::nfc::V1_0::NfcStatus result0;
+ result0 = hw_binder_proxy_->powerCycle();
+ vector<float>* measured = vts_measurement.Stop();
+ cout << "time " << (*measured)[0] << endl;
+ result_msg->set_name("powerCycle");
+ VariableSpecificationMessage* result_val_0 = result_msg->add_return_type_hidl();
+ result_val_0->set_type(TYPE_ENUM);
+ SetResult__android__hardware__nfc__V1_0__NfcStatus(result_val_0, result0);
+ cout << "called" << endl;
+ return true;
+ }
+ return false;
+}
+
+bool FuzzerExtended_INfc::VerifyResults(const FunctionSpecificationMessage& expected_result, const FunctionSpecificationMessage& actual_result) {
+ if (!strcmp(actual_result.name().c_str(), "open")) {
+ if (actual_result.return_type_hidl_size() != expected_result.return_type_hidl_size() ) { return false; }
+ if(!Verify__android__hardware__nfc__V1_0__NfcStatus(expected_result.return_type_hidl(0), actual_result.return_type_hidl(0))) { return false; }
+ return true;
+ }
+ if (!strcmp(actual_result.name().c_str(), "write")) {
+ if (actual_result.return_type_hidl_size() != expected_result.return_type_hidl_size() ) { return false; }
+ if (actual_result.return_type_hidl(0).scalar_value().uint32_t() != expected_result.return_type_hidl(0).scalar_value().uint32_t()) { return false; }
+ return true;
+ }
+ if (!strcmp(actual_result.name().c_str(), "coreInitialized")) {
+ if (actual_result.return_type_hidl_size() != expected_result.return_type_hidl_size() ) { return false; }
+ if(!Verify__android__hardware__nfc__V1_0__NfcStatus(expected_result.return_type_hidl(0), actual_result.return_type_hidl(0))) { return false; }
+ return true;
+ }
+ if (!strcmp(actual_result.name().c_str(), "prediscover")) {
+ if (actual_result.return_type_hidl_size() != expected_result.return_type_hidl_size() ) { return false; }
+ if(!Verify__android__hardware__nfc__V1_0__NfcStatus(expected_result.return_type_hidl(0), actual_result.return_type_hidl(0))) { return false; }
+ return true;
+ }
+ if (!strcmp(actual_result.name().c_str(), "close")) {
+ if (actual_result.return_type_hidl_size() != expected_result.return_type_hidl_size() ) { return false; }
+ if(!Verify__android__hardware__nfc__V1_0__NfcStatus(expected_result.return_type_hidl(0), actual_result.return_type_hidl(0))) { return false; }
+ return true;
+ }
+ if (!strcmp(actual_result.name().c_str(), "controlGranted")) {
+ if (actual_result.return_type_hidl_size() != expected_result.return_type_hidl_size() ) { return false; }
+ if(!Verify__android__hardware__nfc__V1_0__NfcStatus(expected_result.return_type_hidl(0), actual_result.return_type_hidl(0))) { return false; }
+ return true;
+ }
+ if (!strcmp(actual_result.name().c_str(), "powerCycle")) {
+ if (actual_result.return_type_hidl_size() != expected_result.return_type_hidl_size() ) { return false; }
+ if(!Verify__android__hardware__nfc__V1_0__NfcStatus(expected_result.return_type_hidl(0), actual_result.return_type_hidl(0))) { return false; }
+ return true;
+ }
+ return false;
+}
+
extern "C" {
-android::vts::FuzzerBase*
-vts_func_4_android_hardware_nfc_1_(
-) {
- return (android::vts::FuzzerBase*) new android::vts::FuzzerExtended_INfc();
+android::vts::FuzzerBase* vts_func_4_android_hardware_nfc_1_() {
+ return (android::vts::FuzzerBase*) new android::vts::FuzzerExtended_INfc();
}
}
diff --git a/sysfuzzer/vtscompiler/test/golden/DRIVER/NfcClientCallback.driver.cpp b/sysfuzzer/vtscompiler/test/golden/DRIVER/NfcClientCallback.driver.cpp
index e2c5a95..97e389a 100644
--- a/sysfuzzer/vtscompiler/test/golden/DRIVER/NfcClientCallback.driver.cpp
+++ b/sysfuzzer/vtscompiler/test/golden/DRIVER/NfcClientCallback.driver.cpp
@@ -1,19 +1,17 @@
#include "hardware/interfaces/nfc/1.0/vts/NfcClientCallback.vts.h"
-#include <hidl/HidlSupport.h>
-#include <iostream>
#include "vts_datatype.h"
#include "vts_measurement.h"
+#include <iostream>
#include <hidl/HidlSupport.h>
#include <android/hardware/nfc/1.0/INfcClientCallback.h>
#include "hardware/interfaces/nfc/1.0/vts/types.vts.h"
#include <android/hardware/nfc/1.0/types.h>
+
+
using namespace android::hardware::nfc::V1_0;
namespace android {
namespace vts {
-
-
-
::android::hardware::Return<void> VtsNfcClientCallback::sendEvent(
::android::hardware::nfc::V1_0::NfcEvent arg0,
::android::hardware::nfc::V1_0::NfcStatus arg1) {
@@ -27,8 +25,10 @@
return ::android::hardware::Void();
}
-VtsNfcClientCallback* VtsFuzzerCreateINfcClientCallback(const string& callback_socket_name) {
- return new VtsNfcClientCallback();
+sp<INfcClientCallback> VtsFuzzerCreateINfcClientCallback(const string& callback_socket_name) {
+ sp<INfcClientCallback> result;
+ result = new VtsNfcClientCallback();
+ return result;
}
} // namespace vts
diff --git a/sysfuzzer/vtscompiler/test/golden/DRIVER/WifiHalV1.driver.cpp b/sysfuzzer/vtscompiler/test/golden/DRIVER/WifiHalV1.driver.cpp
new file mode 100644
index 0000000..11115b8
--- /dev/null
+++ b/sysfuzzer/vtscompiler/test/golden/DRIVER/WifiHalV1.driver.cpp
@@ -0,0 +1,49 @@
+#include "test/vts/specification/hal_conventional/WifiHalV1.vts.h"
+#include <hardware/hardware.h>
+#include <hardware_legacy/wifi_hal.h>
+#include "vts_datatype.h"
+#include "vts_measurement.h"
+#include <iostream>
+
+
+namespace android {
+namespace vts {
+bool FuzzerExtended_wifi::Fuzz(
+ FunctionSpecificationMessage* func_msg,
+ void** result, const string& callback_socket_name) {
+ const char* func_name = func_msg->name().c_str();
+ cout << "Function: " << func_name << endl;
+ if (!strcmp(func_name, "wifi_initialize")) {
+ wifi_handle* arg0 = (wifi_handle*) malloc(sizeof(wifi_handle));
+ cout << "arg0 = " << arg0 << endl;
+ typedef void* (*func_type_wifi_initialize)(...);
+ *result = const_cast<void*>(reinterpret_cast<const void*>( ((func_type_wifi_initialize) target_loader_.GetLoaderFunction("wifi_initialize"))(
+ arg0)));
+ return true;
+ }
+ return false;
+}
+bool FuzzerExtended_wifi::GetAttribute(
+ FunctionSpecificationMessage* func_msg,
+ void** result) {
+ const char* func_name = func_msg->name().c_str();
+ cout << "Function: " << __func__ << " '" << func_name << "'" << endl;
+ cerr << "attribute not supported for legacy hal yet" << endl;
+ return false;
+}
+bool FuzzerExtended_wifi::CallFunction(const FunctionSpecificationMessage&, const string&, FunctionSpecificationMessage* ) {
+ /* No implementation yet. */
+ return true;
+}
+bool FuzzerExtended_wifi::VerifyResults(const FunctionSpecificationMessage&, const FunctionSpecificationMessage&) {
+ /* No implementation yet. */
+ return true;
+}
+extern "C" {
+android::vts::FuzzerBase* vts_func_3_5_1_() {
+ return (android::vts::FuzzerBase*) new android::vts::FuzzerExtended_wifi();
+}
+
+}
+} // namespace vts
+} // namespace android
diff --git a/sysfuzzer/vtscompiler/test/golden/DRIVER/hardware/interfaces/nfc/1.0/vts/Nfc.vts.h b/sysfuzzer/vtscompiler/test/golden/DRIVER/hardware/interfaces/nfc/1.0/vts/Nfc.vts.h
index 60a8aaa..4efb50c 100644
--- a/sysfuzzer/vtscompiler/test/golden/DRIVER/hardware/interfaces/nfc/1.0/vts/Nfc.vts.h
+++ b/sysfuzzer/vtscompiler/test/golden/DRIVER/hardware/interfaces/nfc/1.0/vts/Nfc.vts.h
@@ -1,41 +1,43 @@
-#ifndef __VTS_SPEC_Nfc.driver__
-#define __VTS_SPEC_Nfc.driver__
+#ifndef __VTS_SPEC_android_hardware_nfc_Nfc.driver__
+#define __VTS_SPEC_android_hardware_nfc_Nfc.driver__
+
+#define LOG_TAG "FuzzerExtended_INfc"
+
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
-#define LOG_TAG "FuzzerExtended_INfc"
#include <utils/Log.h>
#include <fuzz_tester/FuzzerBase.h>
#include <fuzz_tester/FuzzerCallbackBase.h>
+
+
#include <android/hardware/nfc/1.0/INfc.h>
#include <android/hardware/nfc/1.0/INfc.h>
#include <hidl/HidlSupport.h>
-
using namespace android::hardware::nfc::V1_0;
namespace android {
namespace vts {
class FuzzerExtended_INfc : public FuzzerBase {
public:
- FuzzerExtended_INfc() : FuzzerBase(HAL_HIDL), hw_binder_proxy_() { }
+ FuzzerExtended_INfc() : FuzzerBase(HAL_HIDL), hw_binder_proxy_() {}
protected:
- bool Fuzz(FunctionSpecificationMessage* func_msg,
- void** result, const string& callback_socket_name);
- bool GetAttribute(FunctionSpecificationMessage* func_msg,
- void** result);
- bool GetService(bool get_stub);
+ bool Fuzz(FunctionSpecificationMessage* func_msg, void** result, const string& callback_socket_name);
+ bool CallFunction(const FunctionSpecificationMessage& func_msg, const string& callback_socket_name, FunctionSpecificationMessage* result_msg);
+ bool VerifyResults(const FunctionSpecificationMessage& expected_result, const FunctionSpecificationMessage& actual_result);
+ bool GetAttribute(FunctionSpecificationMessage* func_msg, void** result);
+ bool GetService(bool get_stub, const char* service_name);
private:
sp<INfc> hw_binder_proxy_;
};
+
extern "C" {
-extern android::vts::FuzzerBase*
-vts_func_4_android_hardware_nfc_1_(
-);
+extern android::vts::FuzzerBase* vts_func_4_android_hardware_nfc_1_();
}
} // namespace vts
} // namespace android
diff --git a/sysfuzzer/vtscompiler/test/golden/DRIVER/hardware/interfaces/nfc/1.0/vts/NfcClientCallback.vts.h b/sysfuzzer/vtscompiler/test/golden/DRIVER/hardware/interfaces/nfc/1.0/vts/NfcClientCallback.vts.h
index 5ed2995..ec666a8 100644
--- a/sysfuzzer/vtscompiler/test/golden/DRIVER/hardware/interfaces/nfc/1.0/vts/NfcClientCallback.vts.h
+++ b/sysfuzzer/vtscompiler/test/golden/DRIVER/hardware/interfaces/nfc/1.0/vts/NfcClientCallback.vts.h
@@ -1,25 +1,27 @@
-#ifndef __VTS_SPEC_NfcClientCallback.driver__
-#define __VTS_SPEC_NfcClientCallback.driver__
+#ifndef __VTS_SPEC_android_hardware_nfc_NfcClientCallback.driver__
+#define __VTS_SPEC_android_hardware_nfc_NfcClientCallback.driver__
+
+#define LOG_TAG "FuzzerExtended_INfcClientCallback"
+
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
-#define LOG_TAG "FuzzerExtended_INfcClientCallback"
#include <utils/Log.h>
#include <fuzz_tester/FuzzerBase.h>
#include <fuzz_tester/FuzzerCallbackBase.h>
+
+
#include <android/hardware/nfc/1.0/INfcClientCallback.h>
#include <android/hardware/nfc/1.0/INfcClientCallback.h>
#include <hidl/HidlSupport.h>
-
using namespace android::hardware::nfc::V1_0;
namespace android {
namespace vts {
-
class VtsNfcClientCallback: public INfcClientCallback {
public:
VtsNfcClientCallback() {};
@@ -35,7 +37,9 @@
};
-VtsNfcClientCallback* VtsFuzzerCreateINfcClientCallback(const string& callback_socket_name);
+sp<INfcClientCallback> VtsFuzzerCreateINfcClientCallback(const string& callback_socket_name);
+
+
} // namespace vts
} // namespace android
diff --git a/sysfuzzer/vtscompiler/test/golden/DRIVER/hardware/interfaces/nfc/1.0/vts/types.vts.h b/sysfuzzer/vtscompiler/test/golden/DRIVER/hardware/interfaces/nfc/1.0/vts/types.vts.h
index c7cb4e8..ff338fe 100644
--- a/sysfuzzer/vtscompiler/test/golden/DRIVER/hardware/interfaces/nfc/1.0/vts/types.vts.h
+++ b/sysfuzzer/vtscompiler/test/golden/DRIVER/hardware/interfaces/nfc/1.0/vts/types.vts.h
@@ -1,24 +1,36 @@
-#ifndef __VTS_SPEC_types.driver__
-#define __VTS_SPEC_types.driver__
+#ifndef __VTS_SPEC_android_hardware_nfc_types.driver__
+#define __VTS_SPEC_android_hardware_nfc_types.driver__
+
+#define LOG_TAG "FuzzerExtended_types"
+
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
-#define LOG_TAG "FuzzerExtended_types"
#include <utils/Log.h>
#include <fuzz_tester/FuzzerBase.h>
#include <fuzz_tester/FuzzerCallbackBase.h>
+
+
#include <android/hardware/nfc/1.0/types.h>
#include <hidl/HidlSupport.h>
-
using namespace android::hardware::nfc::V1_0;
namespace android {
namespace vts {
+::android::hardware::nfc::V1_0::NfcEvent EnumValue__android__hardware__nfc__V1_0__NfcEvent(const ScalarDataValueMessage& arg);
+
::android::hardware::nfc::V1_0::NfcEvent Random__android__hardware__nfc__V1_0__NfcEvent();
+::android::hardware::nfc::V1_0::NfcStatus EnumValue__android__hardware__nfc__V1_0__NfcStatus(const ScalarDataValueMessage& arg);
+
::android::hardware::nfc::V1_0::NfcStatus Random__android__hardware__nfc__V1_0__NfcStatus();
+bool Verify__android__hardware__nfc__V1_0__NfcEvent(const VariableSpecificationMessage& expected_result, const VariableSpecificationMessage& actual_result);
+void SetResult__android__hardware__nfc__V1_0__NfcEvent(VariableSpecificationMessage* result_msg, ::android::hardware::nfc::V1_0::NfcEvent result_value);
+bool Verify__android__hardware__nfc__V1_0__NfcStatus(const VariableSpecificationMessage& expected_result, const VariableSpecificationMessage& actual_result);
+void SetResult__android__hardware__nfc__V1_0__NfcStatus(VariableSpecificationMessage* result_msg, ::android::hardware::nfc::V1_0::NfcStatus result_value);
+
} // namespace vts
} // namespace android
diff --git a/sysfuzzer/vtscompiler/test/golden/DRIVER/libcV1.driver.cpp b/sysfuzzer/vtscompiler/test/golden/DRIVER/libcV1.driver.cpp
new file mode 100644
index 0000000..9825a50
--- /dev/null
+++ b/sysfuzzer/vtscompiler/test/golden/DRIVER/libcV1.driver.cpp
@@ -0,0 +1,217 @@
+#include "test/vts/specification/lib_bionic/libcV1.vts.h"
+#include <unistd.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include <linux/socket.h>
+#include "vts_datatype.h"
+#include "vts_measurement.h"
+#include <iostream>
+
+
+namespace android {
+namespace vts {
+bool FuzzerExtended_libc::Fuzz(
+ FunctionSpecificationMessage* func_msg,
+ void** result, const string& callback_socket_name) {
+ const char* func_name = func_msg->name().c_str();
+ cout << "Function: " << func_name << endl;
+ if (!strcmp(func_name, "socket")) {
+ int32_t arg0 = (func_msg->arg(0).type() == TYPE_SCALAR && func_msg->arg(0).scalar_value().has_int32_t()) ? func_msg->arg(0).scalar_value().int32_t() : RandomInt32();
+ cout << "arg0 = " << arg0 << endl;
+ int32_t arg1 = (func_msg->arg(1).type() == TYPE_SCALAR && func_msg->arg(1).scalar_value().has_int32_t()) ? func_msg->arg(1).scalar_value().int32_t() : RandomInt32();
+ cout << "arg1 = " << arg1 << endl;
+ int32_t arg2 = (func_msg->arg(2).type() == TYPE_SCALAR && func_msg->arg(2).scalar_value().has_int32_t()) ? func_msg->arg(2).scalar_value().int32_t() : RandomInt32();
+ cout << "arg2 = " << arg2 << endl;
+ typedef void* (*func_type_socket)(...);
+ *result = const_cast<void*>(reinterpret_cast<const void*>( ((func_type_socket) target_loader_.GetLoaderFunction("socket"))(
+ arg0,
+ arg1,
+ arg2)));
+ return true;
+ }
+ if (!strcmp(func_name, "accept")) {
+ int32_t arg0 = (func_msg->arg(0).type() == TYPE_SCALAR && func_msg->arg(0).scalar_value().has_int32_t()) ? func_msg->arg(0).scalar_value().int32_t() : RandomInt32();
+ cout << "arg0 = " << arg0 << endl;
+ struct sockaddr* arg1 = (struct sockaddr*) malloc(sizeof(struct sockaddr));
+ cout << "arg1 = " << arg1 << endl;
+ socklen_t* arg2 = (socklen_t*) malloc(sizeof(socklen_t));
+ cout << "arg2 = " << arg2 << endl;
+ typedef void* (*func_type_accept)(...);
+ *result = const_cast<void*>(reinterpret_cast<const void*>( ((func_type_accept) target_loader_.GetLoaderFunction("accept"))(
+ arg0,
+ arg1,
+ arg2)));
+ return true;
+ }
+ if (!strcmp(func_name, "bind")) {
+ int32_t arg0 = (func_msg->arg(0).type() == TYPE_SCALAR && func_msg->arg(0).scalar_value().has_int32_t()) ? func_msg->arg(0).scalar_value().int32_t() : RandomInt32();
+ cout << "arg0 = " << arg0 << endl;
+ struct sockaddr* arg1 = (struct sockaddr*) malloc(sizeof(struct sockaddr));
+ cout << "arg1 = " << arg1 << endl;
+ socklen_t* arg2 = (socklen_t*) malloc(sizeof(socklen_t));
+ cout << "arg2 = " << arg2 << endl;
+ typedef void* (*func_type_bind)(...);
+ *result = const_cast<void*>(reinterpret_cast<const void*>( ((func_type_bind) target_loader_.GetLoaderFunction("bind"))(
+ arg0,
+ arg1,
+ arg2)));
+ return true;
+ }
+ if (!strcmp(func_name, "connect")) {
+ int32_t arg0 = (func_msg->arg(0).type() == TYPE_SCALAR && func_msg->arg(0).scalar_value().has_int32_t()) ? func_msg->arg(0).scalar_value().int32_t() : RandomInt32();
+ cout << "arg0 = " << arg0 << endl;
+ struct sockaddr* arg1 = (struct sockaddr*) malloc(sizeof(struct sockaddr));
+ cout << "arg1 = " << arg1 << endl;
+ socklen_t* arg2 = (socklen_t*) malloc(sizeof(socklen_t));
+ cout << "arg2 = " << arg2 << endl;
+ typedef void* (*func_type_connect)(...);
+ *result = const_cast<void*>(reinterpret_cast<const void*>( ((func_type_connect) target_loader_.GetLoaderFunction("connect"))(
+ arg0,
+ arg1,
+ arg2)));
+ return true;
+ }
+ if (!strcmp(func_name, "listen")) {
+ int32_t arg0 = (func_msg->arg(0).type() == TYPE_SCALAR && func_msg->arg(0).scalar_value().has_int32_t()) ? func_msg->arg(0).scalar_value().int32_t() : RandomInt32();
+ cout << "arg0 = " << arg0 << endl;
+ int32_t arg1 = (func_msg->arg(1).type() == TYPE_SCALAR && func_msg->arg(1).scalar_value().has_int32_t()) ? func_msg->arg(1).scalar_value().int32_t() : RandomInt32();
+ cout << "arg1 = " << arg1 << endl;
+ typedef void* (*func_type_listen)(...);
+ *result = const_cast<void*>(reinterpret_cast<const void*>( ((func_type_listen) target_loader_.GetLoaderFunction("listen"))(
+ arg0,
+ arg1)));
+ return true;
+ }
+ if (!strcmp(func_name, "recv")) {
+ int32_t arg0 = (func_msg->arg(0).type() == TYPE_SCALAR && func_msg->arg(0).scalar_value().has_int32_t()) ? func_msg->arg(0).scalar_value().int32_t() : RandomInt32();
+ cout << "arg0 = " << arg0 << endl;
+ void* arg1 = (func_msg->arg(1).type() == TYPE_SCALAR && func_msg->arg(1).scalar_value().has_void_pointer()) ? reinterpret_cast<void*>(func_msg->arg(1).scalar_value().void_pointer()) : RandomVoidPointer();
+ cout << "arg1 = " << arg1 << endl;
+ uint32_t arg2 = (func_msg->arg(2).type() == TYPE_SCALAR && func_msg->arg(2).scalar_value().has_uint32_t()) ? func_msg->arg(2).scalar_value().uint32_t() : RandomUint32();
+ cout << "arg2 = " << arg2 << endl;
+ int32_t arg3 = (func_msg->arg(3).type() == TYPE_SCALAR && func_msg->arg(3).scalar_value().has_int32_t()) ? func_msg->arg(3).scalar_value().int32_t() : RandomInt32();
+ cout << "arg3 = " << arg3 << endl;
+ typedef void* (*func_type_recv)(...);
+ *result = const_cast<void*>(reinterpret_cast<const void*>( ((func_type_recv) target_loader_.GetLoaderFunction("recv"))(
+ arg0,
+ arg1,
+ arg2,
+ arg3)));
+ return true;
+ }
+ if (!strcmp(func_name, "send")) {
+ int32_t arg0 = (func_msg->arg(0).type() == TYPE_SCALAR && func_msg->arg(0).scalar_value().has_int32_t()) ? func_msg->arg(0).scalar_value().int32_t() : RandomInt32();
+ cout << "arg0 = " << arg0 << endl;
+ void* arg1 = (func_msg->arg(1).type() == TYPE_SCALAR && func_msg->arg(1).scalar_value().has_void_pointer()) ? reinterpret_cast<void*>(func_msg->arg(1).scalar_value().void_pointer()) : RandomVoidPointer();
+ cout << "arg1 = " << arg1 << endl;
+ uint32_t arg2 = (func_msg->arg(2).type() == TYPE_SCALAR && func_msg->arg(2).scalar_value().has_uint32_t()) ? func_msg->arg(2).scalar_value().uint32_t() : RandomUint32();
+ cout << "arg2 = " << arg2 << endl;
+ int32_t arg3 = (func_msg->arg(3).type() == TYPE_SCALAR && func_msg->arg(3).scalar_value().has_int32_t()) ? func_msg->arg(3).scalar_value().int32_t() : RandomInt32();
+ cout << "arg3 = " << arg3 << endl;
+ typedef void* (*func_type_send)(...);
+ *result = const_cast<void*>(reinterpret_cast<const void*>( ((func_type_send) target_loader_.GetLoaderFunction("send"))(
+ arg0,
+ arg1,
+ arg2,
+ arg3)));
+ return true;
+ }
+ if (!strcmp(func_name, "fopen")) {
+ char arg0[func_msg->arg(0).string_value().length() + 1];
+ if (func_msg->arg(0).type() == TYPE_SCALAR && func_msg->arg(0).string_value().has_message()) {
+ strcpy(arg0, func_msg->arg(0).string_value().message().c_str());
+ } else {
+ strcpy(arg0, RandomCharPointer());
+ }
+ ;
+ cout << "arg0 = " << arg0 << endl;
+ char arg1[func_msg->arg(1).string_value().length() + 1];
+ if (func_msg->arg(1).type() == TYPE_SCALAR && func_msg->arg(1).string_value().has_message()) {
+ strcpy(arg1, func_msg->arg(1).string_value().message().c_str());
+ } else {
+ strcpy(arg1, RandomCharPointer());
+ }
+ ;
+ cout << "arg1 = " << arg1 << endl;
+ typedef void* (*func_type_fopen)(...);
+ *result = const_cast<void*>(reinterpret_cast<const void*>( ((func_type_fopen) target_loader_.GetLoaderFunction("fopen"))(
+ arg0,
+ arg1)));
+ return true;
+ }
+ if (!strcmp(func_name, "read")) {
+ int32_t arg0 = (func_msg->arg(0).type() == TYPE_SCALAR && func_msg->arg(0).scalar_value().has_int32_t()) ? func_msg->arg(0).scalar_value().int32_t() : RandomInt32();
+ cout << "arg0 = " << arg0 << endl;
+ void* arg1 = (func_msg->arg(1).type() == TYPE_SCALAR && func_msg->arg(1).scalar_value().has_void_pointer()) ? reinterpret_cast<void*>(func_msg->arg(1).scalar_value().void_pointer()) : RandomVoidPointer();
+ cout << "arg1 = " << arg1 << endl;
+ uint32_t arg2 = (func_msg->arg(2).type() == TYPE_SCALAR && func_msg->arg(2).scalar_value().has_uint32_t()) ? func_msg->arg(2).scalar_value().uint32_t() : RandomUint32();
+ cout << "arg2 = " << arg2 << endl;
+ typedef void* (*func_type_read)(...);
+ *result = const_cast<void*>(reinterpret_cast<const void*>( ((func_type_read) target_loader_.GetLoaderFunction("read"))(
+ arg0,
+ arg1,
+ arg2)));
+ return true;
+ }
+ if (!strcmp(func_name, "write")) {
+ int32_t arg0 = (func_msg->arg(0).type() == TYPE_SCALAR && func_msg->arg(0).scalar_value().has_int32_t()) ? func_msg->arg(0).scalar_value().int32_t() : RandomInt32();
+ cout << "arg0 = " << arg0 << endl;
+ void* arg1 = (func_msg->arg(1).type() == TYPE_SCALAR && func_msg->arg(1).scalar_value().has_void_pointer()) ? reinterpret_cast<void*>(func_msg->arg(1).scalar_value().void_pointer()) : RandomVoidPointer();
+ cout << "arg1 = " << arg1 << endl;
+ int32_t arg2 = (func_msg->arg(2).type() == TYPE_SCALAR && func_msg->arg(2).scalar_value().has_int32_t()) ? func_msg->arg(2).scalar_value().int32_t() : RandomInt32();
+ cout << "arg2 = " << arg2 << endl;
+ typedef void* (*func_type_write)(...);
+ *result = const_cast<void*>(reinterpret_cast<const void*>( ((func_type_write) target_loader_.GetLoaderFunction("write"))(
+ arg0,
+ arg1,
+ arg2)));
+ return true;
+ }
+ if (!strcmp(func_name, "lseek")) {
+ int32_t arg0 = (func_msg->arg(0).type() == TYPE_SCALAR && func_msg->arg(0).scalar_value().has_int32_t()) ? func_msg->arg(0).scalar_value().int32_t() : RandomInt32();
+ cout << "arg0 = " << arg0 << endl;
+ int32_t arg1 = (func_msg->arg(1).type() == TYPE_SCALAR && func_msg->arg(1).scalar_value().has_int32_t()) ? func_msg->arg(1).scalar_value().int32_t() : RandomInt32();
+ cout << "arg1 = " << arg1 << endl;
+ int32_t arg2 = (func_msg->arg(2).type() == TYPE_SCALAR && func_msg->arg(2).scalar_value().has_int32_t()) ? func_msg->arg(2).scalar_value().int32_t() : RandomInt32();
+ cout << "arg2 = " << arg2 << endl;
+ typedef void* (*func_type_lseek)(...);
+ *result = const_cast<void*>(reinterpret_cast<const void*>( ((func_type_lseek) target_loader_.GetLoaderFunction("lseek"))(
+ arg0,
+ arg1,
+ arg2)));
+ return true;
+ }
+ if (!strcmp(func_name, "close")) {
+ int32_t arg0 = (func_msg->arg(0).type() == TYPE_SCALAR && func_msg->arg(0).scalar_value().has_int32_t()) ? func_msg->arg(0).scalar_value().int32_t() : RandomInt32();
+ cout << "arg0 = " << arg0 << endl;
+ typedef void* (*func_type_close)(...);
+ *result = const_cast<void*>(reinterpret_cast<const void*>( ((func_type_close) target_loader_.GetLoaderFunction("close"))(
+ arg0)));
+ return true;
+ }
+ return false;
+}
+bool FuzzerExtended_libc::GetAttribute(
+ FunctionSpecificationMessage* func_msg,
+ void** result) {
+ const char* func_name = func_msg->name().c_str();
+ cout << "Function: " << __func__ << " '" << func_name << "'" << endl;
+ cerr << "attribute not supported for shared lib yet" << endl;
+ return false;
+}
+bool FuzzerExtended_libc::CallFunction(const FunctionSpecificationMessage&, const string&, FunctionSpecificationMessage* ) {
+ /* No implementation yet. */
+ return true;
+}
+bool FuzzerExtended_libc::VerifyResults(const FunctionSpecificationMessage&, const FunctionSpecificationMessage&) {
+ /* No implementation yet. */
+ return true;
+}
+extern "C" {
+android::vts::FuzzerBase* vts_func_11_1002_1_() {
+ return (android::vts::FuzzerBase*) new android::vts::FuzzerExtended_libc();
+}
+
+}
+} // namespace vts
+} // namespace android
diff --git a/sysfuzzer/vtscompiler/test/golden/DRIVER/test/vts/specification/hal_conventional/BluetoothHalV1.vts.h b/sysfuzzer/vtscompiler/test/golden/DRIVER/test/vts/specification/hal_conventional/BluetoothHalV1.vts.h
new file mode 100644
index 0000000..1bf1523
--- /dev/null
+++ b/sysfuzzer/vtscompiler/test/golden/DRIVER/test/vts/specification/hal_conventional/BluetoothHalV1.vts.h
@@ -0,0 +1,37 @@
+#ifndef __VTS_SPEC__BluetoothHalV1.driver__
+#define __VTS_SPEC__BluetoothHalV1.driver__
+
+#define LOG_TAG "FuzzerExtended_bluetooth_module_t"
+#include <hardware/hardware.h>
+#include <hardware/bluetooth.h>
+
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <utils/Log.h>
+#include <fuzz_tester/FuzzerBase.h>
+#include <fuzz_tester/FuzzerCallbackBase.h>
+
+
+namespace android {
+namespace vts {
+class FuzzerExtended_bluetooth_module_t : public FuzzerBase {
+ public:
+ FuzzerExtended_bluetooth_module_t() : FuzzerBase(HAL_CONVENTIONAL) {}
+ protected:
+ bool Fuzz(FunctionSpecificationMessage* func_msg, void** result, const string& callback_socket_name);
+ bool CallFunction(const FunctionSpecificationMessage& func_msg, const string& callback_socket_name, FunctionSpecificationMessage* result_msg);
+ bool VerifyResults(const FunctionSpecificationMessage& expected_result, const FunctionSpecificationMessage& actual_result);
+ bool GetAttribute(FunctionSpecificationMessage* func_msg, void** result);
+ private:
+};
+
+
+extern "C" {
+extern android::vts::FuzzerBase* vts_func_1_7_1_();
+}
+} // namespace vts
+} // namespace android
+#endif
diff --git a/sysfuzzer/vtscompiler/test/golden/DRIVER/test/vts/specification/hal_conventional/BluetoothHalV1bt_interface_t.vts.h b/sysfuzzer/vtscompiler/test/golden/DRIVER/test/vts/specification/hal_conventional/BluetoothHalV1bt_interface_t.vts.h
new file mode 100644
index 0000000..96bc2c2
--- /dev/null
+++ b/sysfuzzer/vtscompiler/test/golden/DRIVER/test/vts/specification/hal_conventional/BluetoothHalV1bt_interface_t.vts.h
@@ -0,0 +1,42 @@
+#ifndef __VTS_SPEC__BluetoothHalV1bt_interface_t.driver__
+#define __VTS_SPEC__BluetoothHalV1bt_interface_t.driver__
+
+#define LOG_TAG "FuzzerExtended_bt_interface_t"
+#include <hardware/hardware.h>
+#include <hardware/bluetooth.h>
+
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <utils/Log.h>
+#include <fuzz_tester/FuzzerBase.h>
+#include <fuzz_tester/FuzzerCallbackBase.h>
+
+
+namespace android {
+namespace vts {
+class FuzzerExtended_bt_interface_t : public FuzzerBase {
+ public:
+ FuzzerExtended_bt_interface_t() : FuzzerBase(HAL_CONVENTIONAL_SUBMODULE) {}
+ protected:
+ bool Fuzz(FunctionSpecificationMessage* func_msg, void** result, const string& callback_socket_name);
+ bool CallFunction(const FunctionSpecificationMessage& func_msg, const string& callback_socket_name, FunctionSpecificationMessage* result_msg);
+ bool VerifyResults(const FunctionSpecificationMessage& expected_result, const FunctionSpecificationMessage& actual_result);
+ bool GetAttribute(FunctionSpecificationMessage* func_msg, void** result);
+ void SetSubModule(bt_interface_t* submodule) {
+ submodule_ = submodule;
+ }
+
+ private:
+ bt_interface_t* submodule_;
+};
+
+
+extern "C" {
+extern android::vts::FuzzerBase* vts_func_2_7_1_();
+}
+} // namespace vts
+} // namespace android
+#endif
diff --git a/sysfuzzer/vtscompiler/test/golden/DRIVER/test/vts/specification/hal_conventional/WifiHalV1.vts.h b/sysfuzzer/vtscompiler/test/golden/DRIVER/test/vts/specification/hal_conventional/WifiHalV1.vts.h
new file mode 100644
index 0000000..2975f08
--- /dev/null
+++ b/sysfuzzer/vtscompiler/test/golden/DRIVER/test/vts/specification/hal_conventional/WifiHalV1.vts.h
@@ -0,0 +1,37 @@
+#ifndef __VTS_SPEC__WifiHalV1.driver__
+#define __VTS_SPEC__WifiHalV1.driver__
+
+#define LOG_TAG "FuzzerExtended_wifi"
+#include <hardware/hardware.h>
+#include <hardware_legacy/wifi_hal.h>
+
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <utils/Log.h>
+#include <fuzz_tester/FuzzerBase.h>
+#include <fuzz_tester/FuzzerCallbackBase.h>
+
+
+namespace android {
+namespace vts {
+class FuzzerExtended_wifi : public FuzzerBase {
+ public:
+ FuzzerExtended_wifi() : FuzzerBase(HAL_LEGACY) {}
+ protected:
+ bool Fuzz(FunctionSpecificationMessage* func_msg, void** result, const string& callback_socket_name);
+ bool CallFunction(const FunctionSpecificationMessage& func_msg, const string& callback_socket_name, FunctionSpecificationMessage* result_msg);
+ bool VerifyResults(const FunctionSpecificationMessage& expected_result, const FunctionSpecificationMessage& actual_result);
+ bool GetAttribute(FunctionSpecificationMessage* func_msg, void** result);
+ private:
+};
+
+
+extern "C" {
+extern android::vts::FuzzerBase* vts_func_3_5_1_();
+}
+} // namespace vts
+} // namespace android
+#endif
diff --git a/sysfuzzer/vtscompiler/test/golden/DRIVER/test/vts/specification/lib_bionic/libcV1.vts.h b/sysfuzzer/vtscompiler/test/golden/DRIVER/test/vts/specification/lib_bionic/libcV1.vts.h
new file mode 100644
index 0000000..bdf97d9
--- /dev/null
+++ b/sysfuzzer/vtscompiler/test/golden/DRIVER/test/vts/specification/lib_bionic/libcV1.vts.h
@@ -0,0 +1,39 @@
+#ifndef __VTS_SPEC__libcV1.driver__
+#define __VTS_SPEC__libcV1.driver__
+
+#define LOG_TAG "FuzzerExtended_libc"
+#include <unistd.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include <linux/socket.h>
+
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <utils/Log.h>
+#include <fuzz_tester/FuzzerBase.h>
+#include <fuzz_tester/FuzzerCallbackBase.h>
+
+
+namespace android {
+namespace vts {
+class FuzzerExtended_libc : public FuzzerBase {
+ public:
+ FuzzerExtended_libc() : FuzzerBase(LIB_SHARED) {}
+ protected:
+ bool Fuzz(FunctionSpecificationMessage* func_msg, void** result, const string& callback_socket_name);
+ bool CallFunction(const FunctionSpecificationMessage& func_msg, const string& callback_socket_name, FunctionSpecificationMessage* result_msg);
+ bool VerifyResults(const FunctionSpecificationMessage& expected_result, const FunctionSpecificationMessage& actual_result);
+ bool GetAttribute(FunctionSpecificationMessage* func_msg, void** result);
+ private:
+};
+
+
+extern "C" {
+extern android::vts::FuzzerBase* vts_func_11_1002_1_();
+}
+} // namespace vts
+} // namespace android
+#endif
diff --git a/sysfuzzer/vtscompiler/test/golden/DRIVER/types.driver.cpp b/sysfuzzer/vtscompiler/test/golden/DRIVER/types.driver.cpp
index 3f55471..b6a6f17 100644
--- a/sysfuzzer/vtscompiler/test/golden/DRIVER/types.driver.cpp
+++ b/sysfuzzer/vtscompiler/test/golden/DRIVER/types.driver.cpp
@@ -1,41 +1,61 @@
#include "hardware/interfaces/nfc/1.0/vts/types.vts.h"
-#include <hidl/HidlSupport.h>
-#include <iostream>
#include "vts_datatype.h"
#include "vts_measurement.h"
+#include <iostream>
#include <hidl/HidlSupport.h>
#include <android/hardware/nfc/1.0/types.h>
+
+
using namespace android::hardware::nfc::V1_0;
namespace android {
namespace vts {
-
-
-
-::android::hardware::nfc::V1_0::NfcEvent EnumValue__android__hardware__nfc__V1_0__NfcEvent(const EnumDataValueMessage& arg) {
- return (::android::hardware::nfc::V1_0::NfcEvent) arg.scalar_value(0).uint32_t();
+::android::hardware::nfc::V1_0::NfcEvent EnumValue__android__hardware__nfc__V1_0__NfcEvent(const ScalarDataValueMessage& arg) {
+ return (::android::hardware::nfc::V1_0::NfcEvent) arg.uint32_t();
}
::android::hardware::nfc::V1_0::NfcEvent Random__android__hardware__nfc__V1_0__NfcEvent() {
-uint32_t choice = (uint32_t) rand() / 7;
-if (choice == (uint32_t) 0) return ::android::hardware::nfc::V1_0::NfcEvent::OPEN_CPLT;
-if (choice == (uint32_t) 1) return ::android::hardware::nfc::V1_0::NfcEvent::CLOSE_CPLT;
-if (choice == (uint32_t) 2) return ::android::hardware::nfc::V1_0::NfcEvent::POST_INIT_CPLT;
-if (choice == (uint32_t) 3) return ::android::hardware::nfc::V1_0::NfcEvent::PRE_DISCOVER_CPLT;
-if (choice == (uint32_t) 4) return ::android::hardware::nfc::V1_0::NfcEvent::REQUEST_CONTROL;
-if (choice == (uint32_t) 5) return ::android::hardware::nfc::V1_0::NfcEvent::RELEASE_CONTROL;
-if (choice == (uint32_t) 6) return ::android::hardware::nfc::V1_0::NfcEvent::ERROR;
+ uint32_t choice = (uint32_t) rand() / 7;
+ if (choice == (uint32_t) 0) return ::android::hardware::nfc::V1_0::NfcEvent::OPEN_CPLT;
+ if (choice == (uint32_t) 1) return ::android::hardware::nfc::V1_0::NfcEvent::CLOSE_CPLT;
+ if (choice == (uint32_t) 2) return ::android::hardware::nfc::V1_0::NfcEvent::POST_INIT_CPLT;
+ if (choice == (uint32_t) 3) return ::android::hardware::nfc::V1_0::NfcEvent::PRE_DISCOVER_CPLT;
+ if (choice == (uint32_t) 4) return ::android::hardware::nfc::V1_0::NfcEvent::REQUEST_CONTROL;
+ if (choice == (uint32_t) 5) return ::android::hardware::nfc::V1_0::NfcEvent::RELEASE_CONTROL;
+ if (choice == (uint32_t) 6) return ::android::hardware::nfc::V1_0::NfcEvent::ERROR;
return ::android::hardware::nfc::V1_0::NfcEvent::OPEN_CPLT;
}
-::android::hardware::nfc::V1_0::NfcStatus EnumValue__android__hardware__nfc__V1_0__NfcStatus(const EnumDataValueMessage& arg) {
- return (::android::hardware::nfc::V1_0::NfcStatus) arg.scalar_value(0).uint32_t();
+bool Verify__android__hardware__nfc__V1_0__NfcEvent(const VariableSpecificationMessage& expected_result, const VariableSpecificationMessage& actual_result){
+ if (actual_result.scalar_value().uint32_t() != expected_result.scalar_value().uint32_t()) { return false; }
+ return true;
+}
+
+void SetResult__android__hardware__nfc__V1_0__NfcEvent(VariableSpecificationMessage* result_msg, ::android::hardware::nfc::V1_0::NfcEvent result_value){
+ result_msg->set_type(TYPE_ENUM);
+ result_msg->set_scalar_type("uint32_t");
+ result_msg->mutable_scalar_value()->set_uint32_t(static_cast<uint32_t>(result_value));
+}
+
+::android::hardware::nfc::V1_0::NfcStatus EnumValue__android__hardware__nfc__V1_0__NfcStatus(const ScalarDataValueMessage& arg) {
+ return (::android::hardware::nfc::V1_0::NfcStatus) arg.uint32_t();
}
::android::hardware::nfc::V1_0::NfcStatus Random__android__hardware__nfc__V1_0__NfcStatus() {
-uint32_t choice = (uint32_t) rand() / 5;
-if (choice == (uint32_t) 0) return ::android::hardware::nfc::V1_0::NfcStatus::OK;
-if (choice == (uint32_t) 1) return ::android::hardware::nfc::V1_0::NfcStatus::FAILED;
-if (choice == (uint32_t) 2) return ::android::hardware::nfc::V1_0::NfcStatus::ERR_TRANSPORT;
-if (choice == (uint32_t) 3) return ::android::hardware::nfc::V1_0::NfcStatus::ERR_CMD_TIMEOUT;
-if (choice == (uint32_t) 4) return ::android::hardware::nfc::V1_0::NfcStatus::REFUSED;
+ uint32_t choice = (uint32_t) rand() / 5;
+ if (choice == (uint32_t) 0) return ::android::hardware::nfc::V1_0::NfcStatus::OK;
+ if (choice == (uint32_t) 1) return ::android::hardware::nfc::V1_0::NfcStatus::FAILED;
+ if (choice == (uint32_t) 2) return ::android::hardware::nfc::V1_0::NfcStatus::ERR_TRANSPORT;
+ if (choice == (uint32_t) 3) return ::android::hardware::nfc::V1_0::NfcStatus::ERR_CMD_TIMEOUT;
+ if (choice == (uint32_t) 4) return ::android::hardware::nfc::V1_0::NfcStatus::REFUSED;
return ::android::hardware::nfc::V1_0::NfcStatus::OK;
}
+bool Verify__android__hardware__nfc__V1_0__NfcStatus(const VariableSpecificationMessage& expected_result, const VariableSpecificationMessage& actual_result){
+ if (actual_result.scalar_value().uint32_t() != expected_result.scalar_value().uint32_t()) { return false; }
+ return true;
+}
+
+void SetResult__android__hardware__nfc__V1_0__NfcStatus(VariableSpecificationMessage* result_msg, ::android::hardware::nfc::V1_0::NfcStatus result_value){
+ result_msg->set_type(TYPE_ENUM);
+ result_msg->set_scalar_type("uint32_t");
+ result_msg->mutable_scalar_value()->set_uint32_t(static_cast<uint32_t>(result_value));
+}
+
} // namespace vts
} // namespace android
diff --git a/sysfuzzer/vtscompiler/test/golden/PROFILER/Nfc.profiler.cpp b/sysfuzzer/vtscompiler/test/golden/PROFILER/Nfc.profiler.cpp
index b0feebd..d857c5f 100644
--- a/sysfuzzer/vtscompiler/test/golden/PROFILER/Nfc.profiler.cpp
+++ b/sysfuzzer/vtscompiler/test/golden/PROFILER/Nfc.profiler.cpp
@@ -44,27 +44,29 @@
switch (event) {
case HidlInstrumentor::CLIENT_API_ENTRY:
case HidlInstrumentor::SERVER_API_ENTRY:
+ case HidlInstrumentor::PASSTHROUGH_ENTRY:
{
if ((*args).size() != 1) {
LOG(ERROR) << "Number of arguments does not match. expect: 1, actual: " << (*args).size() << ", method name: open, event type: " << event;
break;
}
auto *arg_0 = msg.add_arg();
- INfcClientCallback *arg_val_0 = reinterpret_cast<INfcClientCallback*> ((*args)[0]);
+ sp<INfcClientCallback> *arg_val_0 = reinterpret_cast<sp<INfcClientCallback>*> ((*args)[0]);
arg_0->set_type(TYPE_HIDL_CALLBACK);
break;
}
case HidlInstrumentor::CLIENT_API_EXIT:
case HidlInstrumentor::SERVER_API_EXIT:
+ case HidlInstrumentor::PASSTHROUGH_EXIT:
{
if ((*args).size() != 1) {
LOG(ERROR) << "Number of return values does not match. expect: 1, actual: " << (*args).size() << ", method name: open, event type: " << event;
break;
}
auto *result_0 = msg.add_return_type_hidl();
- int32_t *result_val_0 = reinterpret_cast<int32_t*> ((*args)[0]);
- result_0->set_type(TYPE_SCALAR);
- result_0->mutable_scalar_value()->set_int32_t((*result_val_0));
+ ::android::hardware::nfc::V1_0::NfcStatus *result_val_0 = reinterpret_cast<::android::hardware::nfc::V1_0::NfcStatus*> ((*args)[0]);
+ result_0->set_type(TYPE_ENUM);
+ profile____android__hardware__nfc__V1_0__NfcStatus(result_0, (*result_val_0));
break;
}
default:
@@ -85,6 +87,7 @@
switch (event) {
case HidlInstrumentor::CLIENT_API_ENTRY:
case HidlInstrumentor::SERVER_API_ENTRY:
+ case HidlInstrumentor::PASSTHROUGH_ENTRY:
{
if ((*args).size() != 1) {
LOG(ERROR) << "Number of arguments does not match. expect: 1, actual: " << (*args).size() << ", method name: write, event type: " << event;
@@ -101,15 +104,16 @@
}
case HidlInstrumentor::CLIENT_API_EXIT:
case HidlInstrumentor::SERVER_API_EXIT:
+ case HidlInstrumentor::PASSTHROUGH_EXIT:
{
if ((*args).size() != 1) {
LOG(ERROR) << "Number of return values does not match. expect: 1, actual: " << (*args).size() << ", method name: write, event type: " << event;
break;
}
auto *result_0 = msg.add_return_type_hidl();
- int32_t *result_val_0 = reinterpret_cast<int32_t*> ((*args)[0]);
+ uint32_t *result_val_0 = reinterpret_cast<uint32_t*> ((*args)[0]);
result_0->set_type(TYPE_SCALAR);
- result_0->mutable_scalar_value()->set_int32_t((*result_val_0));
+ result_0->mutable_scalar_value()->set_uint32_t((*result_val_0));
break;
}
default:
@@ -130,6 +134,7 @@
switch (event) {
case HidlInstrumentor::CLIENT_API_ENTRY:
case HidlInstrumentor::SERVER_API_ENTRY:
+ case HidlInstrumentor::PASSTHROUGH_ENTRY:
{
if ((*args).size() != 1) {
LOG(ERROR) << "Number of arguments does not match. expect: 1, actual: " << (*args).size() << ", method name: coreInitialized, event type: " << event;
@@ -146,15 +151,16 @@
}
case HidlInstrumentor::CLIENT_API_EXIT:
case HidlInstrumentor::SERVER_API_EXIT:
+ case HidlInstrumentor::PASSTHROUGH_EXIT:
{
if ((*args).size() != 1) {
LOG(ERROR) << "Number of return values does not match. expect: 1, actual: " << (*args).size() << ", method name: coreInitialized, event type: " << event;
break;
}
auto *result_0 = msg.add_return_type_hidl();
- int32_t *result_val_0 = reinterpret_cast<int32_t*> ((*args)[0]);
- result_0->set_type(TYPE_SCALAR);
- result_0->mutable_scalar_value()->set_int32_t((*result_val_0));
+ ::android::hardware::nfc::V1_0::NfcStatus *result_val_0 = reinterpret_cast<::android::hardware::nfc::V1_0::NfcStatus*> ((*args)[0]);
+ result_0->set_type(TYPE_ENUM);
+ profile____android__hardware__nfc__V1_0__NfcStatus(result_0, (*result_val_0));
break;
}
default:
@@ -175,6 +181,7 @@
switch (event) {
case HidlInstrumentor::CLIENT_API_ENTRY:
case HidlInstrumentor::SERVER_API_ENTRY:
+ case HidlInstrumentor::PASSTHROUGH_ENTRY:
{
if ((*args).size() != 0) {
LOG(ERROR) << "Number of arguments does not match. expect: 0, actual: " << (*args).size() << ", method name: prediscover, event type: " << event;
@@ -184,15 +191,16 @@
}
case HidlInstrumentor::CLIENT_API_EXIT:
case HidlInstrumentor::SERVER_API_EXIT:
+ case HidlInstrumentor::PASSTHROUGH_EXIT:
{
if ((*args).size() != 1) {
LOG(ERROR) << "Number of return values does not match. expect: 1, actual: " << (*args).size() << ", method name: prediscover, event type: " << event;
break;
}
auto *result_0 = msg.add_return_type_hidl();
- int32_t *result_val_0 = reinterpret_cast<int32_t*> ((*args)[0]);
- result_0->set_type(TYPE_SCALAR);
- result_0->mutable_scalar_value()->set_int32_t((*result_val_0));
+ ::android::hardware::nfc::V1_0::NfcStatus *result_val_0 = reinterpret_cast<::android::hardware::nfc::V1_0::NfcStatus*> ((*args)[0]);
+ result_0->set_type(TYPE_ENUM);
+ profile____android__hardware__nfc__V1_0__NfcStatus(result_0, (*result_val_0));
break;
}
default:
@@ -213,6 +221,7 @@
switch (event) {
case HidlInstrumentor::CLIENT_API_ENTRY:
case HidlInstrumentor::SERVER_API_ENTRY:
+ case HidlInstrumentor::PASSTHROUGH_ENTRY:
{
if ((*args).size() != 0) {
LOG(ERROR) << "Number of arguments does not match. expect: 0, actual: " << (*args).size() << ", method name: close, event type: " << event;
@@ -222,15 +231,16 @@
}
case HidlInstrumentor::CLIENT_API_EXIT:
case HidlInstrumentor::SERVER_API_EXIT:
+ case HidlInstrumentor::PASSTHROUGH_EXIT:
{
if ((*args).size() != 1) {
LOG(ERROR) << "Number of return values does not match. expect: 1, actual: " << (*args).size() << ", method name: close, event type: " << event;
break;
}
auto *result_0 = msg.add_return_type_hidl();
- int32_t *result_val_0 = reinterpret_cast<int32_t*> ((*args)[0]);
- result_0->set_type(TYPE_SCALAR);
- result_0->mutable_scalar_value()->set_int32_t((*result_val_0));
+ ::android::hardware::nfc::V1_0::NfcStatus *result_val_0 = reinterpret_cast<::android::hardware::nfc::V1_0::NfcStatus*> ((*args)[0]);
+ result_0->set_type(TYPE_ENUM);
+ profile____android__hardware__nfc__V1_0__NfcStatus(result_0, (*result_val_0));
break;
}
default:
@@ -251,6 +261,7 @@
switch (event) {
case HidlInstrumentor::CLIENT_API_ENTRY:
case HidlInstrumentor::SERVER_API_ENTRY:
+ case HidlInstrumentor::PASSTHROUGH_ENTRY:
{
if ((*args).size() != 0) {
LOG(ERROR) << "Number of arguments does not match. expect: 0, actual: " << (*args).size() << ", method name: controlGranted, event type: " << event;
@@ -260,15 +271,16 @@
}
case HidlInstrumentor::CLIENT_API_EXIT:
case HidlInstrumentor::SERVER_API_EXIT:
+ case HidlInstrumentor::PASSTHROUGH_EXIT:
{
if ((*args).size() != 1) {
LOG(ERROR) << "Number of return values does not match. expect: 1, actual: " << (*args).size() << ", method name: controlGranted, event type: " << event;
break;
}
auto *result_0 = msg.add_return_type_hidl();
- int32_t *result_val_0 = reinterpret_cast<int32_t*> ((*args)[0]);
- result_0->set_type(TYPE_SCALAR);
- result_0->mutable_scalar_value()->set_int32_t((*result_val_0));
+ ::android::hardware::nfc::V1_0::NfcStatus *result_val_0 = reinterpret_cast<::android::hardware::nfc::V1_0::NfcStatus*> ((*args)[0]);
+ result_0->set_type(TYPE_ENUM);
+ profile____android__hardware__nfc__V1_0__NfcStatus(result_0, (*result_val_0));
break;
}
default:
@@ -289,6 +301,7 @@
switch (event) {
case HidlInstrumentor::CLIENT_API_ENTRY:
case HidlInstrumentor::SERVER_API_ENTRY:
+ case HidlInstrumentor::PASSTHROUGH_ENTRY:
{
if ((*args).size() != 0) {
LOG(ERROR) << "Number of arguments does not match. expect: 0, actual: " << (*args).size() << ", method name: powerCycle, event type: " << event;
@@ -298,15 +311,16 @@
}
case HidlInstrumentor::CLIENT_API_EXIT:
case HidlInstrumentor::SERVER_API_EXIT:
+ case HidlInstrumentor::PASSTHROUGH_EXIT:
{
if ((*args).size() != 1) {
LOG(ERROR) << "Number of return values does not match. expect: 1, actual: " << (*args).size() << ", method name: powerCycle, event type: " << event;
break;
}
auto *result_0 = msg.add_return_type_hidl();
- int32_t *result_val_0 = reinterpret_cast<int32_t*> ((*args)[0]);
- result_0->set_type(TYPE_SCALAR);
- result_0->mutable_scalar_value()->set_int32_t((*result_val_0));
+ ::android::hardware::nfc::V1_0::NfcStatus *result_val_0 = reinterpret_cast<::android::hardware::nfc::V1_0::NfcStatus*> ((*args)[0]);
+ result_0->set_type(TYPE_ENUM);
+ profile____android__hardware__nfc__V1_0__NfcStatus(result_0, (*result_val_0));
break;
}
default:
diff --git a/sysfuzzer/vtscompiler/test/golden/PROFILER/NfcClientCallback.profiler.cpp b/sysfuzzer/vtscompiler/test/golden/PROFILER/NfcClientCallback.profiler.cpp
index ef66b8a..12a0787 100644
--- a/sysfuzzer/vtscompiler/test/golden/PROFILER/NfcClientCallback.profiler.cpp
+++ b/sysfuzzer/vtscompiler/test/golden/PROFILER/NfcClientCallback.profiler.cpp
@@ -44,6 +44,7 @@
switch (event) {
case HidlInstrumentor::CLIENT_API_ENTRY:
case HidlInstrumentor::SERVER_API_ENTRY:
+ case HidlInstrumentor::PASSTHROUGH_ENTRY:
{
if ((*args).size() != 2) {
LOG(ERROR) << "Number of arguments does not match. expect: 2, actual: " << (*args).size() << ", method name: sendEvent, event type: " << event;
@@ -61,6 +62,7 @@
}
case HidlInstrumentor::CLIENT_API_EXIT:
case HidlInstrumentor::SERVER_API_EXIT:
+ case HidlInstrumentor::PASSTHROUGH_EXIT:
{
if ((*args).size() != 0) {
LOG(ERROR) << "Number of return values does not match. expect: 0, actual: " << (*args).size() << ", method name: sendEvent, event type: " << event;
@@ -86,6 +88,7 @@
switch (event) {
case HidlInstrumentor::CLIENT_API_ENTRY:
case HidlInstrumentor::SERVER_API_ENTRY:
+ case HidlInstrumentor::PASSTHROUGH_ENTRY:
{
if ((*args).size() != 1) {
LOG(ERROR) << "Number of arguments does not match. expect: 1, actual: " << (*args).size() << ", method name: sendData, event type: " << event;
@@ -102,6 +105,7 @@
}
case HidlInstrumentor::CLIENT_API_EXIT:
case HidlInstrumentor::SERVER_API_EXIT:
+ case HidlInstrumentor::PASSTHROUGH_EXIT:
{
if ((*args).size() != 0) {
LOG(ERROR) << "Number of return values does not match. expect: 0, actual: " << (*args).size() << ", method name: sendData, event type: " << event;
diff --git a/sysfuzzer/vtscompiler/test/golden/PROFILER/types.profiler.cpp b/sysfuzzer/vtscompiler/test/golden/PROFILER/types.profiler.cpp
index 47f44bd..10dda43 100644
--- a/sysfuzzer/vtscompiler/test/golden/PROFILER/types.profiler.cpp
+++ b/sysfuzzer/vtscompiler/test/golden/PROFILER/types.profiler.cpp
@@ -12,15 +12,15 @@
void profile____android__hardware__nfc__V1_0__NfcEvent(VariableSpecificationMessage* arg_name,
::android::hardware::nfc::V1_0::NfcEvent arg_val_name) {
arg_name->set_type(TYPE_ENUM);
- arg_name->mutable_enum_value()->add_scalar_value()->set_uint32_t(static_cast<uint32_t>(arg_val_name));
- arg_name->mutable_enum_value()->set_scalar_type("uint32_t");
+ arg_name->mutable_scalar_value()->set_uint32_t(static_cast<uint32_t>(arg_val_name));
+ arg_name->set_scalar_type("uint32_t");
}
void profile____android__hardware__nfc__V1_0__NfcStatus(VariableSpecificationMessage* arg_name,
::android::hardware::nfc::V1_0::NfcStatus arg_val_name) {
arg_name->set_type(TYPE_ENUM);
- arg_name->mutable_enum_value()->add_scalar_value()->set_uint32_t(static_cast<uint32_t>(arg_val_name));
- arg_name->mutable_enum_value()->set_scalar_type("uint32_t");
+ arg_name->mutable_scalar_value()->set_uint32_t(static_cast<uint32_t>(arg_val_name));
+ arg_name->set_scalar_type("uint32_t");
}
} // namespace vts
diff --git a/sysfuzzer/vtscompiler/test/test_vtsc.py b/sysfuzzer/vtscompiler/test/test_vtsc.py
index c423617..05c1ef7 100755
--- a/sysfuzzer/vtscompiler/test/test_vtsc.py
+++ b/sysfuzzer/vtscompiler/test/test_vtsc.py
@@ -26,6 +26,7 @@
from vts.utils.python.common import cmd_utils
+
class VtscTester(unittest.TestCase):
"""Integration test runner for vtsc in generating the driver/profiler code.
@@ -47,6 +48,7 @@
_output_dir: root directory that stores all output files.
_errors: number of errors generates during the test.
"""
+
def __init__(self, testName, vtsc_path, canonical_dir, output_dir):
super(VtscTester, self).__init__(testName)
self._vtsc_path = vtsc_path
@@ -72,18 +74,28 @@
def TestDriver(self):
"""Run tests for DRIVER mode. """
logging.info("Running TestDriver test case.")
+ #Tests for Hidl Hals.
for component_name in ["Nfc", "types", "NfcClientCallback"]:
+ self.RunTest("DRIVER", "hardware/interfaces/nfc/1.0/vts/%s.vts" %
+ component_name, "%s.driver.cpp" % component_name)
+ #Tests for conventional Hals.
+ for component_name in [
+ "BluetoothHalV1", "BluetoothHalV1bt_interface_t", "WifiHalV1"
+ ]:
self.RunTest("DRIVER",
- "hardware/interfaces/nfc/1.0/vts/%s.vts" % component_name,
- "%s.driver.cpp" % component_name)
+ "test/vts/specification/hal_conventional/%s.vts" %
+ component_name, "%s.driver.cpp" % component_name)
+ #Tests for shared libraries.
+ for component_name in ["libcV1"]:
+ self.RunTest("DRIVER", "test/vts/specification/lib_bionic/%s.vts" %
+ component_name, "%s.driver.cpp" % component_name)
def TestProfiler(self):
"""Run tests for PROFILER mode. """
logging.info("Running TestProfiler test case.")
for component_name in ["Nfc", "types", "NfcClientCallback"]:
- self.RunTest("PROFILER",
- "hardware/interfaces/nfc/1.0/vts/%s.vts" % component_name,
- "%s.profiler.cpp" % component_name)
+ self.RunTest("PROFILER", "hardware/interfaces/nfc/1.0/vts/%s.vts" %
+ component_name, "%s.profiler.cpp" % component_name)
def RunTest(self, mode, vts_file_path, source_file_name):
"""Run vtsc with given mode for the give vts file and compare the
@@ -94,9 +106,11 @@
vts_file_path: path of the input vts file.
source_file_name: name of the generated source file.
"""
- vtsc_cmd = [self._vtsc_path, "-m" + mode, vts_file_path,
- os.path.join(self._output_dir, mode),
- os.path.join(self._output_dir, mode, source_file_name)]
+ vtsc_cmd = [
+ self._vtsc_path, "-m" + mode, vts_file_path,
+ os.path.join(self._output_dir, mode),
+ os.path.join(self._output_dir, mode, source_file_name)
+ ]
return_code = cmd_utils.RunCommand(vtsc_cmd)
if (return_code != 0):
self.Error("Fail to execute command: %s" % vtsc_cmd)
@@ -107,10 +121,10 @@
output_header_file = os.path.join(self._output_dir, mode,
header_file_name)
- canonical_source_file = os.path.join(
- self._canonical_dir, mode, source_file_name)
- output_source_file = os.path.join(
- self._output_dir, mode, source_file_name)
+ canonical_source_file = os.path.join(self._canonical_dir, mode,
+ source_file_name)
+ output_source_file = os.path.join(self._output_dir, mode,
+ source_file_name)
self.CompareOutputFile(output_header_file, canonical_header_file)
self.CompareOutputFile(output_source_file, canonical_source_file)
@@ -123,20 +137,23 @@
output_file: name of the output file.
"""
if not os.path.isfile(canonical_file):
- self.Error("Generated unexpected file: %s (for %s)" % (output_file, canonical_file))
+ self.Error("Generated unexpected file: %s (for %s)" %
+ (output_file, canonical_file))
else:
if not filecmp.cmp(output_file, canonical_file):
- self.Error("output file: %s does not match the canonical_file: "
- "%s" % (output_file, canonical_file))
+ self.Error(
+ "output file: %s does not match the canonical_file: "
+ "%s" % (output_file, canonical_file))
self.PrintDiffFiles(output_file, canonical_file)
def PrintDiffFiles(self, output_file, canonical_file):
with open(output_file, 'r') as file1:
with open(canonical_file, 'r') as file2:
- diff = difflib.unified_diff(file1.readlines(),
- file2.readlines(),
- fromfile=output_file,
- tofile=canonical_file)
+ diff = difflib.unified_diff(
+ file1.readlines(),
+ file2.readlines(),
+ fromfile=output_file,
+ tofile=canonical_file)
for line in diff:
logging.error(line)
@@ -150,6 +167,7 @@
if os.path.exists(self._output_dir):
shutil.rmtree(self._output_dir)
+
if __name__ == "__main__":
# Default values of the input parameter, could be overridden by command.
vtsc_path = "vtsc"
@@ -171,7 +189,7 @@
elif opt == "-o":
output_dir = val
else:
- print "unhandled option %s" % (opt,)
+ print "unhandled option %s" % (opt, )
sys.exit(1)
suite = unittest.TestSuite()
diff --git a/testcases/README.md b/testcases/README.md
new file mode 100644
index 0000000..9f9192c
--- /dev/null
+++ b/testcases/README.md
@@ -0,0 +1,19 @@
+In principle, VTS test cases are co-located with their respective projects.
+
+* HIDL HAL Tests: `hardware/interfaces/<hal name>/<version>/vts`
+
+* Kernel Tests: `test/vts-testcase/kernel`
+
+ * LTP: `external/ltp`
+
+ * Linux Kselftest: `external/linux-kselftest`
+
+* Performance Tests: `test/vts-testcase/performance`
+
+* Fuzz Tests: `test/vts-testcase/fuzz`
+
+* Security Tests: `test/vts-testcase/security`
+
+The files under this directory (`test/vts/testcases`) are only for:
+VTS codelab, template, tests for legacy components, and tests that are
+under development and do not have any respective projects.
diff --git a/testcases/fuzz/hal_light/conventional/AndroidTest.xml b/testcases/fuzz/hal_light/conventional/AndroidTest.xml
index 99ab8ee..4fd35f6 100644
--- a/testcases/fuzz/hal_light/conventional/AndroidTest.xml
+++ b/testcases/fuzz/hal_light/conventional/AndroidTest.xml
@@ -29,6 +29,6 @@
</target_preparer>
<test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
<option name="test-case-path" value="vts/testcases/fuzz/hal_light/conventional/LightFuzzTest" />
- <option name="test-config-path" value="vts-config/testcases/fuzz/hal_light/conventional/LightFuzzTest.config" />
+ <option name="test-config-path" value="vts/testcases/fuzz/hal_light/conventional/LightFuzzTest.config" />
</test>
</configuration>
diff --git a/testcases/fuzz/hal_light/conventional_standalone/AndroidTest.xml b/testcases/fuzz/hal_light/conventional_standalone/AndroidTest.xml
index f891aa2..4889442 100644
--- a/testcases/fuzz/hal_light/conventional_standalone/AndroidTest.xml
+++ b/testcases/fuzz/hal_light/conventional_standalone/AndroidTest.xml
@@ -23,6 +23,6 @@
</target_preparer>
<test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
<option name="test-case-path" value="vts/testcases/fuzz/hal_light/conventional_standalone/StandaloneLightFuzzTest" />
- <option name="test-config-path" value="vts-config/testcases/fuzz/hal_light/conventional_standalone/StandaloneLightFuzzTest.config" />
+ <option name="test-config-path" value="vts/testcases/fuzz/hal_light/conventional_standalone/StandaloneLightFuzzTest.config" />
</test>
</configuration>
diff --git a/testcases/fuzz/hal_light/conventional_standalone/StandaloneLightFuzzTest.config b/testcases/fuzz/hal_light/conventional_standalone/StandaloneLightFuzzTest.config
index cbe1c9a..6ecb7ce 100644
--- a/testcases/fuzz/hal_light/conventional_standalone/StandaloneLightFuzzTest.config
+++ b/testcases/fuzz/hal_light/conventional_standalone/StandaloneLightFuzzTest.config
@@ -1,7 +1,12 @@
{
"gene_pool_size": 10,
"iteartion_count": 10,
- "modules": ["system/lib64/hw/lights.vts"],
- "git_project_path": "test/vts",
- "git_project_name": "platform/test/vts"
+ "coverage": true,
+ "modules": [{
+ "module_name": "system/lib64/hw/lights.vts",
+ "git_project": {
+ "name": "platform/test/vts",
+ "path": "test/vts"
+ }
+ }]
}
diff --git a/testcases/fuzz/lib_bionic/LibBionicLibmFuzzTest.xml b/testcases/fuzz/lib_bionic/LibBionicLibmFuzzTest.xml
index 5aa2dec..ab58c5f 100644
--- a/testcases/fuzz/lib_bionic/LibBionicLibmFuzzTest.xml
+++ b/testcases/fuzz/lib_bionic/LibBionicLibmFuzzTest.xml
@@ -15,7 +15,7 @@
-->
<configuration description="Runs VTS multi device test">
<test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-case-path" value="test/vts/testcases/host/sample/SampleLightTest" />
- <option name="test-config-path" value="test/vts/testcases/host/sample/SampleLightTest.config" />
+ <option name="test-case-path" value="vts/testcases/host/sample/SampleLightTest" />
+ <option name="test-config-path" value="vts/testcases/host/sample/SampleLightTest.config" />
</test>
</configuration>
diff --git a/testcases/hal/Android.mk b/testcases/hal/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/hal/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/hal/audio/Android.mk b/testcases/hal/audio/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/hal/audio/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/hal/audio/effect/Android.mk b/testcases/hal/audio/effect/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/hal/audio/effect/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/hal/audio/effect/hidl/Android.mk b/testcases/hal/audio/effect/hidl/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/hal/audio/effect/hidl/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/hal/audio/effect/hidl/target/Android.mk b/testcases/hal/audio/effect/hidl/target/Android.mk
deleted file mode 100644
index fe5ea0f..0000000
--- a/testcases/hal/audio/effect/hidl/target/Android.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# 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)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := HalAudioEffectHidlTargetBasicTest
-VTS_CONFIG_SRC_DIR := testcases/hal/audio/effect/hidl/target
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/hal/audio/effect/hidl/target/AndroidTest.xml b/testcases/hal/audio/effect/hidl/target/AndroidTest.xml
deleted file mode 100644
index f0af67a..0000000
--- a/testcases/hal/audio/effect/hidl/target/AndroidTest.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS Audio Effect HIDL HAL's basic target-side test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HidlHalTest.push" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="HalAudioEffectHidlTargetBasicTest" />
- <option name="binary-test-sources" value="
- _32bit::DATA/nativetest/audio_effect_hidl_hal_test/audio_effect_hidl_hal_test,
- _64bit::DATA/nativetest64/audio_effect_hidl_hal_test/audio_effect_hidl_hal_test,
- "/>
- <option name="binary-test-type" value="gtest" />
- <option name="test-timeout" value="1m" />
- </test>
-</configuration>
diff --git a/testcases/hal/common/fuzz/Android.hal_fuzzer.mk b/testcases/hal/common/fuzz/Android.hal_fuzzer.mk
deleted file mode 100644
index 7cadcfe..0000000
--- a/testcases/hal/common/fuzz/Android.hal_fuzzer.mk
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# 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.
-#
-
-include $(CLEAR_VARS)
-
-# TODO(trong): enable for mips and x86.
-ifeq (,$(findstring mips, $(TARGET_ARCH)))
-ifeq (,$(findstring x86, $(TARGET_ARCH)))
-
-hal_common_fuzz_dir := test/vts/testcases/hal/common/fuzz
-
-module_path := hal_fuzzer
-
-LOCAL_MODULE := $(module_name)
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(module_path)
-LOCAL_SRC_FILES := $(module_src_files)
-
-LOCAL_C_INCLUDES := \
- external/llvm/lib/Fuzzer \
- test/vts/testcases/hal/common/fuzz \
-
-LOCAL_SHARED_LIBRARIES := \
- $(module_shared_libraries) \
- libutils \
- libhidlbase \
- libhidltransport \
- libhardware \
-
-LOCAL_ARM_MODE := arm
-LOCAL_CLANG := true
-LOCAL_CFLAGS += \
- $(module_cflags) \
- -Wno-unused-parameter \
- -fno-omit-frame-pointer \
-
-LOCAL_STATIC_LIBRARIES := \
- libLLVMFuzzer \
-
-LOCAL_SANITIZE := address coverage
-
-include $(BUILD_EXECUTABLE)
-
-# Copy resulting executable to vts directory.
-include $(hal_common_fuzz_dir)/Android.vts_testcase.mk
-
-module_name :=
-module_path :=
-
-endif
-endif
diff --git a/testcases/hal/common/fuzz/Android.vts_testcase.mk b/testcases/hal/common/fuzz/Android.vts_testcase.mk
deleted file mode 100644
index cd79da3..0000000
--- a/testcases/hal/common/fuzz/Android.vts_testcase.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# 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.
-#
-
-VTS_TESTCASES_OUT := $(HOST_OUT)/vts/android-vts/testcases
-
-# Copy test executable.
-vts_src_file := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(module_path)/$(module_name)
-vts_dst_file := $(VTS_TESTCASES_OUT)/$(module_path)/$(module_name)
-
-$(vts_dst_file): $(vts_src_file) | $(ACP)
- $(hide) mkdir -p $(dir $(vts_dst_file))
- $(hide) $(ACP) -fp $< $@
-vts: $(vts_dst_file)
diff --git a/testcases/hal/light/Android.mk b/testcases/hal/light/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/hal/light/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/hal/light/fuzz/Android.mk b/testcases/hal/light/fuzz/Android.mk
deleted file mode 100644
index ab43805..0000000
--- a/testcases/hal/light/fuzz/Android.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# 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)
-module_name := ILightSetLight_fuzzer
-module_src_files := ILightSetLight_fuzzer.cpp
-module_shared_libraries := android.hardware.light@2.0
-include test/vts/testcases/hal/common/fuzz/Android.hal_fuzzer.mk
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := ILightFuzzTest
-VTS_CONFIG_SRC_DIR := testcases/hal/light/fuzz
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/hal/light/fuzz/AndroidTest.xml b/testcases/hal/light/fuzz/AndroidTest.xml
deleted file mode 100644
index 49e17d8..0000000
--- a/testcases/hal/light/fuzz/AndroidTest.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS LIGHT HIDL HAL's fuzz test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="LLVMFuzzerTest.push" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="ILightFuzzTest" />
- <option name="binary-test-sources" value="ILightSetLight_fuzzer"/>
- <option name="binary-test-type" value="llvmfuzzer" />
- <option name="test-config-path" value="vts-config/testcases/hal/light/fuzz/ILightFuzzTest.config" />
- </test>
-</configuration>
diff --git a/testcases/hal/light/fuzz/ILightFuzzTest.config b/testcases/hal/light/fuzz/ILightFuzzTest.config
deleted file mode 100644
index 00489c5..0000000
--- a/testcases/hal/light/fuzz/ILightFuzzTest.config
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "fuzzer_configs": {
- "ILightSetLight_fuzzer": {
- "fuzzer_params": {
- "max_len": 30
- },
- "corpus": [
- "\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
- ]
- }
- }
-}
diff --git a/testcases/hal/light/fuzz/ILightSetLight_fuzzer.cpp b/testcases/hal/light/fuzz/ILightSetLight_fuzzer.cpp
deleted file mode 100644
index 0a0bc3c..0000000
--- a/testcases/hal/light/fuzz/ILightSetLight_fuzzer.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#include <FuzzerInterface.h>
-#include <android/hardware/light/2.0/ILight.h>
-
-using ::android::hardware::light::V2_0::ILight;
-using ::android::hardware::light::V2_0::LightState;
-using ::android::hardware::light::V2_0::Type;
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
- static ::android::sp<ILight> light_hal = ILight::getService("light", true);
- if (light_hal == nullptr) {
- return 0;
- }
-
- if (size < sizeof(Type) + sizeof(LightState)) {
- return 0;
- }
-
- Type type;
- memcpy(&type, data, sizeof(Type));
- data += sizeof(Type);
-
- LightState light_state;
- memcpy(&light_state, data, sizeof(LightState));
-
- light_hal->setLight(type, light_state);
- return 0;
-}
diff --git a/testcases/hal/nfc/Android.mk b/testcases/hal/nfc/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/hal/nfc/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/hal/nfc/__init__.py b/testcases/hal/nfc/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/hal/nfc/__init__.py
+++ /dev/null
diff --git a/testcases/hal/nfc/hidl/Android.mk b/testcases/hal/nfc/hidl/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/hal/nfc/hidl/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/hal/nfc/hidl/__init__.py b/testcases/hal/nfc/hidl/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/hal/nfc/hidl/__init__.py
+++ /dev/null
diff --git a/testcases/hal/nfc/hidl/host/Android.mk b/testcases/hal/nfc/hidl/host/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/hal/nfc/hidl/host/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/hal/nfc/hidl/host/NfcHidlBasicTest.py b/testcases/hal/nfc/hidl/host/NfcHidlBasicTest.py
deleted file mode 100644
index 0c34f99..0000000
--- a/testcases/hal/nfc/hidl/host/NfcHidlBasicTest.py
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/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
-
-PASSTHROUGH_MODE_KEY = "passthrough_mode"
-
-
-class NfcHidlBasicTest(base_test_with_webdb.BaseTestWithWebDbClass):
- """A simple testcase for the NFC HIDL HAL."""
-
- def setUpClass(self):
- """Creates a mirror and turns on the framework-layer NFC service."""
- self.dut = self.registerController(android_device)[0]
-
- self.getUserParams(opt_param_names=[PASSTHROUGH_MODE_KEY])
-
- self.dut.shell.InvokeTerminal("one")
- self.dut.shell.one.Execute("setenforce 0") # SELinux permissive mode
- self.dut.shell.one.Execute("service call nfc 6") # Turn off
- time.sleep(2)
-
- if getattr(self, PASSTHROUGH_MODE_KEY, True):
- self.dut.shell.one.Execute(
- "setprop vts.hal.vts.hidl.get_stub true")
- else:
- self.dut.shell.one.Execute(
- "setprop vts.hal.vts.hidl.get_stub false")
-
- self.dut.hal.InitHidlHal(target_type="nfc",
- target_basepaths=["/system/lib64"],
- target_version=1.0,
- target_package="android.hardware.nfc",
- target_component_name="INfc",
- bits=64)
-
- def tearDownClass(self):
- """Turns off the framework-layer NFC service."""
- self.dut.shell.one.Execute("service call nfc 6") # make sure it's off
-
- def testBase(self):
- """A simple test case which just calls each registered function."""
- # TODO: extend to make realistic testcases
- # For example, call after CORE_INIT_RSP is received.
- # result = self.dut.hal.nfc.coreInitialized([1])
- # logging.info("coreInitialized result: %s", result)
-
- def send_event(NfcEvent, NfcStatus):
- logging.info("callback send_event")
- logging.info("arg0 %s", NfcEvent)
- logging.info("arg1 %s", NfcStatus)
-
- def send_data(NfcData):
- logging.info("callback send_data")
- logging.info("arg0 %s", NfcData)
-
- client_callback = self.dut.hal.nfc.GetHidlCallbackInterface(
- "INfcClientCallback",
- sendEvent=send_event,
- sendData=send_data)
-
- result = self.dut.hal.nfc.open(client_callback)
- logging.info("open result: %s", result)
-
- result = self.dut.hal.nfc.prediscover()
- logging.info("prediscover result: %s", result)
-
- result = self.dut.hal.nfc.controlGranted()
- logging.info("controlGranted result: %s", result)
-
- result = self.dut.hal.nfc.powerCycle()
- logging.info("powerCycle result: %s", result)
-
- nfc_types = self.dut.hal.nfc.GetHidlTypeInterface("types")
- logging.info("nfc_types: %s", nfc_types)
-
- result = self.dut.hal.nfc.write([0, 1, 2, 3, 4, 5])
- logging.info("write result: %s", result)
-
- result = self.dut.hal.nfc.close()
- logging.info("close result: %s", result)
-
- self.SetCoverageData(self.dut.hal.nfc.GetRawCodeCoverage())
-
-if __name__ == "__main__":
- test_runner.main()
diff --git a/testcases/hal/nfc/hidl/host/__init__.py b/testcases/hal/nfc/hidl/host/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/hal/nfc/hidl/host/__init__.py
+++ /dev/null
diff --git a/testcases/hal/nfc/hidl/host/binderize/Android.mk b/testcases/hal/nfc/hidl/host/binderize/Android.mk
deleted file mode 100644
index cd58d32..0000000
--- a/testcases/hal/nfc/hidl/host/binderize/Android.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# 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 := NfcHidlBinderizeBasicTest
-VTS_CONFIG_SRC_DIR := testcases/hal/nfc/hidl/host/binderize
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/hal/nfc/hidl/host/binderize/AndroidTest.xml b/testcases/hal/nfc/hidl/host/binderize/AndroidTest.xml
deleted file mode 100644
index 2620c3d..0000000
--- a/testcases/hal/nfc/hidl/host/binderize/AndroidTest.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS HAL NFC (Binder Mode) 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/nfc/1.0/vts/Nfc.vts->/data/local/tmp/spec/Nfc.vts" />
- <option name="push" value="spec/hardware/interfaces/nfc/1.0/vts/NfcClientCallback.vts->/data/local/tmp/spec/NfcClientCallback.vts" />
- <option name="push" value="spec/hardware/interfaces/nfc/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="NfcHidlBinderizeBasicTest" />
- <option name="test-case-path" value="vts/testcases/hal/nfc/hidl/host/NfcHidlBasicTest" />
- <option name="test-config-path" value="vts-config/testcases/hal/nfc/hidl/host/binderize/NfcHidlBinderizeBasicTest.config" />
- </test>
-</configuration>
diff --git a/testcases/hal/nfc/hidl/host/binderize/NfcHidlBinderizeBasicTest.config b/testcases/hal/nfc/hidl/host/binderize/NfcHidlBinderizeBasicTest.config
deleted file mode 100644
index 5a94c6f..0000000
--- a/testcases/hal/nfc/hidl/host/binderize/NfcHidlBinderizeBasicTest.config
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "passthrough_mode": False
-}
diff --git a/testcases/hal/nfc/hidl/host/passthrough/Android.mk b/testcases/hal/nfc/hidl/host/passthrough/Android.mk
deleted file mode 100644
index e274107..0000000
--- a/testcases/hal/nfc/hidl/host/passthrough/Android.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# 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 := NfcHidlPassthroughBasicTest
-VTS_CONFIG_SRC_DIR := testcases/hal/nfc/hidl/host/passthrough
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/hal/nfc/hidl/host/passthrough/AndroidTest.xml b/testcases/hal/nfc/hidl/host/passthrough/AndroidTest.xml
deleted file mode 100644
index 2166d9a..0000000
--- a/testcases/hal/nfc/hidl/host/passthrough/AndroidTest.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS HAL NFC (Passthrough) 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/nfc/1.0/vts/Nfc.vts->/data/local/tmp/spec/Nfc.vts" />
- <option name="push" value="spec/hardware/interfaces/nfc/1.0/vts/NfcClientCallback.vts->/data/local/tmp/spec/NfcClientCallback.vts" />
- <option name="push" value="spec/hardware/interfaces/nfc/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="NfcHidlPassthroughBasicTest" />
- <option name="test-case-path" value="vts/testcases/hal/nfc/hidl/host/NfcHidlBasicTest" />
- <option name="test-config-path" value="vts-config/testcases/hal/nfc/hidl/host/passthrough/NfcHidlPassthroughBasicTest.config" />
- </test>
-</configuration>
diff --git a/testcases/hal/nfc/hidl/host/passthrough/NfcHidlPassthroughBasicTest.config b/testcases/hal/nfc/hidl/host/passthrough/NfcHidlPassthroughBasicTest.config
deleted file mode 100644
index be540a5..0000000
--- a/testcases/hal/nfc/hidl/host/passthrough/NfcHidlPassthroughBasicTest.config
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "passthrough_mode": True,
- "modules": ["system/lib64/hw/nfc_nci.bullhead"],
- "git_project_path": "external/libnfc-nci",
- "git_project_name": "platform/external/libnfc-nci"
-}
diff --git a/testcases/hal/nfc/hidl/target/Android.mk b/testcases/hal/nfc/hidl/target/Android.mk
deleted file mode 100644
index da9b6af..0000000
--- a/testcases/hal/nfc/hidl/target/Android.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# 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)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := HalNfcHidlTargetBasicTest
-VTS_CONFIG_SRC_DIR := testcases/hal/nfc/hidl/target
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/hal/nfc/hidl/target/AndroidTest.xml b/testcases/hal/nfc/hidl/target/AndroidTest.xml
deleted file mode 100644
index e3ba76c..0000000
--- a/testcases/hal/nfc/hidl/target/AndroidTest.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS NFC HIDL HAL's basic target-side test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HidlHalTest.push" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="HalNfcHidlTargetBasicTest" />
- <option name="binary-test-sources" value="
- _32bit::DATA/nativetest/nfc_hidl_hal_test/nfc_hidl_hal_test,
- _64bit::DATA/nativetest64/nfc_hidl_hal_test/nfc_hidl_hal_test,
- "/>
- <option name="test-config-path" value="vts-config/testcases/hal/nfc/hidl/target/HalNfcHidlTargetBasicTest.config" />
- <option name="binary-test-type" value="gtest" />
- <option name="test-timeout" value="1m" />
- </test>
-</configuration>
diff --git a/testcases/hal/nfc/hidl/target/HalNfcHidlTargetBasicTest.config b/testcases/hal/nfc/hidl/target/HalNfcHidlTargetBasicTest.config
deleted file mode 100644
index bb04e79..0000000
--- a/testcases/hal/nfc/hidl/target/HalNfcHidlTargetBasicTest.config
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "modules": ["system/lib64/hw/nfc_nci.bullhead"],
- "git_project_path": "external/libnfc-nci",
- "git_project_name": "platform/external/libnfc-nci"
-}
diff --git a/testcases/hal/nfc/hidl/target_profiling/Android.mk b/testcases/hal/nfc/hidl/target_profiling/Android.mk
deleted file mode 100644
index c7bf853..0000000
--- a/testcases/hal/nfc/hidl/target_profiling/Android.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-## 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 := NfcHidlTargetProfilingTest
-VTS_CONFIG_SRC_DIR := testcases/hal/nfc/hidl/target_profiling
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/hal/nfc/hidl/target_profiling/AndroidTest.xml b/testcases/hal/nfc/hidl/target_profiling/AndroidTest.xml
deleted file mode 100644
index 38ac707..0000000
--- a/testcases/hal/nfc/hidl/target_profiling/AndroidTest.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS NFC HIDL HAL's target-side profiling test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HidlHalTest.push" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="NfcHidlTargetProfilingTest" />
- <option name="binary-test-sources" value="
- _32bit::DATA/nativetest/nfc_hidl_hal_test/nfc_hidl_hal_test,
- _64bit::DATA/nativetest64/nfc_hidl_hal_test/nfc_hidl_hal_test,
- "/>
- <option name="test-config-path" value="vts-config/testcases/hal/nfc/hidl/target_profiling/NfcHidlTargetProfilingTest.config" />
- <option name="binary-test-type" value="gtest" />
- <option name="test-timeout" value="1m" />
- </test>
-</configuration>
diff --git a/testcases/hal/power/Android.mk b/testcases/hal/power/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/hal/power/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/hal/power/__init__.py b/testcases/hal/power/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/hal/power/__init__.py
+++ /dev/null
diff --git a/testcases/hal/power/fuzz/Android.mk b/testcases/hal/power/fuzz/Android.mk
deleted file mode 100644
index f7a31d9..0000000
--- a/testcases/hal/power/fuzz/Android.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# 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)
-module_name := IPowerPowerHint_fuzzer
-module_src_files := IPowerPowerHint_fuzzer.cpp
-module_shared_libraries := android.hardware.power@1.0
-include test/vts/testcases/hal/common/fuzz/Android.hal_fuzzer.mk
-
-include $(CLEAR_VARS)
-module_name := IPowerSetFeature_fuzzer
-module_src_files := IPowerSetFeature_fuzzer.cpp
-module_shared_libraries := android.hardware.power@1.0
-include test/vts/testcases/hal/common/fuzz/Android.hal_fuzzer.mk
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := IPowerFuzzTest
-VTS_CONFIG_SRC_DIR := testcases/hal/power/fuzz
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/hal/power/fuzz/AndroidTest.xml b/testcases/hal/power/fuzz/AndroidTest.xml
deleted file mode 100644
index 0f74787..0000000
--- a/testcases/hal/power/fuzz/AndroidTest.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS Power HIDL HAL's target-side fuzz test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="LLVMFuzzerTest.push" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="IPowerFuzzTest" />
- <option name="binary-test-sources" value="
- IPowerPowerHint_fuzzer,
- IPowerSetFeature_fuzzer
- "/>
- <option name="binary-test-type" value="llvmfuzzer" />
- <option name="test-config-path" value="vts-config/testcases/hal/power/fuzz/IPowerFuzzTest.config" />
- </test>
-</configuration>
diff --git a/testcases/hal/power/fuzz/IPowerFuzzTest.config b/testcases/hal/power/fuzz/IPowerFuzzTest.config
deleted file mode 100644
index d6dba3f..0000000
--- a/testcases/hal/power/fuzz/IPowerFuzzTest.config
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "fuzzer_configs": {
- "IPowerPowerHint_fuzzer": {
- "fuzzer_params": {
- "max_len": 8
- },
- "corpus": []
- },
- "IPowerSetFeature_fuzzer": {
- "fuzzer_params": {
- "max_len": 5
- },
- "corpus": []
- }
- }
-}
diff --git a/testcases/hal/power/fuzz/IPowerPowerHint_fuzzer.cpp b/testcases/hal/power/fuzz/IPowerPowerHint_fuzzer.cpp
deleted file mode 100644
index 36eedb2..0000000
--- a/testcases/hal/power/fuzz/IPowerPowerHint_fuzzer.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#include <FuzzerInterface.h>
-#include <android/hardware/power/1.0/IPower.h>
-
-using ::android::hardware::power::V1_0::IPower;
-using ::android::hardware::power::V1_0::PowerHint;
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
- static ::android::sp<IPower> power_hal = IPower::getService("power", true);
- if (power_hal == nullptr) {
- return 0;
- }
-
- size_t min_size = sizeof(PowerHint) + sizeof(int32_t);
- if (size < min_size) {
- return 0;
- }
-
- PowerHint hint;
- memcpy(&hint, data, sizeof(PowerHint));
- data += sizeof(PowerHint);
-
- int32_t payload;
- memcpy(&payload, data, sizeof(int32_t));
-
- power_hal->powerHint(hint, payload);
- return 0;
-}
diff --git a/testcases/hal/power/fuzz/IPowerSetFeature_fuzzer.cpp b/testcases/hal/power/fuzz/IPowerSetFeature_fuzzer.cpp
deleted file mode 100644
index 1982a1e..0000000
--- a/testcases/hal/power/fuzz/IPowerSetFeature_fuzzer.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#include <FuzzerInterface.h>
-#include <android/hardware/power/1.0/IPower.h>
-
-using ::android::hardware::power::V1_0::IPower;
-using ::android::hardware::power::V1_0::Feature;
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
- static ::android::sp<IPower> power_hal = IPower::getService("power", true);
- if (power_hal == nullptr) {
- return 0;
- }
-
- size_t min_size = sizeof(Feature) + sizeof(uint8_t);
- if (size < min_size) {
- return 0;
- }
-
- Feature feature;
- memcpy(&feature, data, sizeof(Feature));
- data += sizeof(Feature);
-
- bool activate = (*data) % 2 ? false : true;
-
- power_hal->setFeature(feature, activate);
- return 0;
-}
diff --git a/testcases/hal/sensors/Android.mk b/testcases/hal/sensors/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/hal/sensors/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/hal/sensors/fuzz/Android.mk b/testcases/hal/sensors/fuzz/Android.mk
deleted file mode 100644
index 75f86f2..0000000
--- a/testcases/hal/sensors/fuzz/Android.mk
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# 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)
-module_name := ISensorsFlush_fuzzer
-module_src_files := ISensorsFlush_fuzzer.cpp
-module_shared_libraries := android.hardware.sensors@1.0
-include test/vts/testcases/hal/common/fuzz/Android.hal_fuzzer.mk
-
-include $(CLEAR_VARS)
-module_name := ISensorsPoll_fuzzer
-module_src_files := ISensorsPoll_fuzzer.cpp
-module_shared_libraries := android.hardware.sensors@1.0
-include test/vts/testcases/hal/common/fuzz/Android.hal_fuzzer.mk
-
-include $(CLEAR_VARS)
-module_name := ISensorsActivate_fuzzer
-module_src_files := ISensorsActivate_fuzzer.cpp
-module_shared_libraries := android.hardware.sensors@1.0
-include test/vts/testcases/hal/common/fuzz/Android.hal_fuzzer.mk
-
-include $(CLEAR_VARS)
-module_name := ISensorsSetDelay_fuzzer
-module_src_files := ISensorsSetDelay_fuzzer.cpp
-module_shared_libraries := android.hardware.sensors@1.0
-include test/vts/testcases/hal/common/fuzz/Android.hal_fuzzer.mk
-
-include $(CLEAR_VARS)
-module_name := ISensorsBatch_fuzzer
-module_src_files := ISensorsBatch_fuzzer.cpp
-module_shared_libraries := android.hardware.sensors@1.0
-include test/vts/testcases/hal/common/fuzz/Android.hal_fuzzer.mk
-
-include $(CLEAR_VARS)
-module_name := ISensorsInjectSensorData_fuzzer
-module_src_files := ISensorsInjectSensorData_fuzzer.cpp
-module_shared_libraries := android.hardware.sensors@1.0
-include test/vts/testcases/hal/common/fuzz/Android.hal_fuzzer.mk
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := ISensorsFuzzTest
-VTS_CONFIG_SRC_DIR := testcases/hal/sensors/fuzz
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/hal/sensors/fuzz/AndroidTest.xml b/testcases/hal/sensors/fuzz/AndroidTest.xml
deleted file mode 100644
index 74c7bc2..0000000
--- a/testcases/hal/sensors/fuzz/AndroidTest.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS Sensors HIDL HAL's target-side fuzz test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="LLVMFuzzerTest.push" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="ISensorsFuzzTest" />
- <option name="binary-test-sources" value="
- ISensorsFlush_fuzzer,
- ISensorsActivate_fuzzer,
- ISensorsSetDelay_fuzzer,
- ISensorsBatch_fuzzer,
- ISensorsInjectSensorData_fuzzer,
- ISensorsPoll_fuzzer
- "/>
- <option name="binary-test-type" value="llvmfuzzer" />
- <option name="test-config-path" value="vts-config/testcases/hal/sensors/fuzz/ISensorsFuzzTest.config" />
- </test>
-</configuration>
diff --git a/testcases/hal/sensors/fuzz/ISensorsActivate_fuzzer.cpp b/testcases/hal/sensors/fuzz/ISensorsActivate_fuzzer.cpp
deleted file mode 100644
index a25f30e..0000000
--- a/testcases/hal/sensors/fuzz/ISensorsActivate_fuzzer.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#include <FuzzerInterface.h>
-#include <android/hardware/sensors/1.0/ISensors.h>
-
-using ::android::hardware::sensors::V1_0::ISensors;
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
- static ::android::sp<ISensors> sensors_hal = ISensors::getService("sensors", true);
- if (sensors_hal == nullptr) {
- return 0;
- }
-
- size_t min_size = sizeof(int32_t) + sizeof(uint8_t);
- if (size < min_size) {
- return 0;
- }
-
- int32_t sensorHandle;
- memcpy(&sensorHandle, data, sizeof(int32_t));
- data += sizeof(int32_t);
-
- bool enabled = (*data) % 2 ? false : true;
-
- sensors_hal->activate(sensorHandle, enabled);
- return 0;
-}
diff --git a/testcases/hal/sensors/fuzz/ISensorsBatch_fuzzer.cpp b/testcases/hal/sensors/fuzz/ISensorsBatch_fuzzer.cpp
deleted file mode 100644
index 0cf02f6..0000000
--- a/testcases/hal/sensors/fuzz/ISensorsBatch_fuzzer.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#include <FuzzerInterface.h>
-#include <android/hardware/sensors/1.0/ISensors.h>
-
-using ::android::hardware::sensors::V1_0::ISensors;
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
- static ::android::sp<ISensors> sensors_hal = ISensors::getService("sensors", true);
- if (sensors_hal == nullptr) {
- return 0;
- }
-
- size_t min_size = 2 * sizeof(int32_t) + 2 * sizeof(int64_t);
- if (size < min_size) {
- return 0;
- }
-
- int32_t sensorHandle;
- memcpy(&sensorHandle, data, sizeof(int32_t));
- data += sizeof(int32_t);
-
- int32_t flags;
- memcpy(&flags, data, sizeof(int32_t));
- data += sizeof(int32_t);
-
- int64_t samplingPeriodNs;
- memcpy(&samplingPeriodNs, data, sizeof(int64_t));
- data += sizeof(int64_t);
-
- int64_t maxReportLatencyNs;
- memcpy(&maxReportLatencyNs, data, sizeof(int64_t));
-
- sensors_hal->batch(sensorHandle, flags, samplingPeriodNs, maxReportLatencyNs);
- return 0;
-}
diff --git a/testcases/hal/sensors/fuzz/ISensorsFlush_fuzzer.cpp b/testcases/hal/sensors/fuzz/ISensorsFlush_fuzzer.cpp
deleted file mode 100644
index fab94be..0000000
--- a/testcases/hal/sensors/fuzz/ISensorsFlush_fuzzer.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#include <FuzzerInterface.h>
-#include <android/hardware/sensors/1.0/ISensors.h>
-
-using ::android::hardware::sensors::V1_0::ISensors;
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
- static ::android::sp<ISensors> sensors_hal = ISensors::getService("sensors", true);
- if (sensors_hal == nullptr) {
- return 0;
- }
- if (size < sizeof(int32_t)) {
- return 0;
- }
- int32_t sensorHandle;
- memcpy(&sensorHandle, data, sizeof(int32_t));
-
- sensors_hal->flush(sensorHandle);
- return 0;
-}
diff --git a/testcases/hal/sensors/fuzz/ISensorsFuzzTest.config b/testcases/hal/sensors/fuzz/ISensorsFuzzTest.config
deleted file mode 100644
index f8227a3..0000000
--- a/testcases/hal/sensors/fuzz/ISensorsFuzzTest.config
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "fuzzer_configs": {
- "ISensorsActivate_fuzzer": {
- "fuzzer_params": {
- "max_len": 5
- },
- "corpus": []
- },
- "ISensorsBatch_fuzzer": {
- "fuzzer_params": {
- "max_len": 24,
- "max_total_time": 600
- },
- "corpus": []
- },
- "ISensorsFlush_fuzzer": {
- "fuzzer_params": {
- "max_len": 4
- },
- "corpus": [
- "\x3b\x00\x00\x00"
- ]
- },
- "ISensorsInjectSensorData_fuzzer": {
- "fuzzer_params": {
- "max_len": 80,
- "max_total_time": 1800
- },
- "corpus": []
- },
- "ISensorsPoll_fuzzer": {
- "fuzzer_params": {
- "max_len": 4
- },
- "corpus": []
- },
- "ISensorsSetDelay_fuzzer": {
- "fuzzer_params": {
- "max_len": 12
- },
- "corpus": []
- }
- }
-}
diff --git a/testcases/hal/sensors/fuzz/ISensorsInjectSensorData_fuzzer.cpp b/testcases/hal/sensors/fuzz/ISensorsInjectSensorData_fuzzer.cpp
deleted file mode 100644
index a6e94ea..0000000
--- a/testcases/hal/sensors/fuzz/ISensorsInjectSensorData_fuzzer.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#include <FuzzerInterface.h>
-#include <android/hardware/sensors/1.0/ISensors.h>
-
-using ::android::hardware::sensors::V1_0::ISensors;
-using ::android::hardware::sensors::V1_0::Event;
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
- static ::android::sp<ISensors> sensors_hal = ISensors::getService("sensors", true);
- if (sensors_hal == nullptr) {
- return 0;
- }
-
- if (size < sizeof(Event)) {
- return 0;
- }
- Event event;
- memcpy(&event, data, sizeof(Event));
-
- sensors_hal->injectSensorData(event);
- return 0;
-}
diff --git a/testcases/hal/sensors/fuzz/ISensorsPoll_fuzzer.cpp b/testcases/hal/sensors/fuzz/ISensorsPoll_fuzzer.cpp
deleted file mode 100644
index da3f0d7..0000000
--- a/testcases/hal/sensors/fuzz/ISensorsPoll_fuzzer.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#include <algorithm>
-
-#include <FuzzerInterface.h>
-#include <android/hardware/sensors/1.0/ISensors.h>
-
-using ::android::hardware::sensors::V1_0::ISensors;
-
-auto _hidl_cb = [](auto x, auto y, auto z){};
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
- static ::android::sp<ISensors> sensors_hal = ISensors::getService("sensors", true);
- if (sensors_hal == nullptr) {
- return 0;
- }
- if (size < sizeof(int32_t)) {
- return 0;
- }
- int32_t maxCount;
- memcpy(&maxCount, data, sizeof(int32_t));
-
- sensors_hal->poll(maxCount, _hidl_cb);
- return 0;
-}
diff --git a/testcases/hal/sensors/fuzz/ISensorsSetDelay_fuzzer.cpp b/testcases/hal/sensors/fuzz/ISensorsSetDelay_fuzzer.cpp
deleted file mode 100644
index 4a8896a..0000000
--- a/testcases/hal/sensors/fuzz/ISensorsSetDelay_fuzzer.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#include <FuzzerInterface.h>
-#include <android/hardware/sensors/1.0/ISensors.h>
-
-using ::android::hardware::sensors::V1_0::ISensors;
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
- static ::android::sp<ISensors> sensors_hal = ISensors::getService("sensors", true);
- if (sensors_hal == nullptr) {
- return 0;
- }
-
- size_t min_size = sizeof(int32_t) + sizeof(int64_t);
- if (size < min_size) {
- return 0;
- }
-
- int32_t sensorHandle;
- memcpy(&sensorHandle, data, sizeof(int32_t));
- data += sizeof(int32_t);
-
- int64_t samplingPeriodNs;
- memcpy(&samplingPeriodNs, data, sizeof(int64_t));
-
- sensors_hal->setDelay(sensorHandle, samplingPeriodNs);
- return 0;
-}
diff --git a/testcases/hal/thermal/Android.mk b/testcases/hal/thermal/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/hal/thermal/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/hal/thermal/__init__.py b/testcases/hal/thermal/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/hal/thermal/__init__.py
+++ /dev/null
diff --git a/testcases/hal/thermal/hidl/Android.mk b/testcases/hal/thermal/hidl/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/hal/thermal/hidl/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/hal/thermal/hidl/__init__.py b/testcases/hal/thermal/hidl/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/hal/thermal/hidl/__init__.py
+++ /dev/null
diff --git a/testcases/hal/thermal/hidl/target/Android.mk b/testcases/hal/thermal/hidl/target/Android.mk
deleted file mode 100644
index 1c3ceb3..0000000
--- a/testcases/hal/thermal/hidl/target/Android.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# 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)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := ThermalHidlTargetTest
-VTS_CONFIG_SRC_DIR := testcases/hal/thermal/hidl/target
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/hal/thermal/hidl/target/AndroidTest.xml b/testcases/hal/thermal/hidl/target/AndroidTest.xml
deleted file mode 100644
index cc159b9..0000000
--- a/testcases/hal/thermal/hidl/target/AndroidTest.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS VIBRATOR HIDL HAL's target-side test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HidlHalTest.push" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="ThermalHidlTargetTest" />
- <option name="binary-test-sources" value="
- _32bit::DATA/nativetest/thermal_hidl_hal_test/thermal_hidl_hal_test,
- _64bit::DATA/nativetest64/thermal_hidl_hal_test/thermal_hidl_hal_test,
- "/>
- <option name="binary-test-type" value="gtest" />
- <option name="test-timeout" value="1m" />
- </test>
-</configuration>
-
diff --git a/testcases/hal/thermal/hidl/target_profiling/Android.mk b/testcases/hal/thermal/hidl/target_profiling/Android.mk
deleted file mode 100644
index 1f937fa..0000000
--- a/testcases/hal/thermal/hidl/target_profiling/Android.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# 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 := ThermalHidlTargetProfilingTest
-VTS_CONFIG_SRC_DIR := testcases/hal/thermal/hidl/target_profiling
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/hal/thermal/hidl/target_profiling/AndroidTest.xml b/testcases/hal/thermal/hidl/target_profiling/AndroidTest.xml
deleted file mode 100644
index 630dba6..0000000
--- a/testcases/hal/thermal/hidl/target_profiling/AndroidTest.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS THERMAL HIDL HAL's target-side test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HidlHalTest.push" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="ThermalHidlTargetProfilingTest" />
- <option name="binary-test-sources" value="
- _32bit::DATA/nativetest/thermal_hidl_hal_test/thermal_hidl_hal_test,
- _64bit::DATA/nativetest64/thermal_hidl_hal_test/thermal_hidl_hal_test,
- "/>
- <option name="test-config-path" value="vts-config/testcases/hal/thermal/hidl/target_profiling/ThermalHidlTargetProfilingTest.config" />
- <option name="binary-test-type" value="gtest" />
- <option name="test-timeout" value="1m" />
- </test>
-</configuration>
-
diff --git a/testcases/hal/vibrator/Android.mk b/testcases/hal/vibrator/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/hal/vibrator/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/hal/vibrator/__init__.py b/testcases/hal/vibrator/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/hal/vibrator/__init__.py
+++ /dev/null
diff --git a/testcases/hal/vibrator/hidl/Android.mk b/testcases/hal/vibrator/hidl/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/hal/vibrator/hidl/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/hal/vibrator/hidl/__init__.py b/testcases/hal/vibrator/hidl/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/hal/vibrator/hidl/__init__.py
+++ /dev/null
diff --git a/testcases/hal/vibrator/hidl/host/Android.mk b/testcases/hal/vibrator/hidl/host/Android.mk
deleted file mode 100644
index d005450..0000000
--- a/testcases/hal/vibrator/hidl/host/Android.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# 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 := VibratorHidlTest
-VTS_CONFIG_SRC_DIR := testcases/hal/vibrator/hidl/host
-include test/vts/tools/build/Android.host_config.mk
\ No newline at end of file
diff --git a/testcases/hal/vibrator/hidl/host/AndroidTest.xml b/testcases/hal/vibrator/hidl/host/AndroidTest.xml
deleted file mode 100644
index c5074ee..0000000
--- a/testcases/hal/vibrator/hidl/host/AndroidTest.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS HAL vibrator 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/vibrator/1.0/vts/Vibrator.vts->/data/local/tmp/spec/Vibrator.vts" />
- <option name="push" value="spec/hardware/interfaces/vibrator/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="VibratorHidlTest" />
- <option name="test-case-path" value="vts/testcases/hal/vibrator/hidl/host/VibratorHidlTest" />
- </test>
-</configuration>
diff --git a/testcases/hal/vibrator/hidl/host/VibratorHidlTest.py b/testcases/hal/vibrator/hidl/host/VibratorHidlTest.py
deleted file mode 100644
index 0007d89..0000000
--- a/testcases/hal/vibrator/hidl/host/VibratorHidlTest.py
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/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 VibratorHidlTest(base_test_with_webdb.BaseTestWithWebDbClass):
- """A simple testcase for the VIBRATOR HIDL HAL."""
-
- def setUpClass(self):
- """Creates a mirror and turns on the framework-layer VIBRATOR service."""
- self.dut = self.registerController(android_device)[0]
-
- self.dut.shell.InvokeTerminal("one")
- self.dut.shell.one.Execute("setenforce 0") # SELinux permissive mode
-
- # Test using the binderized mode
- self.dut.shell.one.Execute(
- "setprop vts.hal.vts.hidl.get_stub true")
-
- if getattr(self, self.ENABLE_PROFILING, False):
- profiling_utils.EnableVTSProfiling(self.dut.shell.one)
-
- self.dut.hal.InitHidlHal(
- target_type="vibrator",
- target_basepaths=["/system/lib64"],
- target_version=1.0,
- target_package="android.hardware.vibrator",
- target_component_name="IVibrator",
- bits=64)
-
- def tearDownClass(self):
- """ If profiling is enabled for the test, collect the profiling data
- and disable profiling after the test is done.
- """
- if getattr(self, self.ENABLE_PROFILING, False):
- 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 testVibratorBasic(self):
- """A simple test case which just calls each registered function."""
- vibrator_types = self.dut.hal.vibrator.GetHidlTypeInterface("types")
- logging.info("vibrator_types: %s", vibrator_types)
- logging.info("OK: %s", vibrator_types.OK)
- logging.info("ERR: %s", vibrator_types.ERR)
-
- result = self.dut.hal.vibrator.on(10000)
- logging.info("on result: %s", result)
- asserts.assertEqual(vibrator_types.OK, result)
-
- time.sleep(1)
-
- result = self.dut.hal.vibrator.off()
- logging.info("off result: %s", result)
- asserts.assertEqual(vibrator_types.OK, result)
-
-if __name__ == "__main__":
- test_runner.main()
diff --git a/testcases/hal/vibrator/hidl/host/__init__.py b/testcases/hal/vibrator/hidl/host/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/hal/vibrator/hidl/host/__init__.py
+++ /dev/null
diff --git a/testcases/hal/vibrator/hidl/host_profiling/Android.mk b/testcases/hal/vibrator/hidl/host_profiling/Android.mk
deleted file mode 100644
index ec73e06..0000000
--- a/testcases/hal/vibrator/hidl/host_profiling/Android.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# 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 := VibratorHidlProfilingTest
-VTS_CONFIG_SRC_DIR := testcases/hal/vibrator/hidl/host_profiling
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/hal/vibrator/hidl/host_profiling/AndroidTest.xml b/testcases/hal/vibrator/hidl/host_profiling/AndroidTest.xml
deleted file mode 100644
index c214d1f..0000000
--- a/testcases/hal/vibrator/hidl/host_profiling/AndroidTest.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS HAL vibrator 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/vibrator/1.0/vts/Vibrator.vts->/data/local/tmp/spec/Vibrator.vts" />
- <option name="push" value="spec/hardware/interfaces/vibrator/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="VibratorHidlProfilingTest" />
- <option name="test-case-path" value="vts/testcases/hal/vibrator/hidl/host/VibratorHidlTest" />
- <option name="test-config-path" value="vts-config/testcases/hal/vibrator/hidl/host_profiling/VibratorHidlProfilingTest.config" />
- </test>
-</configuration>
diff --git a/testcases/hal/vibrator/hidl/host_profiling/VibratorHidlProfilingTest.config b/testcases/hal/vibrator/hidl/host_profiling/VibratorHidlProfilingTest.config
deleted file mode 100644
index 912d8d5..0000000
--- a/testcases/hal/vibrator/hidl/host_profiling/VibratorHidlProfilingTest.config
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "enable_profiling": true
-}
\ No newline at end of file
diff --git a/testcases/hal/vibrator/hidl/target/Android.mk b/testcases/hal/vibrator/hidl/target/Android.mk
deleted file mode 100644
index 704d985..0000000
--- a/testcases/hal/vibrator/hidl/target/Android.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# 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)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := VibratorHidlTargetTest
-VTS_CONFIG_SRC_DIR := testcases/hal/vibrator/hidl/target
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/hal/vibrator/hidl/target/AndroidTest.xml b/testcases/hal/vibrator/hidl/target/AndroidTest.xml
deleted file mode 100644
index 7948c86..0000000
--- a/testcases/hal/vibrator/hidl/target/AndroidTest.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS VIBRATOR HIDL HAL's target-side test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HidlHalTest.push" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="VibratorHidlTargetTest" />
- <option name="binary-test-sources" value="
- _32bit::DATA/nativetest/vibrator_hidl_hal_test/vibrator_hidl_hal_test,
- _64bit::DATA/nativetest64/vibrator_hidl_hal_test/vibrator_hidl_hal_test,
- "/>
- <option name="binary-test-type" value="gtest" />
- <option name="test-timeout" value="1m" />
- </test>
-</configuration>
-
diff --git a/testcases/hal/vibrator/hidl/target_profiling/Android.mk b/testcases/hal/vibrator/hidl/target_profiling/Android.mk
deleted file mode 100644
index a1f43e4..0000000
--- a/testcases/hal/vibrator/hidl/target_profiling/Android.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# 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 := VibratorHidlTargetProfilingTest
-VTS_CONFIG_SRC_DIR := testcases/hal/vibrator/hidl/target_profiling
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/hal/vibrator/hidl/target_profiling/AndroidTest.xml b/testcases/hal/vibrator/hidl/target_profiling/AndroidTest.xml
deleted file mode 100644
index 0cd95c9..0000000
--- a/testcases/hal/vibrator/hidl/target_profiling/AndroidTest.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS VIBRATOR HIDL HAL's target-side test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HidlHalTest.push" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="VibratorHidlTargetProfilingTest" />
- <option name="binary-test-sources" value="
- _32bit::DATA/nativetest/vibrator_hidl_hal_test/vibrator_hidl_hal_test,
- _64bit::DATA/nativetest64/vibrator_hidl_hal_test/vibrator_hidl_hal_test,
- "/>
- <option name="test-config-path" value="vts-config/testcases/hal/vibrator/hidl/target_profiling/VibratorHidlTargetProfilingTest.config" />
- <option name="binary-test-type" value="gtest" />
- <option name="test-timeout" value="1m" />
- </test>
-</configuration>
-
diff --git a/testcases/hal/vibrator/hidl/target_profiling/VibratorHidlTargetProfilingTest.config b/testcases/hal/vibrator/hidl/target_profiling/VibratorHidlTargetProfilingTest.config
deleted file mode 100644
index 912d8d5..0000000
--- a/testcases/hal/vibrator/hidl/target_profiling/VibratorHidlTargetProfilingTest.config
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "enable_profiling": true
-}
\ No newline at end of file
diff --git a/testcases/host/camera/conventional/2_1/AndroidTest.xml b/testcases/host/camera/conventional/2_1/AndroidTest.xml
index da9362d..a082c41 100644
--- a/testcases/host/camera/conventional/2_1/AndroidTest.xml
+++ b/testcases/host/camera/conventional/2_1/AndroidTest.xml
@@ -25,6 +25,6 @@
</target_preparer>
<test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
<option name="test-case-path" value="vts/testcases/host/camera/conventional/2_1/SampleCameraV2Test" />
- <option name="test-config-path" value="vts-config/testcases/host/camera/conventional/2_1/SampleCameraV2Test.config" />
+ <option name="test-config-path" value="vts/testcases/host/camera/conventional/2_1/SampleCameraV2Test.config" />
</test>
</configuration>
diff --git a/testcases/host/camera/conventional/3_4/AndroidTest.xml b/testcases/host/camera/conventional/3_4/AndroidTest.xml
index 9e6eaf0..85eaac9 100644
--- a/testcases/host/camera/conventional/3_4/AndroidTest.xml
+++ b/testcases/host/camera/conventional/3_4/AndroidTest.xml
@@ -25,6 +25,6 @@
</target_preparer>
<test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
<option name="test-case-path" value="vts/testcases/host/camera/conventional/3_4/SampleCameraV3Test" />
- <option name="test-config-path" value="vts-config/testcases/host/camera/conventional/3_4/SampleCameraV3Test.config" />
+ <option name="test-config-path" value="vts/testcases/host/camera/conventional/3_4/SampleCameraV3Test.config" />
</test>
</configuration>
diff --git a/testcases/kernel/Android.mk b/testcases/kernel/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/kernel/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/kernel/__init__.py b/testcases/kernel/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/kernel/__init__.py
+++ /dev/null
diff --git a/testcases/kernel/cpu_profiling/Android.mk b/testcases/kernel/cpu_profiling/Android.mk
deleted file mode 100644
index e5f315e..0000000
--- a/testcases/kernel/cpu_profiling/Android.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# 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)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := CpuProfilingTest
-VTS_CONFIG_SRC_DIR := testcases/kernel/cpu_profiling
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/kernel/cpu_profiling/AndroidTest.xml b/testcases/kernel/cpu_profiling/AndroidTest.xml
deleted file mode 100644
index 551fbb1..0000000
--- a/testcases/kernel/cpu_profiling/AndroidTest.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS cpu profiling test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HostDrivenTest.push" />
- <option name="cleanup" value="true" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer"></target_preparer>
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-case-path" value="vts/testcases/kernel/cpu_profiling/CpuProfilingTest" />
- <option name="binary-test-sources" value="
- _32bit::DATA/nativetest/simpleperf_cpu_hotplug_test/simpleperf_cpu_hotplug_test,
- _64bit::DATA/nativetest64/simpleperf_cpu_hotplug_test/simpleperf_cpu_hotplug_test" />
- <option name="binary-test-type" value="gtest" />
- <option name="exclude-filter" value="cpu_offline.offline_while_ioctl_enable" />
- </test>
-</configuration>
diff --git a/testcases/kernel/cpu_profiling/CpuProfilingTest.py b/testcases/kernel/cpu_profiling/CpuProfilingTest.py
deleted file mode 100644
index 2025777..0000000
--- a/testcases/kernel/cpu_profiling/CpuProfilingTest.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/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 os
-
-from vts.runners.host import const
-from vts.runners.host import keys
-from vts.runners.host import test_runner
-from vts.utils.python.controllers import android_device
-
-from vts.testcases.template.gtest_binary_test import gtest_binary_test
-from vts.testcases.kernel.cpu_profiling import cpu_profiling_test_config as config
-
-
-class CpuProfilingTest(gtest_binary_test.GtestBinaryTest):
- """Runs cpu profiling test cases against Android OS kernel."""
-
- def setUpClass(self):
- """Creates a remote shell instance, and copies data files."""
- super(CpuProfilingTest, self).setUpClass()
- required_params = ["AndroidDevice"]
- self.getUserParams(req_param_names=required_params)
- self.product_type = self.AndroidDevice[0]['product_type']
-
- def generateAllTests(self):
- """Runs all gtests. Skip if device is excluded"""
- if self.product_type in config.CPT_HOTPLUG_EXCLUDE_DEVICES:
- logging.info("Skip test on device {}.".format(self.product_type))
- return
-
- super(CpuProfilingTest, self).generateAllTests()
-
-
-if __name__ == "__main__":
- test_runner.main()
diff --git a/testcases/kernel/cpu_profiling/__init__.py b/testcases/kernel/cpu_profiling/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/kernel/cpu_profiling/__init__.py
+++ /dev/null
diff --git a/testcases/kernel/cpu_profiling/cpu_profiling_test_config.py b/testcases/kernel/cpu_profiling/cpu_profiling_test_config.py
deleted file mode 100644
index 0ff9847..0000000
--- a/testcases/kernel/cpu_profiling/cpu_profiling_test_config.py
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/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.
-#
-
-CPT_HOTPLUG_EXCLUDE_DEVICES = [
-]
diff --git a/testcases/kernel/linux_kselftest/Android.mk b/testcases/kernel/linux_kselftest/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/kernel/linux_kselftest/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/kernel/linux_kselftest/LinuxKselftestTest.py b/testcases/kernel/linux_kselftest/LinuxKselftestTest.py
deleted file mode 100644
index 5698651..0000000
--- a/testcases/kernel/linux_kselftest/LinuxKselftestTest.py
+++ /dev/null
@@ -1,169 +0,0 @@
-#!/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 os
-
-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 keys
-from vts.runners.host import test_runner
-from vts.utils.python.controllers import android_device
-
-from vts.testcases.kernel.linux_kselftest import kselftest_config as config
-
-class LinuxKselftestTest(base_test_with_webdb.BaseTestWithWebDbClass):
- """Runs Linux Kselftest test cases against Android OS kernel.
-
- Attributes:
- _dut: AndroidDevice, the device under test as config
- _shell: ShellMirrorObject, shell mirror
- _testcases: string list, list of testcases to run
- """
- _32BIT = 32
- _64BIT = 64
-
- def setUpClass(self):
- """Creates a remote shell instance, and copies data files."""
- required_params = [
- keys.ConfigKeys.IKEY_DATA_FILE_PATH,
- config.ConfigKeys.TEST_TYPE
- ]
- self.getUserParams(required_params)
-
- logging.info("%s: %s", keys.ConfigKeys.IKEY_DATA_FILE_PATH,
- self.data_file_path)
-
- self._dut = self.registerController(android_device)[0]
- self._dut.shell.InvokeTerminal("one")
- self._shell = self._dut.shell.one
-
- # Presubmit test cases are always a subset of stable test cases.
- # Stable test cases are always a subset of staging test cases.
- if self.test_type == "presubmit":
- self._testcases = config.KSFT_CASES_PRESUBMIT
- elif self.test_type == "stable":
- self._testcases = (
- config.KSFT_CASES_PRESUBMIT +
- config.KSFT_CASES_STABLE)
- elif self.test_type == "staging":
- self._testcases = (
- config.KSFT_CASES_PRESUBMIT +
- config.KSFT_CASES_STABLE +
- config.KSFT_CASES_STAGING)
- else:
- asserts.fail("Test config is incorrect!")
-
- def tearDownClass(self):
- """Deletes all copied data."""
- self._shell.Execute("rm -rf %s" % config.KSFT_DIR)
-
- def PushFiles(self, n_bit):
- """adb pushes related file to target.
-
- Args:
- n_bit: _32BIT or 32 for 32-bit tests;
- _64BIT or 64 for 64-bit tests;
- """
- self._shell.Execute("mkdir %s -p" % config.KSFT_DIR)
- self._dut.adb.push("%s/%s/linux-kselftest/. %s" %
- (self.data_file_path, n_bit, config.KSFT_DIR))
-
- def PreTestSetup(self):
- """Sets up test before running."""
- # This sed command makes shell scripts compatible wiht android shell.
- sed_pattern = [
- 's?/bin/echo?echo?',
- 's?#!/bin/sh?#!/system/bin/sh?',
- 's?#!/bin/bash?#!/system/bin/sh?'
- ]
- sed_cmd = 'sed %s' % ' '.join(
- ['-i -e ' + ('"%s"' % p) for p in sed_pattern])
-
- # This grep command is used to identify shell scripts.
- grep_pattern = [
- 'bin/sh',
- 'bin/bash'
- ]
- grep_cmd = 'grep -l %s' % ' '.join(
- ['-e ' + ('"%s"' % p) for p in grep_pattern])
-
- # This applies sed_cmd to every shell script.
- cmd = 'find %s -type f | xargs %s | xargs %s' % (
- config.KSFT_DIR, grep_cmd, sed_cmd)
- result = self._shell.Execute(cmd)
-
- asserts.assertFalse(
- any(result[const.EXIT_CODE]),
- "Error: pre-test setup failed.")
-
- def RunTestcase(self, testcase):
- """Runs the given testcase and asserts the result.
-
- Args:
- testcase: string, format testsuite/testname, specifies which
- test case to run.
- """
- chmod_cmd = "chmod -R 755 %s" % os.path.join(
- config.KSFT_DIR, testcase.testsuite)
- cd_cmd = "cd %s" % os.path.join(config.KSFT_DIR, testcase.testsuite)
-
- cmd = [
- chmod_cmd,
- "%s && %s" % (cd_cmd, testcase.test_cmd)
- ]
- logging.info("Executing: %s", cmd)
-
- result = self._shell.Execute(cmd)
- logging.info("EXIT_CODE: %s:", result[const.EXIT_CODE])
-
- asserts.assertFalse(
- any(result[const.EXIT_CODE]),
- "%s failed." % testcase.testname)
-
- def TestNBits(self, n_bit):
- """Runs all 32-bit or all 64-bit tests.
-
- Args:
- n_bit: _32BIT or 32 for 32-bit tests;
- _64BIT or 64 for 64-bit tests;
- """
- self.PushFiles(n_bit)
- self.PreTestSetup()
-
- cpu_abi = self._dut.cpu_abi
- relevant_testcases = filter(
- lambda x: x.IsRelevant(cpu_abi, n_bit), self._testcases)
-
- self.runGeneratedTests(
- test_func=self.RunTestcase,
- settings=relevant_testcases,
- name_func=lambda testcase: "%s_%sbit" % (
- testcase.testname.replace('/','_'), n_bit))
-
- def generate32BitTests(self):
- """Runs all 32-bit tests."""
- self.TestNBits(self._32BIT)
-
- def generate64BitTests(self):
- """Runs all 64-bit tests."""
- if self._dut.is64Bit:
- self.TestNBits(self._64BIT)
-
-if __name__ == "__main__":
- test_runner.main()
diff --git a/testcases/kernel/linux_kselftest/__init__.py b/testcases/kernel/linux_kselftest/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/kernel/linux_kselftest/__init__.py
+++ /dev/null
diff --git a/testcases/kernel/linux_kselftest/kselftest_config.py b/testcases/kernel/linux_kselftest/kselftest_config.py
deleted file mode 100644
index 3f386a2..0000000
--- a/testcases/kernel/linux_kselftest/kselftest_config.py
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/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.
-#
-
-from vts.testcases.kernel.linux_kselftest import test_case
-
-class ConfigKeys(object):
- TEST_TYPE = "test_type"
-
-class ExitCode(object):
- """Exit codes for test binaries and test scripts."""
- KSFT_PASS = 0
- KSFT_FAIL = 1
- KSFT_XPASS = 2
- KSFT_XFAIL = 3
- KSFT_SKIP = 4
-
-# Directory on the target where the tests are copied.
-KSFT_DIR = "/data/local/tmp/linux-kselftest"
-
-# Presubmit, stable, and staging lists are always mutually exclusive.
-KSFT_CASES_PRESUBMIT = map(lambda x: test_case.LinuxKselftestTestcase(*(x)), [
- ("futex/functional/futex_wait_timeout", ["arm", "x86"], [32, 64]),
- ("futex/functional/futex_wait_wouldblock", ["arm", "x86"], [32, 64]),
- ("futex/functional/futex_requeue_pi_mismatched_ops", ["arm", "x86"], [32, 64]),
- ("futex/functional/futex_wait_uninitialized_heap", ["arm", "x86"], [32]),
- ("futex/functional/futex_wait_private_mapped_file", ["arm", "x86"], [32, 64]),
- ("net/socket", ["arm", "x86"], [32, 64]),
-])
-
-KSFT_CASES_STABLE = map(lambda x: test_case.LinuxKselftestTestcase(*(x)), [
- ("net/psock_tpacket", ["arm", "x86"], [32, 64]),
- ("ptrace/peeksiginfo", ["arm", "x86"], [64]),
- ("seccomp/seccomp_bpf", ["arm", "x86"], [32, 64]),
- ("timers/posix_timers", ["arm", "x86"], [32, 64]),
- ("timers/nanosleep", ["arm", "x86"], [32, 64]),
- ("timers/nsleep-lat", ["arm", "x86"], [32, 64]),
- ("timers/set-timer-lat", ["arm", "x86"], [32, 64]),
- ("timers/inconsistency-check", ["arm", "x86"], [32, 64]),
- ("timers/alarmtimer-suspend", ["arm", "x86"], [32, 64]),
- ("timers/raw_skew", ["arm", "x86"], [32, 64]),
- ("timers/threadtest", ["arm", "x86"], [32, 64]),
- ("timers/set-tai", ["arm", "x86"], [32, 64]),
- ("timers/valid-adjtimex", ["arm", "x86"], [64]),
-])
-
-KSFT_CASES_STAGING = map(lambda x: test_case.LinuxKselftestTestcase(*(x)), [
- ("pstore/pstore_tests", ["arm", "x86"], [32, 64]),
- ("x86/single_step_syscall", ["x86"], [32, 64]),
- ("x86/sysret_ss_attrs", ["x86"], [32]),
- ("x86/syscall_nt", ["x86"], [32, 64]),
- ("x86/ptrace_syscall", ["x86"], [32, 64]),
- ("x86/test_mremap_vdso", ["x86"], [32, 64]),
- ("x86/check_initial_reg_state", ["x86"], [32, 64]),
- ("x86/ldt_gdt", ["x86"], [32, 64]),
- ("x86/syscall_arg_fault", ["x86"], [32]),
- ("x86/test_syscall_vdso", ["x86"], [32]),
- ("x86/unwind_vdso", ["x86"], [32]),
- ("x86/test_FCMOV", ["x86"], [32]),
- ("x86/test_FCOMI", ["x86"], [32]),
- ("x86/test_FISTTP", ["x86"], [32]),
- ("x86/vdso_restorer", ["x86"], [32]),
-])
diff --git a/testcases/kernel/linux_kselftest/presubmit/Android.mk b/testcases/kernel/linux_kselftest/presubmit/Android.mk
deleted file mode 100644
index 949462b..0000000
--- a/testcases/kernel/linux_kselftest/presubmit/Android.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# 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)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := LinuxKselftestTestPresubmit
-VTS_CONFIG_SRC_DIR := testcases/kernel/linux_kselftest/presubmit
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/kernel/linux_kselftest/presubmit/AndroidTest.xml b/testcases/kernel/linux_kselftest/presubmit/AndroidTest.xml
deleted file mode 100644
index 6bf4719..0000000
--- a/testcases/kernel/linux_kselftest/presubmit/AndroidTest.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS kernel linux-kselftest test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HostDrivenTest.push" />
- <option name="cleanup" value="true" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer">
- </target_preparer>
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="LinuxKselftestTestPresubmit" />
- <option name="test-case-path" value="vts/testcases/kernel/linux_kselftest/LinuxKselftestTest" />
- <option name="test-config-path" value="vts-config/testcases/kernel/linux_kselftest/presubmit/LinuxKselftestTestPresubmit.config" />
- </test>
-</configuration>
diff --git a/testcases/kernel/linux_kselftest/presubmit/LinuxKselftestTestPresubmit.config b/testcases/kernel/linux_kselftest/presubmit/LinuxKselftestTestPresubmit.config
deleted file mode 100644
index 84f7a6f..0000000
--- a/testcases/kernel/linux_kselftest/presubmit/LinuxKselftestTestPresubmit.config
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "test_type": "presubmit"
-}
diff --git a/testcases/kernel/linux_kselftest/presubmit/__init__.py b/testcases/kernel/linux_kselftest/presubmit/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/kernel/linux_kselftest/presubmit/__init__.py
+++ /dev/null
diff --git a/testcases/kernel/linux_kselftest/stable/Android.mk b/testcases/kernel/linux_kselftest/stable/Android.mk
deleted file mode 100644
index b8b7118..0000000
--- a/testcases/kernel/linux_kselftest/stable/Android.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# 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)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := LinuxKselftestTest
-VTS_CONFIG_SRC_DIR := testcases/kernel/linux_kselftest/stable
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/kernel/linux_kselftest/stable/AndroidTest.xml b/testcases/kernel/linux_kselftest/stable/AndroidTest.xml
deleted file mode 100644
index b8d73d8..0000000
--- a/testcases/kernel/linux_kselftest/stable/AndroidTest.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS kernel linux-kselftest test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HostDrivenTest.push" />
- <option name="cleanup" value="true" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer">
- </target_preparer>
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="LinuxKselftestTest" />
- <option name="test-case-path" value="vts/testcases/kernel/linux_kselftest/LinuxKselftestTest" />
- <option name="test-config-path" value="vts-config/testcases/kernel/linux_kselftest/stable/LinuxKselftestTest.config" />
- </test>
-</configuration>
diff --git a/testcases/kernel/linux_kselftest/stable/LinuxKselftestTest.config b/testcases/kernel/linux_kselftest/stable/LinuxKselftestTest.config
deleted file mode 100644
index 29c4df4..0000000
--- a/testcases/kernel/linux_kselftest/stable/LinuxKselftestTest.config
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "test_type": "stable"
-}
diff --git a/testcases/kernel/linux_kselftest/stable/__init__.py b/testcases/kernel/linux_kselftest/stable/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/kernel/linux_kselftest/stable/__init__.py
+++ /dev/null
diff --git a/testcases/kernel/linux_kselftest/staging/Android.mk b/testcases/kernel/linux_kselftest/staging/Android.mk
deleted file mode 100644
index 3a15fc7..0000000
--- a/testcases/kernel/linux_kselftest/staging/Android.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# 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)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := LinuxKselftestTestStaging
-VTS_CONFIG_SRC_DIR := testcases/kernel/linux_kselftest/staging
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/kernel/linux_kselftest/staging/AndroidTest.xml b/testcases/kernel/linux_kselftest/staging/AndroidTest.xml
deleted file mode 100644
index 294ff33..0000000
--- a/testcases/kernel/linux_kselftest/staging/AndroidTest.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS kernel linux-kselftest test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HostDrivenTest.push" />
- <option name="cleanup" value="true" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer">
- </target_preparer>
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="LinuxKselftestTestStaging" />
- <option name="test-case-path" value="vts/testcases/kernel/linux_kselftest/LinuxKselftestTest" />
- <option name="test-config-path" value="vts-config/testcases/kernel/linux_kselftest/staging/LinuxKselftestTestStaging.config" />
- </test>
-</configuration>
diff --git a/testcases/kernel/linux_kselftest/staging/LinuxKselftestTestStaging.config b/testcases/kernel/linux_kselftest/staging/LinuxKselftestTestStaging.config
deleted file mode 100644
index 63a1e42..0000000
--- a/testcases/kernel/linux_kselftest/staging/LinuxKselftestTestStaging.config
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "test_type": "staging"
-}
diff --git a/testcases/kernel/linux_kselftest/staging/__init__.py b/testcases/kernel/linux_kselftest/staging/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/kernel/linux_kselftest/staging/__init__.py
+++ /dev/null
diff --git a/testcases/kernel/linux_kselftest/test_case.py b/testcases/kernel/linux_kselftest/test_case.py
deleted file mode 100644
index c0994c7..0000000
--- a/testcases/kernel/linux_kselftest/test_case.py
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/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.
-#
-
-class LinuxKselftestTestcase(object):
- """Stores information needed to run the test case.
-
- Attrubutes:
- _testname: string, name of the testcase.
- _testsuite: string, name of suite this testcase belongs to.
- _test_cmd: string, shell command used to invoke this testcase.
- _supported_arch: string list, architectures this testcase supports,
- e.g. ["arm", "x86"].
- _supported_bits: int list, bit version (32 or 64) of the testcase that
- are currently supported, e.g. [32, 64].
- """
- def __init__(self, testname, supported_arch, supported_bits):
- items = testname.split("/", 1)
- self._testname = testname
- self._testsuite = items[0]
- self._test_cmd = "./%s" % items[1]
- self._supported_arch = supported_arch
- self._supported_bits = supported_bits
-
- @property
- def testname(self):
- """Get test name."""
- return self._testname
-
- @property
- def testsuite(self):
- """Get test suite."""
- return self._testsuite
-
- @property
- def test_cmd(self):
- """Get test command."""
- return self._test_cmd
-
- @property
- def supported_arch(self):
- """Get list of architectures this test can run against."""
- return self._supported_arch
-
- @property
- def supported_bits(self):
- """Get list of versions (32 or 64 bit) of the test case that can run."""
- return self._supported_bits
-
- def IsRelevant(self, cpu_abi, n_bit):
- """Checks whether this test case can run in n_bit against this cpu_abi.
-
- Returns:
- True if this testcase can run; False otherwise.
- """
- if cpu_abi is None or n_bit is None:
- return False
-
- if not n_bit in self._supported_bits:
- return False
-
- for arch in self._supported_arch:
- if cpu_abi.find(arch) >= 0:
- return True
-
- return False
-
diff --git a/testcases/kernel/ltp/Android.mk b/testcases/kernel/ltp/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/kernel/ltp/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/kernel/ltp/KernelLtpTest.py b/testcases/kernel/ltp/KernelLtpTest.py
deleted file mode 100644
index 29cd995..0000000
--- a/testcases/kernel/ltp/KernelLtpTest.py
+++ /dev/null
@@ -1,478 +0,0 @@
-#!/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 random
-import logging
-from concurrent import futures
-import queue
-import threading
-import os
-
-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 keys
-from vts.runners.host import test_runner
-from vts.utils.python.common import cmd_utils
-from vts.utils.python.controllers import android_device
-
-from vts.testcases.kernel.ltp import test_cases_parser
-from vts.testcases.kernel.ltp import environment_requirement_checker as env_checker
-from vts.testcases.kernel.ltp.shell_environment import shell_environment
-from vts.testcases.kernel.ltp import ltp_enums
-from vts.testcases.kernel.ltp import ltp_configs
-
-
-class KernelLtpTest(base_test_with_webdb.BaseTestWithWebDbClass):
- """Runs the LTP (Linux Test Project) test cases against Android OS kernel.
-
- Attributes:
- _dut: AndroidDevice, the device under test
- _shell: ShellMirrorObject, shell mirror object used to execute commands
- _testcases: TestcasesParser, test case input parser
- _env: dict<stirng, string>, dict of environment variable key value pair
- data_file_path: string, runner's directory where test cases are stored
- run_staging: bool, whether to run staging tests
- number_of_threads: int, number of threads to run in parallel. If this
- number is set to 0, the test case will automatically
- pick the number of available CPUs on device. If
- the number is less than 0, it will be set to 1. If
- the number is greater than 0, that number of threads
- will be created to run the tests.
- include_filter: list of string, a list of test case names to run
- exclude_filter: list of string, a list of test case names to exclude
- """
- _32BIT = "32"
- _64BIT = "64"
- _PASS = 0
- _SKIP = 1
- _FAIL = -1
-
- def setUpClass(self):
- """Creates a remote shell instance, and copies data files."""
- required_params = [
- keys.ConfigKeys.IKEY_DATA_FILE_PATH,
- keys.ConfigKeys.KEY_TEST_SUITE, ltp_enums.ConfigKeys.RUN_STAGING,
- ltp_enums.ConfigKeys.RUN_32BIT, ltp_enums.ConfigKeys.RUN_64BIT,
- ltp_enums.ConfigKeys.NUMBER_OF_THREADS
- ]
- self.getUserParams(required_params)
-
- logging.info("%s: %s", keys.ConfigKeys.IKEY_DATA_FILE_PATH,
- self.data_file_path)
- logging.info("%s: %s", keys.ConfigKeys.KEY_TEST_SUITE, self.test_suite)
- logging.info("%s: %s", ltp_enums.ConfigKeys.RUN_STAGING,
- self.run_staging)
- logging.info("%s: %s", ltp_enums.ConfigKeys.NUMBER_OF_THREADS,
- self.number_of_threads)
-
- self.include_filter = self.ExpandFilter(self.include_filter)
- self.exclude_filter = self.ExpandFilter(self.exclude_filter)
-
- self._dut = self.registerController(android_device)[0]
- logging.info("product_type: %s", self._dut.product_type)
- self._dut.shell.InvokeTerminal("one")
- self.shell = self._dut.shell.one
-
- self._requirement = env_checker.EnvironmentRequirementChecker(
- self.shell)
- self._shell_env = shell_environment.ShellEnvironment(self.shell)
-
- disabled_tests = self.ExpandFilter(ltp_configs.DISABLED_TESTS)
- staging_tests = self.ExpandFilter(ltp_configs.STAGING_TESTS)
- self._testcases = test_cases_parser.TestCasesParser(
- self.data_file_path, self.filterOneTest, disabled_tests,
- staging_tests)
-
- self._env = {ltp_enums.ShellEnvKeys.TMP: ltp_configs.TMP,
- ltp_enums.ShellEnvKeys.TMPBASE: ltp_configs.TMPBASE,
- ltp_enums.ShellEnvKeys.LTPTMP: ltp_configs.LTPTMP,
- ltp_enums.ShellEnvKeys.TMPDIR: ltp_configs.TMPDIR,
- ltp_enums.ShellEnvKeys.LTP_DEV_FS_TYPE:
- ltp_configs.LTP_DEV_FS_TYPE,
- ltp_enums.ShellEnvKeys.LTPROOT: ltp_configs.LTPDIR,
- ltp_enums.ShellEnvKeys.PATH: ltp_configs.PATH}
-
- @property
- def shell(self):
- """returns an object that can execute a shell command"""
- return self._shell
-
- @shell.setter
- def shell(self, shell):
- """Set shell object"""
- self._shell = shell
-
- def ExpandFilter(self, input_list):
- '''Expand filter items with bitness suffix.
-
- If a filter item contains bitness suffix, only test name with that tag will be included
- in output.
- Otherwise, both 32bit and 64bit suffix will be paired to the test name in output
- list.
-
- Args:
- input_list: list of string, the list to expand
-
- Returns:
- A list of string
- '''
- result = []
- for item in input_list:
- if (item.endswith(const.SUFFIX_32BIT) or
- item.endswith(const.SUFFIX_64BIT)):
- result.append(item)
- else:
- result.append("%s_%s" % (item, const.SUFFIX_32BIT))
- result.append("%s_%s" % (item, const.SUFFIX_64BIT))
- return result
-
- def PreTestSetup(self, n_bit):
- """Setups that needs to be done before any tests."""
- replacements = {'#\\!/bin/sh': '#\\!/system/bin/sh',
- '#\\! /bin/sh': '#\\!/system/bin/sh',
- '#\\!/bin/bash': '#\\!/system/bin/sh',
- '#\\! /bin/bash': '#\\!/system/bin/sh',
- 'bs=1M': 'bs=1m',
- '/var/run': ltp_configs.TMP}
- src_host = os.path.join(self.data_file_path, str(n_bit), 'ltp')
- sed_command = self._shell_env.CreateSedCommand(src_host, replacements)
- logging.info('Executing sed commands on host: %s', sed_command)
- results = cmd_utils.ExecuteShellCommand(sed_command)
- logging.info('Finished sed commands on host. Results: %s', results)
- asserts.assertFalse(
- any(results[cmd_utils.EXIT_CODE]),
- "Error: pre-test setup failed. "
- "Commands: {commands}. Results: {results}".format(
- commands=sed_command, results=results))
-
- self._report_thread_lock = threading.Lock()
-
- def PushFiles(self, n_bit):
- """Push the related files to target.
-
- Args:
- n_bit: int, bitness
- """
- src = os.path.join(self.data_file_path, str(n_bit), 'ltp', '.')
- logging.info('Pushing files from %s to %s', src, ltp_configs.LTPDIR)
- self.shell.Execute("mkdir %s -p" % ltp_configs.LTPDIR)
- self._dut.adb.push(src, ltp_configs.LTPDIR)
- logging.info('finished pushing files from %s to %s', src,
- ltp_configs.LTPDIR)
-
- def GetEnvp(self):
- """Generate the environment variable required to run the tests."""
- return ' '.join("%s=%s" % (key, value)
- for key, value in self._env.items())
-
- def tearDownClass(self):
- """Deletes all copied data files."""
- self.shell.Execute("rm -rf %s" % ltp_configs.LTPDIR)
- self._requirement.Cleanup()
-
- def Verify(self, results):
- """Interpret the test result of each test case.
-
- Returns:
- tuple(int, string), a tuple of int which represents test pass, fail
- or skip, and string representing the reason of a failed or skipped
- test
- """
- if not results:
- return (self._FAIL, "No response received. Socket timeout")
-
- # For LTP test cases, we run one shell command for each test case
- # So the result should also contains only one execution output
- stdout = results[const.STDOUT][0]
- ret_code = results[const.EXIT_CODE][0]
- # Test case is not for the current configuration, SKIP
- if ((ret_code == ltp_enums.TestExitCode.TCONF and
- 'TPASS' not in stdout) or
- (ret_code == ltp_enums.TestExitCode.TPASS and 'CONF' in stdout)):
- return (self._SKIP, "Incompatible test skipped: TCONF")
- elif ret_code not in (ltp_enums.TestExitCode.TCONF,
- ltp_enums.TestExitCode.TPASS):
- return (self._FAIL,
- "Got return code %s, test did not pass." % ret_code)
- else:
- return (self._PASS, None)
-
- def CheckResult(self, cmd_results, result=None, note=None):
- """Check a test result and emit exceptions if test failed or skipped.
-
- If the shell command result is not yet interpreted, self.Verify will
- be called to interpret the results.
-
- Args:
- cmd_results: dict([str],[str],[int]), command results from shell.
- result: int, which is one of the values of _PASS, _SKIP, and _FAIL
- note: string, reason why a test failed or get skipped
- """
- asserts.assertTrue(cmd_results, "No response received. Socket timeout")
-
- logging.info("stdout: %s", cmd_results[const.STDOUT])
- logging.info("stderr: %s", cmd_results[const.STDERR])
- logging.info("exit_code: %s", cmd_results[const.EXIT_CODE])
-
- if result is None:
- result, note = self.Verify(cmd_results)
- logging.info("verify result: %s", result)
- logging.info("note: %s", note)
-
- asserts.skipIf(result == self._SKIP, note)
- asserts.assertEqual(result, self._PASS, note)
-
- def TestNBits(self, n_bit):
- """Runs all 32-bit or 64-bit LTP test cases.
-
- Args:
- n_bit: int, bitness
- """
- self.PreTestSetup(n_bit)
- self.PushFiles(n_bit)
-
- test_cases = list(
- self._testcases.Load(
- ltp_configs.LTPDIR, n_bit=n_bit, run_staging=self.run_staging))
-
- logging.info("Checking binary exists for all test cases.")
- self._requirement.ltp_bin_host_path = os.path.join(
- self.data_file_path, str(n_bit), 'ltp', 'testcases', 'bin')
- self._requirement.CheckAllTestCaseExecutables(test_cases)
- logging.info("Start running %i individual tests." % len(test_cases))
-
- self.RunGeneratedTestsMultiThread(
- test_func=self.RunLtpOnce,
- settings=test_cases,
- args=(n_bit, ),
- name_func=self.GetTestName)
-
- def RunGeneratedTestsMultiThread(self, test_func, settings, args,
- name_func):
- """Run LTP tests with multi-threads.
-
- If number_of_thread is specified to be 0 in config file, a shell query
- will be made to the device to get the number of available CPUs. If
- number_of_thread or number of CPUs available is 1, this function will
- call and return parent class's regular runGeneratedTest function. Since
- some tests may be competing resources with each other, all the failed
- tests will be rerun sequentially in the end to confirm their failure.
- Also, if include_filter is not empty, only 1 thread will be running.
-
- Args:
- test_func: The common logic shared by all these generated test
- cases. This function should take at least one argument,
- which is a parameter set.
- settings: A list of strings representing parameter sets. These are
- usually json strings that get loaded in the test_func.
- args: Iterable of additional position args to be passed to
- test_func.
- name_func: A function that takes a test setting and generates a
- proper test name.
-
- Returns:
- A list of settings that fail.
- """
- n_workers = self.number_of_threads
-
- if n_workers < 0:
- logging.error('invalid setting for number of threads: < 0.')
- n_workers = 1
-
- # Include filter is not empty; Run in sequential.
- if self.include_filter:
- n_workers = 1
-
- # Number of thread is set to 0 (automatic)
- if not n_workers:
- n_workers = self._shell_env.GetDeviceNumberOfPresentCpu()
- logging.info('Number of CPU available on device: %i', n_workers)
-
- # Skip multithread version if only 1 worker available
- if n_workers == 1:
- return self.runGeneratedTests(
- test_func=test_func,
- settings=settings,
- args=args,
- name_func=name_func)
-
- settings_multithread = []
- settings_singlethread = []
- for test_case in settings:
- if (test_case.is_staging or test_case.testsuite in
- ltp_configs.TEST_SUITES_REQUIRE_SINGLE_THREAD_MODE):
- settings_singlethread.append(test_case)
- else:
- settings_multithread.append(test_case)
-
- failed_tests = self.runGeneratedTests(
- test_func=test_func,
- settings=settings_singlethread,
- args=args,
- name_func=name_func)
-
- # Shuffle the tests to reduce resource competition probability
- random.shuffle(settings_multithread)
-
- # Create a queue for thread workers to pull tasks
- q = queue.Queue()
- map(q.put, settings_multithread)
-
- # Create individual shell sessions for thread workers
- for i in xrange(n_workers):
- self._dut.shell.InvokeTerminal("shell_thread_{}".format(i))
-
- failed_multithread_tests = set()
- with futures.ThreadPoolExecutor(max_workers=n_workers) as executor:
- fs = [executor.submit(self.RunLtpWorker, q, args, name_func, i)
- for i in xrange(n_workers)]
-
- failed_test_sets = map(futures.Future.result, fs)
- for failed_test_set in failed_test_sets:
- for test_case in failed_test_set:
- failed_multithread_tests.add(test_case)
-
- for test_case in failed_multithread_tests:
- logging.info(
- "Test case %s failed during multi-thread run, rerunning...",
- test_case)
-
- # In the end, rerun all failed tests to confirm their failure
- # in sequential.
- failed_tests.extend(
- self.runGeneratedTests(
- test_func=test_func,
- settings=failed_multithread_tests,
- args=args,
- name_func=name_func))
-
- return failed_tests
-
- def RunLtpWorker(self, testcases, args, name_func, id):
- """Worker thread to run a LTP test case at a time."""
- shell = getattr(self._dut.shell, "shell_thread_{}".format(id))
- failed_tests = set()
-
- while True:
- test_case = None
- try:
- test_case = testcases.get(block=False)
- logging.info("Worker {} takes '{}'.".format(id, test_case))
- except:
- logging.info("Worker {} finished.".format(id))
- return failed_tests
-
- test_name = name_func(test_case, *args)
-
- # Check whether test case is filtered out by base_test's filtering method
- if test_case.is_filtered:
- self.InternalResultReportMultiThread(test_name, asserts.skipIf,
- (False, test_case.note))
- continue
- logging.info("Worker {} starts checking requirement "
- "for '{}'.".format(id, test_case))
-
- # Check test requirements
- requirement_satisfied = self._requirement.Check(test_case)
- if not requirement_satisfied:
- logging.info("Worker {} reports requirement "
- "not satisfied for '{}'.".format(id, test_case))
- self.InternalResultReportMultiThread(test_name, asserts.skipIf,
- (False, test_case.note))
- continue
-
- cmd = "export {envp} && {commands}".format(
- envp=self.GetEnvp(), commands=test_case.GetCommand())
-
- logging.info("Worker {} starts executing command "
- "for '{}'.\n Command:{}".format(id, test_case, cmd))
- cmd_results = shell.Execute(cmd)
-
- logging.info("Worker {} starts verifying results "
- "for '{}'.".format(id, test_case))
-
- result, note = self.Verify(cmd_results)
- if result == self._FAIL:
- # Hide failed tests from the runner and put into rerun list
- logging.info("Worker {} reports '{}' failed. Adding to "
- "sequential job queue.".format(id, test_case))
- failed_tests.add(test_case)
- else:
- # Report skipped or passed tests to runner
- self.InternalResultReportMultiThread(
- test_name, self.CheckResult, (cmd_results, result, note))
-
- def InternalResultReportMultiThread(self, test_name, function, args,
- **kwargs):
- """Report a test result to runner thread safely.
-
- Run the given function to generate result for the runner. The function
- given should produce the same result visible to the runner but may not
- run any actual tests.
-
- Args:
- test_name: string, name of a test case
- function: the function to generate a test case result for runner
- args: any arguments for the function
- **kwargs: any additional keyword arguments for runner
- """
- self._report_thread_lock.acquire()
- self.results.requested.append(test_name)
- try:
- self.execOneTest(test_name, function, args, **kwargs)
- except Exception as e:
- raise e
- finally:
- self._report_thread_lock.release()
-
- def GetTestName(self, test_case, n_bit):
- "Generate the vts test name of a ltp test"
- return "{}_{}bit".format(test_case, n_bit)
-
- def RunLtpOnce(self, test_case, n_bit):
- "Run one LTP test case"
- asserts.skipIf(test_case.is_filtered, test_case.note)
- asserts.skipIf(not self._requirement.Check(test_case), test_case.note)
-
- cmd = "export {envp} && {commands}".format(
- envp=self.GetEnvp(), commands=test_case.GetCommand())
- logging.info("Executing %s", cmd)
- self.CheckResult(self.shell.Execute(cmd))
-
- def generate64BitTests(self):
- """Runs all 64-bit LTP test cases."""
- if not self.run_64bit:
- logging.info('User specified not to run 64 bit version LTP tests.')
- return
- if not self._dut.is64Bit:
- logging.info('Target device does not support 64 bit tests.')
- return
-
- self.TestNBits(self._64BIT)
-
- def generate32BitTests(self):
- """Runs all 32-bit LTP test cases."""
- if not self.run_32bit:
- logging.info('User specified not to run 32 bit version LTP tests.')
- return
-
- self.TestNBits(self._32BIT)
-
-
-if __name__ == "__main__":
- test_runner.main()
diff --git a/testcases/kernel/ltp/__init__.py b/testcases/kernel/ltp/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/kernel/ltp/__init__.py
+++ /dev/null
diff --git a/testcases/kernel/ltp/environment_requirement_checker.py b/testcases/kernel/ltp/environment_requirement_checker.py
deleted file mode 100644
index dccae1f..0000000
--- a/testcases/kernel/ltp/environment_requirement_checker.py
+++ /dev/null
@@ -1,218 +0,0 @@
-#!/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 os
-import copy
-import logging
-import itertools
-import operator
-
-from vts.runners.host import const
-from vts.utils.python.common import cmd_utils
-
-from vts.testcases.kernel.ltp.shell_environment import shell_environment
-from vts.testcases.kernel.ltp import ltp_enums
-from vts.testcases.kernel.ltp import ltp_configs
-from vts.testcases.kernel.ltp import requirements
-
-
-class EnvironmentRequirementChecker(object):
- """LTP testcase environment checker.
-
- This class contains a dictionary for some known environment
- requirements for a set of test cases and several environment
- check functions to be mapped with. All check functions' results
- are cached in a dictionary for multiple use.
-
- Attributes:
- _REQUIREMENT_DEFINITIONS: dictionary {string, obj}, a map between
- requirement name and the actual definition class object
- _result_cache: dictionary {requirement_check_method_name:
- (bool, string)}, a map between check method name and cached result
- tuples (boolean, note)
- _executable_available: dict {string, bool}, a map between executable
- path and its existance on target
- _shell_env: ShellEnvironment object, which checks and sets
- shell environments given a shell mirror
- shell: shell mirror object, can be used to execute shell
- commands on target side through runner
- ltp_bin_host_path: string, host path of ltp binary
- """
-
- def __init__(self, shell):
- self.shell = shell
- self._result_cache = {}
- self._executable_available = {}
- self._shell_env = shell_environment.ShellEnvironment(self.shell)
- self._REQUIREMENT_DEFINITIONS = requirements.GetRequrementDefinitions()
-
- @property
- def shell(self):
- """Get the runner's shell mirror object to execute commands"""
- return self._shell
-
- @shell.setter
- def shell(self, shell):
- """Set the runner's shell mirror object to execute commands"""
- self._shell = shell
-
- def Cleanup(self):
- """Run all cleanup jobs at the end of tests"""
- self._shell_env.Cleanup()
-
- def GetRequirements(self, test_case):
- """Get a list of requirements for a fiven test case
-
- Args:
- test_case: TestCase object, the test case to query
- """
- result = copy.copy(ltp_configs.REQUIREMENT_FOR_ALL)
-
- result.extend(
- rule
- for rule, tests in ltp_configs.REQUIREMENTS_TO_TESTCASE.iteritems()
- if test_case.fullname in tests)
-
- result.extend(
- rule
- for rule, tests in ltp_configs.REQUIREMENT_TO_TESTSUITE.iteritems()
- if test_case.testsuite in tests)
-
- return list(set(result))
-
- def Check(self, test_case):
- """Check whether a given test case's requirement has been satisfied.
- Skip the test if not.
-
- If check failed, this method returns False and the reason is set
- to test_case.note.
-
- Args:
- test_case: TestCase object, a given test case to check
-
- Returns:
- True if check pass; False otherwise
- """
- if (test_case.requirement_state ==
- ltp_enums.RequirementState.UNSATISFIED or
- not self.TestBinaryExists(test_case)):
- return False
-
- for requirement in self.GetRequirements(test_case):
- if requirement not in self._result_cache:
- definitions = self._REQUIREMENT_DEFINITIONS[requirement]
- self._result_cache[
- requirement] = self._shell_env.ExecuteDefinitions(
- definitions)
-
- result, note = self._result_cache[requirement]
- logging.info("Result for %s's requirement %s is %s", test_case,
- requirement, result)
- if result is False:
- test_case.requirement_state = ltp_enums.RequirementState.UNSATISFIED
- test_case.note = note
- return False
-
- test_case.requirement_state = ltp_enums.RequirementState.SATISFIED
- return True
-
- def CheckAllTestCaseExecutables(self, test_cases):
- """Run a batch job to check executable exists and set permissions.
-
- The result will be stored in self._executable_available for use in
- TestBinaryExists method.
-
- Args:
- test_case: list of TestCase objects.
- """
- executables_generators = (
- test_case.GetRequiredExecutablePaths(self.ltp_bin_host_path)
- for test_case in test_cases)
- executables = list(
- set(itertools.chain.from_iterable(executables_generators)))
-
- # Set all executables executable permission using chmod.
- logging.info("Setting permissions on device")
- permission_command = "chmod 775 %s" % os.path.join(
- ltp_configs.LTPBINPATH, '*')
- permission_result = self.shell.Execute(permission_command)
- if permission_result[const.EXIT_CODE][0]:
- logging.error("Permission command '%s' failed.",
- permission_command)
-
- # Check existence of all executables used in test definition.
- # Some executables needed by test cases but not listed in test
- # definition will not be checked here
- executable_exists_commands = [
- "ls %s" % executable for executable in executables
- if executable not in ltp_configs.INTERNAL_BINS
- ]
- logging.info("Checking binary existence on host: %s",
- executable_exists_commands)
-
- cmd_results = cmd_utils.ExecuteShellCommand(executable_exists_commands)
- executable_exists_results = map(operator.not_,
- cmd_results[cmd_utils.EXIT_CODE])
- logging.info("Finished checking binary existence on host: %s",
- cmd_results)
-
- self._executable_available = dict(
- zip(executables, executable_exists_results))
-
- # Check whether all the internal binaries in path needed exist
- bin_path_exist_commands = ["which %s" % bin
- for bin in ltp_configs.INTERNAL_BINS]
- bin_path_results = map(
- operator.not_,
- self.shell.Execute(bin_path_exist_commands)[const.EXIT_CODE])
-
- bin_path_results = map(
- operator.not_,
- self.shell.Execute(bin_path_exist_commands)[const.EXIT_CODE])
-
- self._executable_available.update(
- dict(zip(ltp_configs.INTERNAL_BINS, bin_path_results)))
-
- def TestBinaryExists(self, test_case):
- """Check whether the given test case's binary exists.
-
- Args:
- test_case: TestCase, the object representing the test case
-
- Return:
- True if exists, False otherwise
- """
- if test_case.requirement_state == ltp_enums.RequirementState.UNSATISFIED:
- logging.warn("[Checker] Attempting to run test case that has "
- "already been checked and requirement not satisfied."
- "%s" % test_case)
- return False
-
- executables = test_case.GetRequiredExecutablePaths(
- self.ltp_bin_host_path)
- results = [self._executable_available[executable]
- for executable in executables]
-
- if not all(results):
- test_case.requirement_state = ltp_enums.RequirementState.UNSATISFIED
- test_case.note = "Some executables not exist: {}".format(
- zip(executables, results))
- logging.error("[Checker] Binary existance check failed for {}. "
- "Reason: {}".format(test_case, test_case.note))
- return False
- else:
- return True
diff --git a/testcases/kernel/ltp/ltp_configs.py b/testcases/kernel/ltp/ltp_configs.py
deleted file mode 100644
index 65099a4..0000000
--- a/testcases/kernel/ltp/ltp_configs.py
+++ /dev/null
@@ -1,575 +0,0 @@
-#!/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 os
-
-from vts.testcases.kernel.ltp import ltp_enums
-
-VTS_LTP_OUTPUT = 'ltp'
-LTP_RUNTEST_DIR = os.path.join(VTS_LTP_OUTPUT, 'runtest')
-LTP_DISABLED_BUILD_TESTS_CONFIG_PATH = os.path.join(VTS_LTP_OUTPUT, 'disabled_tests.txt')
-
-
-# Environment paths for ltp test cases
-# string, ltp build root directory on target
-LTPDIR = '/data/local/tmp/ltp'
-# Directory for environment variable 'TMP' needed by some test cases
-TMP = os.path.join(LTPDIR, 'tmp')
-# Directory for environment variable 'TMPBASE' needed by some test cases
-TMPBASE = os.path.join(TMP, 'tmpbase')
-# Directory for environment variable 'LTPTMP' needed by some test cases
-LTPTMP = os.path.join(TMP, 'ltptemp')
-# Directory for environment variable 'TMPDIR' needed by some test cases
-TMPDIR = os.path.join(TMP, 'tmpdir')
-# Path where ltp test binary exists
-LTPBINPATH = os.path.join(LTPDIR, 'testcases/bin')
-# Add LTP's binary path to PATH
-PATH = '/system/bin:%s' % LTPBINPATH
-
-# File system type for loop device
-LTP_DEV_FS_TYPE = 'ext4'
-
-# Binaries required by LTP test cases that should exist in PATH
-INTERNAL_BINS = [
- 'mktemp',
- 'cp',
- 'chmod',
- 'chown',
- 'ls',
- 'mkfifo',
- 'ldd',
-]
-
-# Internal shell command required by some LTP test cases
-INTERNAL_SHELL_COMMANDS = [
- 'export',
- 'cd',
-]
-
-# Requirement to testcase dictionary.
-REQUIREMENTS_TO_TESTCASE = {
- ltp_enums.Requirements.LOOP_DEVICE_SUPPORT: [
- 'syscalls.mount01',
- 'syscalls.fchmod06',
- 'syscalls.ftruncate04',
- 'syscalls.ftruncate04_64',
- 'syscalls.inotify03',
- 'syscalls.link08',
- 'syscalls.linkat02',
- 'syscalls.mkdir03',
- 'syscalls.mkdirat02',
- 'syscalls.mknod07',
- 'syscalls.mknodat02',
- 'syscalls.mmap16',
- 'syscalls.mount01',
- 'syscalls.mount02',
- 'syscalls.mount03',
- 'syscalls.mount04',
- 'syscalls.mount06',
- 'syscalls.rename11',
- 'syscalls.renameat01',
- 'syscalls.rmdir02',
- 'syscalls.umount01',
- 'syscalls.umount02',
- 'syscalls.umount03',
- 'syscalls.umount2_01',
- 'syscalls.umount2_02',
- 'syscalls.umount2_03',
- 'syscalls.utime06',
- 'syscalls.utimes01',
- 'syscalls.mkfs01',
- 'fs.quota_remount_test01',
- ],
- ltp_enums.Requirements.BIN_IN_PATH_LDD: ['commands.ldd'],
-}
-
-# Requirement for all test cases
-REQUIREMENT_FOR_ALL = [ltp_enums.Requirements.LTP_TMP_DIR]
-
-# Requirement to test suite dictionary
-REQUIREMENT_TO_TESTSUITE = {}
-
-# List of LTP test suites to run
-TEST_SUITES = [
- 'admin_tools',
- 'can',
- 'cap_bounds',
- 'commands',
- 'connectors',
- 'containers',
-# 'controllers',
- 'cpuhotplug',
- 'dio',
- 'fcntl-locktests_android',
- 'filecaps',
- 'fs',
- 'fs_bind',
- 'fs_ext4',
- 'fs_perms_simple',
- 'fsx',
- 'hugetlb',
- 'hyperthreading',
- 'input',
- 'io',
- 'ipc',
- 'kernel_misc',
- 'math',
- 'mm',
- 'modules',
- 'nptl',
- 'numa',
- 'pipes',
- 'power_management_tests',
- 'pty',
- 'sched',
- 'syscalls',
- 'timers',
- # The following are not included in default LTP scenario group
- 'securebits',
- 'tracing',
-]
-
-# List of LTP test suites that will not run in multi-thread mode
-TEST_SUITES_REQUIRE_SINGLE_THREAD_MODE = [
- 'dio',
- 'io',
- 'mm',
-]
-
-# Staging tests are for debugging and verifying fixed tests
-# Test specified here can be in format: testsuite.testname,
-# or testsuite.testname_**bit, or just testname. Using just testname
-# is not recommended
-STAGING_TESTS = [
- # Flaky on pixel
- # b/32417988
- 'syscalls.waitpid02_64bit',
-
- # Tests currently only failing on pixels,
- # these will be inspected soon
- 'syscalls.open14',
- 'syscalls.openat03',
- # Fail on local device but pass on lab devices
- 'fs.proc01',
-]
-
-# Tests disabled
-# Based on external/ltp commit 5f01077afe994f4107b147222f3956716d4a8fde
-DISABLED_TESTS = [
- # b/32386191 getrusage04 result is flaky
- 'syscalls.getrusage04',
- # b/31154962
- 'cpuhotplug.cpuhotplug02',
- # b/32385889
- 'syscalls.creat08',
- # The following test cases are uncategorized
- 'syscalls.fcntl34',
- 'syscalls.fcntl34_64',
- 'syscalls.inotify06',
- 'syscalls.abort01',
- 'syscalls.chmod05',
- 'syscalls.chmod07',
- 'syscalls.chown01_16',
- 'syscalls.chown02_16',
- 'syscalls.chown03_16',
- 'syscalls.chown05_16',
- 'syscalls.fchmod01',
- 'syscalls.fchmod02',
- 'syscalls.fchmod05',
- 'syscalls.fchmod06',
- 'syscalls.fchown01_16',
- 'syscalls.fchown02_16',
- 'syscalls.fchown03_16',
- 'syscalls.fchown04_16',
- 'syscalls.fchown05_16',
- 'syscalls.fsync01',
- 'syscalls.ftruncate04',
- 'syscalls.ftruncate04_64',
- 'syscalls.getcwd02',
- 'syscalls.getcwd03',
- 'syscalls.getegid01_16',
- 'syscalls.getegid02_16',
- 'syscalls.geteuid01_16',
- 'syscalls.geteuid02_16',
- 'syscalls.getgid01_16',
- 'syscalls.getgid03_16',
- 'syscalls.getgroups01_16',
- 'syscalls.gethostbyname_r01',
- 'syscalls.getuid01_16',
- 'syscalls.getuid03_16',
- 'syscalls.ioctl03',
- 'syscalls.inotify03',
- 'syscalls.kill11',
- 'syscalls.lchown01_16',
- 'syscalls.lchown02_16',
- 'syscalls.lchown03_16',
- 'syscalls.link08',
- 'syscalls.linkat02',
- 'syscalls.mkdir03',
- 'syscalls.rmdir02',
- 'syscalls.mkdirat02',
- 'syscalls.mknod07',
- 'syscalls.mknodat02',
- 'syscalls.mmap16',
- 'syscalls.mount01',
- 'syscalls.mount02',
- 'syscalls.mount03',
- 'syscalls.mount04',
- 'syscalls.mount06',
- 'syscalls.move_pages03',
- 'syscalls.move_pages11',
- 'syscalls.mprotect01',
- 'syscalls.nftw01',
- 'syscalls.nftw6401',
- 'syscalls.nice04',
- 'syscalls.open01',
- 'syscalls.open08',
- 'syscalls.open10',
- 'syscalls.open11',
- 'syscalls.madvise01',
- 'syscalls.madvise02',
- 'syscalls.madvise06',
- 'syscalls.pathconf01',
- 'syscalls.preadv02',
- 'syscalls.process_vm_readv01',
- 'syscalls.process_vm_writev01',
- 'syscalls.pwritev01_64',
- 'syscalls.pwritev02',
- 'syscalls.quotactl01',
- 'syscalls.readlink04',
- 'syscalls.rename11',
- 'syscalls.renameat01',
- 'syscalls.request_key01',
- 'syscalls.request_key02',
- 'syscalls.rt_sigprocmask01',
- 'syscalls.sbrk03',
- 'syscalls.setfsgid01_16',
- 'syscalls.setfsgid02_16',
- 'syscalls.setfsgid03_16',
- 'syscalls.setfsuid01_16',
- 'syscalls.setfsuid02_16',
- 'syscalls.setfsuid03_16',
- 'syscalls.setfsuid04_16',
- 'syscalls.setgid01_16',
- 'syscalls.setgid02_16',
- 'syscalls.setgid03_16',
- 'syscalls.setgroups01_16',
- 'syscalls.setgroups02_16',
- 'syscalls.setgroups03_16',
- 'syscalls.setgroups04_16',
- 'syscalls.setregid01_16',
- 'syscalls.setregid02_16',
- 'syscalls.setregid03_16',
- 'syscalls.setregid04_16',
- 'syscalls.setresgid01_16',
- 'syscalls.setresgid02_16',
- 'syscalls.setresgid03_16',
- 'syscalls.setresgid04_16',
- 'syscalls.setresuid01_16',
- 'syscalls.setresuid02_16',
- 'syscalls.setresuid03_16',
- 'syscalls.setresuid04_16',
- 'syscalls.setresuid05_16',
- 'syscalls.setreuid01_16',
- 'syscalls.setreuid02_16',
- 'syscalls.setreuid03_16',
- 'syscalls.setreuid04_16',
- 'syscalls.setreuid05_16',
- 'syscalls.setreuid06_16',
- 'syscalls.setreuid07_16',
- 'syscalls.setuid01_16',
- 'syscalls.setuid02_16',
- 'syscalls.setuid03_16',
- 'syscalls.setuid04_16',
- 'syscalls.splice02',
- 'syscalls.sysconf01',
- 'syscalls.syslog01',
- 'syscalls.syslog02',
- 'syscalls.syslog03',
- 'syscalls.syslog04',
- 'syscalls.syslog05',
- 'syscalls.syslog06',
- 'syscalls.syslog07',
- 'syscalls.syslog08',
- 'syscalls.syslog09',
- 'syscalls.syslog10',
- 'syscalls.umask02',
- 'syscalls.umask03',
- 'syscalls.umount01',
- 'syscalls.umount02',
- 'syscalls.umount03',
- 'syscalls.umount2_01',
- 'syscalls.umount2_02',
- 'syscalls.umount2_03',
- 'syscalls.utime06',
- 'syscalls.utimes01',
- 'syscalls.utimensat01',
- 'syscalls.waitpid05',
- 'fs.gf01',
- 'fs.gf02',
- 'fs.gf03',
- 'fs.gf04',
- 'fs.gf05',
- 'fs.gf06',
- 'fs.gf07',
- 'fs.gf08',
- 'fs.gf09',
- 'fs.gf10',
- 'fs.gf11',
- 'fs.gf14',
- 'fs.gf15',
- 'fs.gf16',
- 'fs.gf17',
- 'fs.gf18',
- 'fs.gf19',
- 'fs.gf20',
- 'fs.gf21',
- 'fs.gf22',
- 'fs.gf23',
- 'fs.gf24',
- 'fs.gf25',
- 'fs.gf26',
- 'fs.gf27',
- 'fs.gf28',
- 'fs.gf29',
- 'fs.gf30',
- 'fs.rwtest01',
- 'fs.rwtest02',
- 'fs.rwtest03',
- 'fs.rwtest04',
- 'fs.rwtest05',
- 'fs.iogen01',
- 'fs.fs_inod01',
- 'fs.ftest06',
- 'fs.isofs',
- 'fsx.fsx-linux',
- 'io.aio01',
- 'io.aio02',
- 'mm.mtest06',
- 'mm.shm_test01',
- 'mm.mallocstress01',
- 'mm.mmapstress04',
- 'mm.mmapstress07',
- 'mm.vma03',
- 'mm.min_free_kbytes',
- 'pipes.pipeio_1',
- 'pipes.pipeio_3',
- 'pipes.pipeio_4',
- 'pipes.pipeio_5',
- 'pipes.pipeio_6',
- 'pipes.pipeio_8',
- 'sched.trace_sched01',
- 'math.float_bessel',
- 'math.float_exp_log',
- 'math.float_iperb',
- 'math.float_power',
- 'math.float_trigo',
- 'pty.pty01',
- 'containers.mqns_01_clone',
- 'containers.mqns_02_clone',
- 'containers.mqns_03_clone',
- 'containers.mqns_04_clone',
- 'containers.netns_netlink',
- 'containers.netns_breakns_ns_exec_ipv4_netlink',
- 'containers.netns_breakns_ns_exec_ipv6_netlink',
- 'containers.netns_breakns_ns_exec_ipv4_ioctl',
- 'containers.netns_breakns_ns_exec_ipv6_ioctl',
- 'containers.netns_breakns_ip_ipv4_netlink',
- 'containers.netns_breakns_ip_ipv6_netlink',
- 'containers.netns_breakns_ip_ipv4_ioctl',
- 'containers.netns_breakns_ip_ipv6_ioctl',
- 'containers.netns_comm_ns_exec_ipv4_netlink',
- 'containers.netns_comm_ns_exec_ipv6_netlink',
- 'containers.netns_comm_ns_exec_ipv4_ioctl',
- 'containers.netns_comm_ns_exec_ipv6_ioctl',
- 'containers.netns_comm_ip_ipv4_netlink',
- 'containers.netns_comm_ip_ipv6_netlink',
- 'containers.netns_comm_ip_ipv4_ioctl',
- 'containers.netns_comm_ip_ipv6_ioctl',
- 'containers.netns_sysfs',
- 'containers.shmnstest_none',
- 'containers.shmnstest_clone',
- 'containers.shmnstest_unshare',
- 'containers.shmem_2nstest_none',
- 'containers.shmem_2nstest_clone',
- 'containers.shmem_2nstest_unshare',
- 'containers.mesgq_nstest_none',
- 'containers.mesgq_nstest_clone',
- 'containers.mesgq_nstest_unshare',
- 'containers.sem_nstest_none',
- 'containers.sem_nstest_clone',
- 'containers.sem_nstest_unshare',
- 'containers.semtest_2ns_none',
- 'containers.semtest_2ns_clone',
- 'containers.semtest_2ns_unshare',
- 'fs_bind.BindMounts',
- 'filecaps.Filecaps',
- 'cap_bounds.Cap_bounds',
- 'fcntl-locktests_android.FCNTL_LOCKTESTS',
- 'admin_tools.su01',
- 'admin_tools.cron02',
- 'admin_tools.cron_deny01',
- 'admin_tools.cron_allow01',
- 'admin_tools.cron_dirs_checks01',
- 'numa.move_pages03',
- 'numa.move_pages11',
- 'hugetlb.hugemmap05_1',
- 'hugetlb.hugemmap05_2',
- 'hugetlb.hugemmap05_3',
- 'commands.ar',
- 'commands.ld',
- 'commands.nm',
- 'commands.objdump',
- 'commands.file',
- 'commands.tar',
- 'commands.cron',
- 'commands.logrotate',
- 'commands.mail',
- 'commands.cpio',
- 'commands.unzip01',
- 'commands.cp_tests01',
- 'commands.ln_tests01',
- 'commands.mkdir_tests01',
- 'commands.mv_tests01',
- 'commands.size01',
- 'commands.sssd01',
- 'commands.sssd02',
- 'commands.sssd03',
- 'commands.du01',
- 'commands.mkfs01',
- 'commands.lsmod01',
- 'commands.wc01',
- 'hyperthreading.smt_smp_enabled',
- 'hyperthreading.smt_smp_affinity',
- 'kernel_misc.zram03',
- 'fs_ext4.ext4-uninit-groups',
- 'fs_ext4.ext4-persist-prealloc',
- 'cpuhotplug.cpuhotplug03',
- 'cpuhotplug.cpuhotplug06',
- 'input.input06',
- 'dio.dio10',
- 'fsx.fsx-linux',
- 'dio.dio04',
- 'numa.Numa-testcases',
- 'syscalls.connect01',
- 'syscalls.prot_hsymlinks',
- 'fs.ftest01',
- 'fs.ftest03',
- 'fs.ftest04',
- 'fs.ftest05',
- 'fs.ftest07',
- 'fs.ftest08',
- 'fs.inode02',
- 'ipc.signal_test_01',
- 'mm.data_space',
- 'mm.mmapstress01',
- 'mm.mmapstress03',
- 'mm.mmapstress09',
- 'mm.mmapstress10',
- 'syscalls.clock_nanosleep01',
- 'syscalls.clone04',
- 'syscalls.fcntl14',
- 'syscalls.fcntl14',
- 'syscalls.fcntl14_64',
- 'syscalls.fcntl17',
- 'syscalls.fcntl17_64',
- 'syscalls.getdomainname01',
- 'syscalls.kill12',
- 'syscalls.setdomainname01',
- 'syscalls.setdomainname02',
- 'syscalls.setdomainname03',
- 'syscalls.sighold02',
- 'syscalls.sigpending02',
- 'syscalls.sigrelse01',
- 'syscalls.vfork02',
- # The following tests are not stable on 64bit version
- 'input.input01_64bit',
- 'input.input02_64bit',
- 'input.input03_64bit',
- 'input.input04_64bit',
- 'input.input05_64bit',
- 'input.input06_64bit',
- # The following tests are failing on 64bit version
- 'mm.overcommit_memory01_64bit',
- 'mm.overcommit_memory02_64bit',
- 'mm.overcommit_memory03_64bit',
- 'mm.overcommit_memory04_64bit',
- 'mm.overcommit_memory05_64bit',
- 'mm.overcommit_memory06_64bit',
- # 'which' in Android does not accept the tested options b/31152668
- 'commands.which01',
- # tests that are currently killing some lab devices 64bit on (pixel and bullhead)
- # b/31181781
- 'mm.oom01_64bit',
- 'mm.oom02_64bit',
- 'mm.oom03_64bit',
- 'mm.oom04_64bit',
- 'mm.oom05_64bit',
- 'mm.swapping01_64bit',
- 'mm.thp01_64bit',
- 'mm.thp02_64bit',
- 'mm.thp03_64bit',
- 'mm.vma01_64bit',
- # kmsg01 would pass but it occasionally causes socket timeout and misalignment
- # of request and response
- # b/32343072
- 'kernel_misc.kmsg01',
- # alarm02 tests for a boundary condition which is impractical to implement
- # correctly on 32-bit Linux. bionic deliberately breaks with POSIX by reporting
- # that it failed to set up the alarm. (Other libc implementations fail to
- # set up the alarm too, but then return 0 anyway.)
- 'syscalls.alarm02',
- # readdir02 calls opendir() -> closedir() -> readdir() and checks if readdir()
- # returns EBADF. POSIX doesn't require this, and bionic is likely to instead
- # deadlock trying to acquire a destroyed mutex.
- 'syscalls.readdir02',
- # Android sets RLIMIT_NICE to 40, so setpriority02 succeeds unexpectedly
- 'syscalls.setpriority02',
- # fork13 takes ~45 minutes to run
- 'syscalls.fork13',
- # open13 tests that fchmod() fails on fds opened with O_PATH. bionic
- # deliberately masks the EBADF returned by the kernel.
- #
- # https://android-review.googlesource.com/#/c/127908/
- 'syscalls.open13',
- # Bug#30675453
- 'syscalls.perf_event_open02',
- # Bug#30688551
- 'syscalls.lstat03_64',
- 'syscalls.lstat03',
- # Bug#30688061
- 'input.input03',
- # Bug#30688056
- 'cpuhotplug.cpuhotplug04',
- # Bug#30699880
- 'mm.mtest01w',
- 'mm.mtest01',
- # Bug#30688574
- 'syscalls.accept4_01',
- # Bug#30689411
- 'mm.mmapstress03',
- # Bug #32100169
- 'dma_thread_diotest.dma_thread_diotest1',
- 'dma_thread_diotest.dma_thread_diotest2',
- 'dma_thread_diotest.dma_thread_diotest3',
- 'dma_thread_diotest.dma_thread_diotest4',
- 'dma_thread_diotest.dma_thread_diotest5',
- 'dma_thread_diotest.dma_thread_diotest6',
- 'dma_thread_diotest.dma_thread_diotest7',
- # b/33008689 (closed) requires mkfs.ext4 and loop device support.
- 'fs.quota_remount_test01',
-]
diff --git a/testcases/kernel/ltp/ltp_enums.py b/testcases/kernel/ltp/ltp_enums.py
deleted file mode 100644
index 34b6d9d..0000000
--- a/testcases/kernel/ltp/ltp_enums.py
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/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.
-#
-
-
-class RequirementState(object):
- """Enum for test case requirement check state.
-
- Attributes:
- UNCHECKED: test case requirement has not been checked
- SATISFIED: all the requirements are satisfied
- UNSATISFIED: some of the requirements are not satisfied. Test case will
- not be executed
- """
- UNCHECKED = 0
- SATISFIED = 2
- UNSATISFIED = 3
-
-
-class ConfigKeys(object):
- RUN_STAGING = "run_staging"
- RUN_32BIT = "run_32bit"
- RUN_64BIT = "run_64bit"
- NUMBER_OF_THREADS = "number_of_threads"
-
-
-class ShellEnvKeys(object):
- """Shell env keys to run LTP (Linux Test Project) testcases.
-
- Contains constant strings starting with prefix "_KEY_ENV_" are used as dict
- key in environment variable dictionary
- """
- TMP = 'TMP'
- TMPBASE = 'TMPBASE'
- LTPTMP = 'LTPTMP'
- TMPDIR = 'TMPDIR'
- LTP_DEV_FS_TYPE = 'LTP_DEV_FS_TYPE'
- LTPROOT = 'LTPROOT'
- PATH = 'PATH'
-
-
-class Delimiters(object):
- TESTCASE_FILTER = ','
- TESTCASE_DEFINITION = '\t'
-
-
-class TestExitCode(object):
- """Exit return codes of LTP test case binary
-
- Attributes:
- TPASS: int, exit_code for Test pass
- TCONF: int, the test case is not for current configuration of kernel
- TBROK: int, test assumption failed, such as missing system binary and
- and permission issue not explicitly checked by the test case.
- SEGFAULT: int, test case results in segmentation fault
- """
- TPASS = 0
- TCONF = 32
- TBROK = 2
- SEGFAULT = 139
-
-
-class Requirements(object):
- """Enum for all ltp requirements"""
- LOOP_DEVICE_SUPPORT = 1
- LTP_TMP_DIR = 2
- BIN_IN_PATH_LDD = 3
diff --git a/testcases/kernel/ltp/requirements.py b/testcases/kernel/ltp/requirements.py
deleted file mode 100644
index 5ad2dfc..0000000
--- a/testcases/kernel/ltp/requirements.py
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/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.
-#
-
-from vts.testcases.kernel.ltp import ltp_enums
-from vts.testcases.kernel.ltp import ltp_configs
-from vts.testcases.kernel.ltp.shell_environment.definitions import directory_exists
-from vts.testcases.kernel.ltp.shell_environment.definitions import loop_device_support
-from vts.testcases.kernel.ltp.shell_environment.definitions import path_permission
-from vts.testcases.kernel.ltp.shell_environment.definitions import bin_in_path
-
-
-def GetRequrementDefinitions():
- """Get requirement definition objects.
-
- Get a dictionary in which keys are requirement names and
- values are corresponding definition class object or a list
- of such objects.
- """
- return {
- ltp_enums.Requirements.LOOP_DEVICE_SUPPORT:
- loop_device_support.LoopDeviceSupport(),
- ltp_enums.Requirements.LTP_TMP_DIR: [
- directory_exists.DirectoryExists(
- paths=[ltp_configs.TMP, ltp_configs.TMPBASE,
- ltp_configs.LTPTMP, ltp_configs.TMPDIR],
- to_check=False,
- to_setup=True,
- to_cleanup=True), path_permission.PathPermission(
- paths=[ltp_configs.TMP, ltp_configs.TMPBASE,
- ltp_configs.LTPTMP, ltp_configs.TMPDIR],
- permissions=775,
- to_check=False,
- to_setup=True,
- to_cleanup=False)
- ],
- ltp_enums.Requirements.BIN_IN_PATH_LDD:
- bin_in_path.BinInPath(paths='ldd'),
- }
diff --git a/testcases/kernel/ltp/shell_environment/__init__.py b/testcases/kernel/ltp/shell_environment/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/kernel/ltp/shell_environment/__init__.py
+++ /dev/null
diff --git a/testcases/kernel/ltp/shell_environment/definitions/__init__.py b/testcases/kernel/ltp/shell_environment/definitions/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/kernel/ltp/shell_environment/definitions/__init__.py
+++ /dev/null
diff --git a/testcases/kernel/ltp/shell_environment/definitions/base_definitions/__init__.py b/testcases/kernel/ltp/shell_environment/definitions/base_definitions/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/kernel/ltp/shell_environment/definitions/base_definitions/__init__.py
+++ /dev/null
diff --git a/testcases/kernel/ltp/shell_environment/definitions/base_definitions/check_setup_cleanup.py b/testcases/kernel/ltp/shell_environment/definitions/base_definitions/check_setup_cleanup.py
deleted file mode 100644
index 04dd868..0000000
--- a/testcases/kernel/ltp/shell_environment/definitions/base_definitions/check_setup_cleanup.py
+++ /dev/null
@@ -1,231 +0,0 @@
-#!/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 itertools
-
-from vts.runners.host import const
-
-
-class CheckSetupCleanup(object):
- """An abstract class for defining environment setup job.
-
- Usually such a job contains check -> setup -> cleanup workflow
-
- Attributes:
- to_check: bool, whether or not to check the defined environment
- requirement. Default: True
- to_setup: bool, whether or not to setup the defined environment
- requirement. Default: False
- to_cleanup: bool, whether or not to cleanup the defined environment
- requirement if it is set up by this class. Default: False
- context: ShellEnvironment object that provides AddCleanupJobs and
- ExecuteShellCommand method
- note: string, used by GetNote to generate error message if fail.
- """
-
- def __init__(self):
- self.to_check = True
- self.to_setup = False
- self.to_cleanup = False
- self.context = None
- self.note = None
-
- @property
- def note(self):
- return self._note
-
- @note.setter
- def note(self, note):
- self._note = note
-
- @property
- def context(self):
- return self._context
-
- @context.setter
- def context(self, context):
- self._context = context
-
- def Execute(self):
- """Execute the check, setup, and cleanup.
-
- Will execute setup and cleanup only if the boolean switches for them
- are True. It will NOT execute cleanup if check function passes.
-
- Return:
- tuple(bool, string), a tuple of True and empty string if success,
- a tuple of False and error message if fail.
- """
-
- if self.context is None:
- self.note = "Error: Environment definition context not set"
- return False
-
- if not self.InternalCall(self.ValidateInputs):
- return False
-
- check_result = False
- if self.to_check:
- check_result = self.InternalCall(self.Check)
-
- if check_result or not self.to_setup:
- return check_result
-
- if self.to_cleanup:
- self.context.AddCleanupJob(self.InternalCall, self.Cleanup)
-
- return self.InternalCall(self.Setup)
-
- def __str__(self):
- return ("Shell Environment Check Definition Class:{cls} "
- "Variables: {props}").format(
- cls=self.__class__.__name__, props=vars(self))
-
- def GetNote(self):
- """Get a string note as error message. Can be override by sub-class"""
- if not self.note:
- self.note = "Shell environment definition unsatisfied"
- return "{}\nat: {}".format(self.note, self)
-
- def InternalCall(self, method):
- """Internal method to call sub class inherited methods.
-
- It call the function, check results, and put failure note if not set
- """
- self.note = None
- success = method()
- if not success and not self.note:
- self.note = ("Shell environment definition unsatisfied: step [%s] "
- "failed.") % method.__name__
- return success
-
- def ValidateInputs(self):
- """Validate input parameters. Can be override by sub-class
-
- Return:
- tuple(bool, string), a tuple of True and empty string if pass,
- a tuple of False and error message if fail.
- """
- return True
-
- def ToListLike(self, obj):
- """Convert single item to list of single item.
-
- If input is already a list like object, the same object will
- be returned.
- This method is for the convenience of writing child class.
-
- Arguments:
- obj: any object
- """
- if not self.IsListLike(obj):
- return [obj]
- else:
- return obj
-
- def IsListLike(self, obj):
- """Checks whether a object is list-like.
-
- This method is for the convenience of writing child class.
- It will check for existence of __iter__ and __getitem__
- in attributes of the object.
- String is not considered list-like, tuple is.
-
- Arguments:
- obj: any object
- """
- return hasattr(obj, '__iter__') and hasattr(obj, '__getitem__')
-
- def NormalizeInputLists(self, *inputs):
- """Normalize inputs to lists of same length.
-
- This method is for the convenience of writing child class.
- If there are lists in inputs, they should all be of same length;
- otherwise, None is returned.
- If there are lists and single items in inputs, single items are
- duplicated to a list of other list's length.
- If there are only single items in inputs, they all get converted to
- single item lists.
-
- Arguments:
- inputs: any inputs
-
- Return:
- a generator of normalized inputs
- """
- # If any of inputs is None or empty, inputs are considered not valid
- # Definition classes wish to take None input should not use this method
- if not all(inputs):
- return None
-
- lists = filter(self.IsListLike, inputs)
- if not lists:
- # All inputs are single items. Convert them to lists
- return ([i] for i in inputs)
-
- lengths = set(map(len, lists))
- if len(lengths) != 1:
- # lists in inputs have different lengths, cannot normalize
- return None
- length = lengths.pop()
-
- return (i if self.IsListLike(i) else list(itertools.repeat(i, length))
- for i in inputs)
-
- def Check(self):
- """Check function for the class.
-
- Used to check environment. Can be override by sub-class
- """
- self.note = "Check step undefined."
- return False
-
- def Setup(self):
- """Check function for the class.
-
- Used to setup environment if check fail. Can be override by sub-class
- """
- self.note = "Setup step undefined."
- return False
-
- def Cleanup(self):
- """Check function for the class.
-
- Used to cleanup setup if check fail. Can be override by sub-class
- """
- self.note = "Cleanup step undefined."
- return False
-
- @property
- def shell(self):
- """returns an object that can execute a shell command"""
- return self.context.shell
-
- def ExecuteShellCommand(self, cmd):
- """Execute a shell command or a list of shell commands.
-
- Args:
- command: str, the command to execute; Or
- list of str, a list of commands to execute
-
- return:
- A dictionary containing results in format:
- {const.STDOUT: [stdouts],
- const.STDERR: [stderrs],
- const.EXIT_CODE: [exit_codes]}.
- """
- return self.shell.Execute(cmd)
diff --git a/testcases/kernel/ltp/shell_environment/definitions/bin_in_path.py b/testcases/kernel/ltp/shell_environment/definitions/bin_in_path.py
deleted file mode 100644
index 28f0449..0000000
--- a/testcases/kernel/ltp/shell_environment/definitions/bin_in_path.py
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/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.
-#
-
-from vts.runners.host import const
-from vts.testcases.kernel.ltp.shell_environment.definitions.base_definitions import check_setup_cleanup
-
-
-class BinInPath(check_setup_cleanup.CheckSetupCleanup):
- """Class for check existence of, make, and afterwards delete directories.
-
- Attributes:
- to_check: bool, whether or not to check the defined environment
- requirement. Default: True
- to_setup: bool, whether or not to setup the defined environment
- requirement. Default: False
- to_cleanup: bool, whether or not to cleanup the defined environment
- requirement if it is set up by this class. Default: False
- _paths: list string, target directory paths
- _failed_paths: list of string, paths that don't have desired permissions
- """
-
- def __init__(self,
- paths=None,
- to_check=True,
- to_setup=False,
- to_cleanup=False):
- self._paths = paths
- self._failed_paths = paths
- self.to_check = to_check
- self.to_setup = to_setup
- self.to_cleanup = to_cleanup
-
- def ValidateInputs(self):
- """Validate input paths.
-
- Check input path is not null or empty list or list containing
- empty string. If input is a single path, it will
- be converted to a single item list containing that path.
- """
- if not self._paths:
- return False
-
- self._paths = self.ToListLike(self._paths)
-
- return all(self._paths)
-
- def Check(self):
- commands = ["which %s" % path for path in self._paths]
- results = self.ExecuteShellCommand(commands)[const.EXIT_CODE]
-
- self._failed_paths = [
- path for path, fail in zip(self._paths, map(bool, results)) if fail
- ]
-
- if not self._failed_paths:
- return True
-
- self.note = "Some binary do not exist in path: %s" % self._failed_paths
- return False
diff --git a/testcases/kernel/ltp/shell_environment/definitions/directory_exists.py b/testcases/kernel/ltp/shell_environment/definitions/directory_exists.py
deleted file mode 100644
index 64cc03b..0000000
--- a/testcases/kernel/ltp/shell_environment/definitions/directory_exists.py
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/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.
-#
-
-from vts.runners.host import const
-from vts.testcases.kernel.ltp.shell_environment.definitions.base_definitions import check_setup_cleanup
-
-
-class DirectoryExists(check_setup_cleanup.CheckSetupCleanup):
- """Class for check existence of, make, and afterwards delete directories.
-
- Attributes:
- to_check: bool, whether or not to check the defined environment
- requirement. Default: True
- to_setup: bool, whether or not to setup the defined environment
- requirement. Default: False
- to_cleanup: bool, whether or not to cleanup the defined environment
- requirement if it is set up by this class. Default: False
- _paths: list string, target directory paths
- _failed_paths: list of string, paths that don't have desired permissions
- _permissions: list of int, desired permissions for each path
- """
-
- def __init__(self,
- paths=None,
- to_check=True,
- to_setup=False,
- to_cleanup=False):
- self._paths = paths
- self._failed_paths = paths
- self.to_check = to_check
- self.to_setup = to_setup
- self.to_cleanup = to_cleanup
-
- def ValidateInputs(self):
- """Validate input paths.
-
- Check input path is not null or empty list or list containing
- empty string. If input is a single path, it will
- be converted to a single item list containing that path.
- """
- if not self._paths:
- return False
-
- self._paths = self.ToListLike(self._paths)
-
- return all(self._paths)
-
- def Check(self):
- commands = ["ls %s" % path for path in self._paths]
- results = self.ExecuteShellCommand(commands)[const.EXIT_CODE]
-
- self._failed_paths = [
- path for path, fail in zip(self._paths, map(bool, results)) if fail
- ]
-
- if not self._failed_paths:
- return True
-
- self.note = "Some directories do not exist: %s" % self._failed_paths
- return False
-
- def Setup(self):
- commands = ["mkdir -p %s" % path for path in self._failed_paths]
- # TODO: perhaps store or print failed setup paths
- return not any(self.ExecuteShellCommand(commands)[const.EXIT_CODE])
-
- def Cleanup(self):
- commands = ["rm -rf %s" % path for path in self._failed_paths]
- return not any(self.ExecuteShellCommand(commands)[const.EXIT_CODE])
diff --git a/testcases/kernel/ltp/shell_environment/definitions/loop_device_support.py b/testcases/kernel/ltp/shell_environment/definitions/loop_device_support.py
deleted file mode 100644
index 70de57e..0000000
--- a/testcases/kernel/ltp/shell_environment/definitions/loop_device_support.py
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/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.
-#
-
-from vts.runners.host import const
-from vts.testcases.kernel.ltp.shell_environment.definitions.base_definitions import check_setup_cleanup
-
-
-class LoopDeviceSupport(check_setup_cleanup.CheckSetupCleanup):
- """Class for checking loopback device support."""
- note = "Kernel does not have loop device support"
-
- def Check(self):
- return not self.ExecuteShellCommand("losetup -f")[const.EXIT_CODE][0]
diff --git a/testcases/kernel/ltp/shell_environment/definitions/path_permission.py b/testcases/kernel/ltp/shell_environment/definitions/path_permission.py
deleted file mode 100644
index c390650..0000000
--- a/testcases/kernel/ltp/shell_environment/definitions/path_permission.py
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/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.
-#
-
-from vts.runners.host import const
-from vts.testcases.kernel.ltp.shell_environment.definitions.base_definitions import check_setup_cleanup
-
-
-class PathPermission(check_setup_cleanup.CheckSetupCleanup):
- """Class for check and set path permissions.
-
- Attributes:
- to_check: bool, whether or not to check the defined environment
- requirement. Default: True
- to_setup: bool, whether or not to setup the defined environment
- requirement. Default: False
- to_cleanup: bool, whether or not to cleanup the defined environment
- requirement if it is set up by this class. Default: False
- _paths: list string, target paths
- _failed_paths: list of string, paths that don't have desired permissions
- _permissions: list of int, desired permissions for each path
- """
-
- def __init__(self,
- paths=None,
- permissions=None,
- to_check=True,
- to_setup=False,
- to_cleanup=False):
- self._paths = paths
- self._permissions = permissions
- self.to_check = to_check
- self.to_setup = to_setup
- self.to_cleanup = to_cleanup
-
- def ValidateInputs(self):
- """Validate inputs.
-
- Check whether input lists is not null or empty list
- or list containing empty string, and two lists containing same number
- of items. If inputs are two single item, they will
- be converted to single item lists.
- """
- normalized = self.NormalizeInputLists(self._paths, self._permissions)
- if not normalized:
- return False
- self._paths, self._permissions = normalized
- self._failed_paths = zip(self._paths, self._permissions,
- self._permissions)
-
- return True
-
- def Check(self):
- commands = ["stat -c {}a {}".format('%', path) for path in self._paths]
- results = self.ExecuteShellCommand(commands)[const.STDOUT]
-
- self._failed_paths = [
- (path, permission, result)
- for path, permission, result in zip(self._paths, self._permissions,
- results)
- if str(permission) != result
- ]
-
- if not self._failed_paths:
- return True
-
- self.note = ("Some paths do not have desired "
- "permission: %s") % self._failed_paths
- return False
-
- def Setup(self):
- commands = ["chmod {} {}".format(permission, path)
- for (path, permission, result) in self._failed_paths]
- # TODO: perhaps store or print failed setup paths
- return not any(self.ExecuteShellCommand(commands)[const.EXIT_CODE])
-
- def Cleanup(self):
- commands = ["chmod {} {}".format(original, path)
- for (path, permission, original) in self._failed_paths]
- return not any(self.ExecuteShellCommand(commands)[const.EXIT_CODE])
diff --git a/testcases/kernel/ltp/shell_environment/shell_commands.py b/testcases/kernel/ltp/shell_environment/shell_commands.py
deleted file mode 100644
index b874fa8..0000000
--- a/testcases/kernel/ltp/shell_environment/shell_commands.py
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/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.
-#
-
-FILEPATH_CPU_PRESENT = '/sys/devices/system/cpu/present'
diff --git a/testcases/kernel/ltp/shell_environment/shell_environment.py b/testcases/kernel/ltp/shell_environment/shell_environment.py
deleted file mode 100644
index 698ee5f..0000000
--- a/testcases/kernel/ltp/shell_environment/shell_environment.py
+++ /dev/null
@@ -1,146 +0,0 @@
-#!/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 types
-import threading
-import re
-import logging
-
-from vts.runners.host import const
-from vts.testcases.kernel.ltp.shell_environment import shell_commands
-
-
-class ShellEnvironment(object):
- '''Class for executing environment definition classes and do cleanup jobs.
-
- Attributes:
- shell: shell mirror object, shell to execute commands
- _cleanup_jobs: set of CheckSetupCleanup objects, a set used to store
- clean up jobs if requested.
- _thread_lock: a threading.Lock object
- '''
-
- def __init__(self, shell):
- self.shell = shell
- self._cleanup_jobs = []
- self._thread_lock = threading.Lock()
-
- def Cleanup(self):
- '''Final cleanup jobs. Will run all the stored cleanup jobs'''
- return all([method(*args) for method, args in self._cleanup_jobs])
-
- def AddCleanupJob(self, method, *args):
- '''Add a clean up job for final cleanup'''
- if (method, args) not in self._cleanup_jobs:
- self._cleanup_jobs.append((method, args))
-
- @property
- def shell(self):
- '''returns an object that can execute a shell command'''
- return self._shell
-
- @shell.setter
- def shell(self, shell):
- self._shell = shell
-
- def ExecuteDefinitions(self, definitions):
- '''Execute a given list of environment check definitions'''
- self._thread_lock.acquire()
- if not isinstance(definitions, types.ListType):
- definitions = [definitions]
-
- for definition in definitions:
- definition.context = self
- if not definition.Execute():
- self._thread_lock.release()
- return (False, definition.GetNote())
-
- self._thread_lock.release()
- return (True, "")
-
- def GetDeviceNumberOfPresentCpu(self):
- '''Get the number of available CPUs on target device'''
- results = self.shell.Execute('cat %s' %
- shell_commands.FILEPATH_CPU_PRESENT)
- if (not results or results[const.EXIT_CODE][0] or
- not results[const.STDOUT][0]):
- logging.error("Cannot get number of working CPU info."
- "\n Command results: {}".format(results))
- return 1
- else:
- cpu_info = results[const.STDOUT][0].strip()
- m = re.match("[0-9]+-?[0-9]*", cpu_info)
- if m and m.span() == (0, len(cpu_info)):
- logging.info("spam" + str(m.span()))
- try:
- return int(cpu_info.split('-')[-1]) + 1
- except Exception as e:
- logging.error(e)
-
- logging.error("Cannot parse number of working CPU info."
- "\n CPU info: '{}'".format(cpu_info))
- return 1
-
- def CreateSedCommand(self, path, patterns):
- '''Create a shell command that uses sed to replace strings.
-
- Args:
- path: string, the path to execude sed command
- patterns: dict of {string: string}, a map from source string to
- replacement string
-
- Returns:
- String, a shell command to replace each string pattern.
- '''
- sed_patterns = [self.CreateSedPattern(*pattern)
- for pattern in patterns.iteritems()]
- sed_cmd = 'sed %s' % ' '.join(['-i -e "%s"' % p for p in sed_patterns])
-
- # This applies sed_cmd to every shell script.
- return 'find %s -type f | xargs %s' % (path, sed_cmd)
-
- def CreateSedPattern(self, replace_from, replace_to):
- '''Create a sed pattern to replace strings in given file list
-
- Args:
- replace_from: string, the string to search using sed
- replace_to: string, the replacement string for sed
-
- Returns:
- String, a sed pattern starting with 's' and ending with 'g',
- with a unique separator
- '''
- separators = '/=+-:#\\'
- separator_avalibility = [c not in replace_from and c not in replace_to
- for c in separators]
-
- available_separator = [
- ch for ch, available in zip(separators, separator_avalibility)
- if available
- ]
-
- if not available_separator:
- logging.error('no pre-defined separator available for the given'
- ' strings')
- return None
-
- separator = available_separator[0]
- return ("s{separator}{replace_from}{separator}"
- "{replace_to}{separator}g").format(
- separator=separator,
- replace_from=replace_from,
- replace_to=replace_to)
diff --git a/testcases/kernel/ltp/stable/Android.mk b/testcases/kernel/ltp/stable/Android.mk
deleted file mode 100644
index fcbebf7..0000000
--- a/testcases/kernel/ltp/stable/Android.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# 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 := KernelLtpTest
-VTS_CONFIG_SRC_DIR := testcases/kernel/ltp/stable
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/kernel/ltp/stable/AndroidTest.xml b/testcases/kernel/ltp/stable/AndroidTest.xml
deleted file mode 100644
index 54ff30b..0000000
--- a/testcases/kernel/ltp/stable/AndroidTest.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS kernel LTP test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HostDrivenTest.push" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer">
- </target_preparer>
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="KernelLtpTest" />
- <option name="test-timeout" value="3h" />
- <option name="runtime-hint" value="1h" />
- <option name="test-case-path" value="vts/testcases/kernel/ltp/KernelLtpTest" />
- <option name="test-config-path" value="vts-config/testcases/kernel/ltp/stable/KernelLtpTest.config" />
- </test>
-</configuration>
diff --git a/testcases/kernel/ltp/stable/KernelLtpTest.config b/testcases/kernel/ltp/stable/KernelLtpTest.config
deleted file mode 100644
index ccfe589..0000000
--- a/testcases/kernel/ltp/stable/KernelLtpTest.config
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "run_staging": false,
- "run_32bit": true,
- "run_64bit": true,
- "number_of_threads": 0
-}
diff --git a/testcases/kernel/ltp/staging/Android.mk b/testcases/kernel/ltp/staging/Android.mk
deleted file mode 100644
index 0c1d7bf..0000000
--- a/testcases/kernel/ltp/staging/Android.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# 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 := KernelLtpStagingTest
-VTS_CONFIG_SRC_DIR := testcases/kernel/ltp/staging
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/kernel/ltp/staging/AndroidTest.xml b/testcases/kernel/ltp/staging/AndroidTest.xml
deleted file mode 100644
index 9338cca..0000000
--- a/testcases/kernel/ltp/staging/AndroidTest.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS kernel LTP KernelLtpStagingTest tests">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HostDrivenTest.push" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer">
- </target_preparer>
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="KernelLtpStagingTest" />
- <option name="test-timeout" value="3h30m" />
- <option name="runtime-hint" value="1h30m" />
- <option name="test-case-path" value="vts/testcases/kernel/ltp/KernelLtpTest" />
- <option name="test-config-path" value="vts-config/testcases/kernel/ltp/staging/KernelLtpStagingTest.config" />
- </test>
-</configuration>
diff --git a/testcases/kernel/ltp/staging/KernelLtpStagingTest.config b/testcases/kernel/ltp/staging/KernelLtpStagingTest.config
deleted file mode 100644
index 4c45444..0000000
--- a/testcases/kernel/ltp/staging/KernelLtpStagingTest.config
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "run_staging": true,
- "run_32bit": true,
- "run_64bit": true,
- "number_of_threads": 0
-}
diff --git a/testcases/kernel/ltp/test_case.py b/testcases/kernel/ltp/test_case.py
deleted file mode 100644
index 26aafe8..0000000
--- a/testcases/kernel/ltp/test_case.py
+++ /dev/null
@@ -1,168 +0,0 @@
-#!/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 re
-import os
-import logging
-
-from vts.testcases.kernel.ltp import ltp_enums
-from vts.testcases.kernel.ltp import ltp_configs
-
-
-class TestCase(object):
- """Stores name, path, and param information for each test case.
-
- All class initiation inputs are assumed to be already validated by
- test case parser.
-
- Attributes:
- testsuite: string, name of testsuite to which the testcase belongs
- testname: string, name of the test case
- command: string, the command to run the test case
- _args: list of string, test case command line arguments
- requirement_state: RequirementState, enum representing requirement
- check results
- note: string, a place to store additional note for the test case
- such as what environment requirement did not satisfy.
- is_staging: bool, whether test case is a staging test
- is_filtered: bool, whether test case is excluded by filter
- """
-
- def __init__(self, testsuite, testname, command):
- self.testsuite = testsuite
- self.testname = testname
- self._command = command
- self.requirement_state = ltp_enums.RequirementState.UNCHECKED
- self.note = ""
- self.is_staging = False
- self.is_filtered = False
-
- @property
- def note(self):
- """Get the note"""
- return self._note
-
- @note.setter
- def note(self, note):
- """Set the note"""
- self._note = note
-
- @property
- def requirement_state(self):
- """Get the requirement state"""
- return self._requirement_state
-
- @requirement_state.setter
- def requirement_state(self, requirement_state):
- """Set the requirement state"""
- self._requirement_state = requirement_state
-
- @property
- def testsuite(self):
- """Get the test suite's name."""
- return self._testsuite
-
- @testsuite.setter
- def testsuite(self, testsuite):
- """Set the test suite's name."""
- self._testsuite = testsuite
-
- @property
- def testname(self):
- """Get the test case's name."""
- return self._testname
-
- @testname.setter
- def testname(self, testname):
- """Set the test case's name."""
- self._testname = testname
-
- def InternalAddLtpPathToCommand(self, command):
- """Internal function to change binary in commands to their full path"""
- tokens = command.strip().split()
-
- # If not ltp executables:
- if (tokens[0] in ltp_configs.INTERNAL_BINS or
- tokens[0] in ltp_configs.INTERNAL_SHELL_COMMANDS or
- tokens[0].find('=') > 0):
- return command
- else: # Is Ltp executable
- tokens[0] = os.path.join(ltp_configs.LTPBINPATH, tokens[0])
- return ' '.join(tokens)
-
- def GetCommand(self):
- """Get test case's command.
-
- Get the test case's command where ltp test binary names have been
- replaced with their full paths
- """
- return '&&'.join((self.InternalAddLtpPathToCommand(command)
- for command in self._command.split('&&')))
-
- def InternalGetExecutableNames(self):
- """Get a generator of all required executable file names"""
- executables = (command.strip().split()[0]
- for command in self._command.split('&&'))
-
- # In some test definitions there were command starting with
- # > TDsrc='mktemp ...'. We use regex to remove quotes
- pattern = re.compile('[\'|\"]')
- return (pattern.sub('', executable.split('=')[1])
- if executable.find('=') > 0 else executable
- for executable in executables)
-
- def GetRequiredExecutablePaths(self, ltp_bin_path=ltp_configs.LTPBINPATH):
- """Get required executables' paths.
-
- Returns:
- A list of all executables' paths that will be needed
- by its command. For LTP's executables, absolute path will be
- returned. For binaries in system's PATH, only the name will be
- returned.
- """
- return [os.path.join(ltp_bin_path, executable)
- if executable not in ltp_configs.INTERNAL_BINS else executable
- for executable in self.InternalGetExecutableNames()
- if executable not in ltp_configs.INTERNAL_SHELL_COMMANDS]
-
- @property
- def fullname(self):
- """Return full test name in <testsuite-testname> format"""
- return "%s.%s" % (self.testsuite, self.testname)
-
- def __str__(self):
- return self.fullname
-
- @property
- def is_staging(self):
- '''Whether this test is a staging test.'''
- return self._is_staging
-
- @is_staging.setter
- def is_staging(self, is_staging):
- '''Set whether this test is a staging test.'''
- self._is_staging = is_staging
-
- @property
- def is_filtered(self):
- '''Whether this test has been filtered out.'''
- return self._is_filtered
-
- @is_filtered.setter
- def is_filtered(self, is_filtered):
- '''Set whether this test has been filtered out.'''
- self._is_filtered = is_filtered
diff --git a/testcases/kernel/ltp/test_cases_parser.py b/testcases/kernel/ltp/test_cases_parser.py
deleted file mode 100644
index e17b1b7..0000000
--- a/testcases/kernel/ltp/test_cases_parser.py
+++ /dev/null
@@ -1,186 +0,0 @@
-#!/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 os
-import logging
-import itertools
-
-from vts.runners.host import const
-
-from vts.testcases.kernel.ltp import ltp_configs
-from vts.testcases.kernel.ltp import ltp_enums
-from vts.testcases.kernel.ltp import test_case
-
-
-class TestCasesParser(object):
- """Load a ltp vts testcase definition file and parse it into a generator.
-
- Attributes:
- _data_path: string, the vts data path on host side
- _filter_func: function, a filter method that will emit exception if a test is filtered
- disabled_tests: list of string
- staging_tests: list of string
- """
-
- def __init__(self, data_path, filter_func, disabled_tests, staging_tests):
- self._data_path = data_path
- self._filter_func = filter_func
- self._disabled_tests = disabled_tests
- self._staging_tests = staging_tests
-
- def ValidateDefinition(self, line):
- """Validate a tab delimited test case definition.
-
- Will check whether the given line of definition has three parts
- separated by tabs.
- It will also trim leading and ending white spaces for each part
- in returned tuple (if valid).
-
- Returns:
- A tuple in format (test suite, test name, test command) if
- definition is valid. None otherwise.
- """
- items = [
- item.strip()
- for item in line.split(ltp_enums.Delimiters.TESTCASE_DEFINITION)
- ]
- if not len(items) == 3 or not items:
- return None
- else:
- return items
-
- def Load(self, ltp_dir, n_bit, run_staging=False):
- """Read the definition file and yields a TestCase generator."""
- run_scritp = self.GenerateLtpRunScript()
-
- for line in run_scritp:
- items = self.ValidateDefinition(line)
- if not items:
- continue
-
- testsuite, testname, command = items
-
- # Tests failed to build will have prefix "DISABLED_"
- if testname.startswith("DISABLED_"):
- logging.info("[Parser] Skipping test case {}-{}. Reason: "
- "not built".format(testsuite, testname))
- continue
-
- # Some test cases contain semicolons in their commands,
- # and we replace them with &&
- command = command.replace(';', '&&')
-
- testcase = test_case.TestCase(
- testsuite=testsuite, testname=testname, command=command)
-
- test_display_name = "{}_{}bit".format(str(testcase), n_bit)
-
- # Check runner's base_test filtering method
- try:
- self._filter_func(test_display_name)
- except:
- logging.info("[Parser] Skipping test case %s. Reason: "
- "filtered" % testcase.fullname)
- testcase.is_filtered = True
- testcase.note = "filtered"
-
- # For skipping tests that are not designed for Android
- if test_display_name in self._disabled_tests:
- logging.info("[Parser] Skipping test case %s. Reason: "
- "disabled" % testcase.fullname)
- continue
-
- # For failing tests that are being inspected
- if test_display_name in self._staging_tests:
- if not run_staging:
- logging.info("[Parser] Skipping test case %s. Reason: "
- "staging" % testcase.fullname)
- continue
- else:
- testcase.is_staging = True
- testcase.note = "staging"
-
- logging.info("[Parser] Adding test case %s." % testcase.fullname)
- yield testcase
-
- def ReadCommentedTxt(self, filepath):
- '''Read a lines of a file that are not commented by #.
-
- Args:
- filepath: string, path of file to read
-
- Returns:
- A set of string representing non-commented lines in given file
- '''
- if not filepath:
- logging.error('Invalid file path')
- return None
-
- with open(filepath, 'r') as f:
- lines_gen = (line.strip() for line in f)
- return set(
- line for line in lines_gen
- if line and not line.startswith('#'))
-
- def GenerateLtpTestCases(self, testsuite, disabled_tests_list):
- '''Generate test cases for each ltp test suite.
-
- Args:
- testsuite: string, test suite name
-
- Returns:
- A list of string
- '''
- testsuite_script = os.path.join(self._data_path,
- ltp_configs.LTP_RUNTEST_DIR, testsuite)
-
- result = []
- for line in open(testsuite_script, 'r'):
- line = line.strip()
- if not line or line.startswith('#'):
- continue
-
- testname = line.split()[0]
- testname_prefix = ('DISABLED_'
- if testname in disabled_tests_list else '')
- testname_modified = testname_prefix + testname
-
- result.append("\t".join([testsuite, testname_modified, line[len(
- testname):].strip()]))
- return result
-
- def GenerateLtpRunScript(self):
- '''Given a scenario group generate test case script.
-
- Args:
- scenario_group: string, file path of scanerio group file
-
- Returns:
- A list of string
- '''
- disabled_tests_path = os.path.join(
- self._data_path, ltp_configs.LTP_DISABLED_BUILD_TESTS_CONFIG_PATH)
- disabled_tests_list = self.ReadCommentedTxt(disabled_tests_path)
-
- result = []
- for testsuite in ltp_configs.TEST_SUITES:
- result.extend(
- self.GenerateLtpTestCases(testsuite, disabled_tests_list))
-
- #TODO(yuexima): remove duplicate
-
- return result
diff --git a/testcases/kernel/syscall/Android.mk b/testcases/kernel/syscall/Android.mk
deleted file mode 100644
index 4daa99d..0000000
--- a/testcases/kernel/syscall/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# 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 := vts_test_binary_syscall_exists
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
- syscall_exists.cpp \
-
-LOCAL_SHARED_LIBRARIES := \
- libutils \
- libcutils \
- liblog \
-
-LOCAL_C_INCLUDES += \
- bionic \
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := SyscallExistenceTest
-
-VTS_CONFIG_SRC_DIR := testcases/kernel/syscall
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/kernel/syscall/AndroidTest.xml b/testcases/kernel/syscall/AndroidTest.xml
deleted file mode 100644
index 46c9348..0000000
--- a/testcases/kernel/syscall/AndroidTest.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS kernel syscall test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HostDrivenTest.push" />
- <option name="cleanup" value="true" />
- <option name="push" value="DATA/bin/vts_test_binary_syscall_exists->/data/local/tmp/64/vts_test_binary_syscall_exists" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer">
- </target_preparer>
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-case-path" value="vts/testcases/kernel/syscall/SyscallExistenceTest" />
- </test>
-</configuration>
diff --git a/testcases/kernel/syscall/SyscallExistenceTest.py b/testcases/kernel/syscall/SyscallExistenceTest.py
deleted file mode 100644
index 9a13f91..0000000
--- a/testcases/kernel/syscall/SyscallExistenceTest.py
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/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
-
-from vts.runners.host import const
-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
-
-
-class SyscallExistenceTest(base_test_with_webdb.BaseTestWithWebDbClass):
- """Tests to verify kernel syscall interface."""
- TEST_SHELL_NAME = "my_shell1"
- AARCH64__NR_name_to_handle_at = 264
- AARCH64__NR_open_by_handle_at = 265
- AARCH64__NR_uselib = 1077
-
- def setUpClass(self):
- self.dut = self.registerController(android_device)[0]
- self.dut.shell.InvokeTerminal(self.TEST_SHELL_NAME)
-
- def tearDownTest(self):
- self.dut.shell.InvokeTerminal(self.TEST_SHELL_NAME)
- results = getattr(self.dut.shell, self.TEST_SHELL_NAME).Execute("which ls")
- logging.info(str(results[const.STDOUT]))
- asserts.assertEqual(len(results[const.STDOUT]), 1)
- asserts.assertEqual(results[const.STDOUT][0].strip(), "/system/bin/ls")
- asserts.assertEqual(results[const.EXIT_CODE][0], 0)
-
- def testSyscall_name_to_handle_at(self):
- """Testcase to verify syscall [name_to_handle_at] is disabled."""
- if self.dut.is64Bit:
- logging.info("testing syscall: name_to_handle_at [%d]",
- self.AARCH64__NR_name_to_handle_at)
- asserts.assertTrue(self.SyscallDisabled(self.AARCH64__NR_name_to_handle_at),
- "syscall [name_to_handle_at] should be disabled")
- else:
- asserts.skip("32-bit not supported")
-
- def testSyscall_open_by_handle_at(self):
- """Testcase to verify syscall [open_by_handle_at] is disabled."""
- if self.dut.is64Bit:
- logging.info("testing syscall: open_by_handle_at [%d]",
- self.AARCH64__NR_open_by_handle_at)
- asserts.assertTrue(self.SyscallDisabled(self.AARCH64__NR_open_by_handle_at),
- "syscall [open_by_handle_at] should be disabled")
- else:
- asserts.skip("32-bit not supported")
-
- def testSyscall_uselib(self):
- """Testcase to verify syscall [uselib] is disabled."""
- if self.dut.is64Bit:
- logging.info("testing syscall: uselib [%d]",
- self.AARCH64__NR_uselib)
- asserts.assertTrue(self.SyscallDisabled(self.AARCH64__NR_uselib),
- "syscall [uselib] should be disabled")
- else:
- asserts.skip("32-bit not supported")
-
- def SyscallDisabled(self, syscallid):
- """Helper function to check if a syscall is disabled."""
- target = "/data/local/tmp/64/vts_test_binary_syscall_exists"
- results = getattr(self.dut.shell, self.TEST_SHELL_NAME).Execute([
- "chmod 755 %s" % target,
- "%s %d" % (target, syscallid)
- ])
- return len(results[const.STDOUT]) == 2 and results[const.STDOUT][1].strip() == "n"
-
-
-if __name__ == "__main__":
- test_runner.main()
diff --git a/testcases/kernel/syscall/__init__.py b/testcases/kernel/syscall/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/kernel/syscall/__init__.py
+++ /dev/null
diff --git a/testcases/kernel/syscall/syscall_exists.cpp b/testcases/kernel/syscall/syscall_exists.cpp
deleted file mode 100644
index cb1782a..0000000
--- a/testcases/kernel/syscall/syscall_exists.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 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.
- */
-#include <unistd.h>
-
-#define LOG_TAG "VtsSyscall"
-#include <utils/Log.h>
-
-#include <cerrno>
-#include <cstdlib>
-#include <iostream>
-
-int main(int argc, char **argv) {
- if (argc != 2) {
- ALOGE("syscall_exists: invalid argument");
- return -EINVAL;
- }
- int syscall_id = atoi(argv[1]);
- ALOGI("testing syscall [%d]", syscall_id);
- int ret = syscall(syscall_id);
- bool exists = !(ret == -1 && errno == ENOSYS);
- ALOGI("syscall [%d] is %s", syscall_id, exists ? "enabled" : "disabled");
- std::cout << (exists ? 'y' : 'n');
- return 0;
-}
diff --git a/testcases/library/bionic_native_test/AndroidTest.xml b/testcases/library/bionic_native_test/AndroidTest.xml
index 826e8fa..f0c3dde 100644
--- a/testcases/library/bionic_native_test/AndroidTest.xml
+++ b/testcases/library/bionic_native_test/AndroidTest.xml
@@ -19,6 +19,7 @@
</target_preparer>
<target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
<test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+ <option name="test-module-name" value="BionicNativeTest" />
<option name="binary-test-working-directories" value="
_32bit::/data/local/tmp/nativetest,
_64bit::/data/local/tmp/nativetest64"/>
diff --git a/testcases/performance/Android.mk b/testcases/performance/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/performance/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/performance/__init__.py b/testcases/performance/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/performance/__init__.py
+++ /dev/null
diff --git a/testcases/performance/binder_benchmark/Android.mk b/testcases/performance/binder_benchmark/Android.mk
deleted file mode 100644
index 86da605..0000000
--- a/testcases/performance/binder_benchmark/Android.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# 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)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := BinderPerformanceTest
-VTS_CONFIG_SRC_DIR := testcases/performance/binder_benchmark
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/performance/binder_benchmark/AndroidTest.xml b/testcases/performance/binder_benchmark/AndroidTest.xml
deleted file mode 100644
index 01a710b..0000000
--- a/testcases/performance/binder_benchmark/AndroidTest.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS libbinder performance benchmarks">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HostDrivenTest.push" />
- <option name="cleanup" value="true" />
- <option name="push" value="DATA/benchmarktest/libbinder_benchmark/libbinder_benchmark32->/data/local/tmp/32/libbinder_benchmark32" />
- <option name="push" value="DATA/benchmarktest64/libbinder_benchmark/libbinder_benchmark64->/data/local/tmp/64/libbinder_benchmark64" />
- <option name="push" value="DATA/lib/android.hardware.tests.libbinder.so->/data/local/tmp/32/android.hardware.tests.libbinder.so" />
- <option name="push" value="DATA/lib64/android.hardware.tests.libbinder.so->/data/local/tmp/64/android.hardware.tests.libbinder.so" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer">
- </target_preparer>
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-case-path" value="vts/testcases/performance/binder_benchmark/BinderPerformanceTest" />
- </test>
-</configuration>
diff --git a/testcases/performance/binder_benchmark/BinderPerformanceTest.py b/testcases/performance/binder_benchmark/BinderPerformanceTest.py
deleted file mode 100644
index ea48e35..0000000
--- a/testcases/performance/binder_benchmark/BinderPerformanceTest.py
+++ /dev/null
@@ -1,148 +0,0 @@
-#!/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
-
-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.runners.host import const
-
-
-class BinderPerformanceTest(base_test_with_webdb.BaseTestWithWebDbClass):
- """A testcase for the Binder Performance Benchmarking."""
-
- DELIMITER = "\033[m\033[0;33m"
- SCREEN_COMMANDS = ["\x1b[0;32m", "\x1b[m\x1b[0;36m", "\x1b[m", "\x1b[m"]
- THRESHOLD = {
- "BM_sendVec_binder/64": 150000,
- "BM_sendVec_binder/128": 150000,
- "BM_sendVec_binder/256": 150000,
- "BM_sendVec_binder/512": 150000,
- "BM_sendVec_binder/1024": 150000,
- "BM_sendVec_binder/2k": 200000,
- "BM_sendVec_binder/4k": 300000,
- "BM_sendVec_binder/8k": 400000,
- "BM_sendVec_binder/16k": 600000,
- "BM_sendVec_binder/32k": 800000,
- "BM_sendVec_binder/64k": 1000000,
- }
- LABEL_PREFIX = "BM_sendVec_binder/"
-
- def setUpClass(self):
- self.dut = self.registerController(android_device)[0]
- self.dut.shell.InvokeTerminal("one")
- self.DisableCpuScaling()
-
- def tearDownClass(self):
- self.EnableCpuScaling()
-
- def ChangeCpuGoverner(self, mode):
- """Changes the cpu governer mode of all the cpus on the device.
-
- Args:
- mode: string, expected CPU governer mode, e.g., performance/interactive.
- """
- results = self.dut.shell.one.Execute(
- "cat /sys/devices/system/cpu/possible")
- asserts.assertEqual(len(results[const.STDOUT]), 1)
- stdout_lines = results[const.STDOUT][0].split("\n")
- (low, high) = stdout_lines[0].split('-')
- logging.info("possible cpus: %s : %s" % (low, high))
-
- for cpu_no in range(int(low), int(high)):
- self.dut.shell.one.Execute(
- "echo %s > /sys/devices/system/cpu/cpu%s/"
- "cpufreq/scaling_governor" % (mode, cpu_no))
-
- def DisableCpuScaling(self):
- """Disable CPU frequency scaling on the device."""
- self.ChangeCpuGoverner("performance")
-
- def EnableCpuScaling(self):
- """Enable CPU frequency scaling on the device."""
- self.ChangeCpuGoverner("interactive")
-
- def testRunBenchmark32Bit(self):
- """A testcase which runs the 32-bit benchmark."""
- self.RunBenchmark(32)
-
- def testRunBenchmark64Bit(self):
- """A testcase which runs the 64-bit benchmark."""
- self.RunBenchmark(64)
-
- def RunBenchmark(self, bits):
- """Runs the native binary and parses its result.
-
- Args:
- bits: integer (32 or 64), the number of bits in a word chosen
- at the compile time (e.g., 32- vs. 64-bit library).
- """
- # Runs the benchmark.
- logging.info("Start to run the benchmark (%s bit mode)", bits)
- binary = "/data/local/tmp/%s/libbinder_benchmark%s" % (bits, bits)
-
- results = self.dut.shell.one.Execute(
- ["chmod 755 %s" % binary,
- "LD_LIBRARY_PATH=/data/local/tmp/%s/hw:"
- "/data/local/tmp/%s:"
- "$LD_LIBRARY_PATH %s" % (bits, bits, binary)])
-
- # Parses the result.
- asserts.assertEqual(len(results[const.STDOUT]), 2)
- logging.info("stderr: %s", results[const.STDERR][1])
- stdout_lines = results[const.STDOUT][1].split("\n")
- logging.info("stdout: %s", stdout_lines)
- label_result = []
- value_result = []
- for line in stdout_lines:
- if self.DELIMITER in line:
- tokens = []
- for line_original in line.split(self.DELIMITER):
- line_original = line_original.strip()
- for command in self.SCREEN_COMMANDS:
- if command in line_original:
- line_original = line_original.replace(command, "")
- tokens.append(line_original)
- benchmark_name = tokens[0]
- time_in_ns = tokens[1].split()[0]
- logging.info(benchmark_name)
- logging.info(time_in_ns)
- label_result.append(
- benchmark_name.replace(self.LABEL_PREFIX, ""))
- value_result.append(int(time_in_ns))
-
- logging.info("result label for %sbits: %s", bits, label_result)
- logging.info("result value for %sbits: %s", bits, value_result)
- # To upload to the web DB.
- self.AddProfilingDataLabeledVector(
- "binder_vector_roundtrip_latency_benchmark_%sbits" % bits,
- label_result, value_result, x_axis_label="Message Size (Bytes)",
- y_axis_label="Roundtrip Binder RPC Latency (nanoseconds)")
-
- # Assertions to check the performance requirements
- for label, value in zip(label_result, value_result):
- if label in self.THRESHOLD:
- asserts.assertLess(
- value,
- self.THRESHOLD[label],
- "%s ns for %s is longer than the threshold %s ns" % (
- value, label, self.THRESHOLD[label]))
-
-if __name__ == "__main__":
- test_runner.main()
diff --git a/testcases/performance/binder_benchmark/__init__.py b/testcases/performance/binder_benchmark/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/performance/binder_benchmark/__init__.py
+++ /dev/null
diff --git a/testcases/performance/binder_throughput_test/Android.mk b/testcases/performance/binder_throughput_test/Android.mk
deleted file mode 100644
index e467d77..0000000
--- a/testcases/performance/binder_throughput_test/Android.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# 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)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := BinderThroughputBenchmark
-VTS_CONFIG_SRC_DIR := testcases/performance/binder_throughput_test
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/performance/binder_throughput_test/AndroidTest.xml b/testcases/performance/binder_throughput_test/AndroidTest.xml
deleted file mode 100644
index 9158da1..0000000
--- a/testcases/performance/binder_throughput_test/AndroidTest.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS BinderThroughputBenchmark 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="DATA/nativetest/binderThroughputTest/binderThroughputTest->/data/local/tmp/32/binderThroughputTest32" />
- <option name="push" value="DATA/nativetest64/binderThroughputTest/binderThroughputTest->/data/local/tmp/64/binderThroughputTest64" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer">
- </target_preparer>
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-case-path" value="vts/testcases/performance/binder_throughput_test/BinderThroughputBenchmark" />
- </test>
-</configuration>
diff --git a/testcases/performance/binder_throughput_test/BinderThroughputBenchmark.py b/testcases/performance/binder_throughput_test/BinderThroughputBenchmark.py
deleted file mode 100644
index 913495d..0000000
--- a/testcases/performance/binder_throughput_test/BinderThroughputBenchmark.py
+++ /dev/null
@@ -1,214 +0,0 @@
-#!/usr/bin/env python
-#
-# 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
-
-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.runners.host import const
-
-# number of threads to use when running the throughput tests on target.
-_THREAD_LIST = [2, 3, 4, 5, 7, 10, 100]
-
-_ITERATIONS_PER_SECOND = "iterations_per_second"
-_TIME_AVERAGE = "time_average"
-_TIME_WORST = "time_worst"
-_TIME_BEST = "time_best"
-_TIME_PERCENTILE = "time_percentile"
-
-
-class BinderThroughputBenchmark(base_test_with_webdb.BaseTestWithWebDbClass):
- """A test case for the binder throughput benchmarking."""
-
- def setUpClass(self):
- self.dut = self.registerController(android_device)[0]
- self.dut.shell.InvokeTerminal("one")
- self.DisableCpuScaling()
-
- def tearDownClass(self):
- self.EnableCpuScaling()
-
- def ChangeCpuGoverner(self, mode):
- """Changes the cpu governer mode of all the cpus on the device.
-
- Args:
- mode:expected cpu governer mode. e.g performan/interactive.
- """
- results = self.dut.shell.one.Execute(
- "cat /sys/devices/system/cpu/possible")
- asserts.assertEqual(len(results[const.STDOUT]), 1)
- stdout_lines = results[const.STDOUT][0].split("\n")
- (low, high) = stdout_lines[0].split('-')
- logging.info("possible cpus: %s : %s" % (low, high))
-
- for cpu_no in range(int(low), int(high)):
- self.dut.shell.one.Execute(
- "echo %s > /sys/devices/system/cpu/cpu%s/"
- "cpufreq/scaling_governor" % (mode, cpu_no))
-
- def DisableCpuScaling(self):
- """Disable CPU frequency scaling on the device."""
- self.ChangeCpuGoverner("performance")
-
- def EnableCpuScaling(self):
- """Enable CPU frequency scaling on the device."""
- self.ChangeCpuGoverner("interactive")
-
- def testRunBenchmark32Bit(self):
- """A test case which runs the 32-bit benchmark."""
- self.RunBenchmarkAndReportResult(32)
-
- def testRunBenchmark64Bit(self):
- """A test case which runs the 64-bit benchmark."""
- self.RunBenchmarkAndReportResult(64)
-
- def RunBenchmarkAndReportResult(self, bits):
- """Runs the native binary and stores its result to the web DB.
-
- Args:
- bits: integer (32 or 64), the number of bits in a word chosen
- at the compile time (e.g., 32- vs. 64-bit library).
- """
- labels = []
- iterations_per_second = []
- time_average = []
- time_best = []
- time_worst = []
- time_percentile_50 = []
- time_percentile_90 = []
- time_percentile_95 = []
- time_percentile_99 = []
-
- for thread in _THREAD_LIST:
- result = self.RunBenchmark(bits, thread)
- labels.append("%s_thread" % thread)
- iterations_per_second.append(result["iterations_per_second"])
- time_average.append(result["time_average"])
- time_best.append(result["time_best"])
- time_worst.append(result["time_worst"])
- time_percentile_50.append(result["time_percentile"][50])
- time_percentile_90.append(result["time_percentile"][90])
- time_percentile_95.append(result["time_percentile"][95])
- time_percentile_99.append(result["time_percentile"][99])
-
- # To upload to the web DB.
- self.AddProfilingDataLabeledVector(
- "binder_throughput_iterations_per_second_%sbits" % bits,
- labels, iterations_per_second, x_axis_label="Number of Threads",
- y_axis_label="Binder RPC Iterations Per Second")
-
- self.AddProfilingDataLabeledVector(
- "binder_throughput_time_average_ns_%sbits" % bits,
- labels, time_average, x_axis_label="Number of Threads",
- y_axis_label="Binder RPC Time - Average (nanoseconds)")
- self.AddProfilingDataLabeledVector(
- "binder_throughput_time_best_ns_%sbits" % bits,
- labels, time_best, x_axis_label="Number of Threads",
- y_axis_label="Binder RPC Time - Best Case (nanoseconds)")
- self.AddProfilingDataLabeledVector(
- "binder_throughput_time_worst_ns_%sbits" % bits,
- labels, time_worst, x_axis_label="Number of Threads",
- y_axis_label="Binder RPC Time - Worst Case (nanoseconds)")
-
- self.AddProfilingDataLabeledVector(
- "binder_throughput_time_50percentile_ns_%sbits" % bits,
- labels, time_percentile_50, x_axis_label="Number of Threads",
- y_axis_label="Binder RPC Time - 50 Percentile (nanoseconds)")
- self.AddProfilingDataLabeledVector(
- "binder_throughput_time_90percentile_ns_%sbits" % bits,
- labels, time_percentile_90, x_axis_label="Number of Threads",
- y_axis_label="Binder RPC Time - 90 Percentile (nanoseconds)")
- self.AddProfilingDataLabeledVector(
- "binder_throughput_time_95percentile_ns_%sbits" % bits,
- labels, time_percentile_95, x_axis_label="Number of Threads",
- y_axis_label="Binder RPC Time - 95 Percentile (nanoseconds)")
- self.AddProfilingDataLabeledVector(
- "binder_throughput_time_99percentile_ns_%sbits" % bits,
- labels, time_percentile_99, x_axis_label="Number of Threads",
- y_axis_label="Binder RPC Time - 99 Percentile (nanoseconds)")
-
- def RunBenchmark(self, bits, threads):
- """Runs the native binary and parses its result.
-
- Args:
- bits: integer (32 or 64), the number of bits in a word chosen
- at the compile time (e.g., 32- vs. 64-bit library).
- threads: positive integer, the number of threads to use.
-
- Returns:
- a dict which contains the benchmarking result where the keys are:
- 'iterations_per_second', 'time_average', 'time_worst',
- 'time_best', 'time_percentile'.
- """
- # Runs the benchmark.
- logging.info("Start to run the benchmark (%s bit mode)", bits)
- binary = "/data/local/tmp/%s/binderThroughputTest%s" % (bits, bits)
-
- results = self.dut.shell.one.Execute(
- ["chmod 755 %s" % binary,
- "LD_LIBRARY_PATH=/data/local/tmp/%s/hw:"
- "/data/local/tmp/%s:"
- "$LD_LIBRARY_PATH %s -w %s" % (bits, bits, binary, threads)])
-
- # Parses the result.
- asserts.assertEqual(len(results[const.STDOUT]), 2)
- logging.info("stderr: %s", results[const.STDERR][1])
- stdout_lines = results[const.STDOUT][1].split("\n")
- logging.info("stdout: %s", stdout_lines)
-
- asserts.assertFalse(
- any(results[const.EXIT_CODE]),
- "testRunBenchmark%sBit(%s thread) failed." % (bits, threads))
-
- # To upload to the web DB.
- summary = {}
- index = next(i for i, string in enumerate(stdout_lines)
- if "iterations per sec:" in string)
- summary[_ITERATIONS_PER_SECOND] = int(float(
- stdout_lines[index].replace("iterations per sec: ", "")))
- # an example is 'iterations per sec: 34868.7'
-
- index = next(i for i, string in enumerate(stdout_lines)
- if "average:" in string)
- stats_string = stdout_lines[index].split()
- # an example is 'average:0.0542985ms worst:0.314584ms best:0.02651ms'
- summary[_TIME_AVERAGE] = int(float(
- stats_string[0].replace(
- "average:", "").replace("ms", "")) * 1000000)
- summary[_TIME_WORST] = int(float(
- stats_string[1].replace("worst:", "").replace("ms", "")) * 1000000)
- summary[_TIME_BEST] = int(float(
- stats_string[2].replace("best:", "").replace("ms", "")) * 1000000)
-
- index = next(i for i, string in enumerate(stdout_lines)
- if "50%: " in string)
- percentiles_string = stdout_lines[index].split()
- summary[_TIME_PERCENTILE] = {}
- summary[_TIME_PERCENTILE][50] = int(float(percentiles_string[1])
- * 1000000)
- summary[_TIME_PERCENTILE][90] = int(float(percentiles_string[3])
- * 1000000)
- summary[_TIME_PERCENTILE][95] = int(float(percentiles_string[5])
- * 1000000)
- summary[_TIME_PERCENTILE][99] = int(float(percentiles_string[7])
- * 1000000)
- return summary
-
-if __name__ == "__main__":
- test_runner.main()
diff --git a/testcases/performance/binder_throughput_test/__init__.py b/testcases/performance/binder_throughput_test/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/performance/binder_throughput_test/__init__.py
+++ /dev/null
diff --git a/testcases/performance/hwbinder_benchmark/Android.mk b/testcases/performance/hwbinder_benchmark/Android.mk
deleted file mode 100644
index bfe7181..0000000
--- a/testcases/performance/hwbinder_benchmark/Android.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# 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/testcases/performance/hwbinder_benchmark/HwBinderPerformanceTest.py b/testcases/performance/hwbinder_benchmark/HwBinderPerformanceTest.py
deleted file mode 100644
index af5ca48..0000000
--- a/testcases/performance/hwbinder_benchmark/HwBinderPerformanceTest.py
+++ /dev/null
@@ -1,165 +0,0 @@
-#!/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
-
-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.runners.host import const
-
-
-class HwBinderPerformanceTest(base_test_with_webdb.BaseTestWithWebDbClass):
- """A test case for the HWBinder performance benchmarking."""
-
- DELIMITER = "\033[m\033[0;33m"
- SCREEN_COMMANDS = ["\x1b[0;32m", "\x1b[m\x1b[0;36m", "\x1b[m", "\x1b[m"]
- THRESHOLD = {
- 32: {
- "BM_sendVec/64": 100000,
- "BM_sendVec/128": 100000,
- "BM_sendVec/256": 100000,
- "BM_sendVec/512": 100000,
- "BM_sendVec/1024": 100000,
- "BM_sendVec/2k": 100000,
- "BM_sendVec/4k": 100000,
- "BM_sendVec/8k": 110000,
- "BM_sendVec/16k": 120000,
- "BM_sendVec/32k": 140000,
- "BM_sendVec/64k": 170000,
- },
- 64: {
- "BM_sendVec/64": 100000,
- "BM_sendVec/128": 100000,
- "BM_sendVec/256": 100000,
- "BM_sendVec/512": 100000,
- "BM_sendVec/1024": 100000,
- "BM_sendVec/2k": 100000,
- "BM_sendVec/4k": 100000,
- "BM_sendVec/8k": 110000,
- "BM_sendVec/16k": 120000,
- "BM_sendVec/32k": 150000,
- "BM_sendVec/64k": 200000,
- }
- }
- LABEL_PREFIX = "BM_sendVec/"
-
- def setUpClass(self):
- required_params = ["hidl_hal_mode"]
- self.getUserParams(required_params)
- self.dut = self.registerController(android_device)[0]
- self.dut.shell.InvokeTerminal("one")
- self.DisableCpuScaling()
-
- def tearDownClass(self):
- self.EnableCpuScaling()
-
- def ChangeCpuGoverner(self, mode):
- """Changes the cpu governer mode of all the cpus on the device.
-
- Args:
- mode:expected cpu governer mode. e.g performan/interactive.
- """
- results = self.dut.shell.one.Execute(
- "cat /sys/devices/system/cpu/possible")
- asserts.assertEqual(len(results[const.STDOUT]), 1)
- stdout_lines = results[const.STDOUT][0].split("\n")
- (low, high) = stdout_lines[0].split('-')
- logging.info("possible cpus: %s : %s" % (low, high))
-
- for cpu_no in range(int(low), int(high)):
- self.dut.shell.one.Execute(
- "echo %s > /sys/devices/system/cpu/cpu%s/"
- "cpufreq/scaling_governor" % (mode, cpu_no))
-
- def DisableCpuScaling(self):
- """Disable CPU frequency scaling on the device."""
- self.ChangeCpuGoverner("performance")
-
- def EnableCpuScaling(self):
- """Enable CPU frequency scaling on the device."""
- self.ChangeCpuGoverner("interactive")
-
- def testRunBenchmark32Bit(self):
- """A testcase which runs the 32-bit benchmark."""
- self.RunBenchmark(32)
-
- def testRunBenchmark64Bit(self):
- """A testcase which runs the 64-bit benchmark."""
- self.RunBenchmark(64)
-
- def RunBenchmark(self, bits):
- """Runs the native binary and parses its result.
-
- Args:
- bits: integer (32 or 64), the number of bits in a word chosen
- at the compile time (e.g., 32- vs. 64-bit library).
- """
- # Runs the benchmark.
- logging.info("Start to run the benchmark with HIDL mode %s (%s bit mode)",
- self.hidl_hal_mode, bits)
- binary = "/data/local/tmp/%s/libhwbinder_benchmark%s" % (bits, bits)
-
- results = self.dut.shell.one.Execute(
- ["chmod 755 %s" % binary,
- "LD_LIBRARY_PATH=/data/local/tmp/%s/hw:"
- "/data/local/tmp/%s:"
- "$LD_LIBRARY_PATH %s -m %s" % (bits, bits, binary, self.hidl_hal_mode.encode("utf-8"))])
-
- # Parses the result.
- asserts.assertEqual(len(results[const.STDOUT]), 2)
- logging.info("stderr: %s", results[const.STDERR][1])
- stdout_lines = results[const.STDOUT][1].split("\n")
- logging.info("stdout: %s", stdout_lines)
- label_result = []
- value_result = []
- for line in stdout_lines:
- if self.DELIMITER in line:
- tokens = []
- for line_original in line.split(self.DELIMITER):
- line_original = line_original.strip()
- for command in self.SCREEN_COMMANDS:
- if command in line_original:
- line_original = line_original.replace(command, "")
- tokens.append(line_original)
- benchmark_name = tokens[0]
- time_in_ns = tokens[1].split()[0]
- logging.info(benchmark_name)
- logging.info(time_in_ns)
- label_result.append(benchmark_name.replace(self.LABEL_PREFIX, ""))
- value_result.append(int(time_in_ns))
-
- logging.info("result label for %sbits: %s", bits, label_result)
- logging.info("result value for %sbits: %s", bits, value_result)
- # To upload to the web DB.
- self.AddProfilingDataLabeledVector(
- "hwbinder_vector_roundtrip_latency_benchmark_%sbits" % bits,
- label_result, value_result, x_axis_label="Message Size (Bytes)",
- y_axis_label="Roundtrip HwBinder RPC Latency (naonseconds)")
-
- # Assertions to check the performance requirements
- for label, value in zip(label_result, value_result):
- if label in self.THRESHOLD[bits]:
- asserts.assertLess(
- value,
- self.THRESHOLD[bits][label],
- "%s ns for %s is longer than the threshold %s ns" % (
- value, label, self.THRESHOLD[bits][label]))
-
-if __name__ == "__main__":
- test_runner.main()
diff --git a/testcases/performance/hwbinder_benchmark/__init__.py b/testcases/performance/hwbinder_benchmark/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/performance/hwbinder_benchmark/__init__.py
+++ /dev/null
diff --git a/testcases/performance/hwbinder_benchmark/binderize/Android.mk b/testcases/performance/hwbinder_benchmark/binderize/Android.mk
deleted file mode 100644
index d479a88..0000000
--- a/testcases/performance/hwbinder_benchmark/binderize/Android.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# 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)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := HwBinderBinderizePerformanceTest
-VTS_CONFIG_SRC_DIR := testcases/performance/hwbinder_benchmark/binderize
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/performance/hwbinder_benchmark/binderize/AndroidTest.xml b/testcases/performance/hwbinder_benchmark/binderize/AndroidTest.xml
deleted file mode 100644
index 7661d91..0000000
--- a/testcases/performance/hwbinder_benchmark/binderize/AndroidTest.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS libhwbinder performance benchmarks">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HostDrivenTest.push" />
- <option name="cleanup" value="true" />
- <option name="push" value="DATA/benchmarktest/libhwbinder_benchmark/libhwbinder_benchmark32->/data/local/tmp/32/libhwbinder_benchmark32" />
- <option name="push" value="DATA/benchmarktest64/libhwbinder_benchmark/libhwbinder_benchmark64->/data/local/tmp/64/libhwbinder_benchmark64" />
- <option name="push" value="DATA/lib/android.hardware.tests.libhwbinder@1.0.so->/data/local/tmp/32/android.hardware.tests.libhwbinder@1.0.so" />
- <option name="push" value="DATA/lib64/android.hardware.tests.libhwbinder@1.0.so->/data/local/tmp/64/android.hardware.tests.libhwbinder@1.0.so" />
- <option name="push" value="DATA/lib/hw/android.hardware.tests.libhwbinder@1.0-impl.so->/data/local/tmp/32/hw/android.hardware.tests.libhwbinder@1.0-impl.so" />
- <option name="push" value="DATA/lib64/hw/android.hardware.tests.libhwbinder@1.0-impl.so->/data/local/tmp/64/hw/android.hardware.tests.libhwbinder@1.0-impl.so" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer">
- </target_preparer>
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="HwBinderBinderizePerformanceTest" />
- <option name="test-case-path" value="vts/testcases/performance/hwbinder_benchmark/HwBinderPerformanceTest" />
- <option name="test-config-path" value="vts-config/testcases/performance/hwbinder_benchmark/binderize/HwBinderBinderizePerformanceTest.config" />
- </test>
-</configuration>
diff --git a/testcases/performance/hwbinder_benchmark/binderize/HwBinderBinderizePerformanceTest.config b/testcases/performance/hwbinder_benchmark/binderize/HwBinderBinderizePerformanceTest.config
deleted file mode 100644
index fc792a7..0000000
--- a/testcases/performance/hwbinder_benchmark/binderize/HwBinderBinderizePerformanceTest.config
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "hidl_hal_mode": "BINDERIZE"
-}
diff --git a/testcases/performance/hwbinder_benchmark/passthrough/Android.mk b/testcases/performance/hwbinder_benchmark/passthrough/Android.mk
deleted file mode 100644
index e21531e..0000000
--- a/testcases/performance/hwbinder_benchmark/passthrough/Android.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# 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)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := HwBinderPassthroughPerformanceTest
-VTS_CONFIG_SRC_DIR := testcases/performance/hwbinder_benchmark/passthrough
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/performance/hwbinder_benchmark/passthrough/AndroidTest.xml b/testcases/performance/hwbinder_benchmark/passthrough/AndroidTest.xml
deleted file mode 100644
index 7029fdc..0000000
--- a/testcases/performance/hwbinder_benchmark/passthrough/AndroidTest.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS libhwbinder performance benchmarks">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HostDrivenTest.push" />
- <option name="cleanup" value="true" />
- <option name="push" value="DATA/benchmarktest/libhwbinder_benchmark/libhwbinder_benchmark32->/data/local/tmp/32/libhwbinder_benchmark32" />
- <option name="push" value="DATA/benchmarktest64/libhwbinder_benchmark/libhwbinder_benchmark64->/data/local/tmp/64/libhwbinder_benchmark64" />
- <option name="push" value="DATA/lib/android.hardware.tests.libhwbinder@1.0.so->/data/local/tmp/32/android.hardware.tests.libhwbinder@1.0.so" />
- <option name="push" value="DATA/lib64/android.hardware.tests.libhwbinder@1.0.so->/data/local/tmp/64/android.hardware.tests.libhwbinder@1.0.so" />
- <option name="push" value="DATA/lib/hw/android.hardware.tests.libhwbinder@1.0-impl.so->/data/local/tmp/32/hw/android.hardware.tests.libhwbinder@1.0-impl.so" />
- <option name="push" value="DATA/lib64/hw/android.hardware.tests.libhwbinder@1.0-impl.so->/data/local/tmp/64/hw/android.hardware.tests.libhwbinder@1.0-impl.so" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer">
- </target_preparer>
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="HwBinderPassthroughPerformanceTest" />
- <option name="test-case-path" value="vts/testcases/performance/hwbinder_benchmark/HwBinderPerformanceTest" />
- <option name="test-config-path" value="vts-config/testcases/performance/hwbinder_benchmark/passthrough/HwBinderPassthroughPerformanceTest.config" />
- </test>
-</configuration>
diff --git a/testcases/performance/hwbinder_benchmark/passthrough/HwBinderPassthroughPerformanceTest.config b/testcases/performance/hwbinder_benchmark/passthrough/HwBinderPassthroughPerformanceTest.config
deleted file mode 100644
index 54d9875..0000000
--- a/testcases/performance/hwbinder_benchmark/passthrough/HwBinderPassthroughPerformanceTest.config
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "hidl_hal_mode": "PASSTHROUGH"
-}
diff --git a/testcases/performance/hwbinder_throughput_test/Android.mk b/testcases/performance/hwbinder_throughput_test/Android.mk
deleted file mode 100644
index 3b372bd..0000000
--- a/testcases/performance/hwbinder_throughput_test/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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)
\ No newline at end of file
diff --git a/testcases/performance/hwbinder_throughput_test/HwBinderThroughputBenchmark.py b/testcases/performance/hwbinder_throughput_test/HwBinderThroughputBenchmark.py
deleted file mode 100644
index aa93cf6..0000000
--- a/testcases/performance/hwbinder_throughput_test/HwBinderThroughputBenchmark.py
+++ /dev/null
@@ -1,218 +0,0 @@
-#!/usr/bin/env python
-#
-# 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
-
-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.runners.host import const
-
-# number of threads to use when running the throughput tests on target.
-_THREAD_LIST = [2, 3, 4, 5, 7, 10, 100]
-
-_ITERATIONS_PER_SECOND = "iterations_per_second"
-_TIME_AVERAGE = "time_average"
-_TIME_WORST = "time_worst"
-_TIME_BEST = "time_best"
-_TIME_PERCENTILE = "time_percentile"
-
-
-class HwBinderThroughputBenchmark(base_test_with_webdb.BaseTestWithWebDbClass):
- """A test case for the binder throughput benchmarking."""
-
- def setUpClass(self):
- required_params = ["hidl_hal_mode"]
- self.getUserParams(required_params)
- self.dut = self.registerController(android_device)[0]
- self.dut.shell.InvokeTerminal("one")
- self.DisableCpuScaling()
-
- def tearDownClass(self):
- self.EnableCpuScaling()
-
-
- def ChangeCpuGoverner(self, mode):
- """Changes the cpu governer mode of all the cpus on the device.
-
- Args:
- mode:expected cpu governer mode. e.g performan/interactive.
- """
- results = self.dut.shell.one.Execute(
- "cat /sys/devices/system/cpu/possible")
- asserts.assertEqual(len(results[const.STDOUT]), 1)
- stdout_lines = results[const.STDOUT][0].split("\n")
- (low, high) = stdout_lines[0].split('-')
- logging.info("possible cpus: %s : %s" % (low, high))
-
- for cpu_no in range(int(low), int(high)):
- self.dut.shell.one.Execute(
- "echo %s > /sys/devices/system/cpu/cpu%s/"
- "cpufreq/scaling_governor" % (mode, cpu_no))
-
- def DisableCpuScaling(self):
- """Disable CPU frequency scaling on the device."""
- self.ChangeCpuGoverner("performance")
-
- def EnableCpuScaling(self):
- """Enable CPU frequency scaling on the device."""
- self.ChangeCpuGoverner("interactive")
-
- def testRunBenchmark32Bit(self):
- """A test case which runs the 32-bit benchmark."""
- self.RunBenchmarkAndReportResult(32)
-
- def testRunBenchmark64Bit(self):
- """A test case which runs the 64-bit benchmark."""
- self.RunBenchmarkAndReportResult(64)
-
- def RunBenchmarkAndReportResult(self, bits):
- """Runs the native binary and stores its result to the web DB.
-
- Args:
- bits: integer (32 or 64), the number of bits in a word chosen
- at the compile time (e.g., 32- vs. 64-bit library).
- """
- labels = []
- iterations_per_second = []
- time_average = []
- time_best = []
- time_worst = []
- time_percentile_50 = []
- time_percentile_90 = []
- time_percentile_95 = []
- time_percentile_99 = []
-
- for thread in _THREAD_LIST:
- result = self.RunBenchmark(bits, thread)
- labels.append("%s_thread" % thread)
- iterations_per_second.append(result["iterations_per_second"])
- time_average.append(result["time_average"])
- time_best.append(result["time_best"])
- time_worst.append(result["time_worst"])
- time_percentile_50.append(result["time_percentile"][50])
- time_percentile_90.append(result["time_percentile"][90])
- time_percentile_95.append(result["time_percentile"][95])
- time_percentile_99.append(result["time_percentile"][99])
-
- # To upload to the web DB.
- self.AddProfilingDataLabeledVector(
- "hwbinder_throughput_iterations_per_second_%sbits" % bits,
- labels, iterations_per_second, x_axis_label="Number of Threads",
- y_axis_label="HwBinder RPC Iterations Per Second")
-
- self.AddProfilingDataLabeledVector(
- "hwbinder_throughput_time_average_ns_%sbits" % bits,
- labels, time_average, x_axis_label="Number of Threads",
- y_axis_label="HwBinder RPC Time - Average (nanoseconds)")
- self.AddProfilingDataLabeledVector(
- "hwbinder_throughput_time_best_ns_%sbits" % bits,
- labels, time_best, x_axis_label="Number of Threads",
- y_axis_label="HwBinder RPC Time - Best Case (nanoseconds)")
- self.AddProfilingDataLabeledVector(
- "hwbinder_throughput_time_worst_ns_%sbits" % bits,
- labels, time_worst, x_axis_label="Number of Threads",
- y_axis_label="HwBinder RPC Time - Worst Case (nanoseconds)")
-
- self.AddProfilingDataLabeledVector(
- "hwbinder_throughput_time_50percentile_ns_%sbits" % bits,
- labels, time_percentile_50, x_axis_label="Number of Threads",
- y_axis_label="HwBinder RPC Time - 50 Percentile (nanoseconds)")
- self.AddProfilingDataLabeledVector(
- "hwbinder_throughput_time_90percentile_ns_%sbits" % bits,
- labels, time_percentile_90, x_axis_label="Number of Threads",
- y_axis_label="HwBinder RPC Time - 90 Percentile (nanoseconds)")
- self.AddProfilingDataLabeledVector(
- "hwbinder_throughput_time_95percentile_ns_%sbits" % bits,
- labels, time_percentile_95, x_axis_label="Number of Threads",
- y_axis_label="HwBinder RPC Time - 95 Percentile (nanoseconds)")
- self.AddProfilingDataLabeledVector(
- "hwbinder_throughput_time_99percentile_ns_%sbits" % bits,
- labels, time_percentile_99, x_axis_label="Number of Threads",
- y_axis_label="HwBinder RPC Time - 99 Percentile (nanoseconds)")
-
- def RunBenchmark(self, bits, threads):
- """Runs the native binary and parses its result.
-
- Args:
- bits: integer (32 or 64), the number of bits in a word chosen
- at the compile time (e.g., 32- vs. 64-bit library).
- threads: positive integer, the number of threads to use.
-
- Returns:
- a dict which contains the benchmarking result where the keys are:
- 'iterations_per_second', 'time_average', 'time_worst',
- 'time_best', 'time_percentile'.
- """
- # Runs the benchmark.
- logging.info("Start to run the benchmark with HIDL mode %s (%s bit mode)",
- self.hidl_hal_mode, bits)
- binary = "/data/local/tmp/%s/hwbinderThroughputTest%s" % (bits, bits)
-
- results = self.dut.shell.one.Execute(
- ["chmod 755 %s" % binary,
- "LD_LIBRARY_PATH=/system/lib%s:/data/local/tmp/%s/hw:"
- "/data/local/tmp/%s:"
- "$LD_LIBRARY_PATH %s -m %s -w %s" % (bits, bits, bits, binary, self.hidl_hal_mode.encode("utf-8"), threads)])
-
- # Parses the result.
- asserts.assertEqual(len(results[const.STDOUT]), 2)
- logging.info("stderr: %s", results[const.STDERR][1])
- stdout_lines = results[const.STDOUT][1].split("\n")
- logging.info("stdout: %s", stdout_lines)
-
- asserts.assertFalse(
- any(results[const.EXIT_CODE]),
- "testRunBenchmark%sBit(%s thread) failed." % (bits, threads))
-
- # To upload to the web DB.
- summary = {}
- index = next(i for i, string in enumerate(stdout_lines)
- if "iterations per sec:" in string)
- summary[_ITERATIONS_PER_SECOND] = int(float(
- stdout_lines[index].replace("iterations per sec: ", "")))
- # an example is 'iterations per sec: 34868.7'
-
- index = next(i for i, string in enumerate(stdout_lines)
- if "average:" in string)
- stats_string = stdout_lines[index].split()
- # an example is 'average:0.0542985ms worst:0.314584ms best:0.02651ms'
- summary[_TIME_AVERAGE] = int(float(
- stats_string[0].replace(
- "average:", "").replace("ms", "")) * 1000000)
- summary[_TIME_WORST] = int(float(
- stats_string[1].replace("worst:", "").replace("ms", "")) * 1000000)
- summary[_TIME_BEST] = int(float(
- stats_string[2].replace("best:", "").replace("ms", "")) * 1000000)
-
- index = next(i for i, string in enumerate(stdout_lines)
- if "50%: " in string)
- percentiles_string = stdout_lines[index].split()
- summary[_TIME_PERCENTILE] = {}
- summary[_TIME_PERCENTILE][50] = int(float(percentiles_string[1])
- * 1000000)
- summary[_TIME_PERCENTILE][90] = int(float(percentiles_string[3])
- * 1000000)
- summary[_TIME_PERCENTILE][95] = int(float(percentiles_string[5])
- * 1000000)
- summary[_TIME_PERCENTILE][99] = int(float(percentiles_string[7])
- * 1000000)
- return summary
-
-if __name__ == "__main__":
- test_runner.main()
diff --git a/testcases/performance/hwbinder_throughput_test/__init__.py b/testcases/performance/hwbinder_throughput_test/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/performance/hwbinder_throughput_test/__init__.py
+++ /dev/null
diff --git a/testcases/performance/hwbinder_throughput_test/binderize/Android.mk b/testcases/performance/hwbinder_throughput_test/binderize/Android.mk
deleted file mode 100644
index 3694a3c..0000000
--- a/testcases/performance/hwbinder_throughput_test/binderize/Android.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# 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)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := HwBinderBinderizeThroughputTest
-VTS_CONFIG_SRC_DIR := testcases/performance/hwbinder_throughput_test/binderize
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/performance/hwbinder_throughput_test/binderize/AndroidTest.xml b/testcases/performance/hwbinder_throughput_test/binderize/AndroidTest.xml
deleted file mode 100644
index d113683..0000000
--- a/testcases/performance/hwbinder_throughput_test/binderize/AndroidTest.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS HwBinderThroughputBenchmark test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HostDrivenTest.push" />
- <option name="cleanup" value="true" />
- <option name="push" value="DATA/nativetest/hwbinderThroughputTest/hwbinderThroughputTest->/data/local/tmp/32/hwbinderThroughputTest32" />
- <option name="push" value="DATA/nativetest64/hwbinderThroughputTest/hwbinderThroughputTest->/data/local/tmp/64/hwbinderThroughputTest64" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer">
- </target_preparer>
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="HwBinderBinderizeThroughputTest" />
- <option name="test-case-path" value="vts/testcases/performance/hwbinder_throughput_test/HwBinderThroughputBenchmark" />
- <option name="test-config-path" value="vts-config/testcases/performance/hwbinder_throughput_test/binderize/HwBinderBinderizeThroughputTest.config" />
- </test>
-</configuration>
diff --git a/testcases/performance/hwbinder_throughput_test/binderize/HwBinderBinderizeThroughputTest.config b/testcases/performance/hwbinder_throughput_test/binderize/HwBinderBinderizeThroughputTest.config
deleted file mode 100644
index fc792a7..0000000
--- a/testcases/performance/hwbinder_throughput_test/binderize/HwBinderBinderizeThroughputTest.config
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "hidl_hal_mode": "BINDERIZE"
-}
diff --git a/testcases/performance/hwbinder_throughput_test/passthrough/Android.mk b/testcases/performance/hwbinder_throughput_test/passthrough/Android.mk
deleted file mode 100644
index 1d1c1a7..0000000
--- a/testcases/performance/hwbinder_throughput_test/passthrough/Android.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# 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)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := HwBinderPassthroughThroughputTest
-VTS_CONFIG_SRC_DIR := testcases/performance/hwbinder_throughput_test/passthrough
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/performance/hwbinder_throughput_test/passthrough/AndroidTest.xml b/testcases/performance/hwbinder_throughput_test/passthrough/AndroidTest.xml
deleted file mode 100644
index 48eb785..0000000
--- a/testcases/performance/hwbinder_throughput_test/passthrough/AndroidTest.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS HwBinderThroughputBenchmark test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HostDrivenTest.push" />
- <option name="cleanup" value="true" />
- <option name="push" value="DATA/nativetest/hwbinderThroughputTest/hwbinderThroughputTest->/data/local/tmp/32/hwbinderThroughputTest32" />
- <option name="push" value="DATA/nativetest64/hwbinderThroughputTest/hwbinderThroughputTest->/data/local/tmp/64/hwbinderThroughputTest64" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer">
- </target_preparer>
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="HwBinderPassthroughThroughputTest" />
- <option name="test-case-path" value="vts/testcases/performance/hwbinder_throughput_test/HwBinderThroughputBenchmark" />
- <option name="test-config-path" value="vts-config/testcases/performance/hwbinder_throughput_test/passthrough/HwBinderPassthroughThroughputTest.config" />
- </test>
-</configuration>
diff --git a/testcases/performance/hwbinder_throughput_test/passthrough/HwBinderPassthroughThroughputTest.config b/testcases/performance/hwbinder_throughput_test/passthrough/HwBinderPassthroughThroughputTest.config
deleted file mode 100644
index 54d9875..0000000
--- a/testcases/performance/hwbinder_throughput_test/passthrough/HwBinderPassthroughThroughputTest.config
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "hidl_hal_mode": "PASSTHROUGH"
-}
diff --git a/testcases/security/Android.mk b/testcases/security/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/security/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/security/__init__.py b/testcases/security/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/security/__init__.py
+++ /dev/null
diff --git a/testcases/security/poc/Android.mk b/testcases/security/poc/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/security/poc/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/security/poc/README.md b/testcases/security/poc/README.md
deleted file mode 100644
index e69de29..0000000
--- a/testcases/security/poc/README.md
+++ /dev/null
diff --git a/testcases/security/poc/__init__.py b/testcases/security/poc/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/security/poc/__init__.py
+++ /dev/null
diff --git a/testcases/security/poc/config/Android.mk b/testcases/security/poc/config/Android.mk
deleted file mode 100644
index f9e3276..0000000
--- a/testcases/security/poc/config/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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/testcases/security/poc/config/stable/Android.mk b/testcases/security/poc/config/stable/Android.mk
deleted file mode 100644
index bfc32da..0000000
--- a/testcases/security/poc/config/stable/Android.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# 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)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := SecurityPoCKernelTest
-VTS_CONFIG_SRC_DIR := testcases/security/poc/config/stable
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/security/poc/config/stable/AndroidTest.xml b/testcases/security/poc/config/stable/AndroidTest.xml
deleted file mode 100644
index 63fa5c3..0000000
--- a/testcases/security/poc/config/stable/AndroidTest.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS kernel security PoC test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HostDrivenTest.push" />
- <option name="cleanup" value="true" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer">
- </target_preparer>
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="SecurityPoCKernelTest" />
- <option name="test-case-path" value="vts/testcases/security/poc/host/SecurityPoCKernelTest" />
- <option name="test-config-path" value="vts-config/testcases/security/poc/config/stable/SecurityPoCKernelTest.config" />
- </test>
-</configuration>
diff --git a/testcases/security/poc/config/stable/SecurityPoCKernelTest.config b/testcases/security/poc/config/stable/SecurityPoCKernelTest.config
deleted file mode 100644
index 9e0d02a..0000000
--- a/testcases/security/poc/config/stable/SecurityPoCKernelTest.config
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "run_staging": false
-}
diff --git a/testcases/security/poc/config/stable/__init__.py b/testcases/security/poc/config/stable/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/security/poc/config/stable/__init__.py
+++ /dev/null
diff --git a/testcases/security/poc/config/staging/Android.mk b/testcases/security/poc/config/staging/Android.mk
deleted file mode 100644
index 5883f1e..0000000
--- a/testcases/security/poc/config/staging/Android.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# 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)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := SecurityPoCKernelTestStaging
-VTS_CONFIG_SRC_DIR := testcases/security/poc/config/staging
-include test/vts/tools/build/Android.host_config.mk
diff --git a/testcases/security/poc/config/staging/AndroidTest.xml b/testcases/security/poc/config/staging/AndroidTest.xml
deleted file mode 100644
index 080b7a0..0000000
--- a/testcases/security/poc/config/staging/AndroidTest.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<configuration description="Config for VTS kernel security PoC test cases">
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
- <option name="push-group" value="HostDrivenTest.push" />
- <option name="cleanup" value="true" />
- </target_preparer>
- <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer">
- </target_preparer>
- <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
- <option name="test-module-name" value="SecurityPoCKernelTestStaging" />
- <option name="test-case-path" value="vts/testcases/security/poc/host/SecurityPoCKernelTest" />
- <option name="test-config-path" value="vts-config/testcases/security/poc/config/staging/SecurityPoCKernelTestStaging.config" />
- </test>
-</configuration>
diff --git a/testcases/security/poc/config/staging/SecurityPoCKernelTestStaging.config b/testcases/security/poc/config/staging/SecurityPoCKernelTestStaging.config
deleted file mode 100644
index 7254be2..0000000
--- a/testcases/security/poc/config/staging/SecurityPoCKernelTestStaging.config
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "run_staging": true
-}
diff --git a/testcases/security/poc/config/staging/__init__.py b/testcases/security/poc/config/staging/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/security/poc/config/staging/__init__.py
+++ /dev/null
diff --git a/testcases/security/poc/host/SecurityPoCKernelTest.py b/testcases/security/poc/host/SecurityPoCKernelTest.py
deleted file mode 100644
index 7ceaa28..0000000
--- a/testcases/security/poc/host/SecurityPoCKernelTest.py
+++ /dev/null
@@ -1,164 +0,0 @@
-#!/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 json
-import logging
-import os
-
-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 keys
-from vts.runners.host import test_runner
-from vts.utils.python.controllers import android_device
-
-from vts.testcases.security.poc.host import poc_test_config as config
-
-class SecurityPoCKernelTest(base_test_with_webdb.BaseTestWithWebDbClass):
- """Runs security PoC kernel test cases.
-
- Attributes:
- _dut: AndroidDevice, the device under test as config
- _shell: ShellMirrorObject, shell mirror
- _testcases: string list, list of testcases to run
- _model: string, device model e.g. "Nexus 5X"
- _host_input: dict, info passed to PoC test
- _test_flags: string, flags that will be passed to PoC test
- """
- def setUpClass(self):
- """Creates a remote shell instance, and copies data files."""
- required_params = [
- keys.ConfigKeys.IKEY_DATA_FILE_PATH,
- config.ConfigKeys.RUN_STAGING
- ]
- self.getUserParams(required_params)
-
- logging.info("%s: %s", keys.ConfigKeys.IKEY_DATA_FILE_PATH,
- self.data_file_path)
-
- self._dut = self.registerController(android_device)[0]
- self._dut.shell.InvokeTerminal("one")
- self._shell = self._dut.shell.one
- self._testcases = config.POC_TEST_CASES_STABLE
- if self.run_staging:
- self._testcases += config.POC_TEST_CASES_STAGING
-
- self._host_input = self.CreateHostInput()
-
- self._test_flags = ["--%s \"%s\"" % (k, v) for k, v in self._host_input.items()]
- self._test_flags = " ".join(self._test_flags)
- logging.info("Test flags: %s", self._test_flags)
-
- def tearDownClass(self):
- """Deletes all copied data."""
- self._shell.Execute("rm -rf %s" % config.POC_TEST_DIR)
-
- def CreateHostInput(self):
- """Gathers information that will be passed to target-side code.
-
- Returns:
- host_input: dict, information passed to native PoC test.
- """
- out = self._shell.Execute("getprop | grep ro.product.model")
- device_model = out[const.STDOUT][0].strip().split('[')[-1][:-1]
-
- host_input = {
- "device_model": device_model,
- }
- return host_input
-
- def PushFiles(self):
- """adb pushes related file to target."""
- self._shell.Execute("mkdir %s -p" % config.POC_TEST_DIR)
-
- push_src = os.path.join(self.data_file_path, "security", "poc", ".")
- self._dut.adb.push("%s %s" % (push_src, config.POC_TEST_DIR))
-
- def IsRelevant(self, testcase):
- """Returns True iff testcase should run according to its config.
-
- Args:
- testcase: string, format testsuite/testname, specifies which
- test case to examine.
- """
- test_config_path = os.path.join(
- self.data_file_path, "security", "poc", testcase + ".config")
-
- with open(test_config_path) as test_config_file:
- test_config = json.load(test_config_file)
- target_models = test_config["target_models"]
- return self._host_input["device_model"] in target_models
-
- def RunTestcase(self, testcase):
- """Runs the given testcase and asserts the result.
-
- Args:
- testcase: string, format testsuite/testname, specifies which
- test case to run.
- """
- asserts.skipIf(not self.IsRelevant(testcase),
- "%s not configured to run against this target model." % testcase)
-
- items = testcase.split("/", 1)
- testsuite = items[0]
-
- chmod_cmd = "chmod -R 755 %s" % os.path.join(config.POC_TEST_DIR, testsuite)
- cd_cmd = "cd %s" % os.path.join(config.POC_TEST_DIR, testsuite)
- test_cmd = "./%s" % items[1]
-
- cmd = [
- chmod_cmd,
- "%s && %s %s" % (cd_cmd, test_cmd, self._test_flags)
- ]
- logging.info("Executing: %s", cmd)
-
- result = self._shell.Execute(cmd)
- self.AssertTestResult(result)
-
- def AssertTestResult(self, result):
- """Asserts that testcase finished as expected.
-
- Checks that device is in responsive state. If not, waits for boot
- then reports test as failure. If it is, asserts that all test commands
- returned exit code 0.
-
- Args:
- result: dict([str],[str],[int]), command results from shell.
- """
- if self._dut.hasBooted():
- exit_codes = result[const.EXIT_CODE]
- logging.info("EXIT_CODE: %s", exit_codes)
-
- # Last exit code is the exit code of PoC executable.
- asserts.skipIf(exit_codes[-1] == config.ExitCode.POC_TEST_SKIP,
- "Test case was skipped.")
- asserts.assertFalse(
- any(exit_codes), "Test case failed.")
- else:
- self._dut.waitForBootCompletion()
- asserts.fail("Test case left the device in unresponsive state.")
-
- def generateSecurityPoCTests(self):
- """Runs security PoC tests."""
- self.PushFiles()
- self.runGeneratedTests(
- test_func=self.RunTestcase,
- settings=self._testcases,
- name_func=lambda x: x.replace('/','_'))
-
-if __name__ == "__main__":
- test_runner.main()
diff --git a/testcases/security/poc/host/__init__.py b/testcases/security/poc/host/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/testcases/security/poc/host/__init__.py
+++ /dev/null
diff --git a/testcases/security/poc/host/poc_test_config.py b/testcases/security/poc/host/poc_test_config.py
deleted file mode 100644
index 1685f45..0000000
--- a/testcases/security/poc/host/poc_test_config.py
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/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.
-#
-
-
-class ConfigKeys(object):
- RUN_STAGING = "run_staging"
-
-class ExitCode(object):
- """Exit codes for test binaries."""
- POC_TEST_PASS = 0
- POC_TEST_FAIL = 1
- POC_TEST_SKIP = 2
-
-# Directory on the target where the tests are copied.
-POC_TEST_DIR = "/data/local/tmp/security/poc"
-
-POC_TEST_CASES_STABLE = [
-]
-
-POC_TEST_CASES_STAGING = [
- "kernel_sound/28838221",
- "kernel_bluetooth/30149612"
-]
-
-POC_TEST_CASES_DISABLED = [
-]
diff --git a/testcases/security/poc/target/Android.mk b/testcases/security/poc/target/Android.mk
deleted file mode 100644
index 7246b03..0000000
--- a/testcases/security/poc/target/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# 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)
-poc_target_dir := $(LOCAL_PATH)
-
-include $(call all-subdir-makefiles)
-
-include $(CLEAR_VARS)
-
-poc_test_src_files := \
- poc_test.c \
-
-poc_test_cflags := \
- -Wno-int-conversion \
- -Wno-unused-parameter \
-
-poc_test_c_includes := \
- $(poc_target_dir) \
-
-build_poc_test := $(poc_target_dir)/Android.poc_test.mk
-include $(poc_target_dir)/Android.poc_test_list.mk
diff --git a/testcases/security/poc/target/Android.poc_test.mk b/testcases/security/poc/target/Android.poc_test.mk
deleted file mode 100644
index 36b7df1..0000000
--- a/testcases/security/poc/target/Android.poc_test.mk
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# 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.
-#
-
-# Compiles a PoC test module into an executable and copies it into
-# android-vts/testcases/security/poc/ directory.
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-module_name := $(notdir $(module_testname))
-module_path := security/poc/$(dir $(module_testname))
-
-LOCAL_MODULE := $(module_name)
-LOCAL_MODULE_STEM := $(module_name)
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(module_path)
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
- $(poc_test_src_files) \
- $(addprefix $(poc_test_dir)/,$(module_src_files)) \
-
-LOCAL_CFLAGS := \
- $(poc_test_cflags) \
- $(module_cflags) \
-
-LOCAL_C_INCLUDES := \
- $(poc_test_c_includes) \
- $(addprefix $(poc_test_dir)/,$(module_c_includes)) \
-
-LOCAL_STATIC_LIBRARIES := \
- $(poc_test_static_libraries) \
- $(module_static_libraries) \
-
-LOCAL_SHARED_LIBRARIES := \
- $(ltp_shared_libraries) \
- $(module_shared_libraries) \
-
-include $(BUILD_EXECUTABLE)
-
-# Copy resulting executable to vts directory.
-include $(poc_target_dir)/Android.vts_testcase.mk
-
-module_name :=
-module_path :=
-vts_src_file :=
diff --git a/testcases/security/poc/target/Android.poc_test_list.mk b/testcases/security/poc/target/Android.poc_test_list.mk
deleted file mode 100644
index ea7325e..0000000
--- a/testcases/security/poc/target/Android.poc_test_list.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# 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.
-#
-
-module_testname := kernel_bluetooth/30149612
-module_src_files := kernel_bluetooth/30149612/poc.c
-module_cflags :=
-module_c_includes :=
-module_static_libraries :=
-module_shared_libraries :=
-include $(build_poc_test)
-
-module_testname := kernel_sound/28838221
-module_src_files := kernel_sound/28838221/poc.c
-module_cflags :=
-module_c_includes :=
-module_static_libraries :=
-module_shared_libraries :=
-include $(build_poc_test)
-
diff --git a/testcases/security/poc/target/Android.vts_testcase.mk b/testcases/security/poc/target/Android.vts_testcase.mk
deleted file mode 100644
index dca5cd8..0000000
--- a/testcases/security/poc/target/Android.vts_testcase.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# 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.
-#
-
-VTS_TESTCASES_OUT := $(HOST_OUT)/vts/android-vts/testcases
-
-# Copy test executable.
-vts_src_file := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(module_path)/$(module_name)
-vts_dst_file := $(VTS_TESTCASES_OUT)/$(module_path)/$(module_name)
-
-$(vts_dst_file): $(vts_src_file) | $(ACP)
- $(hide) mkdir -p $(dir $(vts_dst_file))
- $(hide) $(ACP) -fp $< $@
-vts: $(vts_dst_file)
-
-# Copy test config.
-vts_src_file := $(poc_target_dir)/$(dir $(module_testname))/$(module_name)/poc.config
-vts_dst_file := $(VTS_TESTCASES_OUT)/$(module_path)/$(module_name).config
-
-$(vts_dst_file): $(vts_src_file) | $(ACP)
- $(hide) mkdir -p $(dir $(vts_dst_file))
- $(hide) $(ACP) -fp $< $@
-vts: $(vts_dst_file)
diff --git a/testcases/security/poc/target/kernel_bluetooth/30149612/poc.c b/testcases/security/poc/target/kernel_bluetooth/30149612/poc.c
deleted file mode 100644
index 519283d..0000000
--- a/testcases/security/poc/target/kernel_bluetooth/30149612/poc.c
+++ /dev/null
@@ -1,53 +0,0 @@
-#include "poc_test.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <unistd.h>
-
-int main(int argc, char* argv[]) {
- VtsHostInput host_input = ParseVtsHostFlags(argc, argv);
- struct sockaddr sa;
- unsigned int len, i;
- int fd;
-
- fd = socket(AF_BLUETOOTH, SOCK_STREAM, 3);
- if (fd == -1) {
- printf("[-] can't create socket: %s\n", strerror(errno));
- return POC_TEST_SKIP;
- }
-
- memset(&sa, 0, sizeof(sa));
- sa.sa_family = AF_BLUETOOTH;
-
- if (bind(fd, &sa, 2)) {
- printf("[-] can't bind socket: %s\n", strerror(errno));
- close(fd);
- return POC_TEST_SKIP;
- }
-
- len = sizeof(sa);
- if (getsockname(fd, &sa, &len)) {
- printf("[-] can't getsockname for socket: %s\n", strerror(errno));
- close(fd);
- return POC_TEST_SKIP;
- } else {
- printf("[+] getsockname return len = %d\n", len);
- }
-
- for (i = 0; i < len; i++) {
- printf("%02x ", ((unsigned char*)&sa)[i]);
- }
- printf("\n");
-
- for (i = 1; i < len; i++) {
- if (((unsigned char*)&sa)[i] != 0) {
- return POC_TEST_FAIL;
- }
- }
-
- close(fd);
- return POC_TEST_PASS;
-}
diff --git a/testcases/security/poc/target/kernel_bluetooth/30149612/poc.config b/testcases/security/poc/target/kernel_bluetooth/30149612/poc.config
deleted file mode 100644
index fb23a7d..0000000
--- a/testcases/security/poc/target/kernel_bluetooth/30149612/poc.config
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "target_models": [
- "Nexus 5",
- "Nexus 6P",
- "Android One"
- ]
-}
diff --git a/testcases/security/poc/target/kernel_sound/28838221/poc.c b/testcases/security/poc/target/kernel_sound/28838221/poc.c
deleted file mode 100644
index 949d068..0000000
--- a/testcases/security/poc/target/kernel_sound/28838221/poc.c
+++ /dev/null
@@ -1,51 +0,0 @@
-#include "poc_test.h"
-
-#include <asm/ioctl.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#define SIZE 32
-
-int main(int argc, char* argv[]) {
- VtsHostInput host_input = ParseVtsHostFlags(argc, argv);
- const char* path;
- switch (host_input.device_model) {
- case NEXUS_5X:
- path = "/sys/kernel/debug/asoc/msm8994-tomtom-snd-card/snd-soc-dummy/codec_reg";
- break;
- case NEXUS_6P:
- path = "/sys/kernel/debug/asoc/msm8994-tomtom-mtp-snd-card/snd-soc-dummy/codec_reg";
- break;
- default:
- return POC_TEST_SKIP;
- }
-
- int ret;
- int fd;
- char buf[SIZE] = {0};
-
- fd = open(path, O_RDWR);
- if (fd < 0) {
- perror("open fail");
- return POC_TEST_FAIL;
- }
- printf("open %s succ\n", path);
-
- sprintf(buf, "%x %x", 0x1111111, 0x2222222);
- ret = write(fd, buf, SIZE);
- if (ret < 0) {
- perror("write fail");
- return POC_TEST_FAIL;
- } else {
- printf("succ write %d byte\n", ret);
- }
- close(fd);
-
- return POC_TEST_PASS;
-}
diff --git a/testcases/security/poc/target/kernel_sound/28838221/poc.config b/testcases/security/poc/target/kernel_sound/28838221/poc.config
deleted file mode 100644
index 464b6a7..0000000
--- a/testcases/security/poc/target/kernel_sound/28838221/poc.config
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "target_models": [
- "Nexus 5",
- "Nexus 5X",
- "Nexus 6",
- "Nexus 6P",
- "Nexus Player"
- ]
-}
diff --git a/testcases/security/poc/target/poc_test.c b/testcases/security/poc/target/poc_test.c
deleted file mode 100644
index 18273d8..0000000
--- a/testcases/security/poc/target/poc_test.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 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.
- */
-
-#include "poc_test.h"
-
-#include <getopt.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-static struct option long_options[] = {
- {"device_model", required_argument, 0, 'd'}
-};
-
-static DeviceModel TranslateDeviceModel(const char *name) {
- DeviceModel device_model;
- if (!strcmp("Nexus 5", name)) device_model = NEXUS_5;
- if (!strcmp("Nexus 5X", name)) device_model = NEXUS_5X;
- if (!strcmp("Nexus 6", name)) device_model = NEXUS_6;
- if (!strcmp("Nexus 6P", name)) device_model = NEXUS_6P;
- return device_model;
-}
-
-VtsHostInput ParseVtsHostFlags(int argc, char *argv[]) {
- VtsHostInput host_input;
- int opt = 0;
- int index = 0;
- while ((opt = getopt_long_only(argc, argv, "", long_options, &index)) != -1) {
- switch(opt) {
- case 'd':
- host_input.device_model = TranslateDeviceModel(optarg);
- break;
- default:
- printf("Wrong parameters.");
- exit(POC_TEST_FAIL);
- }
- }
- return host_input;
-}
diff --git a/testcases/security/poc/target/poc_test.h b/testcases/security/poc/target/poc_test.h
deleted file mode 100644
index 575c62e..0000000
--- a/testcases/security/poc/target/poc_test.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 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.
- */
-
-#ifndef __VTS_TESTCASES_SECURITY_POC_TARGET_POC_TEST_H__
-#define __VTS_TESTCASES_SECURITY_POC_TARGET_POC_TEST_H__
-
-/* define poc_test exit codes */
-#define POC_TEST_PASS 0
-#define POC_TEST_FAIL 1
-#define POC_TEST_SKIP 2
-
-typedef enum {
- NEXUS_5,
- NEXUS_5X,
- NEXUS_6,
- NEXUS_6P
-} DeviceModel;
-
-typedef struct {
- DeviceModel device_model;
-} VtsHostInput;
-
-extern VtsHostInput ParseVtsHostFlags(int argc, char *argv[]);
-
-#endif // __VTS_TESTCASES_SECURITY_POC_TARGET_POC_TEST_H__
diff --git a/testcases/template/binary_test/binary_test.py b/testcases/template/binary_test/binary_test.py
index 4c937cd..8072850 100644
--- a/testcases/template/binary_test/binary_test.py
+++ b/testcases/template/binary_test/binary_test.py
@@ -223,7 +223,6 @@
# Retrieve coverage if applicable
if getattr(self, self.COVERAGE, False):
- logging.info('Retrieving coverage data.')
gcda_dict = coverage_utils.GetGcdaDict(self._dut)
self.SetCoverageData(gcda_dict, True)
@@ -332,7 +331,7 @@
Args:
test_case: BinaryTestCase object
'''
- if getattr(self, self.ENABLE_PROFILING, False):
+ if self.enable_profiling:
profiling_utils.EnableVTSProfiling(
self.shell, test_case.profiling_library_path)
@@ -342,7 +341,7 @@
self.VerifyTestResult(test_case, command_results)
- if getattr(self, self.ENABLE_PROFILING, False):
+ if self.enable_profiling:
profiling_trace_path = getattr(self,
self.VTS_PROFILING_TRACING_PATH, "")
self.ProcessAndUploadTraceData(self._dut, profiling_trace_path)
diff --git a/testcases/template/llvmfuzzer_test/llvmfuzzer_test.py b/testcases/template/llvmfuzzer_test/llvmfuzzer_test.py
index a77401a..a479982 100644
--- a/testcases/template/llvmfuzzer_test/llvmfuzzer_test.py
+++ b/testcases/template/llvmfuzzer_test/llvmfuzzer_test.py
@@ -130,17 +130,28 @@
corpus_dir = self.CreateCorpus(fuzzer, fuzzer_config)
chmod_cmd = "chmod -R 755 %s" % os.path.join(config.FUZZER_TEST_DIR, fuzzer)
+ self._shell.Execute(chmod_cmd)
+
cd_cmd = "cd %s" % config.FUZZER_TEST_DIR
ld_path = "LD_LIBRARY_PATH=/data/local/tmp/32:/data/local/tmp/64:$LD_LIBRARY_PATH"
test_cmd = "./%s" % fuzzer
- cmd = [
- chmod_cmd,
- "%s && %s %s %s %s" % (cd_cmd, ld_path, test_cmd, corpus_dir, test_flags)
- ]
- logging.info("Executing: %s", cmd)
-
- result = self._shell.Execute(cmd)
+ fuzz_cmd = "%s && %s %s %s %s" % (cd_cmd, ld_path, test_cmd, corpus_dir, test_flags)
+ logging.info("Executing: %s", fuzz_cmd)
+ # TODO(trong): vts shell doesn't handle timeouts properly, change this after it does.
+ try:
+ stdout = self._dut.adb.shell("'%s'" % fuzz_cmd)
+ result = {
+ const.STDOUT: stdout,
+ const.STDERR: "",
+ const.EXIT_CODE: 0
+ }
+ except adb.AdbError as e:
+ result = {
+ const.STDOUT: e.stdout,
+ const.STDERR: e.stderr,
+ const.EXIT_CODE: e.ret_code
+ }
self.AssertTestResult(fuzzer, result)
def LogCrashReport(self, fuzzer):
@@ -178,14 +189,13 @@
Args:
fuzzer: string, name of fuzzer executable.
- result: dict([str],[str],[int]), command results from shell.
+ result: dict(str, str, int), command results from shell.
"""
if not self._dut.hasBooted():
self._dut.waitForBootCompletion()
asserts.fail("%s left the device in unresponsive state." % fuzzer)
- # Last exit code is the exit code of the fuzzer executable.
- exit_code = result[const.EXIT_CODE][-1]
+ exit_code = result[const.EXIT_CODE]
if exit_code == config.ExitCode.FUZZER_TEST_FAIL:
self.LogCrashReport(fuzzer)
asserts.fail("%s failed normally." % fuzzer)
diff --git a/tools/build/Android.host_config.mk b/tools/build/Android.host_config.mk
index aae7c57..3d1df0c 100644
--- a/tools/build/Android.host_config.mk
+++ b/tools/build/Android.host_config.mk
@@ -24,16 +24,3 @@
@echo "VTS host-driven test target: $(LOCAL_MODULE)"
$(hide) touch $@
-VTS_TESTCASES_OUT := $(HOST_OUT)/vts/android-vts/testcases
-
-vts_config_file_src := test/vts/$(VTS_CONFIG_SRC_DIR)/$(LOCAL_MODULE).config
-
-ifneq (,$(wildcard $(vts_config_file_src)))
-vts_config_file := $(VTS_TESTCASES_OUT)/vts-config/$(VTS_CONFIG_SRC_DIR)/$(LOCAL_MODULE).config
-
-$(vts_config_file): $(vts_config_file_src) | $(ACP)
- $(hide) mkdir -p $(dir $@)
- $(hide) $(ACP) -fp $< $@
-
-vts: $(vts_config_file)
-endif
diff --git a/tools/build/tasks/list/vts_spec_file_list.mk b/tools/build/tasks/list/vts_spec_file_list.mk
index 9c838e1..509bf93 100644
--- a/tools/build/tasks/list/vts_spec_file_list.mk
+++ b/tools/build/tasks/list/vts_spec_file_list.mk
@@ -36,3 +36,9 @@
hardware/interfaces/vibrator/1.0/vts/types.vts \
hardware/interfaces/thermal/1.0/vts/Thermal.vts \
hardware/interfaces/thermal/1.0/vts/types.vts \
+ hardware/interfaces/sensors/1.0/vts/Sensors.vts \
+ hardware/interfaces/sensors/1.0/vts/types.vts \
+ hardware/interfaces/vr/1.0/vts/Vr.vts \
+ hardware/interfaces/tv/cec/1.0/vts/HdmiCec.vts \
+ hardware/interfaces/tv/cec/1.0/vts/HdmiCecCallback.vts \
+ hardware/interfaces/tv/cec/1.0/vts/types.vts \
diff --git a/tools/build/tasks/list/vts_test_bin_package_list.mk b/tools/build/tasks/list/vts_test_bin_package_list.mk
index a8b3935..5d685ac 100644
--- a/tools/build/tasks/list/vts_test_bin_package_list.mk
+++ b/tools/build/tasks/list/vts_test_bin_package_list.mk
@@ -24,3 +24,8 @@
bionic-unit-tests \
bionic-unit-tests-gcc \
bionic-unit-tests-static \
+
+# some CTS packages for record-and-replay test development purpose
+vts_test_bin_packages += \
+ CtsAccelerationTestCases \
+ CtsSensorTestCases \
diff --git a/tools/build/tasks/list/vts_test_lib_hidl_package_list.mk b/tools/build/tasks/list/vts_test_lib_hidl_package_list.mk
index 65cf373..c49462b 100644
--- a/tools/build/tasks/list/vts_test_lib_hidl_package_list.mk
+++ b/tools/build/tasks/list/vts_test_lib_hidl_package_list.mk
@@ -17,15 +17,33 @@
libhwbinder \
libhidlbase \
libhidltransport \
- libvts_driver_hidl_nfc@1.0 \
+ android.hardware.boot.vts.driver@1.0 \
+ android.hardware.light.vts.driver@2.0 \
+ android.hardware.memtrack.vts.driver@1.0 \
+ android.hardware.nfc.vts.driver@1.0 \
+ android.hardware.power.vts.driver@1.0 \
+ android.hardware.thermal.vts.driver@1.0 \
+ android.hardware.tv.cec.vts.driver@1.0 \
+ android.hardware.vehicle.vts.driver@2.0 \
+ android.hardware.vibrator.vts.driver@1.0 \
+ android.hardware.vr.vts.driver@1.0 \
+ libvts_profiler_hidl_boot@1.0 \
libvts_profiler_hidl_nfc@1.0 \
- libvts_driver_hidl_vibrator@1.0 \
+ libvts_profiler_hidl_power@1.0 \
+ libvts_profiler_hidl_sensors@1.0 \
+ libvts_profiler_hidl_thermal@1.0 \
libvts_profiler_hidl_vibrator@1.0 \
- libvts_driver_hidl_thermal@1.0 \
- libvts_profiler_hidl_thermal@1.0
+ libvts_profiler_hidl_vr@1.0 \
+ libvts_profiler_hidl_tv_cec@1.0 \
vts_test_lib_hidl_packages += \
audio_effect_hidl_hal_test \
+ boot_hidl_hal_test \
+ light_hidl_hal_test \
nfc_hidl_hal_test \
+ power_hidl_hal_test \
+ sensors_hidl_hal_test \
+ thermal_hidl_hal_test \
vibrator_hidl_hal_test \
- thermal_hidl_hal_test
+ vr_hidl_hal_test \
+
diff --git a/tools/vts-tradefed/res/config/vts-serving-staging-hal-hidl.xml b/tools/vts-tradefed/res/config/vts-serving-staging-hal-hidl.xml
index 8df3f46..e689c7a 100644
--- a/tools/vts-tradefed/res/config/vts-serving-staging-hal-hidl.xml
+++ b/tools/vts-tradefed/res/config/vts-serving-staging-hal-hidl.xml
@@ -25,13 +25,17 @@
<option name="compatibility:include-filter" value="NfcHidlBinderizeBasicTest" />
<option name="compatibility:include-filter" value="NfcHidlPassthroughBasicTest" />
<option name="compatibility:include-filter" value="HalNfcHidlTargetBasicTest" />
- <option name="compatibility:include-filter" value="NfcHidlTargetProfilingTest" />
<option name="compatibility:include-filter" value="VibratorHidlTargetTest" />
<option name="compatibility:include-filter" value="VibratorHidlTest" />
<option name="compatibility:include-filter" value="VibratorHidlProfilingTest" />
<option name="compatibility:include-filter" value="VibratorHidlTargetProfilingTest" />
<option name="compatibility:include-filter" value="HalAudioEffectHidlTargetBasicTest" />
- <option name="compatibility:include-filter" value="ThermalHidlTargetProfilingTest" />
<option name="compatibility:include-filter" value="ThermalHidlTargetTest" />
+ <option name="compatibility:include-filter" value="SensorsHidlTest" /><!-- need runtime stopped -->
+ <option name="compatibility:include-filter" value="SensorsHidlTargetTest" /><!-- need runtime stopped -->
+ <option name="compatibility:include-filter" value="HalPowerHidlTargetTest" />
+ <option name="compatibility:include-filter" value="HidlTraceRecorder" />
+ <option name="compatibility:include-filter" value="LightHidlTargetTest" />
+ <option name="compatibility:include-filter" value="VrHidlTargetTest" />
<template-include name="reporters" default="basic-reporters" />
</configuration>
diff --git a/tools/vts-tradefed/res/config/vts-serving-staging-system.xml b/tools/vts-tradefed/res/config/vts-serving-staging-system.xml
index a315ff7..abe3259 100644
--- a/tools/vts-tradefed/res/config/vts-serving-staging-system.xml
+++ b/tools/vts-tradefed/res/config/vts-serving-staging-system.xml
@@ -17,7 +17,5 @@
<include name="everything" />
<option name="plan" value="vts" />
<option name="compatibility:include-filter" value="CameraITSTest" />
- <option name="compatibility:include-filter" value="RebootTest" />
- <option name="compatibility:include-filter" value="RebootRootRemountTest" />
<template-include name="reporters" default="basic-reporters" />
</configuration>
diff --git a/tools/vts-tradefed/res/push_groups/HidlHalTest.push b/tools/vts-tradefed/res/push_groups/HidlHalTest.push
index 2b02fe8..6050e8e 100644
--- a/tools/vts-tradefed/res/push_groups/HidlHalTest.push
+++ b/tools/vts-tradefed/res/push_groups/HidlHalTest.push
@@ -1,17 +1,47 @@
HostDrivenTest.push
-DATA/lib/libvts_driver_hidl_nfc@1.0.so->/data/local/tmp/32/libvts_driver_hidl_nfc@1.0.so
-DATA/lib64/libvts_driver_hidl_nfc@1.0.so->/data/local/tmp/64/libvts_driver_hidl_nfc@1.0.so
+DATA/lib/android.hardware.boot.vts.driver@1.0.so->/data/local/tmp/32/android.hardware.boot.vts.driver@1.0.so
+DATA/lib64/android.hardware.boot.vts.driver@1.0.so->/data/local/tmp/64/android.hardware.boot.vts.driver@1.0.so
-DATA/lib/libvts_driver_hidl_vibrator@1.0.so->/data/local/tmp/32/libvts_driver_hidl_vibrator@1.0.so
-DATA/lib64/libvts_driver_hidl_vibrator@1.0.so->/data/local/tmp/64/libvts_driver_hidl_vibrator@1.0.so
+DATA/lib/android.hardware.light.vts.driver@2.0.so->/data/local/tmp/32/android.hardware.light.vts.driver@2.0.so
+DATA/lib64/android.hardware.light.vts.driver@2.0.so->/data/local/tmp/64/android.hardware.light.vts.driver@2.0.so
-DATA/lib/libvts_profiler_hidl_vibrator@1.0.so->/data/local/tmp/32/hw/android.hardware.vibrator@1.0::IVibrator.profiler.so
-DATA/lib64/libvts_profiler_hidl_vibrator@1.0.so->/data/local/tmp/64/hw/android.hardware.vibrator@1.0::IVibrator.profiler.so
+DATA/lib/android.hardware.memtrack.vts.driver@1.0.so->/data/local/tmp/32/android.hardware.memtrack.vts.driver@1.0.so
+DATA/lib64/android.hardware.memtrack.vts.driver@1.0.so->/data/local/tmp/64/android.hardware.memtrack.vts.driver@1.0.so
-DATA/lib/libvts_driver_hidl_thermal@1.0.so->/data/local/tmp/32/libvts_driver_hidl_thermal@1.0.so
-DATA/lib64/libvts_driver_hidl_thermal@1.0.so->/data/local/tmp/64/libvts_driver_hidl_thermal@1.0.so
+DATA/lib/android.hardware.nfc.vts.driver@1.0.so->/data/local/tmp/32/android.hardware.nfc.vts.driver@1.0.so
+DATA/lib64/android.hardware.nfc.vts.driver@1.0.so->/data/local/tmp/64/android.hardware.nfc.vts.driver@1.0.so
+
+DATA/lib/android.hardware.power.vts.driver@1.0.so->/data/local/tmp/32/android.hardware.power.vts.driver@1.0.so
+DATA/lib64/android.hardware.power.vts.driver@1.0.so->/data/local/tmp/64/android.hardware.power.vts.driver@1.0.so
+
+DATA/lib/android.hardware.thermal.vts.driver@1.0.so->/data/local/tmp/32/android.hardware.thermal.vts.driver@1.0.so
+DATA/lib64/android.hardware.thermal.vts.driver@1.0.so->/data/local/tmp/64/android.hardware.thermal.vts.driver@1.0.so
+
+DATA/lib/android.hardware.tv.cec.vts.driver@1.0.so->/data/local/tmp/32/android.hardware.tv.cec.vts.driver@1.0.so
+DATA/lib64/android.hardware.tv.cec.vts.driver@1.0.so->/data/local/tmp/64/android.hardware.tv.cec.vts.driver@1.0.so
+
+DATA/lib/android.hardware.vehicle.vts.driver@2.0.so->/data/local/tmp/32/android.hardware.vehicle.vts.driver@2.0.so
+DATA/lib64/android.hardware.vehicle.vts.driver@2.0.so->/data/local/tmp/64/android.hardware.vehicle.vts.driver@2.0.so
+
+DATA/lib/android.hardware.vibrator.vts.driver@1.0.so->/data/local/tmp/32/android.hardware.vibrator.vts.driver@1.0.so
+DATA/lib64/android.hardware.vibrator.vts.driver@1.0.so->/data/local/tmp/64/android.hardware.vibrator.vts.driver@1.0.so
+
+DATA/lib/android.hardware.vr.vts.driver@1.0.so->/data/local/tmp/32/android.hardware.vr.vts.driver@1.0.so
+DATA/lib64/android.hardware.vr.vts.driver@1.0.so->/data/local/tmp/64/android.hardware.vr.vts.driver@1.0.so
+
+/lib/libvts_profiler_hidl_boot@1.0.so->/data/local/tmp/32/hw/android.hardware.boot@1.0::IBoot.profiler.so
+DATA/lib64/libvts_profiler_hidl_boot@1.0.so->/data/local/tmp/64/hw/android.hardware.boot@1.0::IBoot.profiler.so
+
+DATA/lib/libvts_profiler_hidl_power@1.0.so->/data/local/tmp/32/hw/android.hardware.power@1.0::IPower.profiler.so
+DATA/lib64/libvts_profiler_hidl_power@1.0.so->/data/local/tmp/64/hw/android.hardware.power@1.0::IPower.profiler.so
+
+DATA/lib/libvts_profiler_hidl_tv_cec@1.0.so->/data/local/tmp/32/hw/android.hardware.tv.cec@1.0::IHdmiCec.profiler.so
+DATA/lib64/libvts_profiler_hidl_tv_cec@1.0.so->/data/local/tmp/64/hw/android.hardware.tv.cec@1.0::IHdmiCec.profiler.so
DATA/lib/libvts_profiler_hidl_thermal@1.0.so->/data/local/tmp/32/hw/android.hardware.thermal@1.0::IThermal.profiler.so
DATA/lib64/libvts_profiler_hidl_thermal@1.0.so->/data/local/tmp/64/hw/android.hardware.thermal@1.0::IThermal.profiler.so
+DATA/lib/libvts_profiler_hidl_vibrator@1.0.so->/data/local/tmp/32/hw/android.hardware.vibrator@1.0::IVibrator.profiler.so
+DATA/lib64/libvts_profiler_hidl_vibrator@1.0.so->/data/local/tmp/64/hw/android.hardware.vibrator@1.0::IVibrator.profiler.so
+
diff --git a/utils/python/common/cmd_utils.py b/utils/python/common/cmd_utils.py
index bc2d765..dee464d 100644
--- a/utils/python/common/cmd_utils.py
+++ b/utils/python/common/cmd_utils.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
#
# Copyright 2016 - The Android Open Source Project
#
diff --git a/utils/python/controllers/adb.py b/utils/python/controllers/adb.py
index 252a3ad..b770fd3 100644
--- a/utils/python/controllers/adb.py
+++ b/utils/python/controllers/adb.py
@@ -26,6 +26,16 @@
class AdbError(Exception):
"""Raised when there is an error in adb operations."""
+ def __init__(self, cmd, stdout, stderr, ret_code):
+ self.cmd = cmd
+ self.stdout = stdout
+ self.stderr = stderr
+ self.ret_code = ret_code
+
+ def __str__(self):
+ return ("Error executing adb cmd '%s'. ret: %d, stdout: %s, stderr: %s"
+ ) % (self.cmd, self.ret_code, self.stdout, self.stderr)
+
SL4A_LAUNCH_CMD = (
"am start -a com.googlecode.android_scripting.action.LAUNCH_SERVER "
@@ -127,18 +137,18 @@
Raises:
AdbError if the adb command exit code is not 0.
"""
- proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
+ proc = subprocess.Popen(cmd,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ shell=True)
(out, err) = proc.communicate()
ret = proc.returncode
- total_output = "stdout: {}, stderr: {}, ret: {}".format(out, err, ret)
- # TODO(angli): Fix this when global logger is done.
- if self.log:
- self.log.debug("{}\n{}".format(cmd, total_output))
- if ret != 0:
- logging.error("adb '%s' failed error code %s", cmd, ret)
- logging.error("total_output: %s", total_output)
- raise AdbError(total_output)
- return out
+ logging.debug("cmd: %s, stdout: %s, stderr: %s, ret: %s", cmd, out,
+ err, ret)
+ if ret == 0:
+ return out
+ else:
+ raise AdbError(cmd=cmd, stdout=out, stderr=err, ret_code=ret)
def _exec_adb_cmd(self, name, arg_str):
return self._exec_cmd(' '.join((self.adb_str, name, arg_str)))
diff --git a/utils/python/coverage/coverage_report.py b/utils/python/coverage/coverage_report.py
index e9f8fff..5e1a116 100644
--- a/utils/python/coverage/coverage_report.py
+++ b/utils/python/coverage/coverage_report.py
@@ -48,6 +48,7 @@
the i-th line was executed. -1 indicates a line that is not executable.
"""
src_lines_counts = []
+ covered_line_count = 0
for ident in gcno_file_summary.functions:
func = gcno_file_summary.functions[ident]
if not src_file_name == func.src_file_name:
@@ -56,14 +57,16 @@
continue
for block in func.blocks:
for line in block.lines:
- logging.info("GenerateLineCoverageVector: covered line %s",
- line)
if line > len(src_lines_counts):
src_lines_counts.extend([-1] *
(line - len(src_lines_counts)))
if src_lines_counts[line - 1] < 0:
src_lines_counts[line - 1] = 0
src_lines_counts[line - 1] += block.count
+ if block.count > 0:
+ covered_line_count += 1
+ logging.info("GenerateLineCoverageVector: file %s: %s lines covered",
+ src_file_name, str(covered_line_count))
return src_lines_counts
diff --git a/utils/python/coverage/coverage_utils.py b/utils/python/coverage/coverage_utils.py
index bc39469..fc426e0 100644
--- a/utils/python/coverage/coverage_utils.py
+++ b/utils/python/coverage/coverage_utils.py
@@ -28,6 +28,12 @@
TARGET_COVERAGE_PATH = "/data/local/tmp/"
LOCAL_COVERAGE_PATH = "/tmp/vts-test-coverage"
+COVERAGE_SUFFIX = ".gcnodir"
+GIT_PROJECT = "git_project"
+MODULE_NAME = "module_name"
+NAME = "name"
+PATH = "path"
+
def InitializeDeviceCoverage(dut):
"""Initializes the device for coverage before tests run.
@@ -41,7 +47,6 @@
logging.info("Removing existing gcda files.")
gcda_files = dut.adb.shell("find %s -name \"*.gcda\" -type f -delete" %
TARGET_COVERAGE_PATH)
- logging.info("Removed files:", gcda_files)
def GetGcdaDict(dut, local_coverage_path=None):
@@ -77,11 +82,9 @@
dut.adb.pull("%s %s" % (gcda, file_name))
gcda_content = open(file_name, "rb").read()
gcda_dict[basename] = gcda_content
- logging.info("Found gcda %s", gcda)
return gcda_dict
-def ProcessCoverageData(report_msg, cov_zip, modules, gcda_dict,
- project_name, project_path, revision):
+def ProcessCoverageData(report_msg, cov_zip, modules, gcda_dict, revision_dict):
"""Process coverage data and appends coverage reports to the report message.
Opens the gcno files in the cov_zip for the specified modules and matches
@@ -94,13 +97,33 @@
cov_zip: the zip file containing gcnodir files from the device build
modules: the list of module names for which to enable coverage
gcda_dict: the dictionary of gcda basenames to gcda content (binary string)
- project_name: the git project name (string) containing the source code
- corresponding to the gcno files
- project_path: the path (string) to the git project root
- revision: the commit ID used to identify the version of the source code.
+ revision_dict: the dictionary with project names as keys and revision ID
+ strings as values.
"""
- gcnodirs = set([m + '.gcnodir' for m in modules])
- for name in [name for name in cov_zip.namelist() if name in gcnodirs]:
+ covered_modules = set(cov_zip.namelist())
+ for module in modules:
+ if MODULE_NAME not in module or GIT_PROJECT not in module:
+ logging.error("Coverage module must specify name and git project: %s",
+ module)
+ continue
+ project = module[GIT_PROJECT]
+ if PATH not in project or NAME not in project:
+ logging.error("Project name and path not specified: %s", project)
+ continue
+
+ name = str(module[MODULE_NAME]) + COVERAGE_SUFFIX
+ git_project = str(project[NAME])
+ git_project_path = str(project[PATH])
+
+ if name not in covered_modules:
+ logging.error("No coverage information for module %s", name)
+ continue
+ if git_project not in revision_dict:
+ logging.error("Git project not present in device revision dict: %s",
+ git_project)
+ continue
+
+ revision = str(revision_dict[git_project])
archive = archive_parser.Archive(cov_zip.open(name).read())
try:
archive.Parse()
@@ -160,8 +183,7 @@
coverage.total_line_count, coverage.covered_line_count = (
coverage_report.GetCoverageStats(coverage_vec))
coverage.line_coverage_vector.extend(coverage_vec)
- src_file_path = os.path.relpath(src_file_path,
- project_path)
+ src_file_path = os.path.relpath(src_file_path, git_project_path)
coverage.file_path = src_file_path
- coverage.revision = str(revision)
- coverage.project_name = str(project_name)
+ coverage.revision = revision
+ coverage.project_name = git_project
diff --git a/utils/python/mirror/hal_mirror.py b/utils/python/mirror/hal_mirror.py
index 1ce9d6f..cd45350 100644
--- a/utils/python/mirror/hal_mirror.py
+++ b/utils/python/mirror/hal_mirror.py
@@ -43,6 +43,10 @@
"nfc": 8,
"vibrator": 12,
"thermal": 13,
+ "tv_cec": 15,
+ "sensors": 16,
+ "vehicle": 17,
+ "vr": 18,
"bionic_libm": 1001,
"bionic_libc": 1002,
"vndk_libcutils": 1101}
@@ -152,6 +156,7 @@
target_component_name=None,
target_basepaths=_DEFAULT_TARGET_BASE_PATHS,
handler_name=None,
+ hw_binder_service_name=None,
bits=64):
"""Initiates a handler for a particular HIDL HAL.
@@ -166,6 +171,7 @@
files in. Default is _DEFAULT_TARGET_BASE_PATHS.
handler_name: string, the name of the handler. target_type is used
by default.
+ hw_binder_service_name: string, the name of a HW binder service.
bits: integer, processor architecture indicator: 32 or 64.
"""
self._CreateMirrorObject("hal_hidl",
@@ -175,6 +181,7 @@
target_component_name=target_component_name,
target_basepaths=target_basepaths,
handler_name=handler_name,
+ hw_binder_service_name=hw_binder_service_name,
bits=bits)
def RemoveHal(self, handler_name):
@@ -203,6 +210,7 @@
target_component_name=None,
target_basepaths=_DEFAULT_TARGET_BASE_PATHS,
handler_name=None,
+ hw_binder_service_name=None,
bits=64):
"""Initiates the driver for a HAL on the target device and creates a top
level MirroObject for it.
@@ -219,6 +227,7 @@
files in. Default is _DEFAULT_TARGET_BASE_PATHS.
handler_name: string, the name of the handler. target_type is used
by default.
+ hw_binder_service_name: string, the name of a HW binder service.
bits: integer, processor architecture indicator: 32 or 64.
Raises:
@@ -282,7 +291,8 @@
target_type=target_type_id,
target_version=target_version,
target_package=target_package,
- target_component_name=target_component_name)
+ target_component_name=target_component_name,
+ hw_binder_service_name=hw_binder_service_name)
if not launched:
raise errors.ComponentLoadingError(
diff --git a/utils/python/profiling/profiling_utils.py b/utils/python/profiling/profiling_utils.py
index 47cd638..39ba80b 100644
--- a/utils/python/profiling/profiling_utils.py
+++ b/utils/python/profiling/profiling_utils.py
@@ -17,6 +17,8 @@
import logging
import os
+from google.protobuf import text_format
+from vts.proto import VtsProfilingMessage_pb2 as VtsProfilingMsg
from vts.runners.host import asserts
from vts.runners.host import const
@@ -99,23 +101,27 @@
myfile = open(trace_file, "r")
new_entry = True
+ profiling_record_str = ""
for line in myfile.readlines():
+ if not line.strip():
+ new_entry = False
if new_entry:
- time_stamp, event, package, version, interface, api = line.strip(
- ).split(",")
+ profiling_record_str += line
+ else:
+ vts_profiling_record = VtsProfilingMsg.VtsProfilingRecord()
+ text_format.Merge(profiling_record_str, vts_profiling_record)
if not profiling_data.name:
logging.warning("no name set for the profiling data. ")
# TODO(zhuoyao): figure out a better way to set the data name.
- profiling_data.name = EVENT_TYPE_DICT[int(event)]
+ profiling_data.name = EVENT_TYPE_DICT[
+ vts_profiling_record.event]
+ api = vts_profiling_record.func_msg.name
+ timestamp = vts_profiling_record.timestamp
if api_timestamps.get(api):
- api_timestamps[api].append(time_stamp)
+ api_timestamps[api].append(timestamp)
else:
- api_timestamps[api] = [time_stamp]
- new_entry = False
- else:
- # get the msg data.
- if not line.strip():
- new_entry = True
+ api_timestamps[api] = [timestamp]
+ new_entry = True
for api, time_stamps in api_timestamps.items():
latencies = []
# TODO(zhuoyao): figure out a way to get the latencies, e.g based on the
diff --git a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/api/BigtableApiServlet.java b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/api/BigtableApiServlet.java
index debb98e..2246892 100644
--- a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/api/BigtableApiServlet.java
+++ b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/api/BigtableApiServlet.java
@@ -16,7 +16,7 @@
package com.android.vts.api;
-import com.android.vts.helpers.BigtableHelper;
+import com.android.vts.util.BigtableHelper;
import com.google.api.client.json.gson.GsonFactory;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.jackson.JacksonFactory;
@@ -35,10 +35,10 @@
import org.apache.hadoop.hbase.util.Bytes;
import org.json.JSONArray;
import org.json.JSONObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import java.io.BufferedReader;
import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -51,7 +51,7 @@
public class BigtableApiServlet extends HttpServlet {
private static final String SERVICE_CLIENT_ID = System.getenv("SERVICE_CLIENT_ID");
- private static final Logger logger = LoggerFactory.getLogger(BigtableApiServlet.class);
+ private static final Logger logger = Logger.getLogger(BigtableApiServlet.class.getName());
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
@@ -99,7 +99,8 @@
insertRow(payloadJson);
break;
default:
- logger.info("Invalid Bigtable API verb: ", payloadJson.getString("verb"));
+ logger.log(Level.INFO, "Invalid Bigtable API verb: " +
+ payloadJson.getString("verb"));
throw new IOException("Unsupported POST verb.");
}
}
@@ -121,7 +122,7 @@
*/
private void createTable(JSONObject payloadJson) throws IOException {
if (!payloadJson.has("tableName") || !payloadJson.has("familyNames")) {
- logger.info("Missing attributes for bigtable api createTable().");
+ logger.log(Level.INFO, "Missing attributes for bigtable api createTable().");
throw new IOException("Missing attributes.");
}
String table = payloadJson.getString("tableName");
@@ -151,7 +152,7 @@
if (!payloadJson.has("tableName") || !payloadJson.has("rowKey") ||
!payloadJson.has("family") || !payloadJson.has("qualifier") ||
!payloadJson.has("value")) {
- logger.info("Missing attributes for bigtable api insertRow().");
+ logger.log(Level.INFO, "Missing attributes for bigtable api insertRow().");
throw new IOException("Missing attributes.");
}
String tableName = payloadJson.getString("tableName");
diff --git a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/proto/VtsReportMessage.java b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/proto/VtsReportMessage.java
index 196a0e0..f79fb25 100644
--- a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/proto/VtsReportMessage.java
+++ b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/proto/VtsReportMessage.java
@@ -244,6 +244,130 @@
}
/**
+ * Protobuf enum {@code android.vts.VtsProfilingRegressionMode}
+ */
+ public enum VtsProfilingRegressionMode
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>UNKNOWN_REGRESSION_MODE = 0;</code>
+ */
+ UNKNOWN_REGRESSION_MODE(0, 0),
+ /**
+ * <code>VTS_REGRESSION_MODE_DISABLED = 1;</code>
+ *
+ * <pre>
+ * disable analysis
+ * </pre>
+ */
+ VTS_REGRESSION_MODE_DISABLED(1, 1),
+ /**
+ * <code>VTS_REGRESSION_MODE_INCREASING = 2;</code>
+ *
+ * <pre>
+ * interpret increases in values as regression
+ * </pre>
+ */
+ VTS_REGRESSION_MODE_INCREASING(2, 2),
+ /**
+ * <code>VTS_REGRESSION_MODE_DECREASING = 3;</code>
+ *
+ * <pre>
+ * interpret decreases in values as regression
+ * </pre>
+ */
+ VTS_REGRESSION_MODE_DECREASING(3, 3),
+ ;
+
+ /**
+ * <code>UNKNOWN_REGRESSION_MODE = 0;</code>
+ */
+ public static final int UNKNOWN_REGRESSION_MODE_VALUE = 0;
+ /**
+ * <code>VTS_REGRESSION_MODE_DISABLED = 1;</code>
+ *
+ * <pre>
+ * disable analysis
+ * </pre>
+ */
+ public static final int VTS_REGRESSION_MODE_DISABLED_VALUE = 1;
+ /**
+ * <code>VTS_REGRESSION_MODE_INCREASING = 2;</code>
+ *
+ * <pre>
+ * interpret increases in values as regression
+ * </pre>
+ */
+ public static final int VTS_REGRESSION_MODE_INCREASING_VALUE = 2;
+ /**
+ * <code>VTS_REGRESSION_MODE_DECREASING = 3;</code>
+ *
+ * <pre>
+ * interpret decreases in values as regression
+ * </pre>
+ */
+ public static final int VTS_REGRESSION_MODE_DECREASING_VALUE = 3;
+
+
+ public final int getNumber() { return value; }
+
+ public static VtsProfilingRegressionMode valueOf(int value) {
+ switch (value) {
+ case 0: return UNKNOWN_REGRESSION_MODE;
+ case 1: return VTS_REGRESSION_MODE_DISABLED;
+ case 2: return VTS_REGRESSION_MODE_INCREASING;
+ case 3: return VTS_REGRESSION_MODE_DECREASING;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<VtsProfilingRegressionMode>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static com.google.protobuf.Internal.EnumLiteMap<VtsProfilingRegressionMode>
+ internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<VtsProfilingRegressionMode>() {
+ public VtsProfilingRegressionMode findValueByNumber(int number) {
+ return VtsProfilingRegressionMode.valueOf(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(index);
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return com.android.vts.proto.VtsReportMessage.getDescriptor().getEnumTypes().get(2);
+ }
+
+ private static final VtsProfilingRegressionMode[] VALUES = values();
+
+ public static VtsProfilingRegressionMode valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int index;
+ private final int value;
+
+ private VtsProfilingRegressionMode(int index, int value) {
+ this.index = index;
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:android.vts.VtsProfilingRegressionMode)
+ }
+
+ /**
* Protobuf enum {@code android.vts.VtsProfilingType}
*/
public enum VtsProfilingType
@@ -325,7 +449,7 @@
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
- return com.android.vts.proto.VtsReportMessage.getDescriptor().getEnumTypes().get(2);
+ return com.android.vts.proto.VtsReportMessage.getDescriptor().getEnumTypes().get(3);
}
private static final VtsProfilingType[] VALUES = values();
@@ -479,6 +603,42 @@
*/
com.google.protobuf.ByteString getApiLevel();
+ // optional bytes abi_name = 51;
+ /**
+ * <code>optional bytes abi_name = 51;</code>
+ *
+ * <pre>
+ * ABI name that is current in use for the test
+ * </pre>
+ */
+ boolean hasAbiName();
+ /**
+ * <code>optional bytes abi_name = 51;</code>
+ *
+ * <pre>
+ * ABI name that is current in use for the test
+ * </pre>
+ */
+ com.google.protobuf.ByteString getAbiName();
+
+ // optional bytes abi_bitness = 52;
+ /**
+ * <code>optional bytes abi_bitness = 52;</code>
+ *
+ * <pre>
+ * ABI bitness that is current in use for the test. Example: '32', '64',
+ * </pre>
+ */
+ boolean hasAbiBitness();
+ /**
+ * <code>optional bytes abi_bitness = 52;</code>
+ *
+ * <pre>
+ * ABI bitness that is current in use for the test. Example: '32', '64',
+ * </pre>
+ */
+ com.google.protobuf.ByteString getAbiBitness();
+
// optional bytes serial = 101;
/**
* <code>optional bytes serial = 101;</code>
@@ -587,8 +747,18 @@
apiLevel_ = input.readBytes();
break;
}
- case 810: {
+ case 410: {
bitField0_ |= 0x00000080;
+ abiName_ = input.readBytes();
+ break;
+ }
+ case 418: {
+ bitField0_ |= 0x00000100;
+ abiBitness_ = input.readBytes();
+ break;
+ }
+ case 810: {
+ bitField0_ |= 0x00000200;
serial_ = input.readBytes();
break;
}
@@ -800,6 +970,54 @@
return apiLevel_;
}
+ // optional bytes abi_name = 51;
+ public static final int ABI_NAME_FIELD_NUMBER = 51;
+ private com.google.protobuf.ByteString abiName_;
+ /**
+ * <code>optional bytes abi_name = 51;</code>
+ *
+ * <pre>
+ * ABI name that is current in use for the test
+ * </pre>
+ */
+ public boolean hasAbiName() {
+ return ((bitField0_ & 0x00000080) == 0x00000080);
+ }
+ /**
+ * <code>optional bytes abi_name = 51;</code>
+ *
+ * <pre>
+ * ABI name that is current in use for the test
+ * </pre>
+ */
+ public com.google.protobuf.ByteString getAbiName() {
+ return abiName_;
+ }
+
+ // optional bytes abi_bitness = 52;
+ public static final int ABI_BITNESS_FIELD_NUMBER = 52;
+ private com.google.protobuf.ByteString abiBitness_;
+ /**
+ * <code>optional bytes abi_bitness = 52;</code>
+ *
+ * <pre>
+ * ABI bitness that is current in use for the test. Example: '32', '64',
+ * </pre>
+ */
+ public boolean hasAbiBitness() {
+ return ((bitField0_ & 0x00000100) == 0x00000100);
+ }
+ /**
+ * <code>optional bytes abi_bitness = 52;</code>
+ *
+ * <pre>
+ * ABI bitness that is current in use for the test. Example: '32', '64',
+ * </pre>
+ */
+ public com.google.protobuf.ByteString getAbiBitness() {
+ return abiBitness_;
+ }
+
// optional bytes serial = 101;
public static final int SERIAL_FIELD_NUMBER = 101;
private com.google.protobuf.ByteString serial_;
@@ -811,7 +1029,7 @@
* </pre>
*/
public boolean hasSerial() {
- return ((bitField0_ & 0x00000080) == 0x00000080);
+ return ((bitField0_ & 0x00000200) == 0x00000200);
}
/**
* <code>optional bytes serial = 101;</code>
@@ -832,6 +1050,8 @@
branch_ = com.google.protobuf.ByteString.EMPTY;
buildAlias_ = com.google.protobuf.ByteString.EMPTY;
apiLevel_ = com.google.protobuf.ByteString.EMPTY;
+ abiName_ = com.google.protobuf.ByteString.EMPTY;
+ abiBitness_ = com.google.protobuf.ByteString.EMPTY;
serial_ = com.google.protobuf.ByteString.EMPTY;
}
private byte memoizedIsInitialized = -1;
@@ -868,6 +1088,12 @@
output.writeBytes(31, apiLevel_);
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
+ output.writeBytes(51, abiName_);
+ }
+ if (((bitField0_ & 0x00000100) == 0x00000100)) {
+ output.writeBytes(52, abiBitness_);
+ }
+ if (((bitField0_ & 0x00000200) == 0x00000200)) {
output.writeBytes(101, serial_);
}
getUnknownFields().writeTo(output);
@@ -909,6 +1135,14 @@
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(51, abiName_);
+ }
+ if (((bitField0_ & 0x00000100) == 0x00000100)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(52, abiBitness_);
+ }
+ if (((bitField0_ & 0x00000200) == 0x00000200)) {
+ size += com.google.protobuf.CodedOutputStream
.computeBytesSize(101, serial_);
}
size += getUnknownFields().getSerializedSize();
@@ -1045,8 +1279,12 @@
bitField0_ = (bitField0_ & ~0x00000020);
apiLevel_ = com.google.protobuf.ByteString.EMPTY;
bitField0_ = (bitField0_ & ~0x00000040);
- serial_ = com.google.protobuf.ByteString.EMPTY;
+ abiName_ = com.google.protobuf.ByteString.EMPTY;
bitField0_ = (bitField0_ & ~0x00000080);
+ abiBitness_ = com.google.protobuf.ByteString.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000100);
+ serial_ = com.google.protobuf.ByteString.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000200);
return this;
}
@@ -1106,6 +1344,14 @@
if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
to_bitField0_ |= 0x00000080;
}
+ result.abiName_ = abiName_;
+ if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
+ to_bitField0_ |= 0x00000100;
+ }
+ result.abiBitness_ = abiBitness_;
+ if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
+ to_bitField0_ |= 0x00000200;
+ }
result.serial_ = serial_;
result.bitField0_ = to_bitField0_;
onBuilt();
@@ -1144,6 +1390,12 @@
if (other.hasApiLevel()) {
setApiLevel(other.getApiLevel());
}
+ if (other.hasAbiName()) {
+ setAbiName(other.getAbiName());
+ }
+ if (other.hasAbiBitness()) {
+ setAbiBitness(other.getAbiBitness());
+ }
if (other.hasSerial()) {
setSerial(other.getSerial());
}
@@ -1538,6 +1790,110 @@
return this;
}
+ // optional bytes abi_name = 51;
+ private com.google.protobuf.ByteString abiName_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ * <code>optional bytes abi_name = 51;</code>
+ *
+ * <pre>
+ * ABI name that is current in use for the test
+ * </pre>
+ */
+ public boolean hasAbiName() {
+ return ((bitField0_ & 0x00000080) == 0x00000080);
+ }
+ /**
+ * <code>optional bytes abi_name = 51;</code>
+ *
+ * <pre>
+ * ABI name that is current in use for the test
+ * </pre>
+ */
+ public com.google.protobuf.ByteString getAbiName() {
+ return abiName_;
+ }
+ /**
+ * <code>optional bytes abi_name = 51;</code>
+ *
+ * <pre>
+ * ABI name that is current in use for the test
+ * </pre>
+ */
+ public Builder setAbiName(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000080;
+ abiName_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional bytes abi_name = 51;</code>
+ *
+ * <pre>
+ * ABI name that is current in use for the test
+ * </pre>
+ */
+ public Builder clearAbiName() {
+ bitField0_ = (bitField0_ & ~0x00000080);
+ abiName_ = getDefaultInstance().getAbiName();
+ onChanged();
+ return this;
+ }
+
+ // optional bytes abi_bitness = 52;
+ private com.google.protobuf.ByteString abiBitness_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ * <code>optional bytes abi_bitness = 52;</code>
+ *
+ * <pre>
+ * ABI bitness that is current in use for the test. Example: '32', '64',
+ * </pre>
+ */
+ public boolean hasAbiBitness() {
+ return ((bitField0_ & 0x00000100) == 0x00000100);
+ }
+ /**
+ * <code>optional bytes abi_bitness = 52;</code>
+ *
+ * <pre>
+ * ABI bitness that is current in use for the test. Example: '32', '64',
+ * </pre>
+ */
+ public com.google.protobuf.ByteString getAbiBitness() {
+ return abiBitness_;
+ }
+ /**
+ * <code>optional bytes abi_bitness = 52;</code>
+ *
+ * <pre>
+ * ABI bitness that is current in use for the test. Example: '32', '64',
+ * </pre>
+ */
+ public Builder setAbiBitness(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000100;
+ abiBitness_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional bytes abi_bitness = 52;</code>
+ *
+ * <pre>
+ * ABI bitness that is current in use for the test. Example: '32', '64',
+ * </pre>
+ */
+ public Builder clearAbiBitness() {
+ bitField0_ = (bitField0_ & ~0x00000100);
+ abiBitness_ = getDefaultInstance().getAbiBitness();
+ onChanged();
+ return this;
+ }
+
// optional bytes serial = 101;
private com.google.protobuf.ByteString serial_ = com.google.protobuf.ByteString.EMPTY;
/**
@@ -1548,7 +1904,7 @@
* </pre>
*/
public boolean hasSerial() {
- return ((bitField0_ & 0x00000080) == 0x00000080);
+ return ((bitField0_ & 0x00000200) == 0x00000200);
}
/**
* <code>optional bytes serial = 101;</code>
@@ -1571,7 +1927,7 @@
if (value == null) {
throw new NullPointerException();
}
- bitField0_ |= 0x00000080;
+ bitField0_ |= 0x00000200;
serial_ = value;
onChanged();
return this;
@@ -1584,7 +1940,7 @@
* </pre>
*/
public Builder clearSerial() {
- bitField0_ = (bitField0_ & ~0x00000080);
+ bitField0_ = (bitField0_ & ~0x00000200);
serial_ = getDefaultInstance().getSerial();
onChanged();
return this;
@@ -2504,6 +2860,445 @@
// @@protoc_insertion_point(class_scope:android.vts.AndroidBuildInfo)
}
+ public interface VtsHostInfoOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // optional bytes hostname = 1;
+ /**
+ * <code>optional bytes hostname = 1;</code>
+ *
+ * <pre>
+ * the host name (i.e., full domain name).
+ * </pre>
+ */
+ boolean hasHostname();
+ /**
+ * <code>optional bytes hostname = 1;</code>
+ *
+ * <pre>
+ * the host name (i.e., full domain name).
+ * </pre>
+ */
+ com.google.protobuf.ByteString getHostname();
+ }
+ /**
+ * Protobuf type {@code android.vts.VtsHostInfo}
+ *
+ * <pre>
+ * To specify the information about a host node.
+ * </pre>
+ */
+ public static final class VtsHostInfo extends
+ com.google.protobuf.GeneratedMessage
+ implements VtsHostInfoOrBuilder {
+ // Use VtsHostInfo.newBuilder() to construct.
+ private VtsHostInfo(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private VtsHostInfo(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final VtsHostInfo defaultInstance;
+ public static VtsHostInfo getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public VtsHostInfo getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private VtsHostInfo(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ bitField0_ |= 0x00000001;
+ hostname_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.android.vts.proto.VtsReportMessage.internal_static_android_vts_VtsHostInfo_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.android.vts.proto.VtsReportMessage.internal_static_android_vts_VtsHostInfo_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.android.vts.proto.VtsReportMessage.VtsHostInfo.class, com.android.vts.proto.VtsReportMessage.VtsHostInfo.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<VtsHostInfo> PARSER =
+ new com.google.protobuf.AbstractParser<VtsHostInfo>() {
+ public VtsHostInfo parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new VtsHostInfo(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<VtsHostInfo> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // optional bytes hostname = 1;
+ public static final int HOSTNAME_FIELD_NUMBER = 1;
+ private com.google.protobuf.ByteString hostname_;
+ /**
+ * <code>optional bytes hostname = 1;</code>
+ *
+ * <pre>
+ * the host name (i.e., full domain name).
+ * </pre>
+ */
+ public boolean hasHostname() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>optional bytes hostname = 1;</code>
+ *
+ * <pre>
+ * the host name (i.e., full domain name).
+ * </pre>
+ */
+ public com.google.protobuf.ByteString getHostname() {
+ return hostname_;
+ }
+
+ private void initFields() {
+ hostname_ = com.google.protobuf.ByteString.EMPTY;
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, hostname_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, hostname_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static com.android.vts.proto.VtsReportMessage.VtsHostInfo parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.android.vts.proto.VtsReportMessage.VtsHostInfo parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.android.vts.proto.VtsReportMessage.VtsHostInfo parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.android.vts.proto.VtsReportMessage.VtsHostInfo parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.android.vts.proto.VtsReportMessage.VtsHostInfo parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static com.android.vts.proto.VtsReportMessage.VtsHostInfo parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static com.android.vts.proto.VtsReportMessage.VtsHostInfo parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static com.android.vts.proto.VtsReportMessage.VtsHostInfo parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static com.android.vts.proto.VtsReportMessage.VtsHostInfo parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static com.android.vts.proto.VtsReportMessage.VtsHostInfo parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(com.android.vts.proto.VtsReportMessage.VtsHostInfo prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code android.vts.VtsHostInfo}
+ *
+ * <pre>
+ * To specify the information about a host node.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements com.android.vts.proto.VtsReportMessage.VtsHostInfoOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.android.vts.proto.VtsReportMessage.internal_static_android_vts_VtsHostInfo_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.android.vts.proto.VtsReportMessage.internal_static_android_vts_VtsHostInfo_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.android.vts.proto.VtsReportMessage.VtsHostInfo.class, com.android.vts.proto.VtsReportMessage.VtsHostInfo.Builder.class);
+ }
+
+ // Construct using com.android.vts.proto.VtsReportMessage.VtsHostInfo.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ hostname_ = com.google.protobuf.ByteString.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return com.android.vts.proto.VtsReportMessage.internal_static_android_vts_VtsHostInfo_descriptor;
+ }
+
+ public com.android.vts.proto.VtsReportMessage.VtsHostInfo getDefaultInstanceForType() {
+ return com.android.vts.proto.VtsReportMessage.VtsHostInfo.getDefaultInstance();
+ }
+
+ public com.android.vts.proto.VtsReportMessage.VtsHostInfo build() {
+ com.android.vts.proto.VtsReportMessage.VtsHostInfo result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public com.android.vts.proto.VtsReportMessage.VtsHostInfo buildPartial() {
+ com.android.vts.proto.VtsReportMessage.VtsHostInfo result = new com.android.vts.proto.VtsReportMessage.VtsHostInfo(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.hostname_ = hostname_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof com.android.vts.proto.VtsReportMessage.VtsHostInfo) {
+ return mergeFrom((com.android.vts.proto.VtsReportMessage.VtsHostInfo)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(com.android.vts.proto.VtsReportMessage.VtsHostInfo other) {
+ if (other == com.android.vts.proto.VtsReportMessage.VtsHostInfo.getDefaultInstance()) return this;
+ if (other.hasHostname()) {
+ setHostname(other.getHostname());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ com.android.vts.proto.VtsReportMessage.VtsHostInfo parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (com.android.vts.proto.VtsReportMessage.VtsHostInfo) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // optional bytes hostname = 1;
+ private com.google.protobuf.ByteString hostname_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ * <code>optional bytes hostname = 1;</code>
+ *
+ * <pre>
+ * the host name (i.e., full domain name).
+ * </pre>
+ */
+ public boolean hasHostname() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>optional bytes hostname = 1;</code>
+ *
+ * <pre>
+ * the host name (i.e., full domain name).
+ * </pre>
+ */
+ public com.google.protobuf.ByteString getHostname() {
+ return hostname_;
+ }
+ /**
+ * <code>optional bytes hostname = 1;</code>
+ *
+ * <pre>
+ * the host name (i.e., full domain name).
+ * </pre>
+ */
+ public Builder setHostname(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ hostname_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional bytes hostname = 1;</code>
+ *
+ * <pre>
+ * the host name (i.e., full domain name).
+ * </pre>
+ */
+ public Builder clearHostname() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ hostname_ = getDefaultInstance().getHostname();
+ onChanged();
+ return this;
+ }
+
+ // @@protoc_insertion_point(builder_scope:android.vts.VtsHostInfo)
+ }
+
+ static {
+ defaultInstance = new VtsHostInfo(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:android.vts.VtsHostInfo)
+ }
+
public interface TestCaseReportMessageOrBuilder
extends com.google.protobuf.MessageOrBuilder {
@@ -3764,6 +4559,16 @@
*/
com.android.vts.proto.VtsReportMessage.VtsProfilingType getType();
+ // optional .android.vts.VtsProfilingRegressionMode regression_mode = 3;
+ /**
+ * <code>optional .android.vts.VtsProfilingRegressionMode regression_mode = 3;</code>
+ */
+ boolean hasRegressionMode();
+ /**
+ * <code>optional .android.vts.VtsProfilingRegressionMode regression_mode = 3;</code>
+ */
+ com.android.vts.proto.VtsReportMessage.VtsProfilingRegressionMode getRegressionMode();
+
// optional int64 start_timestamp = 11;
/**
* <code>optional int64 start_timestamp = 11;</code>
@@ -3919,28 +4724,39 @@
}
break;
}
+ case 24: {
+ int rawValue = input.readEnum();
+ com.android.vts.proto.VtsReportMessage.VtsProfilingRegressionMode value = com.android.vts.proto.VtsReportMessage.VtsProfilingRegressionMode.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(3, rawValue);
+ } else {
+ bitField0_ |= 0x00000004;
+ regressionMode_ = value;
+ }
+ break;
+ }
case 88: {
- bitField0_ |= 0x00000004;
+ bitField0_ |= 0x00000008;
startTimestamp_ = input.readInt64();
break;
}
case 96: {
- bitField0_ |= 0x00000008;
+ bitField0_ |= 0x00000010;
endTimestamp_ = input.readInt64();
break;
}
case 170: {
- if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
+ if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
label_ = new java.util.ArrayList<com.google.protobuf.ByteString>();
- mutable_bitField0_ |= 0x00000010;
+ mutable_bitField0_ |= 0x00000020;
}
label_.add(input.readBytes());
break;
}
case 176: {
- if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
+ if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
value_ = new java.util.ArrayList<java.lang.Long>();
- mutable_bitField0_ |= 0x00000020;
+ mutable_bitField0_ |= 0x00000040;
}
value_.add(input.readInt64());
break;
@@ -3948,9 +4764,9 @@
case 178: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
- if (!((mutable_bitField0_ & 0x00000020) == 0x00000020) && input.getBytesUntilLimit() > 0) {
+ if (!((mutable_bitField0_ & 0x00000040) == 0x00000040) && input.getBytesUntilLimit() > 0) {
value_ = new java.util.ArrayList<java.lang.Long>();
- mutable_bitField0_ |= 0x00000020;
+ mutable_bitField0_ |= 0x00000040;
}
while (input.getBytesUntilLimit() > 0) {
value_.add(input.readInt64());
@@ -3959,12 +4775,12 @@
break;
}
case 250: {
- bitField0_ |= 0x00000010;
+ bitField0_ |= 0x00000020;
xAxisLabel_ = input.readBytes();
break;
}
case 258: {
- bitField0_ |= 0x00000020;
+ bitField0_ |= 0x00000040;
yAxisLabel_ = input.readBytes();
break;
}
@@ -3976,10 +4792,10 @@
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
- if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
+ if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
label_ = java.util.Collections.unmodifiableList(label_);
}
- if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
+ if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
value_ = java.util.Collections.unmodifiableList(value_);
}
this.unknownFields = unknownFields.build();
@@ -4054,6 +4870,22 @@
return type_;
}
+ // optional .android.vts.VtsProfilingRegressionMode regression_mode = 3;
+ public static final int REGRESSION_MODE_FIELD_NUMBER = 3;
+ private com.android.vts.proto.VtsReportMessage.VtsProfilingRegressionMode regressionMode_;
+ /**
+ * <code>optional .android.vts.VtsProfilingRegressionMode regression_mode = 3;</code>
+ */
+ public boolean hasRegressionMode() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>optional .android.vts.VtsProfilingRegressionMode regression_mode = 3;</code>
+ */
+ public com.android.vts.proto.VtsReportMessage.VtsProfilingRegressionMode getRegressionMode() {
+ return regressionMode_;
+ }
+
// optional int64 start_timestamp = 11;
public static final int START_TIMESTAMP_FIELD_NUMBER = 11;
private long startTimestamp_;
@@ -4065,7 +4897,7 @@
* </pre>
*/
public boolean hasStartTimestamp() {
- return ((bitField0_ & 0x00000004) == 0x00000004);
+ return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional int64 start_timestamp = 11;</code>
@@ -4085,7 +4917,7 @@
* <code>optional int64 end_timestamp = 12;</code>
*/
public boolean hasEndTimestamp() {
- return ((bitField0_ & 0x00000008) == 0x00000008);
+ return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional int64 end_timestamp = 12;</code>
@@ -4151,7 +4983,7 @@
* </pre>
*/
public boolean hasXAxisLabel() {
- return ((bitField0_ & 0x00000010) == 0x00000010);
+ return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>optional bytes x_axis_label = 31;</code>
@@ -4171,7 +5003,7 @@
* <code>optional bytes y_axis_label = 32;</code>
*/
public boolean hasYAxisLabel() {
- return ((bitField0_ & 0x00000020) == 0x00000020);
+ return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
* <code>optional bytes y_axis_label = 32;</code>
@@ -4183,6 +5015,7 @@
private void initFields() {
name_ = com.google.protobuf.ByteString.EMPTY;
type_ = com.android.vts.proto.VtsReportMessage.VtsProfilingType.UNKNOWN_VTS_PROFILING_TYPE;
+ regressionMode_ = com.android.vts.proto.VtsReportMessage.VtsProfilingRegressionMode.UNKNOWN_REGRESSION_MODE;
startTimestamp_ = 0L;
endTimestamp_ = 0L;
label_ = java.util.Collections.emptyList();
@@ -4209,9 +5042,12 @@
output.writeEnum(2, type_.getNumber());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
- output.writeInt64(11, startTimestamp_);
+ output.writeEnum(3, regressionMode_.getNumber());
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ output.writeInt64(11, startTimestamp_);
+ }
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeInt64(12, endTimestamp_);
}
for (int i = 0; i < label_.size(); i++) {
@@ -4220,10 +5056,10 @@
for (int i = 0; i < value_.size(); i++) {
output.writeInt64(22, value_.get(i));
}
- if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ if (((bitField0_ & 0x00000020) == 0x00000020)) {
output.writeBytes(31, xAxisLabel_);
}
- if (((bitField0_ & 0x00000020) == 0x00000020)) {
+ if (((bitField0_ & 0x00000040) == 0x00000040)) {
output.writeBytes(32, yAxisLabel_);
}
getUnknownFields().writeTo(output);
@@ -4245,10 +5081,14 @@
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
- .computeInt64Size(11, startTimestamp_);
+ .computeEnumSize(3, regressionMode_.getNumber());
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
+ .computeInt64Size(11, startTimestamp_);
+ }
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ size += com.google.protobuf.CodedOutputStream
.computeInt64Size(12, endTimestamp_);
}
{
@@ -4269,11 +5109,11 @@
size += dataSize;
size += 2 * getValueList().size();
}
- if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(31, xAxisLabel_);
}
- if (((bitField0_ & 0x00000020) == 0x00000020)) {
+ if (((bitField0_ & 0x00000040) == 0x00000040)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(32, yAxisLabel_);
}
@@ -4401,18 +5241,20 @@
bitField0_ = (bitField0_ & ~0x00000001);
type_ = com.android.vts.proto.VtsReportMessage.VtsProfilingType.UNKNOWN_VTS_PROFILING_TYPE;
bitField0_ = (bitField0_ & ~0x00000002);
- startTimestamp_ = 0L;
+ regressionMode_ = com.android.vts.proto.VtsReportMessage.VtsProfilingRegressionMode.UNKNOWN_REGRESSION_MODE;
bitField0_ = (bitField0_ & ~0x00000004);
- endTimestamp_ = 0L;
+ startTimestamp_ = 0L;
bitField0_ = (bitField0_ & ~0x00000008);
- label_ = java.util.Collections.emptyList();
+ endTimestamp_ = 0L;
bitField0_ = (bitField0_ & ~0x00000010);
- value_ = java.util.Collections.emptyList();
+ label_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000020);
- xAxisLabel_ = com.google.protobuf.ByteString.EMPTY;
+ value_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000040);
- yAxisLabel_ = com.google.protobuf.ByteString.EMPTY;
+ xAxisLabel_ = com.google.protobuf.ByteString.EMPTY;
bitField0_ = (bitField0_ & ~0x00000080);
+ yAxisLabel_ = com.google.protobuf.ByteString.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000100);
return this;
}
@@ -4452,28 +5294,32 @@
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
- result.startTimestamp_ = startTimestamp_;
+ result.regressionMode_ = regressionMode_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
- result.endTimestamp_ = endTimestamp_;
- if (((bitField0_ & 0x00000010) == 0x00000010)) {
- label_ = java.util.Collections.unmodifiableList(label_);
- bitField0_ = (bitField0_ & ~0x00000010);
- }
- result.label_ = label_;
- if (((bitField0_ & 0x00000020) == 0x00000020)) {
- value_ = java.util.Collections.unmodifiableList(value_);
- bitField0_ = (bitField0_ & ~0x00000020);
- }
- result.value_ = value_;
- if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
+ result.startTimestamp_ = startTimestamp_;
+ if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000010;
}
- result.xAxisLabel_ = xAxisLabel_;
+ result.endTimestamp_ = endTimestamp_;
+ if (((bitField0_ & 0x00000020) == 0x00000020)) {
+ label_ = java.util.Collections.unmodifiableList(label_);
+ bitField0_ = (bitField0_ & ~0x00000020);
+ }
+ result.label_ = label_;
+ if (((bitField0_ & 0x00000040) == 0x00000040)) {
+ value_ = java.util.Collections.unmodifiableList(value_);
+ bitField0_ = (bitField0_ & ~0x00000040);
+ }
+ result.value_ = value_;
if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
to_bitField0_ |= 0x00000020;
}
+ result.xAxisLabel_ = xAxisLabel_;
+ if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
+ to_bitField0_ |= 0x00000040;
+ }
result.yAxisLabel_ = yAxisLabel_;
result.bitField0_ = to_bitField0_;
onBuilt();
@@ -4497,6 +5343,9 @@
if (other.hasType()) {
setType(other.getType());
}
+ if (other.hasRegressionMode()) {
+ setRegressionMode(other.getRegressionMode());
+ }
if (other.hasStartTimestamp()) {
setStartTimestamp(other.getStartTimestamp());
}
@@ -4506,7 +5355,7 @@
if (!other.label_.isEmpty()) {
if (label_.isEmpty()) {
label_ = other.label_;
- bitField0_ = (bitField0_ & ~0x00000010);
+ bitField0_ = (bitField0_ & ~0x00000020);
} else {
ensureLabelIsMutable();
label_.addAll(other.label_);
@@ -4516,7 +5365,7 @@
if (!other.value_.isEmpty()) {
if (value_.isEmpty()) {
value_ = other.value_;
- bitField0_ = (bitField0_ & ~0x00000020);
+ bitField0_ = (bitField0_ & ~0x00000040);
} else {
ensureValueIsMutable();
value_.addAll(other.value_);
@@ -4644,6 +5493,42 @@
return this;
}
+ // optional .android.vts.VtsProfilingRegressionMode regression_mode = 3;
+ private com.android.vts.proto.VtsReportMessage.VtsProfilingRegressionMode regressionMode_ = com.android.vts.proto.VtsReportMessage.VtsProfilingRegressionMode.UNKNOWN_REGRESSION_MODE;
+ /**
+ * <code>optional .android.vts.VtsProfilingRegressionMode regression_mode = 3;</code>
+ */
+ public boolean hasRegressionMode() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>optional .android.vts.VtsProfilingRegressionMode regression_mode = 3;</code>
+ */
+ public com.android.vts.proto.VtsReportMessage.VtsProfilingRegressionMode getRegressionMode() {
+ return regressionMode_;
+ }
+ /**
+ * <code>optional .android.vts.VtsProfilingRegressionMode regression_mode = 3;</code>
+ */
+ public Builder setRegressionMode(com.android.vts.proto.VtsReportMessage.VtsProfilingRegressionMode value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000004;
+ regressionMode_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional .android.vts.VtsProfilingRegressionMode regression_mode = 3;</code>
+ */
+ public Builder clearRegressionMode() {
+ bitField0_ = (bitField0_ & ~0x00000004);
+ regressionMode_ = com.android.vts.proto.VtsReportMessage.VtsProfilingRegressionMode.UNKNOWN_REGRESSION_MODE;
+ onChanged();
+ return this;
+ }
+
// optional int64 start_timestamp = 11;
private long startTimestamp_ ;
/**
@@ -4654,7 +5539,7 @@
* </pre>
*/
public boolean hasStartTimestamp() {
- return ((bitField0_ & 0x00000004) == 0x00000004);
+ return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional int64 start_timestamp = 11;</code>
@@ -4674,7 +5559,7 @@
* </pre>
*/
public Builder setStartTimestamp(long value) {
- bitField0_ |= 0x00000004;
+ bitField0_ |= 0x00000008;
startTimestamp_ = value;
onChanged();
return this;
@@ -4687,7 +5572,7 @@
* </pre>
*/
public Builder clearStartTimestamp() {
- bitField0_ = (bitField0_ & ~0x00000004);
+ bitField0_ = (bitField0_ & ~0x00000008);
startTimestamp_ = 0L;
onChanged();
return this;
@@ -4699,7 +5584,7 @@
* <code>optional int64 end_timestamp = 12;</code>
*/
public boolean hasEndTimestamp() {
- return ((bitField0_ & 0x00000008) == 0x00000008);
+ return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional int64 end_timestamp = 12;</code>
@@ -4711,7 +5596,7 @@
* <code>optional int64 end_timestamp = 12;</code>
*/
public Builder setEndTimestamp(long value) {
- bitField0_ |= 0x00000008;
+ bitField0_ |= 0x00000010;
endTimestamp_ = value;
onChanged();
return this;
@@ -4720,7 +5605,7 @@
* <code>optional int64 end_timestamp = 12;</code>
*/
public Builder clearEndTimestamp() {
- bitField0_ = (bitField0_ & ~0x00000008);
+ bitField0_ = (bitField0_ & ~0x00000010);
endTimestamp_ = 0L;
onChanged();
return this;
@@ -4729,9 +5614,9 @@
// repeated bytes label = 21;
private java.util.List<com.google.protobuf.ByteString> label_ = java.util.Collections.emptyList();
private void ensureLabelIsMutable() {
- if (!((bitField0_ & 0x00000010) == 0x00000010)) {
+ if (!((bitField0_ & 0x00000020) == 0x00000020)) {
label_ = new java.util.ArrayList<com.google.protobuf.ByteString>(label_);
- bitField0_ |= 0x00000010;
+ bitField0_ |= 0x00000020;
}
}
/**
@@ -4793,7 +5678,7 @@
*/
public Builder clearLabel() {
label_ = java.util.Collections.emptyList();
- bitField0_ = (bitField0_ & ~0x00000010);
+ bitField0_ = (bitField0_ & ~0x00000020);
onChanged();
return this;
}
@@ -4801,9 +5686,9 @@
// repeated int64 value = 22;
private java.util.List<java.lang.Long> value_ = java.util.Collections.emptyList();
private void ensureValueIsMutable() {
- if (!((bitField0_ & 0x00000020) == 0x00000020)) {
+ if (!((bitField0_ & 0x00000040) == 0x00000040)) {
value_ = new java.util.ArrayList<java.lang.Long>(value_);
- bitField0_ |= 0x00000020;
+ bitField0_ |= 0x00000040;
}
}
/**
@@ -4859,7 +5744,7 @@
*/
public Builder clearValue() {
value_ = java.util.Collections.emptyList();
- bitField0_ = (bitField0_ & ~0x00000020);
+ bitField0_ = (bitField0_ & ~0x00000040);
onChanged();
return this;
}
@@ -4874,7 +5759,7 @@
* </pre>
*/
public boolean hasXAxisLabel() {
- return ((bitField0_ & 0x00000040) == 0x00000040);
+ return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* <code>optional bytes x_axis_label = 31;</code>
@@ -4897,7 +5782,7 @@
if (value == null) {
throw new NullPointerException();
}
- bitField0_ |= 0x00000040;
+ bitField0_ |= 0x00000080;
xAxisLabel_ = value;
onChanged();
return this;
@@ -4910,7 +5795,7 @@
* </pre>
*/
public Builder clearXAxisLabel() {
- bitField0_ = (bitField0_ & ~0x00000040);
+ bitField0_ = (bitField0_ & ~0x00000080);
xAxisLabel_ = getDefaultInstance().getXAxisLabel();
onChanged();
return this;
@@ -4922,7 +5807,7 @@
* <code>optional bytes y_axis_label = 32;</code>
*/
public boolean hasYAxisLabel() {
- return ((bitField0_ & 0x00000080) == 0x00000080);
+ return ((bitField0_ & 0x00000100) == 0x00000100);
}
/**
* <code>optional bytes y_axis_label = 32;</code>
@@ -4937,7 +5822,7 @@
if (value == null) {
throw new NullPointerException();
}
- bitField0_ |= 0x00000080;
+ bitField0_ |= 0x00000100;
yAxisLabel_ = value;
onChanged();
return this;
@@ -4946,7 +5831,7 @@
* <code>optional bytes y_axis_label = 32;</code>
*/
public Builder clearYAxisLabel() {
- bitField0_ = (bitField0_ & ~0x00000080);
+ bitField0_ = (bitField0_ & ~0x00000100);
yAxisLabel_ = getDefaultInstance().getYAxisLabel();
onChanged();
return this;
@@ -6603,6 +7488,32 @@
*/
com.google.protobuf.ByteString getSubscriberEmail(int index);
+ // optional .android.vts.VtsHostInfo host_info = 7;
+ /**
+ * <code>optional .android.vts.VtsHostInfo host_info = 7;</code>
+ *
+ * <pre>
+ * info about the host computer
+ * </pre>
+ */
+ boolean hasHostInfo();
+ /**
+ * <code>optional .android.vts.VtsHostInfo host_info = 7;</code>
+ *
+ * <pre>
+ * info about the host computer
+ * </pre>
+ */
+ com.android.vts.proto.VtsReportMessage.VtsHostInfo getHostInfo();
+ /**
+ * <code>optional .android.vts.VtsHostInfo host_info = 7;</code>
+ *
+ * <pre>
+ * info about the host computer
+ * </pre>
+ */
+ com.android.vts.proto.VtsReportMessage.VtsHostInfoOrBuilder getHostInfoOrBuilder();
+
// repeated .android.vts.TestCaseReportMessage test_case = 11;
/**
* <code>repeated .android.vts.TestCaseReportMessage test_case = 11;</code>
@@ -6871,36 +7782,49 @@
subscriberEmail_.add(input.readBytes());
break;
}
+ case 58: {
+ com.android.vts.proto.VtsReportMessage.VtsHostInfo.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ subBuilder = hostInfo_.toBuilder();
+ }
+ hostInfo_ = input.readMessage(com.android.vts.proto.VtsReportMessage.VtsHostInfo.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(hostInfo_);
+ hostInfo_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000010;
+ break;
+ }
case 90: {
- if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
+ if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) {
testCase_ = new java.util.ArrayList<com.android.vts.proto.VtsReportMessage.TestCaseReportMessage>();
- mutable_bitField0_ |= 0x00000040;
+ mutable_bitField0_ |= 0x00000080;
}
testCase_.add(input.readMessage(com.android.vts.proto.VtsReportMessage.TestCaseReportMessage.PARSER, extensionRegistry));
break;
}
case 170: {
- if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) {
+ if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) {
profiling_ = new java.util.ArrayList<com.android.vts.proto.VtsReportMessage.ProfilingReportMessage>();
- mutable_bitField0_ |= 0x00000080;
+ mutable_bitField0_ |= 0x00000100;
}
profiling_.add(input.readMessage(com.android.vts.proto.VtsReportMessage.ProfilingReportMessage.PARSER, extensionRegistry));
break;
}
case 808: {
- bitField0_ |= 0x00000010;
+ bitField0_ |= 0x00000020;
startTimestamp_ = input.readInt64();
break;
}
case 816: {
- bitField0_ |= 0x00000020;
+ bitField0_ |= 0x00000040;
endTimestamp_ = input.readInt64();
break;
}
case 826: {
- if (!((mutable_bitField0_ & 0x00000400) == 0x00000400)) {
+ if (!((mutable_bitField0_ & 0x00000800) == 0x00000800)) {
coverage_ = new java.util.ArrayList<com.android.vts.proto.VtsReportMessage.CoverageReportMessage>();
- mutable_bitField0_ |= 0x00000400;
+ mutable_bitField0_ |= 0x00000800;
}
coverage_.add(input.readMessage(com.android.vts.proto.VtsReportMessage.CoverageReportMessage.PARSER, extensionRegistry));
break;
@@ -6919,13 +7843,13 @@
if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
subscriberEmail_ = java.util.Collections.unmodifiableList(subscriberEmail_);
}
- if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
+ if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) {
testCase_ = java.util.Collections.unmodifiableList(testCase_);
}
- if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) {
+ if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) {
profiling_ = java.util.Collections.unmodifiableList(profiling_);
}
- if (((mutable_bitField0_ & 0x00000400) == 0x00000400)) {
+ if (((mutable_bitField0_ & 0x00000800) == 0x00000800)) {
coverage_ = java.util.Collections.unmodifiableList(coverage_);
}
this.unknownFields = unknownFields.build();
@@ -7157,6 +8081,40 @@
return subscriberEmail_.get(index);
}
+ // optional .android.vts.VtsHostInfo host_info = 7;
+ public static final int HOST_INFO_FIELD_NUMBER = 7;
+ private com.android.vts.proto.VtsReportMessage.VtsHostInfo hostInfo_;
+ /**
+ * <code>optional .android.vts.VtsHostInfo host_info = 7;</code>
+ *
+ * <pre>
+ * info about the host computer
+ * </pre>
+ */
+ public boolean hasHostInfo() {
+ return ((bitField0_ & 0x00000010) == 0x00000010);
+ }
+ /**
+ * <code>optional .android.vts.VtsHostInfo host_info = 7;</code>
+ *
+ * <pre>
+ * info about the host computer
+ * </pre>
+ */
+ public com.android.vts.proto.VtsReportMessage.VtsHostInfo getHostInfo() {
+ return hostInfo_;
+ }
+ /**
+ * <code>optional .android.vts.VtsHostInfo host_info = 7;</code>
+ *
+ * <pre>
+ * info about the host computer
+ * </pre>
+ */
+ public com.android.vts.proto.VtsReportMessage.VtsHostInfoOrBuilder getHostInfoOrBuilder() {
+ return hostInfo_;
+ }
+
// repeated .android.vts.TestCaseReportMessage test_case = 11;
public static final int TEST_CASE_FIELD_NUMBER = 11;
private java.util.List<com.android.vts.proto.VtsReportMessage.TestCaseReportMessage> testCase_;
@@ -7280,7 +8238,7 @@
* </pre>
*/
public boolean hasStartTimestamp() {
- return ((bitField0_ & 0x00000010) == 0x00000010);
+ return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>optional int64 start_timestamp = 101;</code>
@@ -7300,7 +8258,7 @@
* <code>optional int64 end_timestamp = 102;</code>
*/
public boolean hasEndTimestamp() {
- return ((bitField0_ & 0x00000020) == 0x00000020);
+ return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
* <code>optional int64 end_timestamp = 102;</code>
@@ -7372,6 +8330,7 @@
deviceInfo_ = java.util.Collections.emptyList();
buildInfo_ = com.android.vts.proto.VtsReportMessage.AndroidBuildInfo.getDefaultInstance();
subscriberEmail_ = java.util.Collections.emptyList();
+ hostInfo_ = com.android.vts.proto.VtsReportMessage.VtsHostInfo.getDefaultInstance();
testCase_ = java.util.Collections.emptyList();
profiling_ = java.util.Collections.emptyList();
startTimestamp_ = 0L;
@@ -7408,16 +8367,19 @@
for (int i = 0; i < subscriberEmail_.size(); i++) {
output.writeBytes(6, subscriberEmail_.get(i));
}
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ output.writeMessage(7, hostInfo_);
+ }
for (int i = 0; i < testCase_.size(); i++) {
output.writeMessage(11, testCase_.get(i));
}
for (int i = 0; i < profiling_.size(); i++) {
output.writeMessage(21, profiling_.get(i));
}
- if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ if (((bitField0_ & 0x00000020) == 0x00000020)) {
output.writeInt64(101, startTimestamp_);
}
- if (((bitField0_ & 0x00000020) == 0x00000020)) {
+ if (((bitField0_ & 0x00000040) == 0x00000040)) {
output.writeInt64(102, endTimestamp_);
}
for (int i = 0; i < coverage_.size(); i++) {
@@ -7461,6 +8423,10 @@
size += dataSize;
size += 1 * getSubscriberEmailList().size();
}
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(7, hostInfo_);
+ }
for (int i = 0; i < testCase_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(11, testCase_.get(i));
@@ -7469,11 +8435,11 @@
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(21, profiling_.get(i));
}
- if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(101, startTimestamp_);
}
- if (((bitField0_ & 0x00000020) == 0x00000020)) {
+ if (((bitField0_ & 0x00000040) == 0x00000040)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(102, endTimestamp_);
}
@@ -7595,6 +8561,7 @@
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getDeviceInfoFieldBuilder();
getBuildInfoFieldBuilder();
+ getHostInfoFieldBuilder();
getTestCaseFieldBuilder();
getProfilingFieldBuilder();
getCoverageFieldBuilder();
@@ -7626,25 +8593,31 @@
bitField0_ = (bitField0_ & ~0x00000010);
subscriberEmail_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000020);
+ if (hostInfoBuilder_ == null) {
+ hostInfo_ = com.android.vts.proto.VtsReportMessage.VtsHostInfo.getDefaultInstance();
+ } else {
+ hostInfoBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000040);
if (testCaseBuilder_ == null) {
testCase_ = java.util.Collections.emptyList();
- bitField0_ = (bitField0_ & ~0x00000040);
+ bitField0_ = (bitField0_ & ~0x00000080);
} else {
testCaseBuilder_.clear();
}
if (profilingBuilder_ == null) {
profiling_ = java.util.Collections.emptyList();
- bitField0_ = (bitField0_ & ~0x00000080);
+ bitField0_ = (bitField0_ & ~0x00000100);
} else {
profilingBuilder_.clear();
}
startTimestamp_ = 0L;
- bitField0_ = (bitField0_ & ~0x00000100);
- endTimestamp_ = 0L;
bitField0_ = (bitField0_ & ~0x00000200);
+ endTimestamp_ = 0L;
+ bitField0_ = (bitField0_ & ~0x00000400);
if (coverageBuilder_ == null) {
coverage_ = java.util.Collections.emptyList();
- bitField0_ = (bitField0_ & ~0x00000400);
+ bitField0_ = (bitField0_ & ~0x00000800);
} else {
coverageBuilder_.clear();
}
@@ -7710,36 +8683,44 @@
bitField0_ = (bitField0_ & ~0x00000020);
}
result.subscriberEmail_ = subscriberEmail_;
+ if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
+ to_bitField0_ |= 0x00000010;
+ }
+ if (hostInfoBuilder_ == null) {
+ result.hostInfo_ = hostInfo_;
+ } else {
+ result.hostInfo_ = hostInfoBuilder_.build();
+ }
if (testCaseBuilder_ == null) {
- if (((bitField0_ & 0x00000040) == 0x00000040)) {
+ if (((bitField0_ & 0x00000080) == 0x00000080)) {
testCase_ = java.util.Collections.unmodifiableList(testCase_);
- bitField0_ = (bitField0_ & ~0x00000040);
+ bitField0_ = (bitField0_ & ~0x00000080);
}
result.testCase_ = testCase_;
} else {
result.testCase_ = testCaseBuilder_.build();
}
if (profilingBuilder_ == null) {
- if (((bitField0_ & 0x00000080) == 0x00000080)) {
+ if (((bitField0_ & 0x00000100) == 0x00000100)) {
profiling_ = java.util.Collections.unmodifiableList(profiling_);
- bitField0_ = (bitField0_ & ~0x00000080);
+ bitField0_ = (bitField0_ & ~0x00000100);
}
result.profiling_ = profiling_;
} else {
result.profiling_ = profilingBuilder_.build();
}
- if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
- to_bitField0_ |= 0x00000010;
- }
- result.startTimestamp_ = startTimestamp_;
if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
to_bitField0_ |= 0x00000020;
}
+ result.startTimestamp_ = startTimestamp_;
+ if (((from_bitField0_ & 0x00000400) == 0x00000400)) {
+ to_bitField0_ |= 0x00000040;
+ }
result.endTimestamp_ = endTimestamp_;
if (coverageBuilder_ == null) {
- if (((bitField0_ & 0x00000400) == 0x00000400)) {
+ if (((bitField0_ & 0x00000800) == 0x00000800)) {
coverage_ = java.util.Collections.unmodifiableList(coverage_);
- bitField0_ = (bitField0_ & ~0x00000400);
+ bitField0_ = (bitField0_ & ~0x00000800);
}
result.coverage_ = coverage_;
} else {
@@ -7809,11 +8790,14 @@
}
onChanged();
}
+ if (other.hasHostInfo()) {
+ mergeHostInfo(other.getHostInfo());
+ }
if (testCaseBuilder_ == null) {
if (!other.testCase_.isEmpty()) {
if (testCase_.isEmpty()) {
testCase_ = other.testCase_;
- bitField0_ = (bitField0_ & ~0x00000040);
+ bitField0_ = (bitField0_ & ~0x00000080);
} else {
ensureTestCaseIsMutable();
testCase_.addAll(other.testCase_);
@@ -7826,7 +8810,7 @@
testCaseBuilder_.dispose();
testCaseBuilder_ = null;
testCase_ = other.testCase_;
- bitField0_ = (bitField0_ & ~0x00000040);
+ bitField0_ = (bitField0_ & ~0x00000080);
testCaseBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getTestCaseFieldBuilder() : null;
@@ -7839,7 +8823,7 @@
if (!other.profiling_.isEmpty()) {
if (profiling_.isEmpty()) {
profiling_ = other.profiling_;
- bitField0_ = (bitField0_ & ~0x00000080);
+ bitField0_ = (bitField0_ & ~0x00000100);
} else {
ensureProfilingIsMutable();
profiling_.addAll(other.profiling_);
@@ -7852,7 +8836,7 @@
profilingBuilder_.dispose();
profilingBuilder_ = null;
profiling_ = other.profiling_;
- bitField0_ = (bitField0_ & ~0x00000080);
+ bitField0_ = (bitField0_ & ~0x00000100);
profilingBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getProfilingFieldBuilder() : null;
@@ -7871,7 +8855,7 @@
if (!other.coverage_.isEmpty()) {
if (coverage_.isEmpty()) {
coverage_ = other.coverage_;
- bitField0_ = (bitField0_ & ~0x00000400);
+ bitField0_ = (bitField0_ & ~0x00000800);
} else {
ensureCoverageIsMutable();
coverage_.addAll(other.coverage_);
@@ -7884,7 +8868,7 @@
coverageBuilder_.dispose();
coverageBuilder_ = null;
coverage_ = other.coverage_;
- bitField0_ = (bitField0_ & ~0x00000400);
+ bitField0_ = (bitField0_ & ~0x00000800);
coverageBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getCoverageFieldBuilder() : null;
@@ -8641,13 +9625,166 @@
return this;
}
+ // optional .android.vts.VtsHostInfo host_info = 7;
+ private com.android.vts.proto.VtsReportMessage.VtsHostInfo hostInfo_ = com.android.vts.proto.VtsReportMessage.VtsHostInfo.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ com.android.vts.proto.VtsReportMessage.VtsHostInfo, com.android.vts.proto.VtsReportMessage.VtsHostInfo.Builder, com.android.vts.proto.VtsReportMessage.VtsHostInfoOrBuilder> hostInfoBuilder_;
+ /**
+ * <code>optional .android.vts.VtsHostInfo host_info = 7;</code>
+ *
+ * <pre>
+ * info about the host computer
+ * </pre>
+ */
+ public boolean hasHostInfo() {
+ return ((bitField0_ & 0x00000040) == 0x00000040);
+ }
+ /**
+ * <code>optional .android.vts.VtsHostInfo host_info = 7;</code>
+ *
+ * <pre>
+ * info about the host computer
+ * </pre>
+ */
+ public com.android.vts.proto.VtsReportMessage.VtsHostInfo getHostInfo() {
+ if (hostInfoBuilder_ == null) {
+ return hostInfo_;
+ } else {
+ return hostInfoBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .android.vts.VtsHostInfo host_info = 7;</code>
+ *
+ * <pre>
+ * info about the host computer
+ * </pre>
+ */
+ public Builder setHostInfo(com.android.vts.proto.VtsReportMessage.VtsHostInfo value) {
+ if (hostInfoBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ hostInfo_ = value;
+ onChanged();
+ } else {
+ hostInfoBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000040;
+ return this;
+ }
+ /**
+ * <code>optional .android.vts.VtsHostInfo host_info = 7;</code>
+ *
+ * <pre>
+ * info about the host computer
+ * </pre>
+ */
+ public Builder setHostInfo(
+ com.android.vts.proto.VtsReportMessage.VtsHostInfo.Builder builderForValue) {
+ if (hostInfoBuilder_ == null) {
+ hostInfo_ = builderForValue.build();
+ onChanged();
+ } else {
+ hostInfoBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000040;
+ return this;
+ }
+ /**
+ * <code>optional .android.vts.VtsHostInfo host_info = 7;</code>
+ *
+ * <pre>
+ * info about the host computer
+ * </pre>
+ */
+ public Builder mergeHostInfo(com.android.vts.proto.VtsReportMessage.VtsHostInfo value) {
+ if (hostInfoBuilder_ == null) {
+ if (((bitField0_ & 0x00000040) == 0x00000040) &&
+ hostInfo_ != com.android.vts.proto.VtsReportMessage.VtsHostInfo.getDefaultInstance()) {
+ hostInfo_ =
+ com.android.vts.proto.VtsReportMessage.VtsHostInfo.newBuilder(hostInfo_).mergeFrom(value).buildPartial();
+ } else {
+ hostInfo_ = value;
+ }
+ onChanged();
+ } else {
+ hostInfoBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000040;
+ return this;
+ }
+ /**
+ * <code>optional .android.vts.VtsHostInfo host_info = 7;</code>
+ *
+ * <pre>
+ * info about the host computer
+ * </pre>
+ */
+ public Builder clearHostInfo() {
+ if (hostInfoBuilder_ == null) {
+ hostInfo_ = com.android.vts.proto.VtsReportMessage.VtsHostInfo.getDefaultInstance();
+ onChanged();
+ } else {
+ hostInfoBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000040);
+ return this;
+ }
+ /**
+ * <code>optional .android.vts.VtsHostInfo host_info = 7;</code>
+ *
+ * <pre>
+ * info about the host computer
+ * </pre>
+ */
+ public com.android.vts.proto.VtsReportMessage.VtsHostInfo.Builder getHostInfoBuilder() {
+ bitField0_ |= 0x00000040;
+ onChanged();
+ return getHostInfoFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .android.vts.VtsHostInfo host_info = 7;</code>
+ *
+ * <pre>
+ * info about the host computer
+ * </pre>
+ */
+ public com.android.vts.proto.VtsReportMessage.VtsHostInfoOrBuilder getHostInfoOrBuilder() {
+ if (hostInfoBuilder_ != null) {
+ return hostInfoBuilder_.getMessageOrBuilder();
+ } else {
+ return hostInfo_;
+ }
+ }
+ /**
+ * <code>optional .android.vts.VtsHostInfo host_info = 7;</code>
+ *
+ * <pre>
+ * info about the host computer
+ * </pre>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ com.android.vts.proto.VtsReportMessage.VtsHostInfo, com.android.vts.proto.VtsReportMessage.VtsHostInfo.Builder, com.android.vts.proto.VtsReportMessage.VtsHostInfoOrBuilder>
+ getHostInfoFieldBuilder() {
+ if (hostInfoBuilder_ == null) {
+ hostInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ com.android.vts.proto.VtsReportMessage.VtsHostInfo, com.android.vts.proto.VtsReportMessage.VtsHostInfo.Builder, com.android.vts.proto.VtsReportMessage.VtsHostInfoOrBuilder>(
+ hostInfo_,
+ getParentForChildren(),
+ isClean());
+ hostInfo_ = null;
+ }
+ return hostInfoBuilder_;
+ }
+
// repeated .android.vts.TestCaseReportMessage test_case = 11;
private java.util.List<com.android.vts.proto.VtsReportMessage.TestCaseReportMessage> testCase_ =
java.util.Collections.emptyList();
private void ensureTestCaseIsMutable() {
- if (!((bitField0_ & 0x00000040) == 0x00000040)) {
+ if (!((bitField0_ & 0x00000080) == 0x00000080)) {
testCase_ = new java.util.ArrayList<com.android.vts.proto.VtsReportMessage.TestCaseReportMessage>(testCase_);
- bitField0_ |= 0x00000040;
+ bitField0_ |= 0x00000080;
}
}
@@ -8840,7 +9977,7 @@
public Builder clearTestCase() {
if (testCaseBuilder_ == null) {
testCase_ = java.util.Collections.emptyList();
- bitField0_ = (bitField0_ & ~0x00000040);
+ bitField0_ = (bitField0_ & ~0x00000080);
onChanged();
} else {
testCaseBuilder_.clear();
@@ -8945,7 +10082,7 @@
testCaseBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
com.android.vts.proto.VtsReportMessage.TestCaseReportMessage, com.android.vts.proto.VtsReportMessage.TestCaseReportMessage.Builder, com.android.vts.proto.VtsReportMessage.TestCaseReportMessageOrBuilder>(
testCase_,
- ((bitField0_ & 0x00000040) == 0x00000040),
+ ((bitField0_ & 0x00000080) == 0x00000080),
getParentForChildren(),
isClean());
testCase_ = null;
@@ -8957,9 +10094,9 @@
private java.util.List<com.android.vts.proto.VtsReportMessage.ProfilingReportMessage> profiling_ =
java.util.Collections.emptyList();
private void ensureProfilingIsMutable() {
- if (!((bitField0_ & 0x00000080) == 0x00000080)) {
+ if (!((bitField0_ & 0x00000100) == 0x00000100)) {
profiling_ = new java.util.ArrayList<com.android.vts.proto.VtsReportMessage.ProfilingReportMessage>(profiling_);
- bitField0_ |= 0x00000080;
+ bitField0_ |= 0x00000100;
}
}
@@ -9152,7 +10289,7 @@
public Builder clearProfiling() {
if (profilingBuilder_ == null) {
profiling_ = java.util.Collections.emptyList();
- bitField0_ = (bitField0_ & ~0x00000080);
+ bitField0_ = (bitField0_ & ~0x00000100);
onChanged();
} else {
profilingBuilder_.clear();
@@ -9257,7 +10394,7 @@
profilingBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
com.android.vts.proto.VtsReportMessage.ProfilingReportMessage, com.android.vts.proto.VtsReportMessage.ProfilingReportMessage.Builder, com.android.vts.proto.VtsReportMessage.ProfilingReportMessageOrBuilder>(
profiling_,
- ((bitField0_ & 0x00000080) == 0x00000080),
+ ((bitField0_ & 0x00000100) == 0x00000100),
getParentForChildren(),
isClean());
profiling_ = null;
@@ -9275,7 +10412,7 @@
* </pre>
*/
public boolean hasStartTimestamp() {
- return ((bitField0_ & 0x00000100) == 0x00000100);
+ return ((bitField0_ & 0x00000200) == 0x00000200);
}
/**
* <code>optional int64 start_timestamp = 101;</code>
@@ -9295,7 +10432,7 @@
* </pre>
*/
public Builder setStartTimestamp(long value) {
- bitField0_ |= 0x00000100;
+ bitField0_ |= 0x00000200;
startTimestamp_ = value;
onChanged();
return this;
@@ -9308,7 +10445,7 @@
* </pre>
*/
public Builder clearStartTimestamp() {
- bitField0_ = (bitField0_ & ~0x00000100);
+ bitField0_ = (bitField0_ & ~0x00000200);
startTimestamp_ = 0L;
onChanged();
return this;
@@ -9320,7 +10457,7 @@
* <code>optional int64 end_timestamp = 102;</code>
*/
public boolean hasEndTimestamp() {
- return ((bitField0_ & 0x00000200) == 0x00000200);
+ return ((bitField0_ & 0x00000400) == 0x00000400);
}
/**
* <code>optional int64 end_timestamp = 102;</code>
@@ -9332,7 +10469,7 @@
* <code>optional int64 end_timestamp = 102;</code>
*/
public Builder setEndTimestamp(long value) {
- bitField0_ |= 0x00000200;
+ bitField0_ |= 0x00000400;
endTimestamp_ = value;
onChanged();
return this;
@@ -9341,7 +10478,7 @@
* <code>optional int64 end_timestamp = 102;</code>
*/
public Builder clearEndTimestamp() {
- bitField0_ = (bitField0_ & ~0x00000200);
+ bitField0_ = (bitField0_ & ~0x00000400);
endTimestamp_ = 0L;
onChanged();
return this;
@@ -9351,9 +10488,9 @@
private java.util.List<com.android.vts.proto.VtsReportMessage.CoverageReportMessage> coverage_ =
java.util.Collections.emptyList();
private void ensureCoverageIsMutable() {
- if (!((bitField0_ & 0x00000400) == 0x00000400)) {
+ if (!((bitField0_ & 0x00000800) == 0x00000800)) {
coverage_ = new java.util.ArrayList<com.android.vts.proto.VtsReportMessage.CoverageReportMessage>(coverage_);
- bitField0_ |= 0x00000400;
+ bitField0_ |= 0x00000800;
}
}
@@ -9546,7 +10683,7 @@
public Builder clearCoverage() {
if (coverageBuilder_ == null) {
coverage_ = java.util.Collections.emptyList();
- bitField0_ = (bitField0_ & ~0x00000400);
+ bitField0_ = (bitField0_ & ~0x00000800);
onChanged();
} else {
coverageBuilder_.clear();
@@ -9651,7 +10788,7 @@
coverageBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
com.android.vts.proto.VtsReportMessage.CoverageReportMessage, com.android.vts.proto.VtsReportMessage.CoverageReportMessage.Builder, com.android.vts.proto.VtsReportMessage.CoverageReportMessageOrBuilder>(
coverage_,
- ((bitField0_ & 0x00000400) == 0x00000400),
+ ((bitField0_ & 0x00000800) == 0x00000800),
getParentForChildren(),
isClean());
coverage_ = null;
@@ -9681,6 +10818,11 @@
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_android_vts_AndroidBuildInfo_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
+ internal_static_android_vts_VtsHostInfo_descriptor;
+ private static
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_android_vts_VtsHostInfo_fieldAccessorTable;
+ private static com.google.protobuf.Descriptors.Descriptor
internal_static_android_vts_TestCaseReportMessage_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
@@ -9709,55 +10851,63 @@
descriptor;
static {
java.lang.String[] descriptorData = {
- "\n\026VtsReportMessage.proto\022\013android.vts\"\271\001" +
+ "\n\026VtsReportMessage.proto\022\013android.vts\"\340\001" +
"\n\030AndroidDeviceInfoMessage\022\024\n\014product_ty" +
"pe\030\001 \001(\014\022\027\n\017product_variant\030\002 \001(\014\022\024\n\014bui" +
"ld_flavor\030\013 \001(\014\022\020\n\010build_id\030\014 \001(\014\022\016\n\006bra" +
"nch\030\025 \001(\014\022\023\n\013build_alias\030\026 \001(\014\022\021\n\tapi_le" +
- "vel\030\037 \001(\014\022\016\n\006serial\030e \001(\014\"g\n\020AndroidBuil" +
- "dInfo\022\n\n\002id\030\001 \001(\014\022\014\n\004name\030\013 \001(\014\022\022\n\nbuild" +
- "_type\030\014 \001(\014\022\016\n\006branch\030\r \001(\014\022\025\n\rbuild_sum" +
- "mary\030\025 \001(\014\"\275\001\n\025TestCaseReportMessage\022\014\n\004" +
- "name\030\001 \001(\014\0220\n\013test_result\030\013 \001(\0162\033.androi",
- "d.vts.TestCaseResult\022\027\n\017start_timestamp\030" +
- "\025 \001(\003\022\025\n\rend_timestamp\030\026 \001(\003\0224\n\010coverage" +
- "\030\037 \003(\0132\".android.vts.CoverageReportMessa" +
- "ge\"\315\001\n\026ProfilingReportMessage\022\014\n\004name\030\001 " +
- "\001(\014\022+\n\004type\030\002 \001(\0162\035.android.vts.VtsProfi" +
- "lingType\022\027\n\017start_timestamp\030\013 \001(\003\022\025\n\rend" +
- "_timestamp\030\014 \001(\003\022\r\n\005label\030\025 \003(\014\022\r\n\005value" +
- "\030\026 \003(\003\022\024\n\014x_axis_label\030\037 \001(\014\022\024\n\014y_axis_l" +
- "abel\030 \001(\014\"\345\001\n\025CoverageReportMessage\022\021\n\t" +
- "file_path\030\013 \001(\014\022\024\n\014project_name\030\014 \001(\014\022\020\n",
- "\010revision\030\r \001(\014\022\034\n\024line_coverage_vector\030" +
- "\027 \003(\005\022\030\n\020total_line_count\030e \001(\005\022\032\n\022cover" +
- "ed_line_count\030f \001(\005\022\024\n\010dir_path\030\001 \001(\014B\002\030" +
- "\001\022\025\n\tfile_name\030\002 \001(\014B\002\030\001\022\020\n\004html\030\003 \001(\014B\002" +
- "\030\001\"\300\003\n\021TestReportMessage\022\022\n\ntest_suite\030\001" +
- " \001(\014\022\014\n\004test\030\002 \001(\014\022+\n\ttest_type\030\003 \001(\0162\030." +
- "android.vts.VtsTestType\022:\n\013device_info\030\004" +
- " \003(\0132%.android.vts.AndroidDeviceInfoMess" +
- "age\0221\n\nbuild_info\030\005 \001(\0132\035.android.vts.An" +
- "droidBuildInfo\022\030\n\020subscriber_email\030\006 \003(\014",
- "\0225\n\ttest_case\030\013 \003(\0132\".android.vts.TestCa" +
- "seReportMessage\0226\n\tprofiling\030\025 \003(\0132#.and" +
- "roid.vts.ProfilingReportMessage\022\027\n\017start" +
- "_timestamp\030e \001(\003\022\025\n\rend_timestamp\030f \001(\003\022" +
- "4\n\010coverage\030g \003(\0132\".android.vts.Coverage" +
- "ReportMessage*\263\001\n\016TestCaseResult\022\022\n\016UNKN" +
- "OWN_RESULT\020\000\022\031\n\025TEST_CASE_RESULT_PASS\020\001\022" +
- "\031\n\025TEST_CASE_RESULT_FAIL\020\002\022\031\n\025TEST_CASE_" +
- "RESULT_SKIP\020\003\022\036\n\032TEST_CASE_RESULT_EXCEPT" +
- "ION\020\004\022\034\n\030TEST_CASE_RESULT_TIMEOUT\020\005*\234\001\n\013",
- "VtsTestType\022\030\n\024UNKNOWN_VTS_TESTTYPE\020\000\022\036\n" +
- "\032VTS_HOST_DRIVEN_STRUCTURAL\020\001\022\033\n\027VTS_HOS" +
- "T_DRIVEN_FUZZING\020\002\022\031\n\025VTS_TARGET_SIDE_GT" +
- "EST\020\003\022\033\n\027VTS_TARGET_SIDE_FUZZING\020\004*{\n\020Vt" +
- "sProfilingType\022\036\n\032UNKNOWN_VTS_PROFILING_" +
- "TYPE\020\000\022 \n\034VTS_PROFILING_TYPE_TIMESTAMP\020\001" +
- "\022%\n!VTS_PROFILING_TYPE_LABELED_VECTOR\020\002B" +
- ")\n\025com.android.vts.protoB\020VtsReportMessa" +
- "ge"
+ "vel\030\037 \001(\014\022\020\n\010abi_name\0303 \001(\014\022\023\n\013abi_bitne" +
+ "ss\0304 \001(\014\022\016\n\006serial\030e \001(\014\"g\n\020AndroidBuild" +
+ "Info\022\n\n\002id\030\001 \001(\014\022\014\n\004name\030\013 \001(\014\022\022\n\nbuild_" +
+ "type\030\014 \001(\014\022\016\n\006branch\030\r \001(\014\022\025\n\rbuild_summ" +
+ "ary\030\025 \001(\014\"\037\n\013VtsHostInfo\022\020\n\010hostname\030\001 \001",
+ "(\014\"\275\001\n\025TestCaseReportMessage\022\014\n\004name\030\001 \001" +
+ "(\014\0220\n\013test_result\030\013 \001(\0162\033.android.vts.Te" +
+ "stCaseResult\022\027\n\017start_timestamp\030\025 \001(\003\022\025\n" +
+ "\rend_timestamp\030\026 \001(\003\0224\n\010coverage\030\037 \003(\0132\"" +
+ ".android.vts.CoverageReportMessage\"\217\002\n\026P" +
+ "rofilingReportMessage\022\014\n\004name\030\001 \001(\014\022+\n\004t" +
+ "ype\030\002 \001(\0162\035.android.vts.VtsProfilingType" +
+ "\022@\n\017regression_mode\030\003 \001(\0162\'.android.vts." +
+ "VtsProfilingRegressionMode\022\027\n\017start_time" +
+ "stamp\030\013 \001(\003\022\025\n\rend_timestamp\030\014 \001(\003\022\r\n\005la",
+ "bel\030\025 \003(\014\022\r\n\005value\030\026 \003(\003\022\024\n\014x_axis_label" +
+ "\030\037 \001(\014\022\024\n\014y_axis_label\030 \001(\014\"\345\001\n\025Coverag" +
+ "eReportMessage\022\021\n\tfile_path\030\013 \001(\014\022\024\n\014pro" +
+ "ject_name\030\014 \001(\014\022\020\n\010revision\030\r \001(\014\022\034\n\024lin" +
+ "e_coverage_vector\030\027 \003(\005\022\030\n\020total_line_co" +
+ "unt\030e \001(\005\022\032\n\022covered_line_count\030f \001(\005\022\024\n" +
+ "\010dir_path\030\001 \001(\014B\002\030\001\022\025\n\tfile_name\030\002 \001(\014B\002" +
+ "\030\001\022\020\n\004html\030\003 \001(\014B\002\030\001\"\355\003\n\021TestReportMessa" +
+ "ge\022\022\n\ntest_suite\030\001 \001(\014\022\014\n\004test\030\002 \001(\014\022+\n\t" +
+ "test_type\030\003 \001(\0162\030.android.vts.VtsTestTyp",
+ "e\022:\n\013device_info\030\004 \003(\0132%.android.vts.And" +
+ "roidDeviceInfoMessage\0221\n\nbuild_info\030\005 \001(" +
+ "\0132\035.android.vts.AndroidBuildInfo\022\030\n\020subs" +
+ "criber_email\030\006 \003(\014\022+\n\thost_info\030\007 \001(\0132\030." +
+ "android.vts.VtsHostInfo\0225\n\ttest_case\030\013 \003" +
+ "(\0132\".android.vts.TestCaseReportMessage\0226" +
+ "\n\tprofiling\030\025 \003(\0132#.android.vts.Profilin" +
+ "gReportMessage\022\027\n\017start_timestamp\030e \001(\003\022" +
+ "\025\n\rend_timestamp\030f \001(\003\0224\n\010coverage\030g \003(\013" +
+ "2\".android.vts.CoverageReportMessage*\263\001\n",
+ "\016TestCaseResult\022\022\n\016UNKNOWN_RESULT\020\000\022\031\n\025T" +
+ "EST_CASE_RESULT_PASS\020\001\022\031\n\025TEST_CASE_RESU" +
+ "LT_FAIL\020\002\022\031\n\025TEST_CASE_RESULT_SKIP\020\003\022\036\n\032" +
+ "TEST_CASE_RESULT_EXCEPTION\020\004\022\034\n\030TEST_CAS" +
+ "E_RESULT_TIMEOUT\020\005*\234\001\n\013VtsTestType\022\030\n\024UN" +
+ "KNOWN_VTS_TESTTYPE\020\000\022\036\n\032VTS_HOST_DRIVEN_" +
+ "STRUCTURAL\020\001\022\033\n\027VTS_HOST_DRIVEN_FUZZING\020" +
+ "\002\022\031\n\025VTS_TARGET_SIDE_GTEST\020\003\022\033\n\027VTS_TARG" +
+ "ET_SIDE_FUZZING\020\004*\243\001\n\032VtsProfilingRegres" +
+ "sionMode\022\033\n\027UNKNOWN_REGRESSION_MODE\020\000\022 \n",
+ "\034VTS_REGRESSION_MODE_DISABLED\020\001\022\"\n\036VTS_R" +
+ "EGRESSION_MODE_INCREASING\020\002\022\"\n\036VTS_REGRE" +
+ "SSION_MODE_DECREASING\020\003*{\n\020VtsProfilingT" +
+ "ype\022\036\n\032UNKNOWN_VTS_PROFILING_TYPE\020\000\022 \n\034V" +
+ "TS_PROFILING_TYPE_TIMESTAMP\020\001\022%\n!VTS_PRO" +
+ "FILING_TYPE_LABELED_VECTOR\020\002B)\n\025com.andr" +
+ "oid.vts.protoB\020VtsReportMessage"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
@@ -9769,37 +10919,43 @@
internal_static_android_vts_AndroidDeviceInfoMessage_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_android_vts_AndroidDeviceInfoMessage_descriptor,
- new java.lang.String[] { "ProductType", "ProductVariant", "BuildFlavor", "BuildId", "Branch", "BuildAlias", "ApiLevel", "Serial", });
+ new java.lang.String[] { "ProductType", "ProductVariant", "BuildFlavor", "BuildId", "Branch", "BuildAlias", "ApiLevel", "AbiName", "AbiBitness", "Serial", });
internal_static_android_vts_AndroidBuildInfo_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_android_vts_AndroidBuildInfo_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_android_vts_AndroidBuildInfo_descriptor,
new java.lang.String[] { "Id", "Name", "BuildType", "Branch", "BuildSummary", });
- internal_static_android_vts_TestCaseReportMessage_descriptor =
+ internal_static_android_vts_VtsHostInfo_descriptor =
getDescriptor().getMessageTypes().get(2);
+ internal_static_android_vts_VtsHostInfo_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_android_vts_VtsHostInfo_descriptor,
+ new java.lang.String[] { "Hostname", });
+ internal_static_android_vts_TestCaseReportMessage_descriptor =
+ getDescriptor().getMessageTypes().get(3);
internal_static_android_vts_TestCaseReportMessage_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_android_vts_TestCaseReportMessage_descriptor,
new java.lang.String[] { "Name", "TestResult", "StartTimestamp", "EndTimestamp", "Coverage", });
internal_static_android_vts_ProfilingReportMessage_descriptor =
- getDescriptor().getMessageTypes().get(3);
+ getDescriptor().getMessageTypes().get(4);
internal_static_android_vts_ProfilingReportMessage_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_android_vts_ProfilingReportMessage_descriptor,
- new java.lang.String[] { "Name", "Type", "StartTimestamp", "EndTimestamp", "Label", "Value", "XAxisLabel", "YAxisLabel", });
+ new java.lang.String[] { "Name", "Type", "RegressionMode", "StartTimestamp", "EndTimestamp", "Label", "Value", "XAxisLabel", "YAxisLabel", });
internal_static_android_vts_CoverageReportMessage_descriptor =
- getDescriptor().getMessageTypes().get(4);
+ getDescriptor().getMessageTypes().get(5);
internal_static_android_vts_CoverageReportMessage_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_android_vts_CoverageReportMessage_descriptor,
new java.lang.String[] { "FilePath", "ProjectName", "Revision", "LineCoverageVector", "TotalLineCount", "CoveredLineCount", "DirPath", "FileName", "Html", });
internal_static_android_vts_TestReportMessage_descriptor =
- getDescriptor().getMessageTypes().get(5);
+ getDescriptor().getMessageTypes().get(6);
internal_static_android_vts_TestReportMessage_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_android_vts_TestReportMessage_descriptor,
- new java.lang.String[] { "TestSuite", "Test", "TestType", "DeviceInfo", "BuildInfo", "SubscriberEmail", "TestCase", "Profiling", "StartTimestamp", "EndTimestamp", "Coverage", });
+ new java.lang.String[] { "TestSuite", "Test", "TestType", "DeviceInfo", "BuildInfo", "SubscriberEmail", "HostInfo", "TestCase", "Profiling", "StartTimestamp", "EndTimestamp", "Coverage", });
return null;
}
};
diff --git a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/BaseServlet.java b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/BaseServlet.java
index 45e8847..cfd2466 100644
--- a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/BaseServlet.java
+++ b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/BaseServlet.java
@@ -14,9 +14,6 @@
protected final Logger logger = Logger.getLogger(getClass().getName());
// Environment variables
- protected static final String EMAIL_DOMAIN = System.getenv("EMAIL_DOMAIN");
- protected static final String SENDER_EMAIL = System.getenv("SENDER_EMAIL");
- protected static final String DEFAULT_EMAIL = System.getenv("DEFAULT_EMAIL");
protected static final String GERRIT_URI = System.getenv("GERRIT_URI");
protected static final String GERRIT_SCOPE = System.getenv("GERRIT_SCOPE");
protected static final String CLIENT_ID = System.getenv("CLIENT_ID");
diff --git a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/DashboardMainServlet.java b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/DashboardMainServlet.java
index b357cec..40ec300 100644
--- a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/DashboardMainServlet.java
+++ b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/DashboardMainServlet.java
@@ -16,7 +16,7 @@
package com.android.vts.servlet;
-import com.android.vts.helpers.BigtableHelper;
+import com.android.vts.util.BigtableHelper;
import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
diff --git a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/ShowCoverageServlet.java b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/ShowCoverageServlet.java
index ad4b3ae..8c98422 100644
--- a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/ShowCoverageServlet.java
+++ b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/ShowCoverageServlet.java
@@ -16,11 +16,11 @@
package com.android.vts.servlet;
-import com.android.vts.helpers.BigtableHelper;
import com.android.vts.proto.VtsReportMessage;
import com.android.vts.proto.VtsReportMessage.CoverageReportMessage;
import com.android.vts.proto.VtsReportMessage.TestCaseReportMessage;
import com.android.vts.proto.VtsReportMessage.TestReportMessage;
+import com.android.vts.util.BigtableHelper;
import com.google.gson.Gson;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Result;
diff --git a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/ShowGraphServlet.java b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/ShowGraphServlet.java
index bf08447..e170a73 100644
--- a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/ShowGraphServlet.java
+++ b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/ShowGraphServlet.java
@@ -16,10 +16,10 @@
package com.android.vts.servlet;
-import com.android.vts.helpers.BigtableHelper;
import com.android.vts.proto.VtsReportMessage;
import com.android.vts.proto.VtsReportMessage.ProfilingReportMessage;
import com.android.vts.proto.VtsReportMessage.TestReportMessage;
+import com.android.vts.util.BigtableHelper;
import org.apache.commons.math3.stat.descriptive.rank.Percentile;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Result;
diff --git a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/ShowPreferencesServlet.java b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/ShowPreferencesServlet.java
index b960fc3..31f3716 100644
--- a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/ShowPreferencesServlet.java
+++ b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/ShowPreferencesServlet.java
@@ -16,7 +16,7 @@
package com.android.vts.servlet;
-import com.android.vts.helpers.BigtableHelper;
+import com.android.vts.util.BigtableHelper;
import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
diff --git a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/ShowTableServlet.java b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/ShowTableServlet.java
index b6d0a35..388152c 100644
--- a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/ShowTableServlet.java
+++ b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/ShowTableServlet.java
@@ -16,7 +16,6 @@
package com.android.vts.servlet;
-import com.android.vts.helpers.BigtableHelper;
import com.android.vts.proto.VtsReportMessage;
import com.android.vts.proto.VtsReportMessage.AndroidDeviceInfoMessage;
import com.android.vts.proto.VtsReportMessage.CoverageReportMessage;
@@ -24,7 +23,8 @@
import com.android.vts.proto.VtsReportMessage.TestCaseReportMessage;
import com.android.vts.proto.VtsReportMessage.TestCaseResult;
import com.android.vts.proto.VtsReportMessage.TestReportMessage;
-
+import com.android.vts.proto.VtsReportMessage.VtsHostInfo;
+import com.android.vts.util.BigtableHelper;
import com.google.gson.Gson;
import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.hbase.TableName;
@@ -382,7 +382,7 @@
// Build Flavor and test build ID.
String[] headerRow = new String[tests.size() + 1];
- // the time grid on the table has one - Start Time.
+ // the time grid on the table has two rows - Start Time and End Time.
// These represent the start times for the test run.
String[][] timeGrid = new String[TIME_INFO_ROW_COUNT][tests.size() + 1];
@@ -390,7 +390,8 @@
// These represent the length of time the test elapsed.
String[][] durationGrid = new String[DURATION_INFO_ROW_COUNT][tests.size() + 1];
- // the summary grid has four rows - Total Row, Pass Row, Ratio Row, and Coverage %.
+ // the summary grid has four rows - Total, Passing Count, Non-Passing Count, Passing %,
+ // Covered line count, and Coverage %.
String[][] summaryGrid = new String[SUMMARY_ROW_COUNT][tests.size() + 1];
// the results an entry for each testcase result for each build.
@@ -398,7 +399,7 @@
// first column for device grid
String[] headerFields = {"<b>Stats Type \\ Device Build ID</b>", "Branch", "Build Target",
- "Device", "VTS Build ID"};
+ "Device", "ABI Target", "VTS Build ID", "Hostname"};
headerRow[0] = StringUtils.join(headerFields, "<br>");
// first column for time grid
@@ -429,16 +430,28 @@
List<String> buildAliasList = new ArrayList<>();
List<String> productVariantList = new ArrayList<>();
List<String> buildFlavorList = new ArrayList<>();
+ List<String> abiInfoList = new ArrayList<>();
for (AndroidDeviceInfoMessage device : devices) {
buildAliasList.add(device.getBuildAlias().toStringUtf8().toLowerCase());
productVariantList.add(device.getProductVariant().toStringUtf8());
buildFlavorList.add(device.getBuildFlavor().toStringUtf8());
buildIdList.add(device.getBuildId().toStringUtf8());
+ String abi = "";
+ String abiName = device.getAbiName().toStringUtf8();
+ String abiBitness = device.getAbiBitness().toStringUtf8();
+ if (abiName.length() > 0) {
+ abi += abiName;
+ if (abiBitness.length() > 0) {
+ abi += " (" + abiBitness + " bit)";
+ }
+ }
+ abiInfoList.add(abi);
}
String buildAlias = StringUtils.join(buildAliasList, ",");
String productVariant = StringUtils.join(productVariantList, ",");
String buildFlavor = StringUtils.join(buildFlavorList, ",");
String buildIds = StringUtils.join(buildIdList, ",");
+ String abiInfo = StringUtils.join(abiInfoList, ",");
String vtsBuildId = report.getBuildInfo().getId().toStringUtf8();
int passCount = 0;
@@ -481,7 +494,7 @@
String passInfo;
try {
double passPct = Math.round((100 * passCount /
- report.getTestCaseList().size()) * 100f) / 100f;
+ (passCount + nonpassCount)) * 100f) / 100f;
passInfo = Double.toString(passPct) + "%";
} catch (ArithmeticException e) {
passInfo = " - ";
@@ -505,10 +518,12 @@
coverageInfo = " - ";
}
String icon = "<div class='status-icon " + aggregateStatus.toString() + "'> </div>";
-
+ VtsHostInfo hostInfo = report.getHostInfo();
+ String hostname = hostInfo == null ? "" : hostInfo.getHostname().toStringUtf8();
headerRow[j + 1] = "<span class='valign-wrapper'><b>" + buildIds + "</b>" + icon +
"</span>" + buildAlias.toLowerCase() + "<br>" + buildFlavor +
- "<br>" + productVariant + "<br>" + vtsBuildId;
+ "<br>" + productVariant + "<br>" +
+ abiInfo + "<br>" + vtsBuildId + "<br>" + hostname;
timeGrid[0][j + 1] = Long.toString(report.getStartTimestamp());
timeGrid[1][j + 1] = Long.toString(report.getEndTimestamp());
durationGrid[0][j + 1] = Long.toString(report.getEndTimestamp() -
diff --git a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/VtsAlertJobServlet.java b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/VtsAlertJobServlet.java
index 66318dc..5735df8 100644
--- a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/VtsAlertJobServlet.java
+++ b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/VtsAlertJobServlet.java
@@ -17,16 +17,13 @@
package com.android.vts.servlet;
import org.apache.commons.lang.StringUtils;
-import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.TableName;
-import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.client.Table;
import org.apache.hadoop.hbase.util.Bytes;
-import com.android.vts.helpers.BigtableHelper;
import com.android.vts.proto.VtsReportMessage;
import com.android.vts.proto.VtsReportMessage.AndroidDeviceInfoMessage;
import com.android.vts.proto.VtsReportMessage.TestCaseReportMessage;
@@ -36,6 +33,8 @@
import com.android.vts.proto.VtsWebStatusMessage.TestStatus;
import com.android.vts.proto.VtsWebStatusMessage.TestStatusMessage;
import com.android.vts.proto.VtsWebStatusMessage.TestStatusMessage.Builder;
+import com.android.vts.util.BigtableHelper;
+import com.android.vts.util.EmailHelper;
import com.google.protobuf.ByteString;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
@@ -47,16 +46,10 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.Properties;
import java.util.Set;
import java.util.logging.Level;
import javax.mail.Message;
import javax.mail.MessagingException;
-import javax.mail.Session;
-import javax.mail.Transport;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeMessage;
-import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -66,79 +59,14 @@
public class VtsAlertJobServlet extends BaseServlet {
private static final byte[] RESULTS_FAMILY = Bytes.toBytes("test");
- private static final byte[] TEST_FAMILY = Bytes.toBytes("test_to_email");
private static final byte[] STATUS_FAMILY = Bytes.toBytes("status");
private static final byte[] DATA_QUALIFIER = Bytes.toBytes("data");
private static final byte[] TIME_QUALIFIER = Bytes.toBytes("upload_timestamp");
private static final String STATUS_TABLE = "vts_status_table";
- private static final String VTS_EMAIL_NAME = "VTS Alert Bot";
private static final long MILLI_TO_MICRO = 1000; // conversion factor from milli to micro units
private static final long THREE_MINUTES = 180000000L; // units microseconds
/**
- * Fetches the list of subscriber email addresses for a test.
- * @param statusTable The Table instance for the VTS status table.
- * @param tableName The name of the table of the test for which to fetch the email addresses.
- * @returns List of email addresses (String).
- * @throws IOException
- */
- public List<String> getSubscriberEmails(Table statusTable, String tableName)
- throws IOException {
- Get get = new Get(Bytes.toBytes(tableName));
- get.addFamily(TEST_FAMILY);
- Result result = statusTable.get(get);
- Set<String> emailSet = new HashSet<>();
- if (!StringUtils.isBlank(DEFAULT_EMAIL)) {
- emailSet.add(DEFAULT_EMAIL);
- }
- if (result != null) {
- List<Cell> cells = result.listCells();
- if (cells != null) {
- for (Cell cell : cells) {
- String email = Bytes.toString(cell.getQualifierArray());
- String val = Bytes.toString(cell.getValueArray());
- if (email != null && val.equals("1") && email.endsWith(EMAIL_DOMAIN)) {
- emailSet.add(email);
- }
- }
- }
- }
- return new ArrayList<>(emailSet);
- }
-
- /**
- * Sends an email to the specified email address to notify of a test status change.
- * @param emails List of subscriber email addresses (byte[]) to which the email should be sent.
- * @param subject The email subject field, string.
- * @param body The html (string) body to send in the email.
- * @returns The Message object to be sent.
- * @throws MessagingException, UnsupportedEncodingException
- */
- public Message composeEmail(List<String> emails, String subject, String body)
- throws MessagingException, UnsupportedEncodingException {
- if (emails.size() == 0) {
- throw new MessagingException("No subscriber email addresses provided");
- }
- Properties props = new Properties();
- Session session = Session.getDefaultInstance(props, null);
-
- Message msg = new MimeMessage(session);
- for (String email : emails) {
- try {
- msg.addRecipient(Message.RecipientType.TO,
- new InternetAddress(email, email));
- } catch (MessagingException | UnsupportedEncodingException e) {
- // Gracefully continue when a subscriber email is invalid.
- logger.log(Level.WARNING, "Error sending email to recipient " + email + " : ", e);
- }
- }
- msg.setFrom(new InternetAddress(SENDER_EMAIL, VTS_EMAIL_NAME));
- msg.setSubject(subject);
- msg.setContent(body, "text/html; charset=utf-8");
- return msg;
- }
-
- /**
* Checks whether any new failures have occurred beginning since (and including) startTime.
* @param tableName The name of the table that stores the results for a test, string.
* @param link The string URL linking to the test's status table.
@@ -179,7 +107,7 @@
+ uploadTimeString + "."
+ footer;
try {
- messages.add(composeEmail(emails, subject, body));
+ messages.add(EmailHelper.composeEmail(emails, subject, body));
} catch (MessagingException | UnsupportedEncodingException e) {
logger.log(Level.WARNING, "Error composing email : ", e);
}
@@ -340,7 +268,7 @@
+ " for device build ID(s): " + buildId + ".<br><br>"
+ summary + footer;
try {
- messages.add(composeEmail(emails, subject, body));
+ messages.add(EmailHelper.composeEmail(emails, subject, body));
} catch (MessagingException | UnsupportedEncodingException e) {
logger.log(Level.WARNING, "Error composing email : ", e);
}
@@ -350,7 +278,7 @@
+ " for device build ID(s): " + buildId + ".<br><br>"
+ summary + footer;
try {
- messages.add(composeEmail(emails, subject, body));
+ messages.add(EmailHelper.composeEmail(emails, subject, body));
} catch (MessagingException | UnsupportedEncodingException e) {
logger.log(Level.WARNING, "Error composing email : ", e);
}
@@ -360,7 +288,7 @@
+ "are passing in the latest device build(s): " + buildId + ".<br><br>"
+ summary + footer;
try {
- messages.add(composeEmail(emails, subject, body));
+ messages.add(EmailHelper.composeEmail(emails, subject, body));
} catch (MessagingException | UnsupportedEncodingException e) {
logger.log(Level.WARNING, "Error composing email : ", e);
}
@@ -370,7 +298,7 @@
+ " for device build ID(s): " + buildId + "!<br><br>"
+ summary + footer;
try {
- messages.add(composeEmail(emails, subject, body));
+ messages.add(EmailHelper.composeEmail(emails, subject, body));
} catch (MessagingException | UnsupportedEncodingException e) {
logger.log(Level.WARNING, "Error composing email : ", e);
}
@@ -397,7 +325,7 @@
ResultScanner scanner = table.getScanner(scan);
for (Result result = scanner.next(); result != null; result = scanner.next()) {
String testName = Bytes.toString(result.getRow());
- List<String> emails = getSubscriberEmails(table, testName);
+ List<String> emails = EmailHelper.getSubscriberEmails(table, testName);
byte[] value = result.getValue(STATUS_FAMILY, DATA_QUALIFIER);
// Get the time stamp for the last upload.
@@ -427,14 +355,7 @@
// freshest data will update the status to the latest version.
put.addColumn(STATUS_FAMILY, DATA_QUALIFIER, lastUploadTimestamp, newStatus);
table.put(put);
-
- for (Message msg: messageQueue) {
- try {
- Transport.send(msg);
- } catch (MessagingException e) {
- logger.log(Level.WARNING, "Error sending email : ", e);
- }
- }
+ EmailHelper.sendAll(messageQueue);
}
}
}
diff --git a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/VtsPerformanceJobServlet.java b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/VtsPerformanceJobServlet.java
new file mode 100644
index 0000000..82db77c
--- /dev/null
+++ b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/servlet/VtsPerformanceJobServlet.java
@@ -0,0 +1,405 @@
+/*
+ * Copyright (c) 2016 Google Inc. All Rights Reserved.
+ *
+ * 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.
+ */
+
+package com.android.vts.servlet;
+
+import org.apache.hadoop.hbase.HTableDescriptor;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Result;
+import org.apache.hadoop.hbase.client.ResultScanner;
+import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.client.Table;
+import org.apache.hadoop.hbase.util.Bytes;
+import com.android.vts.proto.VtsReportMessage;
+import com.android.vts.proto.VtsReportMessage.ProfilingReportMessage;
+import com.android.vts.proto.VtsReportMessage.TestReportMessage;
+import com.android.vts.proto.VtsReportMessage.VtsProfilingRegressionMode;
+import com.android.vts.util.BigtableHelper;
+import com.android.vts.util.EmailHelper;
+import com.android.vts.util.ProfilingPointSummary;
+import com.android.vts.util.StatSummary;
+import com.google.protobuf.ByteString;
+import java.io.IOException;
+import java.math.RoundingMode;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Represents the notifications service which is automatically called on a fixed schedule.
+ */
+public class VtsPerformanceJobServlet extends BaseServlet {
+
+ private static final String STATUS_TABLE = "vts_status_table";
+ private static final byte[] RESULTS_FAMILY = Bytes.toBytes("test");
+ private static final int N_DIGITS = 2;
+ private static final byte[] DATA_QUALIFIER = Bytes.toBytes("data");
+ private static final long MILLI_TO_MICRO = 1000; // conversion factor from milli to micro units
+
+ private static final String MEAN = "Mean";
+ private static final String MIN = "Min";
+ private static final String MIN_DELTA = "ΔMin (%)";
+ private static final String MAX_DELTA = "ΔMax (%)";
+ private static final String HIGHER_IS_BETTER = "Note: Higher values are better. Maximum is the best-case performance.";
+ private static final String LOWER_IS_BETTER = "Note: Lower values are better. Minimum is the best-case performance.";
+ private static final String STD = "Std";
+ private static final String SUBJECT_PREFIX = "Daily Performance Digest: ";
+ private static final String LAST_WEEK = "Last Week";
+ private static final String LABEL_STYLE = "font-family: arial";
+ private static final String SUBTEXT_STYLE = "font-family: arial; font-size: 12px";
+ private static final String TABLE_STYLE = "width: 100%; border-collapse: collapse; border: 1px solid black; font-size: 12px; font-family: arial;";
+ private static final String SECTION_LABEL_STYLE = "border: 1px solid black; border-bottom: none; background-color: lightgray;";
+ private static final String COL_LABEL_STYLE = "border: 1px solid black; border-bottom-width: 2px; border-top: 1px dotted gray; background-color: lightgray;";
+ private static final String HEADER_COL_STYLE = "border-top: 1px dotted gray; border-right: 2px solid black; text-align: right; background-color: lightgray;";
+ private static final String INNER_CELL_STYLE = "border-top: 1px dotted gray; border-right: 1px dotted gray; text-align: right;";
+ private static final String OUTER_CELL_STYLE = "border-top: 1px dotted gray; border-right: 2px solid black; text-align: right;";
+
+ private static class TimeInterval {
+ public final long start;
+ public final long end;
+ public final String label;
+
+ public TimeInterval(long start, long end, String label) {
+ this.start = start;
+ this.end = end;
+ this.label = label;
+ }
+ }
+
+ /**
+ * Produces a map with summaries for each profiling point present in the specified table.
+ * @param tableName The name of the table whose profiling vectors to retrieve.
+ * @param startTime The (inclusive) start time in milliseconds to scan from.
+ * @param endTime The (exclusive) end time in milliseconds at which to stop scanning.
+ * @returns A map with profiling point name keys and ProfilingPointSummary objects as values.
+ * @throws IOException
+ */
+ private static Map<String, ProfilingPointSummary> getProfilingSummaryMap(
+ String tableName, long startTime, long endTime) throws IOException {
+ Table table = BigtableHelper.getTable(TableName.valueOf(tableName));
+ Scan scan = new Scan();
+ scan.setStartRow(Bytes.toBytes(Long.toString(startTime * MILLI_TO_MICRO)));
+ scan.setStopRow(Bytes.toBytes(Long.toString(endTime * MILLI_TO_MICRO)));
+ ResultScanner scanner = table.getScanner(scan);
+
+ Map<String, ProfilingPointSummary> profilingSummaryMap = new HashMap<>();
+
+ for (Result result = scanner.next(); result != null; result = scanner.next()) {
+ byte[] value = result.getValue(RESULTS_FAMILY, DATA_QUALIFIER);
+ TestReportMessage testReportMessage = VtsReportMessage.TestReportMessage
+ .parseFrom(value);
+ String buildId = testReportMessage.getBuildInfo().getId().toStringUtf8();
+
+ // filter empty build IDs and add only numbers
+ if (buildId.length() == 0) continue;
+
+ // filter empty device info lists
+ if (testReportMessage.getDeviceInfoList().size() == 0) continue;
+
+ String firstDeviceBuildId = testReportMessage.getDeviceInfoList().get(0)
+ .getBuildId().toStringUtf8();
+
+ try {
+ // filter non-integer build IDs
+ Integer.parseInt(buildId);
+ Integer.parseInt(firstDeviceBuildId);
+ } catch (NumberFormatException e) {
+ /* skip a non-post-submit build */
+ continue;
+ }
+ for (ProfilingReportMessage profilingReportMessage :
+ testReportMessage.getProfilingList()) {
+ switch(profilingReportMessage.getRegressionMode()) {
+ case VTS_REGRESSION_MODE_DISABLED:
+ continue;
+ default:
+ break;
+ }
+ String name = profilingReportMessage.getName().toStringUtf8();
+ switch(profilingReportMessage.getType()) {
+ case UNKNOWN_VTS_PROFILING_TYPE:
+ case VTS_PROFILING_TYPE_TIMESTAMP :
+ break;
+ case VTS_PROFILING_TYPE_LABELED_VECTOR :
+ if (profilingReportMessage.getLabelList().size() == 0 ||
+ profilingReportMessage.getLabelList().size() !=
+ profilingReportMessage.getValueList().size()) {
+ continue;
+ }
+ if (!profilingSummaryMap.containsKey(name)) {
+ profilingSummaryMap.put(name, new ProfilingPointSummary());
+ }
+ profilingSummaryMap.get(name).update(profilingReportMessage);
+ break;
+ default :
+ break;
+ }
+ }
+ }
+ return profilingSummaryMap;
+ }
+
+ /**
+ * Rounds a double to a fixed number of digits.
+ * @param value The number to be rounded.
+ * @param digits The number of decimal places of accuracy.
+ * @returns The string representation of 'value' rounded to 'digits' number of decimal places.
+ */
+ private static String round(double value, int digits) {
+ String format = "#." + new String(new char[digits]).replace("\0", "#");
+ DecimalFormat formatter = new DecimalFormat(format);
+ formatter.setRoundingMode(RoundingMode.CEILING);
+ return formatter.format(value);
+ }
+
+ /**
+ * Creates the HTML for a table cell representing the percent change between two numbers.
+ *
+ * Computes the percent change (after - before)/before * 100 and inserts it into a table cell
+ * with the specified style. The color of the cell is white if 'after' is less than before.
+ * Otherwise, the cell is colored red with opacity according to the percent change (100%+
+ * delta means 100% opacity). If the before value is 0 and the after value is positive, then
+ * the color of the cell is 100% red to indicate an increase of undefined magnitude.
+ *
+ * @param baseline The baseline value observed.
+ * @param test The value to compare against the baseline.
+ * @param style A string containing CSS styles to apply to the table cell.
+ * @returns An HTML string for a colored table cell containing the percent change.
+ */
+ private static String getPercentChangeHTML(double baseline, double test, String style,
+ VtsProfilingRegressionMode mode) {
+ String pctChangeString = "0 %";
+ double alpha = 0;
+ double delta = test - baseline;
+ if (baseline != 0) {
+ double pctChange = delta / baseline;
+ alpha = pctChange * 2;
+ pctChangeString = round(pctChange * 100, N_DIGITS) + " %";
+ } else if (delta != 0){
+ // If the percent change is undefined, the cell will be solid red or white
+ alpha = (int) Math.signum(delta); // get the sign of the delta (+1, 0, -1)
+ pctChangeString = "";
+ }
+ if (mode == VtsProfilingRegressionMode.VTS_REGRESSION_MODE_DECREASING) {
+ alpha = -alpha;
+ }
+ String color = "background-color: rgba(255, 0, 0, " + alpha + ");";
+ String html = "<td style='" + style + color + "'>";
+ html += pctChangeString + "</td>";
+ return html;
+ }
+
+ /**
+ * Compares a test StatSummary to a baseline StatSummary and returns a formatted set of cells
+ * @param baseline The StatSummary object containing initial values to compare against
+ * @param test The StatSummary object containing test values to be compared against the baseline
+ * @return HTML string representing the performance of the test versus the baseline
+ */
+ public static String getPerformanceComparisonHTML(StatSummary baseline, StatSummary test) {
+ if (test == null || baseline == null) {
+ return "<td></td><td></td><td></td>";
+ }
+ String row = "";
+ double baselineValue;
+ double testValue;
+ switch (test.getRegressionMode()) {
+ case VTS_REGRESSION_MODE_DECREASING:
+ baselineValue = baseline.getMax();
+ testValue = test.getMax();
+ break;
+ default:
+ baselineValue = baseline.getMin();
+ testValue = test.getMin();
+ break;
+ }
+ // Intensity of red color is a function of the relative (percent) change
+ // in the new value compared to the previous day's. Intensity is a linear function
+ // of percentage change, reaching a ceiling at 100% change (e.g. a doubling).
+ row += getPercentChangeHTML(baselineValue, testValue, INNER_CELL_STYLE,
+ test.getRegressionMode());
+ row += "<td style='" + INNER_CELL_STYLE + "'>" + round(baseline.getMin(), N_DIGITS);
+ row += "</td><td style='" + INNER_CELL_STYLE + "'>" + round(baseline.getMean(), N_DIGITS);
+ row += "</td><td style='" + OUTER_CELL_STYLE + "'>";
+ row += round(baseline.getStd(), N_DIGITS) + "</td>";
+ return row;
+ }
+
+ /**
+ * Generates an HTML summary of the performance changes for the profiling results in the
+ * specified table.
+ *
+ * Retrieves the past 24 hours of profiling data and compares it to the 24 hours that preceded
+ * it. Creates a table representation of the mean and standard deviation for each profiling
+ * point. When performance degrades, the cell is shaded red.
+ *
+ * @param tableName The name of the table whose profiling data to summarize.
+ * @returns An HTML string containing labeled table summaries.
+ * @throws IOException
+ */
+ private static String getPeformanceSummary(String tableName, List<TimeInterval> testIntervals)
+ throws IOException {
+ if (testIntervals.size() == 0) return "";
+ List<String> labels = new ArrayList<>();
+ labels.add("");
+ List<Map<String, ProfilingPointSummary>> summaryMaps = new ArrayList<>();
+ for (TimeInterval interval : testIntervals) {
+ Map<String, ProfilingPointSummary> summaryMap = getProfilingSummaryMap(
+ tableName, interval.start, interval.end);
+ if (summaryMap == null || summaryMap.size() == 0) break;
+ labels.add(interval.label);
+ summaryMaps.add(summaryMap);
+ }
+ if (summaryMaps.size() == 0) return "";
+ Map<String, ProfilingPointSummary> now = summaryMaps.get(0);
+ String tableHTML = "<p style='" + LABEL_STYLE + "'><b>";
+ tableHTML += tableName.substring(TABLE_PREFIX.length()) + "</b></p>";
+ for (String profilingPoint : now.keySet()) {
+ ProfilingPointSummary summary = now.get(profilingPoint);
+ tableHTML += "<table cellpadding='2' style='" + TABLE_STYLE + "'>";
+
+ // Format header rows
+ String[] headerRows = new String[]{profilingPoint, summary.yLabel.toStringUtf8()};
+ int colspan = labels.size() * 4;
+ for (String content : headerRows) {
+ tableHTML += "<tr><td colspan='" + colspan + "'>" + content + "</td></tr>";
+ }
+
+ // Format section labels
+ tableHTML += "<tr>";
+ for (int i = 0; i < labels.size(); i++) {
+ String content = labels.get(i);
+ tableHTML += "<th style='" + SECTION_LABEL_STYLE + "' ";
+ if (i == 0) tableHTML += "colspan='1'";
+ else if (i == 1) tableHTML += "colspan='3'";
+ else tableHTML += "colspan='4'";
+ tableHTML += ">" + content + "</th>";
+ }
+ tableHTML += "</tr>";
+
+ String deltaString;
+ String subtext;
+ switch (now.get(profilingPoint).getRegressionMode()) {
+ case VTS_REGRESSION_MODE_DECREASING:
+ deltaString = MAX_DELTA;
+ subtext = HIGHER_IS_BETTER;
+ break;
+ default:
+ deltaString = MIN_DELTA;
+ subtext = LOWER_IS_BETTER;
+ break;
+ }
+
+ // Format column labels
+ tableHTML += "<tr>";
+ for (int i = 0; i < labels.size(); i++) {
+ if (i > 1) {
+ tableHTML += "<th style='" + COL_LABEL_STYLE + "'>" + deltaString + "</th>";
+ }
+ if (i == 0) {
+ tableHTML += "<th style='" + COL_LABEL_STYLE + "'>";
+ tableHTML += summary.xLabel.toStringUtf8() + "</th>";
+ } else if (i > 0) {
+ tableHTML += "<th style='" + COL_LABEL_STYLE + "'>" + MIN + "</th>";
+ tableHTML += "<th style='" + COL_LABEL_STYLE + "'>" + MEAN + "</th>";
+ tableHTML += "<th style='" + COL_LABEL_STYLE + "'>" + STD + "</th>";
+ }
+ }
+ tableHTML += "</tr>";
+
+ // Populate data cells
+ for (StatSummary stats : summary) {
+ ByteString label = stats.getLabel();
+ tableHTML += "<tr><td style='" + HEADER_COL_STYLE +"'>" + label.toStringUtf8();
+ tableHTML += "</td><td style='" + INNER_CELL_STYLE + "'>";
+ tableHTML += round(stats.getMin(), N_DIGITS) + "</td>";
+ tableHTML += "<td style='" + INNER_CELL_STYLE + "'>";
+ tableHTML += round(stats.getMean(), N_DIGITS) + "</td>";
+ tableHTML += "<td style='" + OUTER_CELL_STYLE + "'>";
+ tableHTML += round(stats.getStd(), N_DIGITS) + "</td>";
+ for (int i = 1; i < summaryMaps.size(); i++) {
+ Map<String, ProfilingPointSummary> summaryMapOld = summaryMaps.get(i);
+ if (summaryMapOld.containsKey(profilingPoint)) {
+ tableHTML += getPerformanceComparisonHTML(summaryMapOld.get(profilingPoint)
+ .getStatSummary(label), stats);
+ }
+ }
+ tableHTML += "</tr>";
+ }
+ tableHTML += "</table>";
+ tableHTML += "<i style='" + SUBTEXT_STYLE + "'>" + subtext + "</i><br><br>";
+ }
+ return tableHTML;
+ }
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws IOException {
+ doGetHandler(request, response);
+ }
+
+ @Override
+ public void doGetHandler(HttpServletRequest request, HttpServletResponse response)
+ throws IOException {
+ Table statusTable = BigtableHelper.getTable(TableName.valueOf(STATUS_TABLE));
+ HTableDescriptor[] tables = BigtableHelper.getTables();
+ Set<String> allTables = new HashSet<>();
+
+ for (HTableDescriptor descriptor : tables) {
+ String tableName = descriptor.getNameAsString();
+ if (tableName.startsWith(TABLE_PREFIX)) {
+ allTables.add(tableName);
+ }
+ }
+
+ // Add today to the list of time intervals to analyze
+ List<TimeInterval> timeIntervals = new ArrayList<>();
+ long now = System.currentTimeMillis();
+ String dateString = new SimpleDateFormat("MM-dd-yyyy").format(new Date(now));
+ TimeInterval today = new TimeInterval(now - ONE_DAY / MILLI_TO_MICRO, now, dateString);
+ timeIntervals.add(today);
+
+ // Add yesterday as a baseline time interval for analysis
+ long oneDayAgo = now - ONE_DAY / MILLI_TO_MICRO;
+ String dateStringYesterday = new SimpleDateFormat("MM-dd-yyyy").format(new Date(oneDayAgo));
+ TimeInterval yesterday = new TimeInterval(oneDayAgo - ONE_DAY / MILLI_TO_MICRO, oneDayAgo,
+ dateStringYesterday);
+ timeIntervals.add(yesterday);
+
+ // Add last week as a baseline time interval for analysis
+ long oneWeek = 7 * ONE_DAY / MILLI_TO_MICRO;
+ long oneWeekAgo = now - oneWeek;
+ TimeInterval lastWeek = new TimeInterval(oneWeekAgo - oneWeek, oneWeekAgo, LAST_WEEK);
+ timeIntervals.add(lastWeek);
+
+ for (String tableName : allTables) {
+ if (!tableName.equals("result_BinderThroughputBenchmark")) continue;
+ String body = getPeformanceSummary(tableName, timeIntervals);
+ if (body == null || body.equals("")) continue;
+ List<String> emails = EmailHelper.getSubscriberEmails(statusTable, tableName);
+ if (emails.size() == 0) continue;
+ String subject = SUBJECT_PREFIX + tableName.substring(TABLE_PREFIX.length());
+ EmailHelper.send(emails, subject, body);
+ }
+ }
+}
diff --git a/web/dashboard/appengine/servlet/src/main/java/com/google/android/vts/test/DashboardMainServletTest.java b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/test/DashboardMainServletTest.java
similarity index 98%
rename from web/dashboard/appengine/servlet/src/main/java/com/google/android/vts/test/DashboardMainServletTest.java
rename to web/dashboard/appengine/servlet/src/main/java/com/android/vts/test/DashboardMainServletTest.java
index fc976c4..f5f6c37 100644
--- a/web/dashboard/appengine/servlet/src/main/java/com/google/android/vts/test/DashboardMainServletTest.java
+++ b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/test/DashboardMainServletTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.android.vts.test;
+package com.android.vts.test;
import junit.framework.Assert;
import junit.framework.TestCase;
diff --git a/web/dashboard/appengine/servlet/src/main/java/com/google/android/vts/test/README.md b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/test/README.md
similarity index 100%
rename from web/dashboard/appengine/servlet/src/main/java/com/google/android/vts/test/README.md
rename to web/dashboard/appengine/servlet/src/main/java/com/android/vts/test/README.md
diff --git a/web/dashboard/appengine/servlet/src/main/java/com/google/android/vts/test/ShowTableServletTest.java b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/test/ShowTableServletTest.java
similarity index 98%
rename from web/dashboard/appengine/servlet/src/main/java/com/google/android/vts/test/ShowTableServletTest.java
rename to web/dashboard/appengine/servlet/src/main/java/com/android/vts/test/ShowTableServletTest.java
index 92d9d98..6d51e3f 100644
--- a/web/dashboard/appengine/servlet/src/main/java/com/google/android/vts/test/ShowTableServletTest.java
+++ b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/test/ShowTableServletTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.android.vts.test;
+package com.android.vts.test;
import junit.framework.Assert;
import junit.framework.TestCase;
diff --git a/web/dashboard/appengine/servlet/src/main/java/com/google/android/vts/test/chromedriver b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/test/chromedriver
similarity index 100%
rename from web/dashboard/appengine/servlet/src/main/java/com/google/android/vts/test/chromedriver
rename to web/dashboard/appengine/servlet/src/main/java/com/android/vts/test/chromedriver
Binary files differ
diff --git a/web/dashboard/appengine/servlet/src/main/java/com/google/android/vts/test/config.properties b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/test/config.properties
similarity index 100%
rename from web/dashboard/appengine/servlet/src/main/java/com/google/android/vts/test/config.properties
rename to web/dashboard/appengine/servlet/src/main/java/com/android/vts/test/config.properties
diff --git a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/helpers/BigtableHelper.java b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/util/BigtableHelper.java
similarity index 99%
rename from web/dashboard/appengine/servlet/src/main/java/com/android/vts/helpers/BigtableHelper.java
rename to web/dashboard/appengine/servlet/src/main/java/com/android/vts/util/BigtableHelper.java
index a508c65..c6120f7 100644
--- a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/helpers/BigtableHelper.java
+++ b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/util/BigtableHelper.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.vts.helpers;
+package com.android.vts.util;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
diff --git a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/util/EmailHelper.java b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/util/EmailHelper.java
new file mode 100644
index 0000000..6f27bb5
--- /dev/null
+++ b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/util/EmailHelper.java
@@ -0,0 +1,157 @@
+/**
+ * Copyright 2016 Google Inc. All Rights Reserved.
+ *
+ * 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.
+ */
+package com.android.vts.util;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.client.Get;
+import org.apache.hadoop.hbase.client.Result;
+import org.apache.hadoop.hbase.client.Table;
+import org.apache.hadoop.hbase.util.Bytes;
+import java.util.logging.Logger;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.logging.Level;
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+
+
+/**
+ * EmailHelper, a helper class for building and sending emails.
+ **/
+public class EmailHelper {
+
+ protected static final Logger logger = Logger.getLogger(EmailHelper.class.getName());
+ protected static final String DEFAULT_EMAIL = System.getenv("DEFAULT_EMAIL");
+ protected static final String EMAIL_DOMAIN = System.getenv("EMAIL_DOMAIN");
+ protected static final String SENDER_EMAIL = System.getenv("SENDER_EMAIL");
+ private static final byte[] TEST_FAMILY = Bytes.toBytes("test_to_email");
+ private static final String VTS_EMAIL_NAME = "VTS Alert Bot";
+
+ /**
+ * Fetches the list of subscriber email addresses for a test.
+ * @param statusTable The Table instance for the VTS status table.
+ * @param tableName The name of the table of the test for which to fetch the email addresses.
+ * @returns List of email addresses (String).
+ * @throws IOException
+ */
+ public static List<String> getSubscriberEmails(Table statusTable, String tableName)
+ throws IOException {
+ Get get = new Get(Bytes.toBytes(tableName));
+ get.addFamily(TEST_FAMILY);
+ Result result = statusTable.get(get);
+ Set<String> emailSet = new HashSet<>();
+ if (!StringUtils.isBlank(DEFAULT_EMAIL)) {
+ emailSet.add(DEFAULT_EMAIL);
+ }
+ if (result != null) {
+ List<Cell> cells = result.listCells();
+ if (cells != null) {
+ for (Cell cell : cells) {
+ String email = Bytes.toString(cell.getQualifierArray());
+ String val = Bytes.toString(cell.getValueArray());
+ if (email != null && val.equals("1") && email.endsWith(EMAIL_DOMAIN)) {
+ emailSet.add(email);
+ }
+ }
+ }
+ }
+ return new ArrayList<>(emailSet);
+ }
+
+ /**
+ * Sends an email to the specified email address to notify of a test status change.
+ * @param emails List of subscriber email addresses (byte[]) to which the email should be sent.
+ * @param subject The email subject field, string.
+ * @param body The html (string) body to send in the email.
+ * @returns The Message object to be sent.
+ * @throws MessagingException, UnsupportedEncodingException
+ */
+ public static Message composeEmail(List<String> emails, String subject, String body)
+ throws MessagingException, UnsupportedEncodingException {
+ if (emails.size() == 0) {
+ throw new MessagingException("No subscriber email addresses provided");
+ }
+ Properties props = new Properties();
+ Session session = Session.getDefaultInstance(props, null);
+
+ Message msg = new MimeMessage(session);
+ for (String email : emails) {
+ try {
+ msg.addRecipient(Message.RecipientType.TO,
+ new InternetAddress(email, email));
+ } catch (MessagingException | UnsupportedEncodingException e) {
+ // Gracefully continue when a subscriber email is invalid.
+ logger.log(Level.WARNING, "Error sending email to recipient " + email + " : ", e);
+ }
+ }
+ msg.setFrom(new InternetAddress(SENDER_EMAIL, VTS_EMAIL_NAME));
+ msg.setSubject(subject);
+ msg.setContent(body, "text/html; charset=utf-8");
+ return msg;
+ }
+
+ /**
+ * Sends an email.
+ * @param msg Message object to send.
+ * @returns true if the message sends successfully, false otherwise
+ */
+ public static boolean send(Message msg) {
+ try {
+ Transport.send(msg);
+ } catch (MessagingException e) {
+ logger.log(Level.WARNING, "Error sending email : ", e);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Sends a list of emails and logs any failures.
+ * @param messages List of Message objects to be sent.
+ */
+ public static void sendAll(List<Message> messages) {
+ for (Message msg: messages) {
+ send(msg);
+ }
+ }
+
+ /**
+ * Sends an email.
+ * @param recipients List of email address strings to which an email will be sent.
+ * @param subject The subject of the email.
+ * @param body The body of the email.
+ * @returns true if the message sends successfully, false otherwise
+ */
+ public static boolean send(List<String> recipients, String subject, String body) {
+ try {
+ Message msg = composeEmail(recipients, subject, body);
+ return send(msg);
+ } catch (MessagingException | UnsupportedEncodingException e) {
+ logger.log(Level.WARNING, "Error composing email : ", e);
+ return false;
+ }
+ }
+}
diff --git a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/util/ProfilingPointSummary.java b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/util/ProfilingPointSummary.java
new file mode 100644
index 0000000..5b0f99d
--- /dev/null
+++ b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/util/ProfilingPointSummary.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2016 Google Inc. All Rights Reserved.
+ *
+ * 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.
+ */
+
+package com.android.vts.util;
+
+import com.android.vts.proto.VtsReportMessage.ProfilingReportMessage;
+import com.android.vts.proto.VtsReportMessage.VtsProfilingRegressionMode;
+import com.android.vts.util.StatSummary;
+import com.google.protobuf.ByteString;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Represents statistical summaries of each profiling point.
+ */
+public class ProfilingPointSummary implements Iterable<StatSummary> {
+ private List<StatSummary> statSummaries;
+ private Map<ByteString, Integer> labelIndices;
+ private List<ByteString> labels;
+ private VtsProfilingRegressionMode regression_mode;
+ public ByteString xLabel;
+ public ByteString yLabel;
+
+ /**
+ * Initializes the summary with empty arrays.
+ */
+ public ProfilingPointSummary() {
+ statSummaries = new ArrayList<>();
+ labelIndices = new HashMap<>();
+ labels = null;
+ }
+
+ /**
+ * Determines if a data label is present in the profiling point.
+ * @param label The name of the label.
+ * @return true if the label is present, false otherwise.
+ */
+ public boolean hasLabel(ByteString label) {
+ return labelIndices.containsKey(label);
+ }
+
+ /**
+ * Gets the statistical summary for a specified data label.
+ * @param label The name of the label.
+ * @return The StatSummary object if it exists, or null otherwise.
+ */
+ public StatSummary getStatSummary(ByteString label) {
+ if (!hasLabel(label)) return null;
+ return statSummaries.get(labelIndices.get(label));
+ }
+
+ /**
+ * Gets the last-seen regression mode.
+ * @return The VtsProfilingRegressionMode value.
+ */
+ public VtsProfilingRegressionMode getRegressionMode() {
+ return regression_mode;
+ }
+
+ /**
+ * Updates the profiling summary with the data from a new profiling report.
+ * @param report The ProfilingReportMessage object containing profiling data.
+ */
+ public void update(ProfilingReportMessage report) {
+ for (int i = 0; i < report.getLabelList().size(); i++) {
+ ByteString label = report.getLabelList().get(i);
+ if (!labelIndices.containsKey(label)) {
+ StatSummary summary = new StatSummary(label, report.getRegressionMode());
+ labelIndices.put(label, statSummaries.size());
+ statSummaries.add(summary);
+ }
+ StatSummary summary = getStatSummary(label);
+ summary.updateStats(report.getValueList().get(i));
+ }
+ this.regression_mode = report.getRegressionMode();
+ this.labels = report.getLabelList();
+ this.xLabel = report.getXAxisLabel();
+ this.yLabel = report.getYAxisLabel();
+ }
+
+
+ /**
+ * Gets an iterator that returns stat summaries in the ordered the labels were specified in the
+ * ProfilingReportMessage objects.
+ */
+ @Override
+ public Iterator<StatSummary> iterator() {
+ Iterator<StatSummary> it = new Iterator<StatSummary>() {
+ private int currentIndex = 0;
+
+ @Override
+ public boolean hasNext() {
+ return labels != null && currentIndex < labels.size();
+ }
+
+ @Override
+ public StatSummary next() {
+ ByteString label = labels.get(currentIndex++);
+ return statSummaries.get(labelIndices.get(label));
+ }
+ };
+ return it;
+ }
+}
diff --git a/web/dashboard/appengine/servlet/src/main/java/com/android/vts/util/StatSummary.java b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/util/StatSummary.java
new file mode 100644
index 0000000..1dbb225
--- /dev/null
+++ b/web/dashboard/appengine/servlet/src/main/java/com/android/vts/util/StatSummary.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2016 Google Inc. All Rights Reserved.
+ *
+ * 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.
+ */
+
+package com.android.vts.util;
+
+import com.google.protobuf.ByteString;
+import com.android.vts.proto.VtsReportMessage.VtsProfilingRegressionMode;
+
+/**
+ * Helper object for storing statistics.
+ */
+public class StatSummary {
+ private ByteString label;
+ private double min;
+ private double max;
+ private double mean;
+ private double var;
+ private int n;
+ private VtsProfilingRegressionMode regression_mode;
+
+ /**
+ * Initializes the statistical summary.
+ *
+ * Sets the label as provided. Initializes the mean, variance, and n (number of values seen)
+ * to 0.
+ *
+ * @param label The (String) label to assign to the summary.
+ * @param mode The VtsProfilingRegressionMode to use when analyzing performance.
+ */
+ public StatSummary(ByteString label, VtsProfilingRegressionMode mode) {
+ this.label = label;
+ this.min = Double.MAX_VALUE;
+ this.max = Double.MIN_VALUE;
+ this.mean = 0;
+ this.var = 0;
+ this.n = 0;
+ this.regression_mode = mode;
+ }
+
+ /**
+ * Update the mean and variance using Welford's single-pass method.
+ * @param value The observed value in the stream.
+ */
+ public void updateStats(double value) {
+ n += 1;
+ double oldMean = mean;
+ mean = oldMean + (value - oldMean) / n;
+ var = var + (value - mean) * (value - oldMean);
+ if (value < min) min = value;
+ if (value > max) max = value;
+ }
+
+ /**
+ * Gets the calculated min of the stream.
+ * @return The min.
+ */
+ public double getMin() {
+ return min;
+ }
+
+ /**
+ * Gets the calculated max of the stream.
+ * @return The max.
+ */
+ public double getMax() {
+ return max;
+ }
+
+ /**
+ * Gets the calculated mean of the stream.
+ * @return The mean.
+ */
+ public double getMean() {
+ return mean;
+ }
+
+ /**
+ * Gets the calculated standard deviation of the stream.
+ * @return The standard deviation.
+ */
+ public double getStd() {
+ return Math.sqrt(var / (n - 1));
+ }
+
+ /**
+ * Gets the number of elements that have passed through the stream.
+ * @return Number of elements.
+ */
+ public int getCount() {
+ return n;
+ }
+
+ /**
+ * Gets the label for the summarized statistics.
+ * @return The (string) label.
+ */
+ public ByteString getLabel() {
+ return label;
+ }
+
+ /**
+ * Gets the regression mode.
+ * @return The VtsProfilingRegressionMode value.
+ */
+ public VtsProfilingRegressionMode getRegressionMode() {
+ return regression_mode;
+ }
+}
diff --git a/web/dashboard/appengine/servlet/src/main/webapp/WEB-INF/cron.xml b/web/dashboard/appengine/servlet/src/main/webapp/WEB-INF/cron.xml
index c3a4a5d..1bff3fb 100644
--- a/web/dashboard/appengine/servlet/src/main/webapp/WEB-INF/cron.xml
+++ b/web/dashboard/appengine/servlet/src/main/webapp/WEB-INF/cron.xml
@@ -20,4 +20,10 @@
<description>Send test failure emails.</description>
<schedule>every 2 minutes</schedule>
</cron>
+ <cron>
+ <url>/cron/vts_performance_job</url>
+ <description>Send daily performance digests.</description>
+ <schedule>every day 07:30</schedule>
+ <timezone>America/Los_Angeles</timezone>
+ </cron>
</cronentries>
\ No newline at end of file
diff --git a/web/dashboard/appengine/servlet/src/main/webapp/WEB-INF/web.xml b/web/dashboard/appengine/servlet/src/main/webapp/WEB-INF/web.xml
index 5f5997e..d21a843 100644
--- a/web/dashboard/appengine/servlet/src/main/webapp/WEB-INF/web.xml
+++ b/web/dashboard/appengine/servlet/src/main/webapp/WEB-INF/web.xml
@@ -52,6 +52,11 @@
<servlet-class>com.android.vts.servlet.VtsAlertJobServlet</servlet-class>
</servlet>
+<servlet>
+ <servlet-name>vts_performance_job</servlet-name>
+ <servlet-class>com.android.vts.servlet.VtsPerformanceJobServlet</servlet-class>
+</servlet>
+
<servlet-mapping>
<servlet-name>dashboard_main</servlet-name>
<url-pattern>/</url-pattern>
@@ -97,6 +102,11 @@
<url-pattern>/cron/vts_alert_job/*</url-pattern>
</servlet-mapping>
+<servlet-mapping>
+ <servlet-name>vts_performance_job</servlet-name>
+ <url-pattern>/cron/vts_performance_job/*</url-pattern>
+</servlet-mapping>
+
<security-constraint>
<web-resource-collection>
<web-resource-name>cron</web-resource-name>
diff --git a/web/dashboard/appengine/servlet/src/main/webapp/css/show_table.css b/web/dashboard/appengine/servlet/src/main/webapp/css/show_table.css
index e100b48..a8e08cd 100644
--- a/web/dashboard/appengine/servlet/src/main/webapp/css/show_table.css
+++ b/web/dashboard/appengine/servlet/src/main/webapp/css/show_table.css
@@ -24,22 +24,42 @@
font-size: 13px !important;
white-space: nowrap !important;
}
-.table-header {
+.table-header-cell {
background-color: white;
+ transition: max-width 1s;
+ max-width: 150px;
+}
+.table-header-cell:hover {
+ transition-delay: 0.5s;
+ max-width: 1000px;
+}
+.table-header-content.table-header-legend {
+ max-width: none;
}
.table-header-content {
font-weight: initial;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
display: inline-block;
+ max-width: inherit;
+ width: 100%;
}
-#buttons {
- margin: 25px 10px 0;
+.page-button-wrapper {
+ top: 50%;
+ bottom: auto;
+ padding: 0;
+}
+#newer-wrapper {
+ left: 23px;
+ right: auto;
}
#chart_holder {
padding: 30px 5px;
}
#pie_chart_div {
width: 100%;
- height: 380px;
+ height: 300px;
}
#profiling_container {
padding: 30px 25px;
diff --git a/web/dashboard/appengine/servlet/src/main/webapp/show_table.jsp b/web/dashboard/appengine/servlet/src/main/webapp/show_table.jsp
index f7ea774..427df9e 100644
--- a/web/dashboard/appengine/servlet/src/main/webapp/show_table.jsp
+++ b/web/dashboard/appengine/servlet/src/main/webapp/show_table.jsp
@@ -67,13 +67,13 @@
// disable buttons on load
if (!${hasNewer}) {
- $('#newer_button').toggleClass('disabled');
+ $('#newer-button').toggleClass('disabled');
}
if (!${hasOlder}) {
- $('#older_button').toggleClass('disabled');
+ $('#older-button').toggleClass('disabled');
}
- $('#newer_button').click(prev);
- $('#older_button').click(next);
+ $('#newer-button').click(prev);
+ $('#older-button').click(next);
});
// refresh the page to see the selected test types (pre-/post-submit)
@@ -226,8 +226,10 @@
// Add column headers.
headerRow = ${headerRow};
- headerRow.forEach(function(d) {
- data.addColumn('string', '<span class="table-header-content">' +
+ headerRow.forEach(function(d, i) {
+ var classNames = 'table-header-content';
+ if (i == 0) classNames += ' table-header-legend';
+ data.addColumn('string', '<span class="' + classNames + '">' +
d + '</span>');
});
@@ -266,10 +268,18 @@
var table = new google.visualization.Table(document.getElementById('grid_table_div'));
var classNames = {
- headerRow : 'table-header'
+ headerRow : 'table-header',
+ headerCell : 'table-header-cell'
};
- table.draw(data, {showRowNumber: false, alternatingRowStyle : true, 'allowHtml': true,
- frozenColumns: 1, cssClassNames: classNames});
+ var options = {
+ showRowNumber: false,
+ alternatingRowStyle: true,
+ allowHtml: true,
+ frozenColumns: 1,
+ cssClassNames: classNames,
+ sort: 'disable'
+ };
+ table.draw(data, options);
}
</script>
@@ -317,7 +327,7 @@
</div>
</div>
</div>
- <div class='col s6'>
+ <div class='col s7'>
<div class='col s12 card center-align'>
<div id='legend_wrapper'>
<c:forEach items='${resultNames}' var='res'>
@@ -342,7 +352,7 @@
</c:choose>
</div>
</div>
- <div class='col s6 valign-wrapper'>
+ <div class='col s5 valign-wrapper'>
<!-- pie chart -->
<div id='pie-chart-wrapper' class='col s12 valign center-align card'>
<h6 class='pie-chart-title'>Test Status for Device Build ID: ${topBuildId}</h6>
@@ -355,13 +365,18 @@
<div id='chart_holder' class='col s12 card'>
<!-- Grid tables-->
<div id='grid_table_div'></div>
-
- <div id='buttons' class='col s12'>
- <a id='newer_button' class='btn-floating waves-effect waves-light red'><i class='material-icons'>keyboard_arrow_left</i></a>
- <a id='older_button' class='btn-floating waves-effect waves-light red right'><i class='material-icons'>keyboard_arrow_right</i></a>
- </div>
</div>
</div>
+ <div id='newer-wrapper' class='page-button-wrapper fixed-action-btn'>
+ <a id='newer-button' class='btn-floating btn red waves-effect'>
+ <i class='large material-icons'>keyboard_arrow_left</i>
+ </a>
+ </div>
+ <div id='older-wrapper' class='page-button-wrapper fixed-action-btn'>
+ <a id='older-button' class='btn-floating btn red waves-effect'>
+ <i class='large material-icons'>keyboard_arrow_right</i>
+ </a>
+ </div>
</div>
<div id="help-modal" class="modal">
<div class="modal-content">