SELinuxHostTestCases use VintfDeviceInfo
Force collect VintfDeviceInfo during SELinuxHostTest (even when
--skip-device-info is called) and read SEPolicy version from it.
VintfDeviceInfo uses stable APIs:
- android.os.VintfObject is a stable @TestApi
- The schema of VintfDeviceInfo.deviceinfo.json is defined in protobuf
and kept stable by VintfDeviceInfo.
Because SELinuxHostTest now depend on the behavior of VintfDeviceInfo
and DeviceInfo, add a few comments on the latter two to remind a
developer to keep values in sync. For example:
- If the name VintfDeviceInfo changes, SELinuxHostTest needs to be
updated.
- If the logic of DeviceInfo changes (e.g. the file name is no longer
class name + ".deviceinfo.json"), the relavant logic in
SELinuxHostTestCases needs to be updated.
- If the logic of DeviceInfoCollector changes (e.g. it does not store to
IBuildInfo with the file name), the relevant logic in
SELinuxHostTestCases needs to be updated.
Fixes: 167585477
Test: atest CtsSecurityHostTestCases
Test: manually remove code to read manifest XML files, then
adb shell rm -rf /sdcard/device-info-files && \
cts-tradefed run cts -m CtsSecurityHostTestCases --skip-device-info
Test: manually remove code to read manifest XML files, then
adb shell rm -rf /sdcard/device-info-files && \
cts-tradefed run cts -m CtsSecurityHostTestCases
Change-Id: Iae042885483d9485dcaaf6c1f887c10b3fb9ebae
6 files changed