VtsKernelProcFileApiTest: Fix testProcUidProcstatSet IndexError

testProcUidProcstatSet test was crashing python with the following exception:

======================================================================
ERROR: testProcUidProcstatSet (__main__.VtsKernelProcFileApiTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/Soong.python_bfmswr_h/vts_kernel_proc_file_api_test.py", line 203,
	in testProcUidProcstatSet
  CheckStatsInState(False)
  File "/tmp/Soong.python_bfmswr_h/vts_kernel_proc_file_api_test.py", line 194,
	in CheckStatsInState
    old_wchar = UidIOStats(root_uid)[wchar_index]
IndexError: list index out of range

This resolves the crash and allows the test suite to finish, but in the
error case which is causing the above crash, the test case will fail
with the following signature:

__main__.VtsKernelProcFileApiTest.testProcUidProcstatSet#testProcUidProcstatSet
	fail: Traceback (most recent call last):
  File "/tmp/Soong.python_s5nustga/vts_kernel_proc_file_api_test.py", line 228,
	in testProcUidProcstatSet
    CheckStatsInState(False)
  File "/tmp/Soong.python_s5nustga/vts_kernel_proc_file_api_test.py", line 218,
	in CheckStatsInState
    old_wchar = GetWcharCount(root_uid, state)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/Soong.python_s5nustga/vts_kernel_proc_file_api_test.py", line 202,
	in GetWcharCount
    self.assertTrue(arr_len == 11,
AssertionError: False is not true : Array len returned by UidIOStats()
	 unexpected: 0
armeabi-v7a vts_kernel_proc_file_api_test completed in 1m 14s. 66 passed,
	 1 failed, 0 not executed

The underlying cause of the issue is still under investigation.

Bug: 293215373
Bug: 304711159
Test: manual execution of vts_kernel_proc_file_api_test with and without
error data injected into UidIOStats()
Change-Id: If86ea455d78d5fda31d87ad68afd6f30c8e3bc50
Merged-In: I2bd9d5ae9764e2a56b68a898d648facc49114d07
Signed-off-by: Neill Kapron <nkapron@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:a82c4edb8bd3fe69f5d3caf073046405afc2daea)
[nkapron: resolve merge conflict due to moved file]
Signed-off-by: Neill Kapron <nkapron@google.com>
1 file changed
tree: 0530cd6c5a0df3a2fc70a9869a83c1b34e424f69
  1. agents/
  2. compilation_tools/
  3. doc/
  4. drivers/
  5. hals/
  6. harnesses/
  7. prebuilts/
  8. proto/
  9. runners/
  10. script/
  11. specification/
  12. testcases/
  13. tools/
  14. utils/
  15. .clang-format
  16. .gitignore
  17. __init__.py
  18. OWNERS
  19. PREUPLOAD.cfg
  20. README.md
  21. setup.py
README.md

Android Vendor Test Suite (VTS)

VTS consists of a set of testing frameworks and test cases, designed to help enhance the robustness, reliability, and compliance of:

  • the Android system (e.g., Core HALs and libraries) and
  • low-level system software (e.g., kernel, module, and firmware).

VTS has mainly two types of test suites:

  • 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.

Table of Contents

  1. VTS User Manual
  2. Where to find VTS test cases
  3. VTS Test Developer Manual (Codelab)