Skip process_requests_in_protected_vm if device doesn't support pVMs

Bug: 350902964
Test: atest rialto_test
Change-Id: Ibdfe72119abc17553b8fa2ba492b1d4b9ac7fa75
diff --git a/rialto/Android.bp b/rialto/Android.bp
index 33fe189..b26a1c4 100644
--- a/rialto/Android.bp
+++ b/rialto/Android.bp
@@ -137,6 +137,7 @@
         "liblibc",
         "liblog_rust",
         "libhwtrust",
+        "libhypervisor_props",
         "libservice_vm_comm",
         "libservice_vm_fake_chain",
         "libservice_vm_manager",
diff --git a/rialto/tests/test.rs b/rialto/tests/test.rs
index 0d57301..cf5630f 100644
--- a/rialto/tests/test.rs
+++ b/rialto/tests/test.rs
@@ -26,7 +26,7 @@
 use client_vm_csr::generate_attestation_key_and_csr;
 use coset::{CborSerializable, CoseMac0, CoseSign};
 use hwtrust::{rkp, session::Session};
-use log::info;
+use log::{info, warn};
 use service_vm_comm::{
     ClientVmAttestationParams, Csr, CsrPayload, EcdsaP256KeyPair, GenerateCertificateRequestParams,
     Request, RequestProcessingError, Response, VmType,
@@ -55,10 +55,15 @@
 #[cfg(dice_changes)]
 #[test]
 fn process_requests_in_protected_vm() -> Result<()> {
-    // The test is skipped if the feature flag |dice_changes| is not enabled, because when
-    // the flag is off, the DICE chain is truncated in the pvmfw, and the service VM cannot
-    // verify the chain due to the missing entries in the chain.
-    check_processing_requests(VmType::ProtectedVm)
+    if hypervisor_props::is_protected_vm_supported()? {
+        // The test is skipped if the feature flag |dice_changes| is not enabled, because when
+        // the flag is off, the DICE chain is truncated in the pvmfw, and the service VM cannot
+        // verify the chain due to the missing entries in the chain.
+        check_processing_requests(VmType::ProtectedVm)
+    } else {
+        warn!("pVMs are not supported on device, skipping test");
+        Ok(())
+    }
 }
 
 #[test]