Run libavf VTS only on supported devices
Bug: 385952415
Test: atest vts_libavf_test, ABTD
Change-Id: I4baf0867c0bedac5372ee07e1eadc9454bbfaaf2
diff --git a/tests/vts/Android.bp b/tests/vts/Android.bp
index 35fbcdc..c8e2523 100644
--- a/tests/vts/Android.bp
+++ b/tests/vts/Android.bp
@@ -20,6 +20,7 @@
"libavf_bindgen",
"libciborium",
"liblog_rust",
+ "libhypervisor_props",
"libscopeguard",
"libservice_vm_comm",
"libvsock",
diff --git a/tests/vts/src/vts_libavf_test.rs b/tests/vts/src/vts_libavf_test.rs
index ba38a2e..e30c175 100644
--- a/tests/vts/src/vts_libavf_test.rs
+++ b/tests/vts/src/vts_libavf_test.rs
@@ -177,10 +177,20 @@
#[test]
fn test_run_rialto_protected() -> Result<()> {
- run_rialto(true /* protected_vm */)
+ if hypervisor_props::is_protected_vm_supported()? {
+ run_rialto(true /* protected_vm */)
+ } else {
+ info!("pVMs are not supported on device. skipping test");
+ Ok(())
+ }
}
#[test]
fn test_run_rialto_non_protected() -> Result<()> {
- run_rialto(false /* protected_vm */)
+ if hypervisor_props::is_vm_supported()? {
+ run_rialto(false /* protected_vm */)
+ } else {
+ info!("non-pVMs are not supported on device. skipping test");
+ Ok(())
+ }
}